diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7d83c..ae0c114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.4] - 2023-08-15 + +- **Native**: Added debug information option for library/module/variable + ## [1.1.3] - 2023-08-06 ### Added @@ -62,6 +66,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Initial Release. +[1.1.4]: https://github.com/hyugogirubato/Frida-CodeShare/releases/tag/v1.1.4 [1.1.3]: https://github.com/hyugogirubato/Frida-CodeShare/releases/tag/v1.1.3 [1.1.2]: https://github.com/hyugogirubato/Frida-CodeShare/releases/tag/v1.1.2 [1.1.1]: https://github.com/hyugogirubato/Frida-CodeShare/releases/tag/v1.1.1 diff --git a/scripts/android-native/README.md b/scripts/android-native/README.md index 32dcf0b..4f30189 100644 --- a/scripts/android-native/README.md +++ b/scripts/android-native/README.md @@ -31,6 +31,7 @@ Replace "DEVICE" with the device or emulator ID and "PACKAGE" with the package n - Set the `VARIABLE` variable to `true` if you want to attach and display variable values. - Set the `FUNCTION` variable to `true` if you want to intercept and display function calls. - Set the `RECURSIVE` variable to `true` if you want to display function arguments on output. +- Set the `DEBUG` variable to `true` if you want to display debug output. ## Output diff --git a/scripts/android-native/native.js b/scripts/android-native/native.js index 77a223c..71b7fb0 100644 --- a/scripts/android-native/native.js +++ b/scripts/android-native/native.js @@ -1,10 +1,10 @@ /**@@@+++@@@@****************************************************************** ** - ** Android Native Interceptor frida script v1.7 hyugogirubato + ** Android Native Interceptor frida script v1.8 hyugogirubato ** ** frida -D "DEVICE" -l "native.js" -f "PACKAGE" ** - ** Update: Added simple regex support for short function names. + ** Update: Added debug information option for library/module/variable ** ***@@@---@@@@****************************************************************** */ @@ -18,6 +18,7 @@ const EXCLUDES = []; // empty for intercept everything const VARIABLE = true; // attach variables const FUNCTION = true; // attach functions const RECURSIVE = false; // arguments of the function in output +const DEBUG = false; // debug information about a library/module/variable let index = 0; // color index @@ -96,6 +97,10 @@ const showVariable = (address, colorKey, argIndex = 0, hexValue = false) => { // avoid access violation if (stringData) { + if (DEBUG) { + const debug = JSON.stringify({address: address, ...Process.findRangeByAddress(address)}, null, 0); + console.log(`${colorKey} --> [${argIndex}] Debug: ${debug}${COLORS.reset}`); + } // String console.log(`${colorKey} --> [${argIndex}] String: ${stringData}${COLORS.reset}`); @@ -194,10 +199,21 @@ setTimeout(function () { let variableCount = 0; let functionCount = 0; for (const library of libraries) { + if (DEBUG) { + console.log(JSON.stringify(library, null, 2)); + } const modules = searchModules(library); const fileName = library["path"].substring(library["path"].lastIndexOf("/") + 1); console.log(`[>] Attach: ${fileName} (${modules.length})`); for (const module of modules) { + if (DEBUG) { + const debug = JSON.stringify({ + library: library["name"], + ...module, + ...Process.findRangeByAddress(module["address"]) + }, null, 2); + console.log(debug); + } try { if (module["type"] === "variable" && (VARIABLE || FUNCTION)) { variableCount++;