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

Fix x86 disassembler issues with direct memory addressing and immediate value formatting

This commit is contained in:
bird_egop
2025-04-15 02:29:32 +03:00
parent d351f41808
commit 3ea327064a
67 changed files with 854 additions and 453 deletions

View File

@ -50,8 +50,8 @@ public class ScaledIndexMemoryOperand : MemoryOperand
/// </summary>
public override string ToString()
{
string baseRegPart = BaseRegister != null ? $"{BaseRegister}+" : "";
string indexPart = $"{IndexRegister}*{Scale}";
string baseRegPart = BaseRegister != null ? $"{ModRMDecoder.GetRegisterName(BaseRegister.Value, 32)}+" : "";
string indexPart = $"{ModRMDecoder.GetRegisterName(IndexRegister, 32)}*{Scale}";
string dispPart = "";
if (Displacement != 0)
@ -60,6 +60,6 @@ public class ScaledIndexMemoryOperand : MemoryOperand
dispPart = $"{sign}0x{Math.Abs(Displacement):X}";
}
return $"{GetSegmentPrefix()}[{baseRegPart}{indexPart}{dispPart}]";
return $"{GetSegmentPrefix()}{GetSizePrefix()}[{baseRegPart}{indexPart}{dispPart}]";
}
}