Repository navigation
Tags
Tags
stalker: Fix x86 insns touching all user data regs On IA-32 the only candidates are ESI and EDI. An instruction touching both, e.g. `mov [esi], edi`, hit g_assert_not_reached() in a debug build. In a release build the assertion is compiled out and GUM_X86_NONE is encoded as EDI, so the instruction ran with EDI holding the user data instead of the target's value. Now the transformer's code before such an instruction still gets a register, and keep() releases the register before relocating any instruction that touches it.
dbghelp: Support a mapped DbgHelp without SymSrv Let gum_dbghelp_impl_use_modules() accept a NULL SymSrv, so a caller that fails to map it can still use the mapped DbgHelp. DbgHelp's attempts to load SymSrv then fail, leaving it without symbol server support.
darwin: Avoid remapping code on iOS >= 15.0 Overwriting executable mappings on XNU 8019 can leave the target inaccessible, crashing during cache invalidation. The signature flavor probe only maps a scratch page and does not detect this restriction. Stop using code segments from that kernel on, and only try the newer page swap on macOS, so in-place patching runs everywhere else. Add a test that patches a shared cache function with its own bytes and checks that its page stays executable and the function still works. Co-authored-by: Ole André Vadla Ravnås <oleavr@frida.re>
memory: Swap patched code pages in on Darwin Without RWX the pages being patched were briefly not executable, and threads created while the others were suspended ran into them. Busy dispatch processes crashed on attach and detach as a result. On arm64, remap the patched copy over each run of pages instead, which replaces a run atomically and needs no thread suspended. Suspend only for pages that could not be swapped, which take the old path.
PreviousNext