diff --git a/keydive/keydive.js b/keydive/keydive.js index 7501e47..1a2f911 100644 --- a/keydive/keydive.js +++ b/keydive/keydive.js @@ -1,5 +1,5 @@ /** - * Date: 2024-07-07 + * Date: 2024-07-08 * Description: DRM key extraction for research and educational purposes. * Source: https://github.com/hyugogirubato/KeyDive */ @@ -91,6 +91,27 @@ const getFunctions = (library) => { } } +const disableLibrary = (name) => { + // Disables all functions in the specified library by replacing their implementations. + const library = getLibrary(name); + if (library) { + const functions = getFunctions(library); + functions.forEach(func => { + if (func.type !== 'function') return; + try { + Interceptor.replace(func.address, new NativeCallback(function () { + return 0; + }, 'int', [])); + } catch (e) { + print(Level.ERROR, `${e.message} for ${func.name}`); + } + }); + print(Level.INFO, `The ${name} library has been disabled`); + } else { + print(Level.DEBUG, `The ${name} library was not found`); + } +} + // @Libraries const UsePrivacyMode = (address) => { @@ -287,6 +308,8 @@ const hookLibrary = (name) => { return false; } + // https://github.com/hzy132/liboemcryptodisabler/blob/master/customize.sh#L33 + disableLibrary('liboemcrypto.so'); return true; }