Skip to content

NativeInstruction

Namespace: Dotsider.Core.Analysis.Models

Assembly: Dotsider.Core.dll

One decoded native instruction. The model is structured — bytes, structured operands, flow and target metadata, and source attribution — so navigation, JSON/MCP output, syntax decoration, and future diffing read facts rather than parse text. OperandText and the rendered listing line are projections; Address is the semantic key and DisplayLine the presentation key, mirroring IlInstruction for the shared IL-Inspector plumbing.

public sealed record NativeInstruction : IEquatable<NativeInstruction>

ObjectNativeInstruction

NativeInstruction(ulong, uint?, long?, IReadOnlyList<byte>, int, string, IReadOnlyList<NativeOperand>, string, NativeInstructionCategory, NativeFlowKind, ulong?, NativeTargetKind, string?, string?, int?, bool, int?, NativeLineLayout?)

Section titled “NativeInstruction(ulong, uint?, long?, IReadOnlyList<byte>, int, string, IReadOnlyList<NativeOperand>, string, NativeInstructionCategory, NativeFlowKind, ulong?, NativeTargetKind, string?, string?, int?, bool, int?, NativeLineLayout?)”

One decoded native instruction. The model is structured — bytes, structured operands, flow and target metadata, and source attribution — so navigation, JSON/MCP output, syntax decoration, and future diffing read facts rather than parse text. OperandText and the rendered listing line are projections; Address is the semantic key and DisplayLine the presentation key, mirroring IlInstruction for the shared IL-Inspector plumbing.

Parameters:

  • Address (UInt64): The instruction’s virtual address.
  • Rva (Nullable<UInt32>): The PE relative virtual address, or null for non-PE images.
  • FileOffset (Nullable<Int64>): The file offset of the instruction’s bytes, or null when not file-backed.
  • Bytes (IReadOnlyList<Byte>): The raw encoded bytes of exactly this instruction.
  • Length (Int32): The encoded byte length (always exact, even for the fallback).
  • Mnemonic (String): The instruction mnemonic (e.g. mov, vaddps, bl, or .byte/.word for the fallback).
  • Operands (IReadOnlyList<NativeOperand>): The structured operands, in source order.
  • OperandText (String): The rendered operand string, or empty when there are none.
  • Category (NativeInstructionCategory): The instruction’s coarse category.
  • Flow (NativeFlowKind): How the instruction affects control flow.
  • TargetAddress (Nullable<UInt64>): The resolved absolute call/branch/data target, or null.
  • TargetKind (NativeTargetKind): What TargetAddress points at.
  • TargetName (String): The resolved target’s display name (e.g. Foo, Foo+0x12, loc_140001234), or null.
  • SourceFile (String): The source file for this address from the native source map, or null.
  • Line (Nullable<Int32>): The source line for this address, or null.
  • IsFallback (Boolean): Whether this is a .byte/.word safety-net entry for undefined or corrupt bytes.
  • DisplayLine (Nullable<Int32>): The 1-based rendered line number in formatted disassembly, or null.
  • Layout (Nullable<NativeLineLayout>): The rendered-line column spans, set by the text formatter, or null.
public NativeInstruction(ulong Address, uint? Rva, long? FileOffset, IReadOnlyList<byte> Bytes, int Length, string Mnemonic, IReadOnlyList<NativeOperand> Operands, string OperandText, NativeInstructionCategory Category, NativeFlowKind Flow, ulong? TargetAddress = null, NativeTargetKind TargetKind = NativeTargetKind.None, string? TargetName = null, string? SourceFile = null, int? Line = null, bool IsFallback = false, int? DisplayLine = null, NativeLineLayout? Layout = null)

The instruction’s virtual address.

Returns: UInt64

public ulong Address { get; init; }

The raw encoded bytes of exactly this instruction.

Returns: IReadOnlyList<Byte>

public IReadOnlyList<byte> Bytes { get; init; }

The instruction’s coarse category.

Returns: NativeInstructionCategory

public NativeInstructionCategory Category { get; init; }

The 1-based rendered line number in formatted disassembly, or null.

Returns: Nullable<Int32>

public int? DisplayLine { get; init; }

The file offset of the instruction’s bytes, or null when not file-backed.

Returns: Nullable<Int64>

public long? FileOffset { get; init; }

How the instruction affects control flow.

Returns: NativeFlowKind

public NativeFlowKind Flow { get; init; }

Whether this is a .byte/.word safety-net entry for undefined or corrupt bytes.

Returns: Boolean

public bool IsFallback { get; init; }

The rendered-line column spans, set by the text formatter, or null.

Returns: Nullable<NativeLineLayout>

public NativeLineLayout? Layout { get; init; }

The encoded byte length (always exact, even for the fallback).

Returns: Int32

public int Length { get; init; }

The source line for this address, or null.

Returns: Nullable<Int32>

public int? Line { get; init; }

The instruction mnemonic (e.g. mov, vaddps, bl, or .byte/.word for the fallback).

Returns: String

public string Mnemonic { get; init; }

The structured operands, in source order.

Returns: IReadOnlyList<NativeOperand>

public IReadOnlyList<NativeOperand> Operands { get; init; }

The rendered operand string, or empty when there are none.

Returns: String

public string OperandText { get; init; }

The PE relative virtual address, or null for non-PE images.

Returns: Nullable<UInt32>

public uint? Rva { get; init; }

The source file for this address from the native source map, or null.

Returns: String

public string? SourceFile { get; init; }

The resolved absolute call/branch/data target, or null.

Returns: Nullable<UInt64>

public ulong? TargetAddress { get; init; }

What TargetAddress points at.

Returns: NativeTargetKind

public NativeTargetKind TargetKind { get; init; }

The resolved target’s display name (e.g. Foo, Foo+0x12, loc_140001234), or null.

Returns: String

public string? TargetName { get; init; }

Deconstruct(out ulong, out uint?, out long?, out IReadOnlyList<byte>, out int, out string, out IReadOnlyList<NativeOperand>, out string, out NativeInstructionCategory, out NativeFlowKind, out ulong?, out NativeTargetKind, out string?, out string?, out int?, out bool, out int?, out NativeLineLayout?)

Section titled “Deconstruct(out ulong, out uint?, out long?, out IReadOnlyList<byte>, out int, out string, out IReadOnlyList<NativeOperand>, out string, out NativeInstructionCategory, out NativeFlowKind, out ulong?, out NativeTargetKind, out string?, out string?, out int?, out bool, out int?, out NativeLineLayout?)”

Parameters:

public void Deconstruct(out ulong Address, out uint? Rva, out long? FileOffset, out IReadOnlyList<byte> Bytes, out int Length, out string Mnemonic, out IReadOnlyList<NativeOperand> Operands, out string OperandText, out NativeInstructionCategory Category, out NativeFlowKind Flow, out ulong? TargetAddress, out NativeTargetKind TargetKind, out string? TargetName, out string? SourceFile, out int? Line, out bool IsFallback, out int? DisplayLine, out NativeLineLayout? Layout)

Parameters:

Returns: Boolean

public bool Equals(NativeInstruction? other)

Parameters:

Returns: Boolean

public override bool Equals(object? obj)

Returns: Int32

public override int GetHashCode()

Returns: String

public override string ToString()

operator !=(NativeInstruction?, NativeInstruction?)

Section titled “operator !=(NativeInstruction?, NativeInstruction?)”

Parameters:

Returns: Boolean

public static bool operator !=(NativeInstruction? left, NativeInstruction? right)

operator ==(NativeInstruction?, NativeInstruction?)

Section titled “operator ==(NativeInstruction?, NativeInstruction?)”

Parameters:

Returns: Boolean

public static bool operator ==(NativeInstruction? left, NativeInstruction? right)