Skip to content

Possibility to disable (not detach) single hook #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mFIND opened this issue May 15, 2021 · 1 comment
Open

Possibility to disable (not detach) single hook #78

mFIND opened this issue May 15, 2021 · 1 comment

Comments

@mFIND
Copy link

mFIND commented May 15, 2021

Hi,

As far as I know, currently the only option in Brida for disabling hooks is to detachAll using frida's Interceptor.detachAll().
However it would be nice, to be able to disable hooks one-by-one.

I'm almost certain this can be done. One naive solution would be to change change construction of every Brida-Frida hook.
For example:

Interceptor.attach(Module.getExportByName(null, 'read'), {
  onEnter(args) {
    //on enter logic
  },
  onLeave(result) {
    // on leave logic  
  })

could be changed to something like this:

Interceptor.attach(Module.getExportByName(null, 'read'), {
  onEnter(args) {
    if(isActive[hookId]){  // hookId e.g.: 5 
      //on enter logic
    }
  },
  onLeave(result) {
    if(isActive[hookId]){  // hookId e.g.: 5
      //on leave logic
    }
  })

Where hookId would be a constant in a context of one hook.

After that, if user would decide, that they don't want to use one of his hooks, they could just 'disable' it, and internally, Brida would check what is the ID of that hook and change value of isActive[hookId] to false.

Not sure if this is the best way to go about this, but I think this functionality would be a welcome improvement.

@mFIND

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants