-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Decouple frida.re script (now uses frida-compiler) #3612
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
base: master
Are you sure you want to change the base?
Conversation
…dules. this make maintenance and testing much easier.
… the same output. all output.json are updated.
Diolor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Briefly, lgtm. @bernhste let me know once all todos are ready and I could give it a test
|
|
||
| # create temporary work folder | ||
| randomNumber=$RANDOM | ||
| workDir=/tmp/frida_$randomNumber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially out of scope, but let's better use a project-local temporary folder and not a computer global one?
Plus add it on.gitignore
I could do it in #3584 but then we would conflict
| * @returns {string} The decoded rows and columns. | ||
| */ | ||
| function decodeAndroidDatabaseCursor(value) { | ||
| let out = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some lets could be consts, + other files
This PR closes #3451
Description
The for the demos, the script was compiled using string concatenation. Also, all decoders were implemented in one file (
decoders.js).I refactored the code base to use
frida-compiler. Now the decoders are decoupled and easier to maintain. They are all in the folder./utils/frida/android/decoders. One module for each type, a util module and a module which assigns the decoders to the type.The base script always only used
decodeArguments(). This does not change.I tested the refactored code with all demos which use this frida.re script so far (MASTG-DEMO-0058, MASTG-DEMO-0059, MASTG-DEMO-0060, MASTG-DEMO-0081). They all produce the same output.
The base script itself did change slightly (now using modules). Other than that, no changes. So this should not conflict with #3584.
This should make it much easier maintaining and adding decoders and tests, which I would like to implement.
AI Tool Disclosure
kagi assistantclaude sonnet 4.5take this code <code> and decouple modules for each decoder type (all the cases in the big switch case). make a file for each type. name the files so that it is clear what type it decodes (example: java.io.File.js) name the decode function accordingly (example decodeJavaSecurityPrivateKey()) ONLY export decodeArguments() some of the functions are not type decoder, collect them in a util module. don't change anything at the code nor the comments they should remain as they are fully.[x] I have read the contributing guidelines.