| Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
use with unhooking.
I think we'll need to explicitly record trampoline locations to avoid
the possibility of stomping on someone else's stuff if the function was
re-patched...
Also, document substitute_hook_functions.
|
|
|
|
|
|
- Thread stoppage is now complemented by sigaction to catch injected
threads (sigaction is not used exclusively because the rest of the
program could be trying to use sigaction itself in the meantime - this
is a real thing, ask Dolphin)
- mprotect is no longer used due to max_protection possibly getting in
the way; instead, a copy is created and mapped onto the original.
|
|
The transformed code was incorrect because it assumed the pointer it was
writing to was where the code would execute, but it was actually
'rewritten_temp'. Changed transform_dis_main to take a pc_trampoline
pointer, which also helps the test harness. However, this means that it
has to be called after the trampoline has been allocated, while before
the trampoline allocation depended on the generated size; this change
doesn't bother to use two passes or anything, but just allocates a new
code buffer if the maximum possible size isn't available - not the end
of the world, since trampoline_ptr will still only be increased by the
actual size before the next hook in the series (if any).
|
|
This patch is a monolithic mess, because I was too lazy to do the
refactor first (that would require some stash fun, since I wasn't
actually sure before doing x86 transform-dis what would be needed).
Anyway, the resulting code should be cleaner - less duplication.
This breaks ARM/ARM64.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
the minimum would be...
(and minor build fixes)
|
|
|