Update version

- Fix version number
- Fix import functions text
- Remove auto-select for imported functions (already done with python)
- Add extracted functions for 15.0.0 arm64
- Show script version
- Add clear command
This commit is contained in:
hyugogirubato 2024-04-01 17:46:39 +02:00
parent 00ecd4e1c7
commit c9b2f8975c
7 changed files with 185039 additions and 18883 deletions

View File

@ -15,3 +15,5 @@ tree() {
path=${1:-.} path=${1:-.}
find ${path} -print | sort | sed 's;[^/]*/;|---;g;s;---|; |;g' find ${path} -print | sort | sed 's;[^/]*/;|---;g;s;---|; |;g'
} }
clear

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
from .cdm import * from .cdm import *
from .vendor import * from .vendor import *
__version__ = '1.0.1' __version__ = '1.0.3'

View File

@ -75,20 +75,19 @@ const hookLibrary = (name) => {
const library = getLibrary(name); const library = getLibrary(name);
if (!library) return false; if (!library) return false;
let functions; let functions, target;
if (SYMBOLS.length > 0) { if (SYMBOLS.length > 0) {
functions = SYMBOLS.map(symbol => ({ functions = SYMBOLS.map(symbol => ({
'type': 'function', 'type': 'function',
'name': symbol.name, 'name': symbol.name,
'address': ptr(parseInt(symbol.address, 16) + parseInt(library.base, 16)) 'address': ptr(parseInt(symbol.address, 16) + parseInt(library.base, 16))
})); }));
print(Level.INFO, 'Successfully imported symbols'); print(Level.INFO, 'Successfully imported functions');
} else { } else {
functions = [...library.enumerateExports(), ...library.enumerateImports()]; functions = [...library.enumerateExports(), ...library.enumerateImports()];
target = functions.find(func => OEM_CRYPTO_API.includes(func.name));
} }
const targetFunction = functions.find(func => OEM_CRYPTO_API.includes(func.name));
let hookedCount = 0; let hookedCount = 0;
functions.forEach((func) => { functions.forEach((func) => {
if (func.type !== 'function') return; if (func.type !== 'function') return;
@ -102,7 +101,7 @@ const hookLibrary = (name) => {
disablePrivacyMode(funcAddr); disablePrivacyMode(funcAddr);
} else if (funcName.includes('PrepareKeyRequest')) { } else if (funcName.includes('PrepareKeyRequest')) {
prepareKeyRequest(funcAddr); prepareKeyRequest(funcAddr);
} else if (targetFunction === func || (!targetFunction && funcName.match(/^[a-z]+$/))) { } else if (target === func || (!target && funcName.match(/^[a-z]+$/))) {
getPrivateKey(funcAddr); getPrivateKey(funcAddr);
} else { } else {
funcHooked = false; funcHooked = false;
@ -113,7 +112,7 @@ const hookLibrary = (name) => {
print(Level.DEBUG, `Hooked (${funcAddr}): ${funcName}`); print(Level.DEBUG, `Hooked (${funcAddr}): ${funcName}`);
} }
} catch (e) { } catch (e) {
print(Level.ERROR, `${funcName} (${funcAddr}): ${e.message}`); print(Level.ERROR, `${e.message} for ${funcName}`);
} }
}); });

92514
functions_AARCH64.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ import coloredlogs
from _frida import Process from _frida import Process
from pathlib import Path from pathlib import Path
import extractor
from extractor.cdm import Cdm from extractor.cdm import Cdm
coloredlogs.install( coloredlogs.install(
@ -24,6 +25,8 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
try: try:
logger.info('Version: %s', extractor.__version__)
# Start ADB server # Start ADB server
exitcode, _ = subprocess.getstatusoutput('adb start-server') exitcode, _ = subprocess.getstatusoutput('adb start-server')
if exitcode != 0: if exitcode != 0: