Fix x86_64 injection: Red Zone adjustment and fallback logic (#91)
- Strictly adhere to the System V AMD64 ABI by skipping the 128-byte "Red Zone" before modifying the stack, see page 23 of https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build for details. - Added `inject_via_staging` as a fallback strategy: 1. Copies the payload to `/data/local/tmp`. 2. Sets permissions/context (`u:object_r:system_file:s0`). 3. Loads via standard `dlopen`. 4. Immediately unlinks the file for stealth. - Introduced `RegisterRestorer` RAII class to guarantee original registers are restored even if the injection logic returns early due to error.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
allow keystore system_file unix_dgram_socket *
|
||||
allow system_file keystore unix_dgram_socket *
|
||||
allow keystore system_file file *
|
||||
allow keystore shell_data_file dir *
|
||||
allow crash_dump keystore process *
|
||||
|
||||
Reference in New Issue
Block a user