MCPcopy Create free account
hub / github.com/DFHack/dfhack / internal_patchMemory

Function internal_patchMemory

library/LuaApi.cpp:3833–3842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3831}
3832
3833static int internal_patchMemory(lua_State *L)
3834{
3835 void *dest = checkaddr(L, 1);
3836 void *src = checkaddr(L, 2);
3837 int size = luaL_checkint(L, 3);
3838 if (size < 0) luaL_argerror(L, 1, "negative size");
3839 bool ok = Core::getInstance().p->patchMemory(dest, src, size);
3840 lua_pushboolean(L, ok);
3841 return 1;
3842}
3843
3844static int internal_patchBytes(lua_State *L)
3845{

Callers

nothing calls this directly

Calls 4

checkaddrFunction · 0.85
luaL_argerrorFunction · 0.85
lua_pushbooleanFunction · 0.85
patchMemoryMethod · 0.80

Tested by

no test coverage detected