Interface class for memory operations.
More...
#include <KittyMemOp.hpp>
|
| 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.
|
|
|
pid_t | _pid |
|
int | _lastErrno |
Interface class for memory operations.
◆ init()
| virtual bool IKittyMemOp::init |
( |
pid_t | pid | ) |
|
|
pure virtual |
Initializes the memory operations for a given process.
- Parameters
-
- 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
-
| address | Memory address to read from. |
| buffer | Destination buffer. |
| len | Number of bytes to read. |
| mode | Memory 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
-
| address | Remote memory address containing the string. |
| maxLen | Maximum number of bytes to read. |
- Returns
- UTF-8 string stored in remote memory.
◆ 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
-
| address | Remote memory address containing the string. |
| maxLen | Maximum number of bytes to read. |
- Returns
- UTF-16 string stored in remote memory.
◆ 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
-
| address | Remote memory address containing the string. |
| maxLen | Maximum number of bytes to read. |
- Returns
- UTF-32 string stored in remote memory.
◆ 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
-
| address | Remote memory address containing the string. |
| maxLen | Maximum number of bytes to read. |
- Returns
- UTF-8 string stored in remote memory.
◆ 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
-
| address | Remote memory address containing the string. |
| maxLen | Maximum number of wchar_t characters to read. |
- Returns
- Wide string stored in remote memory.
◆ 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
-
| address | Memory address to write to. |
| buffer | Source buffer containing data. |
| len | Number of bytes to write. |
| mode | Memory access strategy. |
- Returns
- Number of bytes successfully written.
Implemented in KittyMemIO, and KittyMemSys.
◆ 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
-
| address | Remote memory address where the string is written. |
| str | UTF-8 string to write. |
- Returns
- true if all bytes were written successfully.
◆ 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
-
| address | Remote memory address where the string is written. |
| str | Wide string to write. |
- Returns
- true if all characters and the null terminator were written.
The documentation for this class was generated from the following file:
- /home/runner/work/KittyMemoryEx/KittyMemoryEx/KittyMemoryEx/KittyMemOp.hpp