Add an AArch64 object whose functions take a class by value - #214
Conversation
angr recovers an aggregate argument type only from a demangled C++ name, so a C fixture cannot express this shape. The build recipe is recorded at the top of the source.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveats: this repository configures no pre-commit hooks and no CI, so nothing beyond the readback above ran here. session: sharpen |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Loading Before — six of the eight functions produce nothing, which is the failure this fixture angr master a9ca247a5After — every function decompiles: angr with SimCCAArch64.next_arg implementedThe two sides ran the same script over the same object; only the angr tree differed, and each session: sharpen |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
Nothing committed here lets a consumer assert what angr does with an AArch64 function that
takes a class by value. Scanning the 37 AArch64/ARM64 objects tracked in this repository for
an Itanium-mangled symbol whose demangled signature has a by-value class parameter finds
three, all in
tests/aarch64/IPwnKit.macho.kext, and cle refuses that object:Root cause
angr builds an aggregate argument type from the demangled C++ name rather than from debug
information. A C struct passed by value is recovered as
unsigned longwhether or not theobject carries DWARF, so the shape needs a C++ object with unstripped mangled symbols, and
there is no AArch64 one here.
tests_src/test_pass_struct_by_value.cis built for armel only.Fix
tests/aarch64/struct_by_value_aarch64.so, 6136 bytes, built fromtests_src/arch/aarch64/struct_by_value_aarch64.cppwith the recipe recorded at the top ofthat source. Three free functions take a composite by value -- a 16-byte struct that AAPCS64
puts in a register pair, a 40-byte struct it passes indirectly, and a class holding an array
-- and a fourth calls all three, so the callee side and the call site both see one. The scan
above returns no loadable object at the merge base and this one at the head.
Testing
Loading the object with angr at
a9ca247a5recovers eight functions and decompiles two; theother six produce nothing, because
SimCCAArch64.next_argraises on the aggregate. Theconsumer is the angr pull request that links this one.
Validation: #214 (comment)
session: sharpen