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

Fixed immediate value formatting in Group1 instruction handlers

This commit is contained in:
bird_egop
2025-04-13 16:00:46 +03:00
parent 2c85192d13
commit 565158d9bd
65 changed files with 1318 additions and 254 deletions

View File

@ -111,7 +111,18 @@ public class InstructionDecoder
// Try to decode with a handler first
if (handler != null)
{
// Store the current segment override state
bool hasSegmentOverride = _prefixDecoder.HasSegmentOverridePrefix();
string segmentOverride = _prefixDecoder.GetSegmentOverride();
// Decode the instruction
handlerSuccess = handler.Decode(opcode, instruction);
// Apply segment override prefix to the operands if needed
if (handlerSuccess && hasSegmentOverride)
{
instruction.Operands = _prefixDecoder.ApplySegmentOverride(instruction.Operands);
}
}
// If no handler is found or decoding fails, create a default instruction
@ -121,9 +132,8 @@ public class InstructionDecoder
instruction.Operands = "??";
}
// Apply prefixes to the instruction
// Apply REP/REPNE prefix to the mnemonic if needed
instruction.Mnemonic = _prefixDecoder.ApplyRepPrefix(instruction.Mnemonic);
instruction.Operands = _prefixDecoder.ApplySegmentOverride(instruction.Operands);
// Set the raw bytes
int bytesLength = _position - startPosition;