Skip to content

Commit

Permalink
Release v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hyugogirubato committed Aug 15, 2023
1 parent abf99aa commit 8a12e1c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/android-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 18 additions & 2 deletions scripts/android-native/native.js
Original file line number Diff line number Diff line change
@@ -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
**
***@@@---@@@@******************************************************************
*/
Expand All @@ -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
Expand Down Expand Up @@ -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}`);

Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit 8a12e1c

Please sign in to comment.