From b629b208ca49cfa06b13c55a8551db85f460a327 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 11 Dec 2024 04:26:37 +0100 Subject: [PATCH] Fix build --- package-lock.json | 66 ++++++++++++++++++++----------------- package.json | 6 ++-- src/agent/lib/info/index.ts | 22 +++++-------- 3 files changed, 46 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index cfc9d881..2a5bad04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,13 @@ "license": "LGPL-3.0", "devDependencies": { "@frida/events": "^4.0.4", - "@types/frida-gum": "^18.5.1", - "@types/node": "^20.0.0", + "@types/frida-gum": "^18.7.1", + "@types/node": "^22.10.1", "@typescript-eslint/eslint-plugin": "^5.51.0", "@typescript-eslint/parser": "^5.51.0", "eslint": "^8.34.0", "frida-compile": "^16.2.2", - "typescript": "^5.0.0" + "typescript": "^5.7.2" }, "engines": { "node": ">=14.16" @@ -467,10 +467,11 @@ } }, "node_modules/@types/frida-gum": { - "version": "18.5.1", - "resolved": "https://registry.npmjs.org/@types/frida-gum/-/frida-gum-18.5.1.tgz", - "integrity": "sha512-99geyCbWB+YBCqxcO+ue7dJUQJti7kQ5CHGQtKoz0ENtRswKULGMFKW6QgL657sMiztqhcDHWJjYSPv5GKT1ig==", - "dev": true + "version": "18.7.1", + "resolved": "https://registry.npmjs.org/@types/frida-gum/-/frida-gum-18.7.1.tgz", + "integrity": "sha512-++7xogrG/jWdgC2gEeK8Q2tVTcycWXsFHhGaEa/TfY8u11UTUsn9dF+nr3Lo1rUnFGZssKDhqV4vsHOHgsWiLQ==", + "dev": true, + "license": "MIT" }, "node_modules/@types/json-schema": { "version": "7.0.15", @@ -479,12 +480,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.16.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", - "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.20.0" } }, "node_modules/@types/semver": { @@ -2008,10 +2010,11 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2021,10 +2024,11 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" }, "node_modules/uri-js": { "version": "4.4.1", @@ -2414,9 +2418,9 @@ } }, "@types/frida-gum": { - "version": "18.5.1", - "resolved": "https://registry.npmjs.org/@types/frida-gum/-/frida-gum-18.5.1.tgz", - "integrity": "sha512-99geyCbWB+YBCqxcO+ue7dJUQJti7kQ5CHGQtKoz0ENtRswKULGMFKW6QgL657sMiztqhcDHWJjYSPv5GKT1ig==", + "version": "18.7.1", + "resolved": "https://registry.npmjs.org/@types/frida-gum/-/frida-gum-18.7.1.tgz", + "integrity": "sha512-++7xogrG/jWdgC2gEeK8Q2tVTcycWXsFHhGaEa/TfY8u11UTUsn9dF+nr3Lo1rUnFGZssKDhqV4vsHOHgsWiLQ==", "dev": true }, "@types/json-schema": { @@ -2426,12 +2430,12 @@ "dev": true }, "@types/node": { - "version": "20.16.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", - "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", "dev": true, "requires": { - "undici-types": "~6.19.2" + "undici-types": "~6.20.0" } }, "@types/semver": { @@ -3510,15 +3514,15 @@ } }, "typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true }, "undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "uri-js": { diff --git a/package.json b/package.json index be749e73..42bd1d10 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,13 @@ }, "devDependencies": { "@frida/events": "^4.0.4", - "@types/frida-gum": "^18.5.1", - "@types/node": "^20.0.0", + "@types/frida-gum": "^18.7.1", + "@types/node": "^22.10.1", "@typescript-eslint/eslint-plugin": "^5.51.0", "@typescript-eslint/parser": "^5.51.0", "eslint": "^8.34.0", "frida-compile": "^16.2.2", - "typescript": "^5.0.0" + "typescript": "^5.7.2" }, "exports": { "require": "./src/agent/index.js", diff --git a/src/agent/lib/info/index.ts b/src/agent/lib/info/index.ts index d03c7744..621cf1bc 100644 --- a/src/agent/lib/info/index.ts +++ b/src/agent/lib/info/index.ts @@ -189,7 +189,7 @@ export function listHeadersR2(args: string[]): string { interface Symbol { name: string; - address: string; + address: NativePointer | string; } export function listEntrypointSymbols(args: string[]): string { @@ -251,7 +251,7 @@ export function listEntrypointSymbols(args: string[]): string { const clazz = Java.use(className); const methods = clazz.class.getDeclaredMethods(); - methods.forEach((method) => { + methods.forEach((method: any) => { const methodName = method.getName(); if (entryPoints.some((entry) => methodName.includes(entry))) { symbols.push({ name: className + "." + methodName, address: methodName }); @@ -263,19 +263,13 @@ export function listEntrypointSymbols(args: string[]): string { } }); }); - const modules = Module.enumerateModules(); - modules.forEach((module) => { - const exports = Module.findExportByName(module.name, null); - - if (exports) { - exports.forEach((exp) => { - if (exp.name.startsWith("Java_")) { - symbols.push({ name: "entry.jni." + exp.name, address: exp.address }); - } - }); - } + Process.enumerateModules().forEach((mod) => { + mod.enumerateExports().forEach((exp) => { + if (exp.name.startsWith("Java_")) { + symbols.push({ name: "entry.jni." + exp.name, address: exp.address.toString() }); + } + }); }); - } if (ObjC.available) { const classes = ObjC.classes;