Skip to content

v5.0.2

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Oct 09:08
2a943f9

Added

  • (labels) MAX_DELPHI_METADATA_ENTRIES (default 1,000,000) caps the metadata entries the ReSym provider
    reads per image, so a corrupt or hostile image cannot drive VMT and method-table parsing without bound.
  • (binja) Export 32-bit ARM views (armv7 and thumb2) as arm reports. Each function is decoded in
    its own instruction set and carries thumb metadata like the file-based backend. A T32 function's blocks in A32
    (PLT veneers) are left out. Where an A32 and a T32 function claim the same bytes, only the one with more evidence
    is exported: no invalid instructions, then more references to its start. binja_analyze.py creates T32 functions
    as T32. Measured on 04652e66 with Binary Ninja 6.0.10905 on the bundled arm_lz4_mixed_O2, arm_lz4_thumb_Os,
    armnt_lz4_dll and mirai_arm:
    479 of 491 ground-truth starts exported, all in their ground-truth instruction
    set. Cost: four udf #0xf9 in the ARMNT DLL that Capstone cannot decode. Big-endian ARM stays unsupported.

Changed

  • (labels) Delphi detection is looser. _computeDelphiScore now reaches the 0.6 that checkDelphi() needs
    when ReSym validates at least two self-referencing VMTs (one can occur by chance; a real image has one per class,
    dozens from the RTL alone), which turns on the Delphi candidates and finally recovery. Pythia no longer requires
    _validate_metadata_addresses, and Pascal strings decode as cp1252, so 0x80-0x9F count as printable. Cost: a
    non-Delphi image is somewhat more likely to be classed as Delphi. Not measured on non-Delphi samples: none of
    the bundled non-Delphi fixtures contains TObject, so they never reach these checks.
  • (aarch64) Jump the gap scan over non-executable sections instead of stepping through them a word at a time.
    nextGapCandidate now bisects into the sorted, merged executable section ranges and resumes at the next one, as
    the ARM backend already does. Measured on 04652e6: gap scan time on a 50 MB Go ELF (gh 2.62.0 linux/arm64)
    11.8 s to 3.2 s, about 5% of the whole run, and 25-60% less on three numpy/pydantic-core wheel libraries. Recovered
    functions, blocks, instructions and PIC hashes are identical on all four. Not bundled; the behaviour is covered by
    testAArch64GapScanExecSkip.

Fixed

  • (common) Read successors in Tarjan.closure() with graph.get(v, ()), as calculateScc() already does.
    A vertex that only appears as a successor raised KeyError. Nothing in SMDA calls closure(), so no report
    output changes. (#414)
  • (labels) Repair Delphi class RTTI offsets, published/extended method-table traversal, record bounds,
    Unicode names, executable-target validation and Pythia table bounds, and prefer explicit PDB names over generic
    PE entry-point labels. Cache shared legacy tables, share provider results and use a dependency-free
    pointer-suffix scan. Measured on the supplied 1d4e5452…5681c sample against 04652e6: 292 usable labels
    become 7,969; five-run median provider time falls from 1.100s to 0.084s, with lower peak Python allocation.
    Real metadata excerpts and malformed-input tests are bundled; the full binary is private. See
    profiling/delphi_audit/.
  • (labels) PE export and entry-point labels (and their candidates) are no longer dropped when a PDB is
    supplied. The PDB pass re-ran every label provider on the PDB's empty BinaryInfo, which cleared
    PeSymbolProvider; it now updates only PdbSymbolProvider. With USE_SYMBOLS_AS_CANDIDATES on by default,
    exports and the OEP are candidates again on PE+PDB runs, so the function set can grow where the PDB does not
    already name an export. Measured against bfe39ec: msvc_cxx_pdb_pe with its PDB keeps 3 PE symbols instead
    of 0; the function sets of msvc_cxx_pdb_pe and rust_pe_msvc_i686 with their PDBs are unchanged.
  • (intel) Recover normal-flow continuations from the validated 32-bit Delphi finally-dispatch idiom.
    Constructor tails previously ended at pop eax; jmp eax; match the saved continuation and linked
    handler thunk before following the missing edge. Real and generated regression fixtures are bundled.
    Measured against bfe39ec: complete reports bit-identical on 18 bundled non-Delphi x86/x64 PE, ELF and
    PE+PDB fixtures. Reproduced by reviewer on 16.
  • (arm) Pass operands through SmdaInstruction.getMnemonicGroup() for ARM.
    Float-suffixed NEON instructions using q registers now classify as vector (V); scalar VFP stays float (F).
    This changes ARM escaped-block signatures, so stored ones need recomputing; recovery and PIC/opcode hashes are
    unchanged. Covered by testArmDisassembler and the fingerprint corpus's new ARM cases.

Compatibility

  • (labels) Delphi names gain correct unit/class qualification and validated signatures.
  • (labels) An explicit PDB symbol now takes precedence over PE's synthetic original_entry_point label
    at the same address.
  • (intel) Delphi finally continuations extend owning function bodies and can change CFG fingerprints.
  • (arm) ESCAPER_DOWNWARD_COMPATIBILITY moves from 4.4.5 to 5.0.2, the release that ships the NEON
    grouping change, so ARM reports from 5.0.1 and earlier compare as stale.

What's Changed

Changes

  • fix(common): read successors with get() in Tarjan.closure() by @r0ny123 in #414
  • fix(tests): return dynamic segment bounds from mapImage in testElfMappedBuffer by @r0ny123 in #415
  • fix(tests): exercise Delphi label providers, ARM buffer fuzzing, and type checks by @r0ny123 in #417
  • ci: add callgrind instruction-count gate by @r0ny123 in #418
  • ci(profiling): compare the PR's CPU profile against the base branch by @r0ny123 in #419
  • ci: report which code the fuzz corpora reach by @r0ny123 in #420
  • ci: list the heaviest Malpedia samples in the benchmark report by @r0ny123 in #423
  • perf(aarch64): jump the gap scan over non-executable sections by @r0ny123 in #427
  • feat(binja): export 32-bit ARM and Thumb views by @r0ny123 in #428
  • ci: run one fuzzer process per runner core by @r0ny123 in #421
  • ci: fuzz capstone under AddressSanitizer weekly by @r0ny123 in #422
  • fix(labels): repair and accelerate Delphi recovery by @r0ny123 in #424
  • fix(arm): pass instruction operands when escaping ARM mnemonic groups by @r0ny123 in #416
  • build: release 5.0.2 by @danielplohmann in #429

Dependency and tooling updates

  • build(deps): bump the actions group across 1 directory with 2 updates by @dependabot[bot] in #426
  • build(deps-dev): bump the dev-dependencies group across 1 directory with 2 updates by @dependabot[bot] in #425

Full Changelog: v5.0.1...v5.0.2