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
KittyAsm Namespace Reference

Namespace containing utility functions for asm instructions. More...

Functions

uint32_t bits (uint32_t v, int hi, int lo)
 Extracts a bit value from a 32-bit unsigned integer.
bool bit (uint32_t v, int pos)
 Checks if a specific bit is set in a 32-bit unsigned integer.
uint8_t ror8 (uint8_t value, unsigned int shift)
 Rotates an 8-bit unsigned integer to the right by a specified amount.
uint8_t rol8 (uint8_t value, unsigned int shift)
 Rotates an 8-bit unsigned integer to the left by a specified amount.
uint16_t ror16 (uint16_t value, unsigned int shift)
 Rotates a 16-bit unsigned integer to the right by a specified amount.
uint16_t rol16 (uint16_t value, unsigned int shift)
 Rotates a 16-bit unsigned integer to the left by a specified amount.
uint32_t ror32 (uint32_t value, unsigned int shift)
 Rotates a 32-bit unsigned integer to the right by a specified amount.
uint32_t rol32 (uint32_t value, unsigned int shift)
 Rotates a 32-bit unsigned integer to the left by a specified amount.
uint64_t ror64 (uint64_t value, unsigned int shift)
 Rotates a 64-bit unsigned integer to the right by a specified amount.
uint64_t rol64 (uint64_t value, unsigned int shift)
 Rotates a 64-bit unsigned integer to the left by a specified amount.
uint16_t swap16 (uint16_t value)
 Reverses the byte order of a 16-bit unsigned integer.
uint32_t swap32 (uint32_t value)
 Reverses the byte order of a 32-bit unsigned integer.
uint64_t swap64 (uint64_t value)
 Reverses the byte order of a 64-bit unsigned integer.
std::string toHexString (uint64_t v)
 Formats a value as a "0x"-prefixed, upper-case hex string.

Detailed Description

Namespace containing utility functions for asm instructions.

This namespace provides utility functions for decoding instructions,

Function Documentation

◆ bit()

bool KittyAsm::bit ( uint32_t v,
int pos )
inline

Checks if a specific bit is set in a 32-bit unsigned integer.

Parameters
vThe input 32-bit unsigned integer.
posThe bit position to check.
Returns
true if the bit is set, false otherwise.
Here is the call graph for this function:

◆ bits()

uint32_t KittyAsm::bits ( uint32_t v,
int hi,
int lo )

Extracts a bit value from a 32-bit unsigned integer.

Parameters
vThe input 32-bit unsigned integer.
hiThe high bit position (inclusive).
loThe low bit position (inclusive).
Returns
The extracted bit value.
Here is the caller graph for this function:

◆ rol16()

uint16_t KittyAsm::rol16 ( uint16_t value,
unsigned int shift )
inline

Rotates a 16-bit unsigned integer to the left by a specified amount.

Parameters
valueThe input 16-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 16-bit unsigned integer.

◆ rol32()

uint32_t KittyAsm::rol32 ( uint32_t value,
unsigned int shift )
inline

Rotates a 32-bit unsigned integer to the left by a specified amount.

Parameters
valueThe input 32-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 32-bit unsigned integer.

◆ rol64()

uint64_t KittyAsm::rol64 ( uint64_t value,
unsigned int shift )
inline

Rotates a 64-bit unsigned integer to the left by a specified amount.

Parameters
valueThe input 64-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 64-bit unsigned integer.

◆ rol8()

uint8_t KittyAsm::rol8 ( uint8_t value,
unsigned int shift )
inline

Rotates an 8-bit unsigned integer to the left by a specified amount.

Parameters
valueThe input 8-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 8-bit unsigned integer.

◆ ror16()

uint16_t KittyAsm::ror16 ( uint16_t value,
unsigned int shift )
inline

Rotates a 16-bit unsigned integer to the right by a specified amount.

Parameters
valueThe input 16-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 16-bit unsigned integer.

◆ ror32()

uint32_t KittyAsm::ror32 ( uint32_t value,
unsigned int shift )
inline

Rotates a 32-bit unsigned integer to the right by a specified amount.

Parameters
valueThe input 32-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 32-bit unsigned integer.

◆ ror64()

uint64_t KittyAsm::ror64 ( uint64_t value,
unsigned int shift )
inline

Rotates a 64-bit unsigned integer to the right by a specified amount.

Parameters
valueThe input 64-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 64-bit unsigned integer.

◆ ror8()

uint8_t KittyAsm::ror8 ( uint8_t value,
unsigned int shift )
inline

Rotates an 8-bit unsigned integer to the right by a specified amount.

Parameters
valueThe input 8-bit unsigned integer.
shiftThe number of bits to rotate.
Returns
The rotated 8-bit unsigned integer.

◆ swap16()

uint16_t KittyAsm::swap16 ( uint16_t value)
inline

Reverses the byte order of a 16-bit unsigned integer.

Parameters
valueThe input 16-bit unsigned integer.
Returns
The byte-swapped 16-bit unsigned integer.

◆ swap32()

uint32_t KittyAsm::swap32 ( uint32_t value)
inline

Reverses the byte order of a 32-bit unsigned integer.

Parameters
valueThe input 32-bit unsigned integer.
Returns
The byte-swapped 32-bit unsigned integer.

◆ swap64()

uint64_t KittyAsm::swap64 ( uint64_t value)
inline

Reverses the byte order of a 64-bit unsigned integer.

Parameters
valueThe input 64-bit unsigned integer.
Returns
The byte-swapped 64-bit unsigned integer.

◆ toHexString()

std::string KittyAsm::toHexString ( uint64_t v)
inline

Formats a value as a "0x"-prefixed, upper-case hex string.

The one place both architectures' ToString() render an address or immediate, so a caller reading disassembly text sees one hex convention rather than whatever each call site happened to write.