Code Monkey home page Code Monkey logo

Comments (7)

federicodotta avatar federicodotta commented on July 25, 2024

Hi!

Your hooks are inspection hooks but are not correct for Brida.

You can use your hooks with Frida or Brida in order to print arguments and return value of a method when the inspected method is called from the application.

If you want to call a method directly with Brida (with Execute Method or Context Menu or Custom Extension) you have to define a JS function in the Export section of Brida JS file. In your function you don't have to overload the method. You can simply take a reference to target class and then directly call target method.

For example, if your encryption method b is a static method:

rpc.exports = {
  encryptrequest: function(param1,param2,param3) {
    Java.perform(function() {
      var myclass = Java.use("com.package.company.a");
      return myclass.b(param1,param2,param3);
    });
  }
}

Let me know if this works in your situation.

Federico

from brida.

illnino avatar illnino commented on July 25, 2024

Hi, Federicodotta

I have updated my scriptBrida.js as suggested.

rpc.exports = {
  encryptrequest: function(param1,param2,param3) {
    Java.perform(function() {
      var myclass = Java.use("com.package.company.a");
      return myclass.b(param1,param2,param3);
    });
  }
}

Then I inspected method - com.package.company.a.b.

When I executed the method - encryptrequest, I got below on the console. The output was still null, though the inspected method had suggested the method has been called.

*** entered com.package.company.a.b
Parameters:
	arg[0]: plaintext
	arg[1]: mykey
	arg[2]: myiv
*** exiting com.package.company.a.b
Return value:
	retval: cipher_text
*** Output encryptrequest:
null

Any idea? Did I miss anything? Thanks.

from brida.

federicodotta avatar federicodotta commented on July 25, 2024

Uhm... Method "com.package.company.a.b" is a static method or an instance one?

Because if "b" method is an instance method, maybe you have to obtain a reference to an instance of that object or call the constructor of that class in order to be able to call "b", for example in this way:

var myclass = Java.use("com.package.company.a");
var myinstance = myclass.$new();
myinstance .b(param1,param2,param3);

Keep in mind that obtaining an instance of objects created by target application during runtime is not always an easy task...

Federico

from brida.

illnino avatar illnino commented on July 25, 2024

From the decompiled code, I could see

public static String b(String str, String str2, String str3) {
     // encryption alg goes here
}

from brida.

federicodotta avatar federicodotta commented on July 25, 2024

Very strange. Your configuration seems correct, the method is a static method and arguments and return value are strings.

I check again for a bug in that functionality of Brida but I haven't find on.

Can you try the execute method with another function of the same binary?

from brida.

federicodotta avatar federicodotta commented on July 25, 2024

Hi ilnino,

I just checked again the "Execute method" with the last version of Frida on Android and iOS and it works.

I write you a couple of things:

  1. On the BAppStore there was a wrong (old) version of Brida. Now there is the correct (new) version of Brida. Try to delete Brida and re-download it from BAppStore
  2. If you edit the JavaScript file after launching the application with Brida, you have to reload the JS file using "Reload JS" button on Brida

Let me know if you can solve the problem.

Federico

from brida.

federicodotta avatar federicodotta commented on July 25, 2024

I close the issue. If you need more help let me knwo and I will reopen the issue.

from brida.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.