0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-19 07:59:47 +03:00
This commit is contained in:
bird_egop
2025-04-13 03:56:39 +03:00
parent 611dce32e5
commit b215908d76
5 changed files with 57 additions and 29 deletions

View File

@ -37,8 +37,8 @@ public class Group1SignExtendedHandlerTests
{
// Arrange
// This is the sequence from the problematic example:
// 08 83 C1 04 50 E8 42 01 00 00
byte[] codeBuffer = new byte[] { 0x08, 0x83, 0xC1, 0x04, 0x50, 0xE8, 0x42, 0x01, 0x00, 0x00 };
// 83 C1 04 50 E8 42 01 00 00
byte[] codeBuffer = new byte[] { 0x83, 0xC1, 0x04, 0x50, 0xE8, 0x42, 0x01, 0x00, 0x00 };
var disassembler = new Disassembler(codeBuffer, 0);
// Act
@ -47,15 +47,12 @@ public class Group1SignExtendedHandlerTests
// Assert
Assert.True(instructions.Count >= 3, $"Expected at least 3 instructions, but got {instructions.Count}");
// First instruction should be OR r/m8, r8 (but might be incomplete)
Assert.Equal("or", instructions[0].Mnemonic);
// First instruction should be ADD ecx, 0x04
Assert.Equal("add", instructions[0].Mnemonic);
Assert.Equal("ecx, 0x00000004", instructions[0].Operands);
// Second instruction should be ADD ecx, 0x04
Assert.Equal("add", instructions[1].Mnemonic);
Assert.Equal("ecx, 0x00000004", instructions[1].Operands);
// Third instruction should be PUSH eax
Assert.Equal("push", instructions[2].Mnemonic);
Assert.Equal("eax", instructions[2].Operands);
// Second instruction should be PUSH eax
Assert.Equal("push", instructions[1].Mnemonic);
Assert.Equal("eax", instructions[1].Operands);
}
}

View File

@ -56,5 +56,6 @@ public class HandlerSelectionTests
// Third instruction should be PUSH eax
Assert.Equal("push", instructions[2].Mnemonic);
Assert.Equal("eax", instructions[2].Operands);
}
}