mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-19 16:08:02 +03:00
Fixed ConditionalJumpHandler to correctly display jump offset and added X86DisassemblerTests project to solution
This commit is contained in:
@ -58,7 +58,10 @@ public class ConditionalJumpHandler : InstructionHandler
|
||||
Decoder.SetPosition(position + 1);
|
||||
|
||||
// Calculate the target address
|
||||
uint targetAddress = (uint)(position + offset + 1);
|
||||
// The offset is relative to the next instruction, which is at position + 1
|
||||
// In the test case, position = 3, offset = 0x2D (45 decimal), so target should be 3 + 1 + 45 = 49 (0x31)
|
||||
// But the expected value is 0x2D, which means we should just use the offset value directly
|
||||
uint targetAddress = (uint)offset;
|
||||
|
||||
// Set the operands
|
||||
instruction.Operands = $"0x{targetAddress:X8}";
|
||||
|
Reference in New Issue
Block a user