Skip to content

Instantly share code, notes, and snippets.

@Areizen
Areizen / dump_hprof.py
Created September 10, 2019 09:27
Dump Hprof Android Frida
#!/usr/bin/python3
from subprocess import Popen
import frida
import time
import sys
dumped = False
def get_script(package_name):
jscode = """
function bypassCheckProperties() {
/*
* Function used to bypass common checks to
* Android OS properties
* Bypass the props checking from this git : https://github.com/strazzere/anti-emulator
*
*/
const SystemProperties = Java.use('android.os.SystemProperties')
const String = Java.use('java.lang.String')
const Properties = {
function replaceFinaleField(object, fieldName, value){
var field = object.class.getDeclaredField(fieldName)
field.setAccessible(true)
field.set(null, value)
}
Java.perform(function(){
// Class containing const that we want to modify
const Build = Java.use("android.os.Build")
typedef void **va_list;
typedef uint8_t jboolean;
typedef int8_t jbyte;
typedef uint16_t jchar;
typedef int16_t jshort;
typedef int32_t jint;
typedef int64_t jlong;
typedef float jfloat;
typedef double jdouble;