From 2e79463ee86cbdd72c1fd5418135f694c157f34b Mon Sep 17 00:00:00 2001 From: FoxRefire <155989196+FoxRefire@users.noreply.github.com> Date: Mon, 20 May 2024 12:12:24 +0900 Subject: [PATCH] Open Bitmovin's demo automatically --- README.md | 3 ++- keydive.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9deee7..54a8317 100644 --- a/README.md +++ b/README.md @@ -57,12 +57,13 @@ For a detailed step-by-step guide on setting up and executing KeyDive without in ### Command-Line Options ```shell -usage: keydive.py [-h] [-d DEVICE] [-f FUNCTIONS] [--force] +usage: keydive.py [-h] [-a] [-d DEVICE] [-f FUNCTIONS] [--force] Extract Widevine L3 keys from an Android device. options: -h, --help show this help message and exit + -a, --auto Open Bitmovin’s demo automatically -d DEVICE, --device DEVICE Target Android device ID. -f FUNCTIONS, --functions FUNCTIONS diff --git a/keydive.py b/keydive.py index 92591de..fc8cac1 100644 --- a/keydive.py +++ b/keydive.py @@ -19,6 +19,7 @@ if __name__ == '__main__': # Parse command line arguments for device ID parser = argparse.ArgumentParser(description='Extract Widevine L3 keys from an Android device.') + parser.add_argument('-a', '--auto', required=False, action='store_true', help='Open Bitmovin\'s demo automatically.') parser.add_argument('-d', '--device', required=False, type=str, help='Target Android device ID.') parser.add_argument('-f', '--functions', required=False, type=Path, help='Path to Ghidra XML functions file.') parser.add_argument('--force', required=False, action='store_true', help='Force using the default vendor (skipping analysis).') @@ -47,6 +48,9 @@ if __name__ == '__main__': raise Exception('Failed to hook into the Widevine process') logger.info('Successfully hooked. To test, play a DRM-protected video: https://bitmovin.com/demos/drm') + if args.auto: + subprocess.run(['adb', 'shell', 'am', 'start', '-a', 'android.intent.action.VIEW', '-d', 'https://bitmovin.com/demos/drm']) + # Keep script running while extracting keys while cdm.running: time.sleep(1)