public static class AArch64Assembler.PatcherUtil extends Object
| Constructor and Description |
|---|
PatcherUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeRelativePageDifference(long target,
long curPos,
int pageSize)
Computes the page-relative difference between two addresses.
|
static int |
patchAddLo12(int original,
int imm12)
Patches add with provided imm12 value.
|
static int |
patchAdrpHi21(int original,
int imm21)
Patches adrp instruction with provided imm21 value.
|
static int |
patchBitSequence(int original,
int value,
int[] bitsUsed,
int[] offsets)
Method to patch a series a bytes within an instruction.
|
static int |
patchLdrLo12(int original,
int imm12,
int srcSize)
Patches lar (unsigned, scaled) with provided imm12 value.
|
static int |
patchMov(int original,
int imm16)
Patches mov instruction with provided imm16 value.
|
static int |
readInstruction(byte[] code,
int pos)
Convert byte array instruction into an int.
|
static void |
writeInstruction(byte[] code,
int pos,
int val)
Write int representation of instruction to byte array.
|
public static int readInstruction(byte[] code,
int pos)
public static void writeInstruction(byte[] code,
int pos,
int val)
public static int patchBitSequence(int original,
int value,
int[] bitsUsed,
int[] offsets)
original - Initial instruction value.value - The value to be given to the series of bytes.bitsUsed - The number of bits to patch within each byte.offsets - Where within the bytes the value should be added.public static int patchAdrpHi21(int original,
int imm21)
original - Original instruction value.imm21 - The value to patch.public static int patchAddLo12(int original,
int imm12)
original - Original instruction value.imm12 - The value to patch.public static int patchLdrLo12(int original,
int imm12,
int srcSize)
original - Original instruction value.imm12 - The *unscaled* value to patch. The method performs all necessary shifting.srcSize - The memory operation size. This determines the scaling factor.public static int patchMov(int original,
int imm16)
original - Original instruction value.imm16 - The value to patch.public static int computeRelativePageDifference(long target,
long curPos,
int pageSize)