From 9e3781e7eb10788d67a4d51e18710139b7dcb7c8 Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:06:30 +0200 Subject: [PATCH] Fix local frida multiple replacement --- keydive/keydive.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keydive/keydive.js b/keydive/keydive.js index bcc6baa..79f2927 100644 --- a/keydive/keydive.js +++ b/keydive/keydive.js @@ -275,11 +275,11 @@ const hookLibrary = (name) => { functions = functions.filter(f => !NATIVE_C_API.includes(f.name)); const targets = functions.filter(f => OEM_CRYPTO_API.includes(f.name)).map(f => f.name); - let hooked = 0; + const hooked = []; functions.forEach(func => { - if (func.type !== 'function') return; const {name: funcName, address: funcAddr} = func; + if (func.type !== 'function' || hooked.includes(funcAddr)) return; try { if (funcName.includes('UsePrivacyMode')) { @@ -296,14 +296,14 @@ const hookLibrary = (name) => { return; } - hooked++; + hooked.push(funcAddr); print(Level.DEBUG, `Hooked (${funcAddr}): ${funcName}`); } catch (e) { print(Level.ERROR, `${e.message} for ${funcName}`); } }); - if (hooked < 3) { + if (hooked.length < 3) { print(Level.CRITICAL, 'Insufficient functions hooked.'); return false; }