mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
more cleanup
This commit is contained in:
@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
|
||||
namespace X86Disassembler.X86;
|
||||
|
||||
using Handlers;
|
||||
using X86Disassembler.X86.Operands;
|
||||
using Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Decodes x86 instructions from a byte buffer
|
||||
@ -25,7 +25,6 @@ public class InstructionDecoder
|
||||
|
||||
// Specialized decoders
|
||||
private readonly PrefixDecoder _prefixDecoder;
|
||||
private readonly ModRMDecoder _modRMDecoder;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the InstructionDecoder class
|
||||
@ -40,7 +39,7 @@ public class InstructionDecoder
|
||||
|
||||
// Create specialized decoders
|
||||
_prefixDecoder = new PrefixDecoder();
|
||||
_modRMDecoder = new ModRMDecoder(this);
|
||||
new ModRMDecoder(this);
|
||||
|
||||
// Create the instruction handler factory
|
||||
_handlerFactory = new InstructionHandlerFactory(_codeBuffer, this, _length);
|
||||
@ -133,8 +132,7 @@ public class InstructionDecoder
|
||||
string segmentOverride = _prefixDecoder.GetSegmentOverride();
|
||||
|
||||
// Save the position before decoding
|
||||
int beforeDecodePosition = _position;
|
||||
|
||||
|
||||
// Decode the instruction
|
||||
handlerSuccess = handler.Decode(opcode, instruction);
|
||||
|
||||
@ -144,7 +142,7 @@ public class InstructionDecoder
|
||||
// Apply segment override to memory operands
|
||||
foreach (var operand in instruction.StructuredOperands)
|
||||
{
|
||||
if (operand is Operands.MemoryOperand memoryOperand)
|
||||
if (operand is MemoryOperand memoryOperand)
|
||||
{
|
||||
memoryOperand.SegmentOverride = segmentOverride;
|
||||
}
|
||||
@ -287,15 +285,6 @@ public class InstructionDecoder
|
||||
return _prefixDecoder.HasOperandSizePrefix();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the prefix decoder
|
||||
/// </summary>
|
||||
/// <returns>The prefix decoder</returns>
|
||||
public PrefixDecoder GetPrefixDecoder()
|
||||
{
|
||||
return _prefixDecoder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a single byte can be read from the current position
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user