source_tree: pointer casts through GHIDRA_CAST (a float holds the pointer's bits); ApplyTypes: zero-length placeholders

MSVC copies pointers through XMM registers, so Ghidra types some as float: those casts now reinterpret the bits
(float-to-pointer errors 2415 -> 171). Classes with no known field get a zero-length struct, so the decompiler stops
typing 4-byte values with them (applies next build). The hazard count now covers every raw (char *)x + n access: 32689.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-19 21:01:50 -05:00
1 parent bafef76746
commit 2ff2d5d87f
319 files changed
+100751 -100730

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ public class ApplyTypes extends GhidraScript {
int typed = 0;
for (int pass = 0; pass < 3; pass++) // later passes embed structs (Entity._sprite is an ANM2) built by earlier ones
for (String cls : classes) {
StructureDataType s = new StructureDataType(cls, 4);
StructureDataType s = new StructureDataType(cls, 0); // zero-length until fields are known: only usable behind a pointer
addFields(s, cls, 0);
if (s.getLength() < size.getOrDefault(cls, 0)) s.growStructure(size.get(cls) - s.getLength()); // so this[1] stops standing in for the tail
if (s.getLength() % 4 != 0) s.growStructure(4 - s.getLength() % 4); // MSVC pads to the alignment: arrays of it get the real stride