0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-05-19 11:51:17 +03:00
This commit is contained in:
bird_egop 2025-04-15 02:32:14 +03:00
parent 3ea327064a
commit 49f1d7d221
5 changed files with 5 additions and 15 deletions

View File

@ -29,6 +29,6 @@ public class BaseRegisterMemoryOperand : MemoryOperand
public override string ToString()
{
var registerName = ModRMDecoder.GetRegisterName(BaseRegister, 32);
return $"{GetSegmentPrefix()}{GetSizePrefix()}[{registerName}]";
return $"{GetSizePrefix()}[{registerName}]";
}
}

View File

@ -28,6 +28,6 @@ public class DirectMemoryOperand : MemoryOperand
/// </summary>
public override string ToString()
{
return $"{GetSegmentPrefix()}{GetSizePrefix()}[0x{Address:X}]";
return $"{GetSizePrefix()}[0x{Address:X}]";
}
}

View File

@ -43,6 +43,6 @@ public class DisplacementMemoryOperand : MemoryOperand
? $"0x{Math.Abs(Displacement):X2}"
: $"0x{Math.Abs(Displacement):X}";
return $"{GetSegmentPrefix()}{GetSizePrefix()}[{registerName}{sign}{formattedDisplacement}]";
return $"{GetSizePrefix()}[{registerName}{sign}{formattedDisplacement}]";
}
}

View File

@ -21,16 +21,6 @@ public abstract class MemoryOperand : Operand
SegmentOverride = segmentOverride;
}
/// <summary>
/// Gets the segment prefix string for display
/// </summary>
/// <returns>The segment prefix string</returns>
protected string GetSegmentPrefix()
{
// Format changed to match expected test output: "dword ptr es:[ebp+0x10]" instead of "es:dword ptr [ebp+0x10]"
return "";
}
/// <summary>
/// Gets the size prefix string for display (e.g., "byte ptr", "word ptr", "dword ptr")
/// </summary>

View File

@ -60,6 +60,6 @@ public class ScaledIndexMemoryOperand : MemoryOperand
dispPart = $"{sign}0x{Math.Abs(Displacement):X}";
}
return $"{GetSegmentPrefix()}{GetSizePrefix()}[{baseRegPart}{indexPart}{dispPart}]";
return $"{GetSizePrefix()}[{baseRegPart}{indexPart}{dispPart}]";
}
}