Skip to content
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

[fix] Frida snippet empty method arguments #1775

Closed
Ran-Naor opened this issue Feb 1, 2023 · 4 comments
Closed

[fix] Frida snippet empty method arguments #1775

Ran-Naor opened this issue Feb 1, 2023 · 4 comments

Comments

@Ran-Naor
Copy link
Contributor

Ran-Naor commented Feb 1, 2023

A problem that happens when copying a frida snippet, where no arguments appear in the snippet.
This problem occurs almost always after renaming methods which add comments above them, or adding comments yourself.

problem example:
bug

after fix:
fix

I found out why this happen after reading the code and debugging it using logs, and I saw that in the collectMethodArgNames function the getDefPos is used the get the function start, and starting from this position you try to find the function arguments, the problem is that this position dont get changed when the user renames functions above for example which adds comments and change the actual start position of the function (or when the user adds comments).
Instead of using the getPos I changed the logic a bit to just scan the class for this method variables until you have an amount equivlent to the method arugments amount.

I added the PR for this fix of course.

@skylot
Copy link
Owner

skylot commented Feb 1, 2023

@Ran-Naor thanks for this workaround, but root cause of this issue need to be fixed anyway, because it can cause similar issues in other places. I will try to investigate and resolve it, so please wait couple days 🤔

@Ran-Naor
Copy link
Contributor Author

Ran-Naor commented Feb 1, 2023

No problem, If you can fix the getDefPos it will be better :)

@skylot
Copy link
Owner

skylot commented Feb 2, 2023

Ok, I commit a fix to resolve caching which cause usage of outdated method instance after code reload. Instead of using maps, I moved cached object into node it references, so it always will be point on correct one.
Anyway, just to be sure, @Ran-Naor please check latest unstable build 🙂

@Ran-Naor
Copy link
Contributor Author

Ran-Naor commented Feb 3, 2023

From my tests it works great! thanks 😄

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

No branches or pull requests

2 participants