Skip to content

[fix] Frida snippet empty method arguments #1775

@Ran-Naor

Description

@Ran-Naor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions