From 53788ea65556dbb01654daab33e5159ca7090943 Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:20:02 +0200 Subject: [PATCH] Implement native liboemcrypto.so disabler --- keydive/keydive.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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; }