Advertisement
captmicro

Untitled

Feb 4th, 2013
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1.        
  2. typedef int (*_luaL_ls)(void *L, const char *s);
  3. typedef int (*_lua_pcall)(void *L, int nargs, int nresults, int errfunc);
  4.  
  5. g_luaL_loadstring = (_luaL_ls)GetProcAddress(lua_shared, "luaL_loadstring");
  6. if (g_luaL_loadstring == 0)
  7.     MessageBoxA(0, "Failed to get luaL_loadstring address!", "bomb_bypass error", 0);
  8. g_lua_pcall = (_lua_pcall)GetProcAddress(lua_shared, "lua_pcall");
  9. if (g_lua_pcall == 0)
  10.     MessageBoxA(0, "Failed to get lua_pcall address!", "bomb_bypass error", 0);
  11.  
  12. g_luaL_loadstring((void*)state, "SOME LUA BRO");
  13. int err = g_lua_pcall((void*)state, 0, LUA_MULTRET, 0);
  14. if (err == 1)
  15.     printf("lua_pcall returned error. Failed to execute.\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement