cpu: translate the blast decoder and dispatch its callbacks #455

Merged
R0Y00 merged 1 commit from upstream-pr/461 into main 2026-11-22 05:16:04 +00:00
R0Y00 commented 2026-11-22 05:11:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T05:11:14Z.


Refs #459, #317. Translate the linked scalar x64 blast 1.3 export and its reachable routines from the reference PE to C++. Bind the callback actually loaded from the guest state to the caller-provided input or output function. Model the decoder's single nonlocal recovery point and data relocations. No pending PR dependencies.

The original reader uses the native codec. The pe_map child maps all three original modules individually. The AOT reader and decoder use the generated code and native callback adapter; import checks exclude the native decoder. A host callback refusal control checks contexts, byte content and the decoder's return 1.

Local x64 Windows, MSVC 19.51, head 219f289. Built archive_all_lifted, archive_reader_lifted and pe_map:

ctest --preset dev --no-tests=error -R '^cpu_native_archive_' --output-on-failure
ctest --preset release --no-tests=error -R '^cpu_native_archive_' --output-on-failure

Both presets passed 2/2. Two complete records emitted 26 bytes and exited 0. Truncating record two returned 4 then 0 at the input callback, took longjmp and delivered 1 tentative byte to the final output callback; stdout retained only the first 13 bytes, completed count 1, exit 2. Both runs allocated and freed twice. The documentation records the observed callback RVAs and scope.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6538756015 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/461). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T05:11:14Z. --- Refs #459, #317. Translate the linked scalar x64 blast 1.3 export and its reachable routines from the reference PE to C++. Bind the callback actually loaded from the guest state to the caller-provided input or output function. Model the decoder's single nonlocal recovery point and data relocations. No pending PR dependencies. The original reader uses the native codec. The pe_map child maps all three original modules individually. The AOT reader and decoder use the generated code and native callback adapter; import checks exclude the native decoder. A host callback refusal control checks contexts, byte content and the decoder's return 1. Local x64 Windows, MSVC 19.51, head 219f289. Built archive_all_lifted, archive_reader_lifted and pe_map: ```powershell ctest --preset dev --no-tests=error -R '^cpu_native_archive_' --output-on-failure ctest --preset release --no-tests=error -R '^cpu_native_archive_' --output-on-failure ``` Both presets passed 2/2. Two complete records emitted 26 bytes and exited 0. Truncating record two returned 4 then 0 at the input callback, took longjmp and delivered 1 tentative byte to the final output callback; stdout retained only the first 13 bytes, completed count 1, exit 2. Both runs allocated and freed twice. The documentation records the observed callback RVAs and scope.
upstream-sync closed this pull request 2026-11-24 06:43:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
R0Y00/Xbox2Windows!455
No description provided.