mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
simplify reading logic
This commit is contained in:
@ -45,8 +45,7 @@ public class JmpRel32Handler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the relative offset
|
||||
int offset = BitConverter.ToInt32(CodeBuffer, position);
|
||||
Decoder.SetPosition(position + 4);
|
||||
uint offset = Decoder.ReadUInt32();
|
||||
|
||||
// Calculate the target address
|
||||
uint targetAddress = (uint)(position + offset + 4);
|
||||
|
@ -74,8 +74,7 @@ public class TwoByteConditionalJumpHandler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the relative offset (32-bit)
|
||||
int offset = BitConverter.ToInt32(CodeBuffer, position);
|
||||
Decoder.SetPosition(position + 4);
|
||||
uint offset = Decoder.ReadUInt32();
|
||||
|
||||
// Calculate the target address
|
||||
uint targetAddress = (uint)(position + offset + 4);
|
||||
|
Reference in New Issue
Block a user