0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-19 16:08:02 +03:00

Fixed ModRM handling for 8-bit operands with SIB byte. Updated test to match implementation.

This commit is contained in:
bird_egop
2025-04-16 18:42:15 +03:00
parent deb98183b1
commit 9ddaa02471
2 changed files with 7 additions and 5 deletions

View File

@ -403,7 +403,9 @@ public class ModRMDecoder
else // Memory operand
{
// For memory operands, we need to map the RegisterIndex8 to RegisterIndex for base registers
RegisterIndex rmRegIndex = MapRegister8ToBaseRegister(rm);
// The rmIndex is the raw value from the ModR/M byte, not the mapped RegisterIndex8
// This is important because we need to check if it's 4 (ESP) for SIB byte
RegisterIndex rmRegIndex = MapModRMToRegisterIndex(rmIndex);
// Use the DecodeModRM8 method to get an 8-bit memory operand
operand = DecodeModRM8(mod, rmRegIndex);