KittyMemoryEx 1.0.0
Dedicated library for runtime code patching, memory scanning, tracing, injection and some more useful memory utilities. works for both Android and Linux
Loading...
Searching...
No Matches
KittyInsnArm64 Struct Reference

Struct representing an ARM64 instruction. More...

#include <KittyAsm.hpp>

Public Member Functions

bool isValid () const
 Checks if the instruction is valid.
std::string ToString () const
 Renders the instruction as a single line of ARM64 assembly text.

Public Attributes

EKittyInsnTypeArm64 type = EKittyInsnTypeArm64::UNKNOWN
int rd = -1
int rn = -1
int rt = -1
int rm = -1
uint32_t word
 The instruction word itself, as decoded.
uint64_t address
 Where it lives, for PC-relative targets.
int64_t immediate
 Decoded immediate, sign-applied. 0 when there is none.
int64_t bitpos
 Bit position for the bitfield/test forms; -1 when n/a.
uint64_t target
EKittyArmCond cond = EKittyArmCond::None
bool writeback
 The instruction updates its base register (Rn) as a side effect.
bool postIndexed
 The access happens at [Rn]; immediate is applied afterwards.
bool registerOffset
 The offset is a register (held in rm), not immediate.

Detailed Description

Struct representing an ARM64 instruction.

This struct contains the details of an ARM64 instruction, including its type, registers, immediate value, target address, and bit position.

Member Data Documentation

◆ cond

EKittyArmCond KittyInsnArm64::cond = EKittyArmCond::None

Branch condition for B_COND, resolved on demand via branchCondName(); EKittyArmCond::None for every other type.

◆ postIndexed

bool KittyInsnArm64::postIndexed

The access happens at [Rn]; immediate is applied afterwards.

The post-indexed forms encode their immediate as a write-back amount, not as an access offset, so a consumer must use 0 as the offset for these.

◆ rd

int KittyInsnArm64::rd = -1

Register indices, always filled. -1 means the field is absent or names the zero register - which of those two a given type means is not recoverable from the int alone; see ToString()'s own per-type cases. Names are produced on demand via xRegName()/wRegName() rather than stored here, since nothing else claims the plain field names once no string counterpart exists to compete for them.

◆ registerOffset

bool KittyInsnArm64::registerOffset

The offset is a register (held in rm), not immediate.

Register-offset loads and stores cannot be resolved from the instruction alone, so immediate is 0. They are still decoded rather than dropped: a load whose type is unrecognised leaves its destination register holding whatever a consumer previously tracked there, and a stale base is how a confident wrong address gets manufactured.

◆ rm

int KittyInsnArm64::rm = -1

Second source-register operand, used by register-register forms like MOV (Xd = Xm). -1 when not applicable.

◆ target

uint64_t KittyInsnArm64::target

Resolved absolute address for the PC-relative forms.

◆ writeback

bool KittyInsnArm64::writeback

The instruction updates its base register (Rn) as a side effect.

True for the pre- and post-indexed load/store forms. A consumer that tracks register values must invalidate Rn when it sees this, or it carries on believing a base that the instruction has just moved.


The documentation for this struct was generated from the following file:
  • /home/runner/work/KittyMemoryEx/KittyMemoryEx/KittyMemoryEx/KittyAsm.hpp