Repository navigation
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS This report compares head Corpus comparisonThe corpus contains 1,557 PE files. Each side loads one file per process. The expected values come from each file's base relocation directory, not from CLE. The counts exclude
This change cannot help the last two rows. The backend does not resolve the 37 Each file was loaded at its nominal base and at
The head adds base relocations to 388 files. Of those files, 242 load at their preferred base. Their fixups rewrite the same bytes, so their loaded memory matches the baseline. The other 146 files have an The head leaves 218 sites unrelocated. They are in 29 files whose Loaded memory, relocations, symbols, entry points, and function hints remain identical for all 927 x86 and x86-64 files. Both sides have the same 11 load errors. Ten are All 34,133 Thumb MOVW/MOVT sites were decoded independently. Every site contains a MOVW.W followed by a MOVT.W. Every immediate points inside the linked image range. Re-encoding reproduces the original bytes. CFG changesApplying a base relocation changes bytes only when the image moves. The 242 files that load at their preferred base cannot change a CFG. The files that CLE maps at
Fifteen files cover 252,544 more bytes. Forty-two files cover 25,090 fewer bytes. The largest gains are these THUMB files:
The lower coverage is expected. Before the fix, pointers still named the old base.
Two independent LimitsThe corpus is private, so this report uses machine types and counts instead of paths. The fixtures in angr/binaries#183 reproduce both architectures publicly.
The corpus figures were first measured at |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_755 |
0775fe8 to
58d16f7
Compare
58d16f7 to
988c008
Compare
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS This report compares the ARM64 and ARMNT PE fixtures from angr/binaries#183. It loads each image at its linked base and at
BeforeAt the merge base, CLE drops every base relocation in both ARM images. Rebasing leaves each pointer unchanged with cle at the merge base, 46a3733AfterWith this change, CLE recognizes and applies each type. Every fixup moves by the rebase delta. with this change, 988c008 |
ALL_RELOCATIONS was keyed on "arm", "mips" and "RISCV", which archinfo does not produce, and had no AARCH64 entry, so get_relocation returned None for every type on those architectures and the whole .reloc directory was discarded. Key the table on arch.name instead. That alone is not safe. PEReloc.value falls through to self.resolvedby.rebased_addr, which is None for a base relocation, so making the ARM table reachable turns every IMAGE_REL_BASED_THUMB_MOV32 into an AttributeError during loading. Implement that relocation, and let the base class skip a recognised but unimplemented type with a warning rather than raising.
988c008 to
04d5874
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
CLE discards the full
.relocdirectory for ARM64, ARMNT, MIPS, and RISC-V PE files. For example, loadingtests/aarch64/windows/pe_reloc_arm64.exeat its linked base of0x140000000keeps only the padding entry. Rebasing the image does not move any pointer:The preferred base hides this problem. At any other base, each absolute pointer keeps its link-time value. This also affects an image whose
ImageBaseis 0.Cause
PE._make_reloclooks up the table byself.arch.name. However,ALL_RELOCATIONSused names that archinfo does not produce. It also had no AArch64 entry:archinfo uses
AARCH64,ARMEL,ARMHF,ARMCortexM,MIPS32, andRISCV64. As a result,get_relocationreturnedNonefor every type. The loader loggedUnknown reloc 10 on AARCH64.Changing the keys alone is not enough.
PEReloc.valueusedself.resolvedby.rebased_addr, but a base relocation has no resolved symbol. A recognized type could still be dropped without a warning.Fix
This change keys the table by
arch.name. It adds avalueforIMAGE_REL_BASED_THUMB_MOV32. The value reads and rewrites theimm4:i:imm3:imm8halves of the MOVW.W/MOVT.W pair.The base class now returns
Nonefor a symbol-less relocation and warns once per type. A recognized but unimplemented fixup is now reported.IMAGE_REL_BASED_ARM64_MOV32AandMOV32Tremain unimplemented and now report that state.After a rebase by
0x10000, every fixup moves:Fixes #752. The fixtures require angr/binaries#183.
Details: #755 (comment)
sync: angr/binaries#183
session: sharpen