mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-08-04 10:26:31 +03:00
Updated instruction handlers to use Type and StructuredOperands instead of Mnemonic and Operands
This commit is contained in:
32
X86Disassembler/X86/Operands/RelativeOffsetOperand.cs
Normal file
32
X86Disassembler/X86/Operands/RelativeOffsetOperand.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace X86Disassembler.X86.Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a relative offset operand in an x86 instruction (used for jumps and calls)
|
||||
/// </summary>
|
||||
public class RelativeOffsetOperand : Operand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the target address
|
||||
/// </summary>
|
||||
public ulong TargetAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the RelativeOffsetOperand class
|
||||
/// </summary>
|
||||
/// <param name="targetAddress">The target address</param>
|
||||
/// <param name="size">The size of the offset in bits (8 or 32)</param>
|
||||
public RelativeOffsetOperand(ulong targetAddress, int size = 32)
|
||||
{
|
||||
Type = OperandType.RelativeOffset;
|
||||
TargetAddress = targetAddress;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of this operand
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"0x{TargetAddress:X}";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user