amxmodx/dlls/MemHack/MemMiscNatives.cpp
Twilight Suzuka ab5c11f876 Finally done!!! I finished what DS started:
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.
2006-01-12 03:55:49 +00:00

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 }
};