0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-20 08:18:36 +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

@ -45,8 +45,8 @@ public class PushImm32Handler : InstructionHandler
// Read the immediate value
uint imm32 = Decoder.ReadUInt32();
// Create the immediate operand
var immOperand = OperandFactory.CreateImmediateOperand(imm32);
// Create an immediate operand
var immOperand = new ImmediateOperand(imm32);
// Set the structured operands
instruction.StructuredOperands =

View File

@ -43,12 +43,11 @@ public class PushImm8Handler : InstructionHandler
}
// Read the immediate value
byte imm8 = Decoder.ReadByte();
// Create the immediate operand
// Sign-extend the 8-bit value to 32-bit for proper stack alignment
var immOperand = OperandFactory.CreateImmediateOperand((sbyte)imm8);
sbyte imm8 = (sbyte)Decoder.ReadByte();
// Create an 8-bit immediate operand to ensure it's displayed without leading zeros
var immOperand = new ImmediateOperand(imm8, 8);
// Set the structured operands
instruction.StructuredOperands =
[