|
|
@ -2304,6 +2304,24 @@ static const LuaWrapper::FunctionReg dfhack_internal_module[] = {
|
|
|
|
{ NULL, NULL }
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int internal_getmd5(lua_State *L)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
auto p = Core::getInstance().p;
|
|
|
|
|
|
|
|
if (p->getDescriptor()->getOS() == OS_WINDOWS)
|
|
|
|
|
|
|
|
luaL_error(L, "process MD5 not available on Windows");
|
|
|
|
|
|
|
|
lua_pushstring(L, p->getMD5().c_str());
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int internal_getPE(lua_State *L)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
auto p = Core::getInstance().p;
|
|
|
|
|
|
|
|
if (p->getDescriptor()->getOS() != OS_WINDOWS)
|
|
|
|
|
|
|
|
luaL_error(L, "process PE timestamp not available on non-Windows");
|
|
|
|
|
|
|
|
lua_pushinteger(L, p->getPE());
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int internal_getAddress(lua_State *L)
|
|
|
|
static int internal_getAddress(lua_State *L)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const char *name = luaL_checkstring(L, 1);
|
|
|
|
const char *name = luaL_checkstring(L, 1);
|
|
|
@ -2683,6 +2701,8 @@ static int internal_findScript(lua_State *L)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const luaL_Reg dfhack_internal_funcs[] = {
|
|
|
|
static const luaL_Reg dfhack_internal_funcs[] = {
|
|
|
|
|
|
|
|
{ "getPE", internal_getPE },
|
|
|
|
|
|
|
|
{ "getMD5", internal_getmd5 },
|
|
|
|
{ "getAddress", internal_getAddress },
|
|
|
|
{ "getAddress", internal_getAddress },
|
|
|
|
{ "setAddress", internal_setAddress },
|
|
|
|
{ "setAddress", internal_setAddress },
|
|
|
|
{ "getVTable", internal_getVTable },
|
|
|
|
{ "getVTable", internal_getVTable },
|
|
|
|