frida-gum
frida-gum copied to clipboard
ARM Relocator doesn't correctly handle "add sb, pc, r4"
The output it generates is:
ldr sb, [pc, -#0]
add sb, r4, #0
This results in sb being loaded with the value of r4, and the value of pc being discarded. The correct output should be:
ldr sb, [pc, -#0]
add sb, sb, r4
Note that sb is a synonym for r9.
The defect is here.
code should read:
gum_arm_writer_put_add_reg_reg_reg (ctx->output, target, target, right->reg)