-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Comments
@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 🤔 |
No problem, If you can fix the getDefPos it will be better :) |
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. |
From my tests it works great! thanks 😄 |
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](https://user-images.githubusercontent.com/38539376/216146354-46b9caef-3b10-449e-a619-e6d08a19f7a9.png)
after fix:
![fix](https://user-images.githubusercontent.com/38539376/216146384-f23d59b1-d14c-45e0-ab0d-d2844199b2c3.png)
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.
The text was updated successfully, but these errors were encountered: