3#include "KittyUtils.hpp"
4#include "KittyMemoryEx.hpp"
5#include "KittyMemOp.hpp"
32 friend class MemoryPatchMgr;
40 std::vector<uint8_t> _orig_code;
41 std::vector<uint8_t> _patch_code;
47 MemoryPatch(
IKittyMemOp *pMem, uintptr_t absolute_address,
const void *patch_code,
size_t patch_size);
99 MemoryPatchMgr() : _pMem(
nullptr)
139 MP_ASM_ARCH asm_arch,
140 const std::string &asm_code,
141 uintptr_t asm_address = 0);
Interface class for memory operations.
Definition KittyMemOp.hpp:46
MemoryPatch createWithAsm(uintptr_t absolute_address, MP_ASM_ARCH asm_arch, const std::string &asm_code, uintptr_t asm_address=0)
Creates a memory patch with assembly code using keystone assembler.
MemoryPatch createWithHex(uintptr_t absolute_address, std::string hex)
Creates a memory patch with hexadecimal string data.
MemoryPatch createWithBytes(uintptr_t absolute_address, const void *patch_code, size_t patch_size)
Creates a memory patch with byte data.
MemoryPatchMgr(IKittyMemOp *pMem)
Constructor for MemoryPatchMgr.
Definition MemoryPatch.hpp:107
The MemoryPatch class represents a memory patch for applying modifications to a memory address.
Definition MemoryPatch.hpp:31
bool Modify()
Applies patch modifications to the target address.
size_t get_PatchSize() const
Returns the size of the memory patch.
bool isValid() const
Checks if the MemoryPatch object is valid.
uintptr_t get_TargetAddress() const
Returns the target address of the memory patch.
std::string get_OrigBytes() const
Returns hex string of the original bytes.
std::string get_PatchBytes() const
Returns hex string of the patch bytes.
bool Restore()
Restores the patch to its original value.
std::string get_CurrBytes() const
Returns hex string of the current target address bytes.