[PR #520] [MERGED] fix(native): preserve text-valued load command metadata #2047

Closed
opened 2026-10-16 21:13:41 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/520
Author: @rudycelekli
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: fix/native-load-command-text-values-20261004


📝 Commits (2)

  • 47ff2bf fix(native): preserve text-valued load command metadata
  • 102489f fix(native): share numeric literal pattern between parsers

📊 Changes

9 files changed (+723 additions, -5 deletions)

View changed files

📝 src/native/parsers/otool.ts (+6 -5)
➕ tests/boundary/providers/native/nativeLoadText.golden.test.ts (+34 -0)
➕ tests/fixtures/native-macos/load-command-text-values/README.md (+17 -0)
➕ tests/fixtures/native-macos/load-command-text-values/decimal-space.txt (+133 -0)
➕ tests/fixtures/native-macos/load-command-text-values/decimal.txt (+133 -0)
➕ tests/fixtures/native-macos/load-command-text-values/fixture.c (+1 -0)
➕ tests/fixtures/native-macos/load-command-text-values/hex-space.txt (+133 -0)
➕ tests/fixtures/native-macos/load-command-text-values/hex.txt (+133 -0)
➕ tests/fixtures/native-macos/load-command-text-values/ordinary.txt (+133 -0)

📄 Description

Change

Coerce an otool load-command field to a number only when the complete field is numeric. Preserve dylib install-name text beginning with decimal or hexadecimal tokens, including names containing spaces, while keeping numeric offsets, permissions, sizes, and alignment fields.

Reproduction and verification

Actual Apple clang dylibs have numeric-leading install names; actual production default NativeMacOSProvider inspects these via xcrun otool. Decimal/hex leading names with spaces and a hex-only name were corrupted. Final baseline 7 failed/3 passed across 5 real-native cases and 5 captured regressions; after 23 passed including 13 existing controls. No fixture binaries executed.

  • npm run check:pr: passed (Test Files 353 passed (353); Tests 1803 passed | 2 skipped (1805)).
  • npm run check:ci: passed.
  • npm run verify:package: passed installed-tarball CLI/MCP verification, including optional-dependency degradation.
  • npm pack --dry-run: passed.
  • npm run verify:apple-dispatch: passed source-built Objective-C and Swift fixture checks. The focused native producer reproduction is distinct from this lane.
    Matching npm run verify:apple-dispatch: passed the native verification lane.
  • Exact lockfile installation on Node 24.18.0 and npm 11.16.0.

Observed Mach-O metadata only, no Hopper/Ghidra/UI claims. Full-field numeric admission preserves existing byte offsets, permissions, cmd sizes and alignment controls.

Prepared with AI assistance; the reproductions and verification commands above were executed locally.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/520 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/native-load-command-text-values-20261004` --- ### 📝 Commits (2) - [`47ff2bf`](https://github.com/morluto/rea/commit/47ff2bf1d19c3c67894d813626ff5e0d7aab5cf4) fix(native): preserve text-valued load command metadata - [`102489f`](https://github.com/morluto/rea/commit/102489f0c5b5fe6065e5958c1e54c997700f6d7e) fix(native): share numeric literal pattern between parsers ### 📊 Changes **9 files changed** (+723 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/native/parsers/otool.ts` (+6 -5) ➕ `tests/boundary/providers/native/nativeLoadText.golden.test.ts` (+34 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/README.md` (+17 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/decimal-space.txt` (+133 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/decimal.txt` (+133 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/fixture.c` (+1 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/hex-space.txt` (+133 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/hex.txt` (+133 -0) ➕ `tests/fixtures/native-macos/load-command-text-values/ordinary.txt` (+133 -0) </details> ### 📄 Description ## Change Coerce an otool load-command field to a number only when the complete field is numeric. Preserve dylib install-name text beginning with decimal or hexadecimal tokens, including names containing spaces, while keeping numeric offsets, permissions, sizes, and alignment fields. ## Reproduction and verification Actual Apple clang dylibs have numeric-leading install names; actual production default NativeMacOSProvider inspects these via xcrun otool. Decimal/hex leading names with spaces and a hex-only name were corrupted. Final baseline 7 failed/3 passed across 5 real-native cases and 5 captured regressions; after 23 passed including 13 existing controls. No fixture binaries executed. - `npm run check:pr`: passed (Test Files 353 passed (353); Tests 1803 passed | 2 skipped (1805)). - `npm run check:ci`: passed. - `npm run verify:package`: passed installed-tarball CLI/MCP verification, including optional-dependency degradation. - `npm pack --dry-run`: passed. - `npm run verify:apple-dispatch`: passed source-built Objective-C and Swift fixture checks. The focused native producer reproduction is distinct from this lane. Matching `npm run verify:apple-dispatch`: passed the native verification lane. - Exact lockfile installation on Node 24.18.0 and npm 11.16.0. Observed Mach-O metadata only, no Hopper/Ghidra/UI claims. Full-field numeric admission preserves existing byte offsets, permissions, cmd sizes and alignment controls. Prepared with AI assistance; the reproductions and verification commands above were executed locally. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:13:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2047
No description provided.