Skip to content

[AUTOMATED] Decode indexed IEEE-695 and TIOF modules - #1944

Merged
mahaloz merged 2 commits into
Noelo-Lab:mainfrom
thotypous:kuna-ieee695-records
Nov 24, 2026
Merged

mahaloz merged 2 commits into
Noelo-Lab:mainfrom
thotypous:kuna-ieee695-records

Conversation

@thotypous

@thotypous thotypous commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Kuna can now read the indexed envelope and relocation tokens of a binary IEEE-695 or TIOF module. The reader test opens an indexed m68000 module and reads its W5 expression without crossing into the W7 trailer:

cd decompiler
cargo test -p kuna-analysis loader::ieee695::tests
  • Validate module-part offsets and the end record before exposing bounded cursors. Leave layout, symbol resolution, and relocation writes to the input profile.
  • The tests cover empty parts at the next part's offset, both extended name lengths, still reject overlapping parts and missing module-end records, and keep delimiter bytes inside compact numbers.

Dependency for the Carmel PR (#1936): the target profile uses this shared IEEE-695 and TIOF reader.

Model: openai-codex/gpt-6.2-sol

@mahaloz

mahaloz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

[AUTOMATED] Pushed 2960b49 with two fixes, checked against binutils' IEEE-695 reader and writer (bfd/ieee.c) and against modules written by binutils 2.30 objcopy -O ieee from m68k objects:

  • binutils records the trailer-part offset even when the trailer is empty. A relocatable module with no start address therefore has W6 == W7, and module() rejected it with invalid W6 part offset. A W0–W6 part may now share the next part's offset as an empty cursor; W7 must still hold the ME record.
  • A name of 128 bytes or more is written as 0xDE plus one length byte, or 0xDF plus two (binutils read_id). Cursor::name() read only the numeric form, so a long module name failed with expected number, got 0xde. It now reads both forms.

The overlap test now places W2 inside W5, because W2 == W5 is a legal empty W2. A new test covers the empty trailer and both long-name forms. On four binutils-written modules (relocatable, absolute, and 150- and 250-byte module names), one opened before this change and all four open now.

thotypous and others added 2 commits November 24, 2026 17:26
Validate W-part bounds and module termination. Expose compact fields
and relocation-expression tokens without applying a target layout.
…nd 0xDE/0xDF name lengths

binutils' IEEE-695 writer records the trailer-part offset even when the
trailer is empty, so a relocatable module with no start address has
W6 == W7, which module() rejected as an invalid W6 part offset. A W0..W6
part may now share the next part's offset as an empty cursor; W7 must
still hold the ME record.

Cursor::name() also reads the 0xDE (one length byte) and 0xDF (two length
bytes) forms IEEE-695 uses for names of 128 bytes or more, such as a long
module name. The numeric length form is still read.

The overlap test now uses a real overlap (W2 inside W5), since W2 == W5
is a legal empty W2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
@thotypous
thotypous force-pushed the kuna-ieee695-records branch from 2960b49 to 8d56fb6 Compare November 24, 2026 20:38
@mahaloz
mahaloz merged commit 6682e75 into Noelo-Lab:main Nov 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants