mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
more cleanup
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
namespace X86Disassembler.X86.Handlers.Or;
|
||||
|
||||
using X86Disassembler.X86.Operands;
|
||||
using Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for OR AL, imm8 instruction (0x0C)
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace X86Disassembler.X86.Handlers.Or;
|
||||
|
||||
using X86Disassembler.X86.Operands;
|
||||
using Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for OR EAX, imm32 instruction (0x0D)
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace X86Disassembler.X86.Handlers.Or;
|
||||
|
||||
using X86Disassembler.X86.Operands;
|
||||
using Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for OR r/m32, imm32 instruction (0x81 /1)
|
||||
@ -30,8 +30,7 @@ public class OrImmToRm32Handler : InstructionHandler
|
||||
if (!Decoder.CanReadByte())
|
||||
return false;
|
||||
|
||||
byte modRM = Decoder.PeakByte();
|
||||
byte reg = (byte) ((modRM & 0x38) >> 3);
|
||||
var reg = ModRMDecoder.PeakModRMReg();
|
||||
|
||||
return reg == 1; // 1 = OR
|
||||
}
|
||||
@ -53,7 +52,7 @@ public class OrImmToRm32Handler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the ModR/M byte
|
||||
var (mod, reg, rm, destOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, _, _, destOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Check if we can read the immediate value
|
||||
if (!Decoder.CanReadUInt())
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace X86Disassembler.X86.Handlers.Or;
|
||||
|
||||
using X86Disassembler.X86.Operands;
|
||||
using Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for OR r/m32, imm8 (sign-extended) instruction (0x83 /1)
|
||||
@ -30,8 +30,7 @@ public class OrImmToRm32SignExtendedHandler : InstructionHandler
|
||||
if (!Decoder.CanReadByte())
|
||||
return false;
|
||||
|
||||
byte modRM = Decoder.PeakByte();
|
||||
byte reg = (byte) ((modRM & 0x38) >> 3);
|
||||
var reg = ModRMDecoder.PeakModRMReg();
|
||||
|
||||
return reg == 1; // 1 = OR
|
||||
}
|
||||
@ -53,7 +52,7 @@ public class OrImmToRm32SignExtendedHandler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the ModR/M byte
|
||||
var (mod, reg, rm, destOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, _, _, destOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Read the immediate value (sign-extended from 8 to 32 bits)
|
||||
if (!Decoder.CanReadByte())
|
||||
|
@ -30,8 +30,7 @@ public class OrImmToRm8Handler : InstructionHandler
|
||||
if (!Decoder.CanReadByte())
|
||||
return false;
|
||||
|
||||
byte modRM = Decoder.PeakByte();
|
||||
byte reg = (byte) ((modRM & 0x38) >> 3);
|
||||
var reg = ModRMDecoder.PeakModRMReg();
|
||||
|
||||
return reg == 1; // 1 = OR
|
||||
}
|
||||
@ -56,7 +55,7 @@ public class OrImmToRm8Handler : InstructionHandler
|
||||
// For OR r/m8, imm8 (0x80 /1):
|
||||
// - The r/m field with mod specifies the destination operand (register or memory)
|
||||
// - The immediate value is the source operand
|
||||
var (mod, reg, rm, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, _, _, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Adjust the operand size to 8-bit
|
||||
destinationOperand.Size = 8;
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace X86Disassembler.X86.Handlers.Or;
|
||||
|
||||
using X86Disassembler.X86.Operands;
|
||||
using Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for OR r32, r/m32 instruction (0x0B)
|
||||
|
@ -46,7 +46,7 @@ public class OrR8Rm8Handler : InstructionHandler
|
||||
// For OR r8, r/m8 (0x0A):
|
||||
// - The reg field specifies the destination register
|
||||
// - The r/m field with mod specifies the source operand (register or memory)
|
||||
var (mod, reg, rm, sourceOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, reg, _, sourceOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Adjust the operand size to 8-bit
|
||||
sourceOperand.Size = 8;
|
||||
|
@ -29,9 +29,6 @@ public class OrRm8R8Handler : InstructionHandler
|
||||
// Check if we can read the ModR/M byte
|
||||
if (!Decoder.CanReadByte())
|
||||
return false;
|
||||
|
||||
// Peek at the ModR/M byte to verify this is the correct instruction
|
||||
byte modRM = Decoder.PeakByte();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -54,7 +51,7 @@ public class OrRm8R8Handler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the ModR/M byte, specifying that we're dealing with 8-bit operands
|
||||
var (mod, reg, rm, destinationOperand) = ModRMDecoder.ReadModRM8();
|
||||
var (_, reg, _, destinationOperand) = ModRMDecoder.ReadModRM8();
|
||||
|
||||
// Adjust the operand size to 8-bit
|
||||
destinationOperand.Size = 8;
|
||||
|
Reference in New Issue
Block a user