We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97558a6 commit fcf9b12Copy full SHA for fcf9b12
src/patcherex2/patches/function_patches.py
@@ -117,12 +117,17 @@ def apply(self, p) -> None:
117
self.postfunc = self.postfunc.replace(
118
"RESTORE_CONTEXT", f"\n{p.archinfo.restore_context_asm}\n"
119
)
120
- ifp = InsertFunctionPatch(f"__patcherex_{hex(self.addr)}", self.code)
+ ifp = InsertFunctionPatch(
121
+ f"__patcherex_{hex(self.addr)}",
122
+ self.code,
123
+ is_thumb=p.binary_analyzer.is_thumb(self.addr),
124
+ )
125
ifp.apply(p)
126
instrs = ""
127
instrs += p.archinfo.save_context_asm if self.save_context else ""
128
instrs += self.prefunc if self.prefunc else ""
129
instrs += "\n"
130
+ # NOTE: ↓ this is hardcoded to bl, not blx, but it should be fine for this use case
131
instrs += p.archinfo.call_asm.format(
132
dst=f"{{__patcherex_{hex(self.addr)}}}"
133
0 commit comments