Commit ec055ab
committed
harden crash guard and ELF reads; finish docs, README and licensing pass
Clears the review findings that were deliberately deferred from the previous
commit, plus the remaining stale documentation.
Crash guard (mem_scan.cpp):
- Install the handler with SA_ONSTACK, matching what ART installs its own
SIGSEGV handler with. ART uses guard-page faults for implicit stack-overflow
checks, so on a real stack overflow the handler has to run on the alternate
stack rather than the exhausted one. Ignored by the kernel where no
sigaltstack exists, so it costs nothing elsewhere.
- invokeOld() had two paths that returned without doing anything: SA_SIGINFO
set with a null sa_sigaction, and SIG_IGN. Returning from a SIGSEGV handler
without resolving the fault re-executes the faulting instruction, so those
hung the app at 100% CPU instead of crashing it. All paths now either call a
real handler or restore the previous disposition and let the instruction
re-fault. Restoring beats the old signal()+raise(): raise() generates a fresh
signal, so the tombstone pointed at our handler frame instead of the real
faulting instruction -- an unrelated app crash could look like it came from
FlutterTap.
elf_utils.cpp: readMem() went through a bare memcpy while everything else that
reads a heuristically-derived address uses safe_read. The addresses come from
e_phoff/e_phnum of a library we did not write, so a corrupt ELF could point
outside the mapping -- and the installed SIGSEGV guard cannot catch it, because
it only diverts faults while safe_read has armed it. Both call sites now fail
cleanly instead of taking the host app down.
hooks.cpp: log lines carry a "hooks:" prefix, matching elf:/resolver:/
mem_scan:/companion: everywhere else. It was the only file without one.
scripts/build_module_zip.sh: convert paths with cygpath before handing them to
the NDK tools. They are native Windows binaries and cannot read MSYS paths, and
MSYS2_ARG_CONV_EXCL in the caller's environment silently disables the automatic
conversion -- which made llvm-strip fail with "No such file or directory" on a
valid path, aborting the build. Caught only because the checksum of the
installed module did not match the local build.
Docs:
- README rewritten: what the project is, why Flutter needs a different approach
from a normal CA-install, how the resolution works, compatibility table with
both validated environments, install guide, manual config.json usage,
diagnostics, build instructions and licensing. Replaces the placeholder that
still claimed the project was awaiting device validation.
- relatorio.html: section 4 said the Alibaba-specific byte pattern was ported
while 6.5 said the mnemonic scan made it unnecessary -- 6.5 was right; the
language count said 3 where the app ships 7; the project tree omitted
action.sh; the Dobby pin was quoted as e9fe7fb when that is the upstream
parent of the actual pin 025e9fc; section 8 and 10 covered only the OnePlus 5
and never mentioned the Pixel 8a / Android 17 / SukiSu Ultra run, which is the
stronger datapoint; section 5 now points at section 12 for the three items
that had to be reimplemented; section 13 listed finished work as pending.
- PDF regenerated with --headless=new --no-pdf-header-footer. The old flag was
silently ignored, so every page carried a file:///C:/Users/... footer, which
is a local-path leak in a document meant to be shared. Verified: 25 pages, no
page contains a local path.
Re-validated on the Pixel 8a (Android 17, SukiSu Ultra + Zygisk Next 1.4.3 with
the ZN Linker active) after these changes -- these touch the crash-guard path,
so a build-clean check was not enough. Installed build verified by checksum
before rebooting. 120 app processes, SystemUI alive, no new tombstone. Both demo
apps hooked; httpbin.org captured at 01:57:11Z and ostorlab.co (HTTP/2 200,
decrypted) at 01:59:31Z, matching the taps and the hook log lines.
The dobby submodule pin remains the one open blocker for publishing.1 parent 30f7b67 commit ec055ab
7 files changed
Lines changed: 259 additions & 69 deletions
File tree
- docs
- module/src/main/cpp
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
11 | 9 | | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | | - | |
| 16 | + | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
22 | 139 | | |
23 | 140 | | |
24 | 141 | | |
25 | | - | |
26 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
27 | 145 | | |
28 | 146 | | |
29 | 147 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
33 | 151 | | |
34 | 152 | | |
35 | 153 | | |
Binary file not shown.
0 commit comments