mirror of
https://github.com/hyugogirubato/KeyDive.git
synced 2024-12-22 02:48:33 +00:00
Fix local frida multiple replacement
This commit is contained in:
parent
2294f8e784
commit
9e3781e7eb
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user