source_tree --check: report boot-path curation (what Manager::Init reaches, the first milestone)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ce74c6e2d
commit
4badd39376
1 file changed
+9
@@ -504,6 +504,15 @@ if isCheck: # per method: does its body compile against classes.h?
|
||||
clean = sum(1 for c, bad in results for lo, hi, a in spans[c] if not bad.get(a))
|
||||
layout = subprocess.run(CLANG[:1] + ['--target=i686-linux-gnu'] + CLANG[2:] + ['-x', 'c++', f'{outDir}/classes.h'], capture_output=True, text=True)
|
||||
hazards = sum(len(re.findall(r'GHIDRA_CAST<char \*>\([^;]*?\) \+ (?:0x[0-9a-f]+|\d+)\)', open(f'{outDir}/{f}').read())) for f in files.values())
|
||||
calls = collections.defaultdict(set) # the boot path: what Manager::Init reaches, the first milestone to curate
|
||||
for line in open(dumpDir + '/calls.tsv'):
|
||||
caller, callee = line.split()
|
||||
if ':' not in callee: calls[int(caller, 16)].add(int(callee, 16)) # EXTERNAL:... are imports
|
||||
boot, queue = set(), [a for a, f in funcs.items() if f[0] == 'Manager' and f[1] == 'Init']
|
||||
while queue:
|
||||
a = queue.pop()
|
||||
if a not in boot and a in funcs and not LIBRARY.match(funcs[a][0]): boot.add(a); queue += calls[a]
|
||||
print(f'source_tree --check: boot path {len(boot & curated)}/{len(boot)} functions curated')
|
||||
print(f'source_tree --check: {clean}/{total} method bodies compile for x86_64 ({100 * clean / max(total, 1):.1f}%),'
|
||||
f' {hazards} raw offset accesses, 32-bit layout asserts {"hold" if layout.returncode == 0 else "FAIL"}')
|
||||
for message, n in errors.most_common(15): print(f' {n:6d} {message}')
|
||||
Reference in new issue
Block a user