Last active
November 24, 2017 06:39
-
-
Save kopos/ffa4f2b0a0aadd22c6abeb11a80c8cf6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import frida, sys | |
native_hook_code = """ | |
Java.perform(function() { | |
Privilege = Java.user("com.android.engineeringmode.qualcomm.Privilege"); | |
Privilege.escalate.implementation = function(v) { | |
console.log('escalate Done: '); | |
return true; | |
}; | |
Privilege = Java.user("com.android.engineeringmode.qualcomm.Privilege"); | |
Privilege.isEscalated.implementation = function(v) { | |
console.log('isEscalated Done: '); | |
return false; | |
}; | |
Privilege = Java.user("com.android.engineeringmode.qualcomm.Privilege"); | |
Privilege.recover.implementation = function(v) { | |
console.log('recover Done: '); | |
}; | |
}); | |
""" | |
def on_message(message, data): | |
if message['type'] == 'send': | |
print "[*] {0}".format(message['payload']) | |
else: | |
print message | |
process = frida.get_usb_device().attach('com.android.engineeringmode') | |
script = process.create_script(native_hook_code) | |
script.on('message', on_message) | |
script.load() | |
sys.stdin.read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment