diff options
| author | vanhauser-thc <vh@thc.org> | 2022-07-12 09:04:54 +0200 |
|---|---|---|
| committer | vanhauser-thc <vh@thc.org> | 2022-07-12 09:04:54 +0200 |
| commit | b847e0f414e7b310e1a68bc501d4e2453bfce70e (patch) | |
| tree | 1ea5ebbb0b47e8d55b1950e9b787ec9f254655af /frida_mode/src/persistent/persistent_arm64.c | |
| parent | 338f1ae2f85dffe7daa88fa78cd1d078a986d0d5 (diff) | |
| download | afl++-b847e0f414e7b310e1a68bc501d4e2453bfce70e.tar.gz | |
clang format 14
Diffstat (limited to 'frida_mode/src/persistent/persistent_arm64.c')
| -rw-r--r-- | frida_mode/src/persistent/persistent_arm64.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/frida_mode/src/persistent/persistent_arm64.c b/frida_mode/src/persistent/persistent_arm64.c index fbfc3833..565a2b8c 100644 --- a/frida_mode/src/persistent/persistent_arm64.c +++ b/frida_mode/src/persistent/persistent_arm64.c @@ -24,7 +24,7 @@ gboolean persistent_is_supported(void) { } -static void instrument_persitent_save_regs(GumArm64Writer * cw, +static void instrument_persitent_save_regs(GumArm64Writer *cw, persistent_ctx_t *regs) { GumAddress regs_address = GUM_ADDRESS(regs); @@ -106,11 +106,12 @@ static void instrument_persitent_save_regs(GumArm64Writer * cw, /* Q */ for (int i = 0; i < 16; i++) { + gum_arm64_writer_put_stp_reg_reg_reg_offset( - cw, ARM64_REG_Q0 + (i*2), ARM64_REG_Q0 + (i*2) + 1, ARM64_REG_X0, - offsetof(GumCpuContext, v[i]), GUM_INDEX_SIGNED_OFFSET); - } + cw, ARM64_REG_Q0 + (i * 2), ARM64_REG_Q0 + (i * 2) + 1, ARM64_REG_X0, + offsetof(GumCpuContext, v[i]), GUM_INDEX_SIGNED_OFFSET); + } /* x0 & x1 */ gum_arm64_writer_put_ldp_reg_reg_reg_offset(cw, ARM64_REG_X2, ARM64_REG_X3, @@ -130,7 +131,7 @@ static void instrument_persitent_save_regs(GumArm64Writer * cw, } -static void instrument_persitent_restore_regs(GumArm64Writer * cw, +static void instrument_persitent_restore_regs(GumArm64Writer *cw, persistent_ctx_t *regs) { GumAddress regs_address = GUM_ADDRESS(regs); @@ -197,9 +198,11 @@ static void instrument_persitent_restore_regs(GumArm64Writer * cw, /* Q */ for (int i = 0; i < 16; i++) { + gum_arm64_writer_put_ldp_reg_reg_reg_offset( - cw, ARM64_REG_Q0 + (i*2), ARM64_REG_Q0 + (i*2) + 1, ARM64_REG_X0, - offsetof(GumCpuContext, v[i]), GUM_INDEX_SIGNED_OFFSET); + cw, ARM64_REG_Q0 + (i * 2), ARM64_REG_Q0 + (i * 2) + 1, ARM64_REG_X0, + offsetof(GumCpuContext, v[i]), GUM_INDEX_SIGNED_OFFSET); + } /* x2 & x3 */ @@ -246,7 +249,7 @@ static void instrument_afl_persistent_loop(GumArm64Writer *cw) { } -static void persistent_prologue_hook(GumArm64Writer * cw, +static void persistent_prologue_hook(GumArm64Writer *cw, persistent_ctx_t *regs) { if (persistent_hook == NULL) return; |
