Skip to content

fix(native): preserve numeric-looking Mach-O identifiers - #690

Closed
rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-numeric-macho-names-20261006
Closed

rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-numeric-macho-names-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

Problem

Mach-O segment and section identifiers are text. parseFields coerces every numeric-looking otool value to a number, so real names such as segment 0001 and section 0002 become 1 and 2 in native inventory. This changes their identity and breaks matching against the actual binary's names.

Change

Preserve segname and sectname as text. Retain existing numeric parsing for offsets, sizes and other numeric fields.

Verification

An owned dylib was built with actual host clang/linker -sectcreate,0001,0002,.... Real xcrun otool -l reports the segment 0001 and section 0002.

The public filesystem target resolver and actual NativeMacOSProvider/xcrun inventory report the wrong names before the fix. After it they retain 0001 and 0002 while preserving the observed file offset 16384 and section size 8. The corrected native probe reads the public schema's segments.items and sections.items; the earlier probe's array assumption was a setup error and is not evidence for the fix.

  • The captured real otool regression fails before and passes after.
  • All 3 focused native inventory tests and all five npm run check tasks pass using Node 24.18.0 and exact locked dependencies.
  • The owned binary was inspected statically; no target execution, Ghidra or Hopper verification is claimed.

AI assistance was used for investigation, implementation, tests, description and independent patch review. Actual producer proof and limitations are stated above.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve: narrow exemption of segname/sectname from numeric coercion preserves Mach-O identifiers like 0001/0002 while numberField still parses real numerics. Golden regression covers names + fileoff/size preservation. Checks green.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit.

@morluto morluto closed this Oct 6, 2026
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(native): preserve numeric-looking Mach-O identifiers.” I appreciate your contribution to REA.

@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants