2025-04-12 22:16:12 +03:00
|
|
|
using X86Disassembler.X86;
|
2025-04-14 23:08:52 +03:00
|
|
|
using X86Disassembler.X86.Operands;
|
2025-04-12 22:16:12 +03:00
|
|
|
|
2025-04-13 16:00:46 +03:00
|
|
|
namespace X86DisassemblerTests.InstructionTests;
|
|
|
|
|
2025-04-12 22:16:12 +03:00
|
|
|
/// <summary>
|
|
|
|
/// Tests for INT3 instruction handler
|
|
|
|
/// </summary>
|
|
|
|
public class Int3InstructionTests
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Tests the Int3Handler for decoding INT3 instruction
|
|
|
|
/// </summary>
|
|
|
|
[Fact]
|
|
|
|
public void Int3Handler_DecodesInt3_Correctly()
|
|
|
|
{
|
|
|
|
// Arrange
|
|
|
|
// INT3 (CC)
|
|
|
|
byte[] codeBuffer = new byte[] { 0xCC };
|
|
|
|
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
|
|
|
|
|
|
|
|
// Act
|
|
|
|
var instruction = decoder.DecodeInstruction();
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
Assert.NotNull(instruction);
|
2025-04-17 22:54:19 +03:00
|
|
|
Assert.Equal(InstructionType.Int3, instruction.Type);
|
2025-04-14 23:08:52 +03:00
|
|
|
|
|
|
|
// Check that we have no operands
|
|
|
|
Assert.Empty(instruction.StructuredOperands);
|
2025-04-12 22:16:12 +03:00
|
|
|
}
|
|
|
|
}
|