mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-26 14:55:36 +03:00
ab5c11f876
AMXx Mods may now patch/retreive memory of several varieties directly from the game .dll, mod .dll, or can go free and patch/retreive any peice of memory. I salute you DS.
28 lines
748 B
C++
28 lines
748 B
C++
#include "MemMisc.h"
|
|
|
|
#define NATIVE_MISC_ADDRESS params[1]
|
|
#define NATIVE_MISC_BASEADDRESS PickBaseAddress(params[2])
|
|
#define NATIVE_MISC_FLAGS params[3]
|
|
|
|
static cell AMX_NATIVE_CALL memhack_get_base(AMX *amx, cell *params)
|
|
{
|
|
cell *success = MF_GetAmxAddr(amx, params[2]);
|
|
maddress BaseAddr = NULL;
|
|
|
|
bool is_success = GetBaseAddress((void*)(params[1]), BaseAddr);
|
|
*success = is_success;
|
|
|
|
return cell(BaseAddr);
|
|
}
|
|
|
|
static cell AMX_NATIVE_CALL memhack_get_realaddr(AMX *amx, cell *params)
|
|
{
|
|
return (cell)GetRealMemoryAddress(NATIVE_MISC_ADDRESS,NATIVE_MISC_BASEADDRESS,NATIVE_MISC_FLAGS);
|
|
}
|
|
|
|
AMX_NATIVE_INFO misc_natives[] = {
|
|
{ "memhack_get_base", memhack_get_base },
|
|
{ "memhack_get_realaddr", memhack_get_realaddr },
|
|
{ NULL, NULL }
|
|
};
|