Skip to content

Possibility to disable (not detach) single hook #78

@mFIND

Description

@mFIND

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions