fix(relinker): decode address operands for MOV moffs instructions #1211

Closed
emirplus wants to merge 1 commit from upstream-pr/1211 into main
emirplus commented 2026-10-07 17:46:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by emirplus on 2026-10-07T17:46:28Z.


Fixes #1167.

What

  • Tracks PrefixAddressSize (0x67) in X64InstructionDecoder::Decode.
  • Decodes address operands for direct memory-offset MOV instructions (A0-A3, MOV AL/eAX/rAX, moffs and MOV moffs, AL/eAX/rAX), setting operand size to 32-bit if 0x67 prefix is present, or 64-bit by default.
  • Adds test cases in Amd64OnlyConverterTests.cpp for decoder lengths and instruction scanner behavior.

Tested

  • Windows 11 x64, MinGW Clang 19: amd64_only_converter_tests passed (100% test pass).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4776341810 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1211). Originally posted by [emirplus](https://github.com/emirplus) on 2026-10-07T17:46:28Z. --- Fixes #1167. ### What - Tracks PrefixAddressSize (0x67) in X64InstructionDecoder::Decode. - Decodes address operands for direct memory-offset MOV instructions (A0-A3, MOV AL/eAX/rAX, moffs and MOV moffs, AL/eAX/rAX), setting operand size to 32-bit if 0x67 prefix is present, or 64-bit by default. - Adds test cases in Amd64OnlyConverterTests.cpp for decoder lengths and instruction scanner behavior. ### Tested - Windows 11 x64, MinGW Clang 19: amd64_only_converter_tests passed (100% test pass). ### Checklist - [x] Based on current main; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt - [x] No notes, investigation .md files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-08 02:44:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:44:29Z.


Closing: #1168 fixes #1167 the same way (the 0x67 flag, A0-A3, 4- or 8-byte address) and was opened first. If it misses a form your test covers, comment on #1168 with it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051104857 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1211#issuecomment-6051104857). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T02:44:29Z. --- Closing: #1168 fixes #1167 the same way (the `0x67` flag, `A0`-`A3`, 4- or 8-byte address) and was opened first. If it misses a form your test covers, comment on #1168 with it.

Pull request closed

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
boykopovar/AnyPS5!1211
No description provided.