INNER CODE UNIT · JavaScript
parseElf
hackcatml/frida-flutterproxy · script.js:404
function parseElf(base) {
base = ptr(base);
var module = Process.findModuleByAddress(base);
var fd = null;
if (module !== null) {
fd = open(Memory.allocUtf8String(module.path), O_RDONLY, 0);
}
// Read elf header
var magic = "464c457f"
var elf_magic = base.readU32()
if (parseInt(elf_magic).toString(16) != magic) {
console.log("[!] Wrong magic...ignore")
}
var arch = Process.arch
var is32bit = arch == "arm" ? 1 : 0 // 1:32 0:64