mirror of
https://github.com/hyugogirubato/KeyDive.git
synced 2026-07-16 02:44:22 +02:00
Skip C native functions
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
// Placeholder values dynamically replaced at runtime.
|
||||
const SDK_API = parseInt('${SDK_API}', 10);
|
||||
const OEM_CRYPTO_API = JSON.parse('${OEM_CRYPTO_API}');
|
||||
const NATIVE_C_API = JSON.parse('${NATIVE_C_API}');
|
||||
const SYMBOLS = JSON.parse('${SYMBOLS}');
|
||||
|
||||
|
||||
@@ -78,9 +79,9 @@ const hookLibrary = (name) => {
|
||||
let functions, target;
|
||||
if (SYMBOLS.length > 0) {
|
||||
functions = SYMBOLS.map(symbol => ({
|
||||
'type': 'function',
|
||||
'name': symbol.name,
|
||||
'address': ptr(parseInt(symbol.address, 16) + parseInt(library.base, 16))
|
||||
type: 'function',
|
||||
name: symbol.name,
|
||||
address: ptr(parseInt(symbol.address, 16) + parseInt(library.base, 16))
|
||||
}));
|
||||
} else {
|
||||
functions = library.enumerateExports();
|
||||
@@ -88,6 +89,9 @@ const hookLibrary = (name) => {
|
||||
target = functions.find(func => OEM_CRYPTO_API.includes(func.name));
|
||||
}
|
||||
|
||||
// Remove native C functions
|
||||
functions = functions.filter(func => !NATIVE_C_API.includes(func.name));
|
||||
|
||||
let hookedCount = 0;
|
||||
functions.forEach((func) => {
|
||||
if (func.type !== 'function') return;
|
||||
|
||||
Reference in New Issue
Block a user