Skip to content

Commit

Permalink
Release v1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hyugogirubato committed Aug 6, 2023
1 parent 02ac308 commit abf99aa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ 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.2] - 2023-07-04
## [1.1.3] - 2023-08-06

### Added

- **Native**: Added simple regex support for short function names.

## [1.1.2] - 2023-08-04

### Added

Expand Down Expand Up @@ -56,6 +62,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Initial Release.

[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
[1.1.0]: https://github.com/hyugogirubato/Frida-CodeShare/releases/tag/v1.1.0
Expand Down
35 changes: 29 additions & 6 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.6 hyugogirubato
** Android Native Interceptor frida script v1.7 hyugogirubato
**
** frida -D "DEVICE" -l "native.js" -f "PACKAGE"
**
** Update: Added recursive display of function arguments.
** Update: Added simple regex support for short function names.
**
***@@@---@@@@******************************************************************
*/
Expand All @@ -13,7 +13,7 @@
// Custom params
const PACKAGE = "PACKAGE"; // undefined for intercept everything
const LIBRARIES = ["libnative.so"]; // empty for intercept everything
const INCLUDES = ["selectedFunction"]; // empty for intercept everything
const INCLUDES = ["selectedFunction", "^md5$"]; // empty for intercept everything, "^" and/or "$" filter short functions according to regex
const EXCLUDES = []; // empty for intercept everything
const VARIABLE = true; // attach variables
const FUNCTION = true; // attach functions
Expand Down Expand Up @@ -51,18 +51,41 @@ const searchLibraries = () => {
}
}

const filterModules = (modules, filters) => {
const result = [];
for (const module of modules) {
const moduleName = module["name"].toLowerCase();
for (const filter of filters) {
let filterName = filter.toLowerCase();
filterName = filterName.startsWith("^") ? filterName.slice(1) : filterName;
filterName = filterName.endsWith("$") ? filterName.slice(0, -1) : filterName;
if (!moduleName.includes(filterName)) {
continue;
}
if (filter.startsWith("^") && !moduleName.startsWith(filterName)) {
continue;
}
if (filter.endsWith("$") && !moduleName.endsWith(filterName)) {
continue;
}
result.push(module);
}
}
return result;
}

const searchModules = (library) => {
let modules = library.enumerateExports();
if (INCLUDES.length > 0) {
modules = modules.filter(mod => INCLUDES.some(include => mod["name"].toLowerCase().includes(include.toLowerCase())));
modules = filterModules(modules, INCLUDES);
}
if (EXCLUDES.length > 0) {
modules = modules.filter(mod => EXCLUDES.every(exclude => !mod["name"].toLowerCase().includes(exclude.toLowerCase())));
const excludes = filterModules(modules, EXCLUDES);
modules = modules.filter(module => !excludes.some(exclude => exclude["name"] === module["name"]));
}
return modules;
}


const showVariable = (address, colorKey, argIndex = 0, hexValue = false) => {
let stringData;
try {
Expand Down

0 comments on commit abf99aa

Please sign in to comment.