frida / frida-gum

Cross-platform instrumentation and introspection library written in C
https://frida.re
Other
755 stars 244 forks source link

ARM Writer does not support writing ldmia where Rn is in the reglist #479

Open WorksButNotTested opened 4 years ago

WorksButNotTested commented 4 years ago

The documentation states that:

""" In ARM code or pre-Thumb-2 Thumb code, if Rn is in reglist, and writeback is specified with the ! suffix:

if the instruction is STM or STMIA and Rn is the lowest-numbered register in reglist, the initial value of Rn is stored otherwise, the loaded or stored value of Rn cannot be relied upon. """

The function gum_arm_writer_put_ldmia_reg_mask, however, prohibits the use of Rn in the reglist even though it is writing an LDM rather than an STM.

WorksButNotTested commented 4 years ago

The test here should simply be omitted.