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
IKittyMemOp Class Referenceabstract

Interface class for memory operations. More...

#include <KittyMemOp.hpp>

Inheritance diagram for IKittyMemOp:

Public Member Functions

virtual bool init (pid_t pid)=0
 Initializes the memory operations for a given process.
pid_t processID () const
 Returns the process ID.
virtual size_t Read (uintptr_t address, void *buffer, size_t len, MemMode mode=MemMode::Normal)=0
 Reads data from process memory.
virtual size_t Write (uintptr_t address, void *buffer, size_t len, MemMode mode=MemMode::Normal)=0
 Writes data to process memory.
int lastErrno () const
 Returns the last error number.
std::string ReadUTF8 (uintptr_t address, size_t maxLen)
 Reads a UTF-8 encoded string from remote process memory.
std::u16string ReadUTF16 (uintptr_t address, size_t maxLen)
 Reads a UTF-16 encoded string from remote process memory.
std::u32string ReadUTF32 (uintptr_t address, size_t maxLen)
 Reads a UTF-32 encoded string from remote process memory.
std::wstring ReadWStr (uintptr_t address, size_t maxLen)
 Reads a platform wchar_t string from remote process memory.
std::string ReadStr (uintptr_t address, size_t maxLen)
 Reads a UTF-8 string from remote process memory.
bool WriteStr (uintptr_t address, std::string str)
 Writes a UTF-8 string to remote process memory.
bool WriteWStr (uintptr_t address, std::wstring str)
 Writes a platform wchar_t string to remote process memory.

Protected Attributes

pid_t _pid
int _lastErrno

Detailed Description

Interface class for memory operations.

Member Function Documentation

◆ init()

virtual bool IKittyMemOp::init ( pid_t pid)
pure virtual

Initializes the memory operations for a given process.

Parameters
pidprocess ID.
Returns
True if initialization is successful, false otherwise.

Implemented in KittyMemIO, and KittyMemSys.

◆ Read()

virtual size_t IKittyMemOp::Read ( uintptr_t address,
void * buffer,
size_t len,
MemMode mode = MemMode::Normal )
pure virtual

Reads data from process memory.

Parameters
addressMemory address to read from.
bufferDestination buffer.
lenNumber of bytes to read.
modeMemory access strategy.
Returns
Number of bytes successfully read.

Implemented in KittyMemIO, and KittyMemSys.

◆ ReadStr()

std::string IKittyMemOp::ReadStr ( uintptr_t address,
size_t maxLen )
inline

Reads a UTF-8 string from remote process memory.

Convenience wrapper around ReadUTF8().

Parameters
addressRemote memory address containing the string.
maxLenMaximum number of bytes to read.
Returns
UTF-8 string stored in remote memory.
Here is the call graph for this function:

◆ ReadUTF16()

std::u16string IKittyMemOp::ReadUTF16 ( uintptr_t address,
size_t maxLen )

Reads a UTF-16 encoded string from remote process memory.

Reads at most maxLen bytes and stops at the first UTF-16 null terminator.

Parameters
addressRemote memory address containing the string.
maxLenMaximum number of bytes to read.
Returns
UTF-16 string stored in remote memory.
Here is the caller graph for this function:

◆ ReadUTF32()

std::u32string IKittyMemOp::ReadUTF32 ( uintptr_t address,
size_t maxLen )

Reads a UTF-32 encoded string from remote process memory.

Reads at most maxLen bytes and stops at the first UTF-32 null terminator.

Parameters
addressRemote memory address containing the string.
maxLenMaximum number of bytes to read.
Returns
UTF-32 string stored in remote memory.
Here is the caller graph for this function:

◆ ReadUTF8()

std::string IKittyMemOp::ReadUTF8 ( uintptr_t address,
size_t maxLen )

Reads a UTF-8 encoded string from remote process memory.

Reads at most maxLen bytes starting at address and stops when the first null terminator is encountered.

Parameters
addressRemote memory address containing the string.
maxLenMaximum number of bytes to read.
Returns
UTF-8 string stored in remote memory.
Here is the caller graph for this function:

◆ ReadWStr()

std::wstring IKittyMemOp::ReadWStr ( uintptr_t address,
size_t maxLen )
inline

Reads a platform wchar_t string from remote process memory.

Automatically selects the encoding based on the size of wchar_t:

Parameters
addressRemote memory address containing the string.
maxLenMaximum number of wchar_t characters to read.
Returns
Wide string stored in remote memory.
Here is the call graph for this function:

◆ Write()

virtual size_t IKittyMemOp::Write ( uintptr_t address,
void * buffer,
size_t len,
MemMode mode = MemMode::Normal )
pure virtual

Writes data to process memory.

Parameters
addressMemory address to write to.
bufferSource buffer containing data.
lenNumber of bytes to write.
modeMemory access strategy.
Returns
Number of bytes successfully written.

Implemented in KittyMemIO, and KittyMemSys.

Here is the caller graph for this function:

◆ WriteStr()

bool IKittyMemOp::WriteStr ( uintptr_t address,
std::string str )
inline

Writes a UTF-8 string to remote process memory.

Writes the string contents followed by a null terminator.

Parameters
addressRemote memory address where the string is written.
strUTF-8 string to write.
Returns
true if all bytes were written successfully.
Here is the call graph for this function:

◆ WriteWStr()

bool IKittyMemOp::WriteWStr ( uintptr_t address,
std::wstring str )
inline

Writes a platform wchar_t string to remote process memory.

Automatically selects the encoding based on the size of wchar_t:

Parameters
addressRemote memory address where the string is written.
strWide string to write.
Returns
true if all characters and the null terminator were written.
Here is the call graph for this function:

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