From 037ce5cd450bc156151f110c71aeb531e98ed97b Mon Sep 17 00:00:00 2001 From: cc Date: Sun, 25 Jun 2023 14:20:32 +0200 Subject: [PATCH] still #118 --- lib/scan.js | 16 ++++++++++++---- package.json | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/scan.js b/lib/scan.js index 5d9aa90..2d15951 100644 --- a/lib/scan.js +++ b/lib/scan.js @@ -12,10 +12,18 @@ import { debug } from './utils.js'; */ const fix = (() => { if (path.sep !== '/') { - const r = new RegExp(path.sep, 'g'); - return (p) => p.replace(r, '/'); + + /** + * @param {string} p + * @returns {string} + */ + return (p) => p.replaceAll(path.sep, '/'); } + /** + * @param {string} p + * @returns {string} + */ return (p) => p; })(); @@ -118,7 +126,7 @@ export class AppBundleVisitor { for await (const [scope, file, info] of this.visitRoot()) { const adjustedFile = path.relative(this.#root, file); const bucket = buckets.get(scope) ?? []; - bucket.push([adjustedFile, info]); + bucket.push([fix(adjustedFile), info]); buckets.set(scope, bucket); } @@ -132,7 +140,7 @@ export class AppBundleVisitor { const infoPlist = path.join(scope, 'Info.plist'); const plist = parsePlist(await readFile(infoPlist)); const mainExecutable = fix(path.join(adjustedScope, plist['CFBundleExecutable'])); - result.set(fix(mainExecutable), fix(encryptedFiles)); + result.set(mainExecutable, encryptedFiles); } return result; diff --git a/package.json b/package.json index 1395d93..079af8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bagbak", - "version": "3.0.18", + "version": "3.0.19", "description": "Dump iOS app from a jailbroken device, based on frida.re", "main": "index.js", "scripts": { @@ -19,6 +19,9 @@ "/bin", "/lib/" ], + "engines": { + "node": ">=16.0.0" + }, "type": "module", "devDependencies": { "@types/frida-gum": "^18.3.1",