Skip to content

fix: when hooking a constructor with Frida, call $new instead of `$…#1605

Merged
skylot merged 1 commit intoskylot:masterfrom
Areizen:master
Aug 6, 2022
Merged

fix: when hooking a constructor with Frida, call $new instead of `$…#1605
skylot merged 1 commit intoskylot:masterfrom
Areizen:master

Conversation

@Areizen
Copy link
Copy Markdown
Contributor

@Areizen Areizen commented Aug 6, 2022

Description

Fix the javascript generated by Frida action that, in case of a constructor, generate a call to $init instead of $new to instantiate the object.

…init`. `$init` cannot be used to instantiate an object and is reserved for hooking$
@skylot
Copy link
Copy Markdown
Owner

skylot commented Aug 6, 2022

@Areizen thanks!
Do I understand correctly that $init is also work, but $new is just more correct (i.e. create object instead of hooking constructor)?

@Areizen
Copy link
Copy Markdown
Contributor Author

Areizen commented Aug 6, 2022

In fact $init cannot be called, it result in an error. It is only used as a keyword to hook the constructor. The method that can be used to instantiate an object is another keyword $new which can be called (but not hooked).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants