0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-19 07:59:47 +03:00

Added support for string instructions with REP prefix, specifically F3 A5 (REP MOVS)

This commit is contained in:
bird_egop
2025-04-13 02:10:48 +03:00
parent bfaeba0d5f
commit c14a92bf04
3 changed files with 125 additions and 4 deletions

View File

@ -0,0 +1,32 @@
namespace X86DisassemblerTests;
using System;
using Xunit;
using X86Disassembler.X86;
using X86Disassembler.X86.Handlers.String;
/// <summary>
/// Tests for string instruction handlers
/// </summary>
public class StringInstructionHandlerTests
{
/// <summary>
/// Tests the RepMovsHandler for decoding REP MOVS instruction
/// </summary>
[Fact]
public void RepMovsHandler_DecodesRepMovs_Correctly()
{
// Arrange
// REP MOVS (F3 A5)
byte[] codeBuffer = new byte[] { 0xF3, 0xA5 };
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
// Act
var instruction = decoder.DecodeInstruction();
// Assert
Assert.NotNull(instruction);
Assert.Equal("rep movs", instruction.Mnemonic);
Assert.Equal("dword ptr [edi], dword ptr [esi]", instruction.Operands);
}
}