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

more refactoring

This commit is contained in:
bird_egop
2025-04-14 01:08:14 +03:00
parent f54dc10596
commit 99b93523a4
78 changed files with 379 additions and 594 deletions

View File

@ -37,9 +37,8 @@ public class MovMemRegHandler : InstructionHandler
// Set the mnemonic
instruction.Mnemonic = "mov";
int position = Decoder.GetPosition();
if (position >= Length)
// Check if we have enough bytes for the ModR/M byte
if (!Decoder.CanReadByte())
{
return false;
}

View File

@ -37,9 +37,8 @@ public class MovRm8Imm8Handler : InstructionHandler
// Set the mnemonic
instruction.Mnemonic = "mov";
int position = Decoder.GetPosition();
if (position >= Length)
// Check if we have enough bytes for the ModR/M byte
if (!Decoder.CanReadByte())
{
return false;
}
@ -66,7 +65,7 @@ public class MovRm8Imm8Handler : InstructionHandler
}
// Read the immediate value
if (Decoder.GetPosition() >= Length)
if (!Decoder.CanReadByte())
{
return false;
}