LuaHook | Example of how to hook Lua for Game Hacking | Game Engine library
kandi X-RAY | LuaHook Summary
kandi X-RAY | LuaHook Summary
Example of how to hook Lua for Game Hacking. This code works perfectly to hook Lua inside Vermintide 2 but can be easily addapted to any game. More info: Personal Blog.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of LuaHook
LuaHook Key Features
LuaHook Examples and Code Snippets
Community Discussions
Trending Discussions on LuaHook
QUESTION
I am working on a lua script interrupt project, I want to use std::Stack and lua coroutine to save the context. But when I set stacksize to more than 38, it randomly crashes in lua_resume and lua_close. test.lua:
...ANSWER
Answered 2018-Sep-29 at 10:27You are overflowing the Lua stack by continuously generating new Lua threads and leaving its Lua objects on stack.
lua_newstack()
not only returns a pointer to lua_State
structure, it also leaves a value of type LUA_TTHREAD
on a stack in your L
state. You should either accommodate the Lua stack accordingly, or manage returned Lua threads in some other way.
Quick and dirty "fix" would be to call lua_checkstack(L, 10);
right before your Lstack.push(lua_newthread(L));
line. It allows your code to run as is, but the stack would continuously grow. Instead you should grab the new thread object off the stack and put it in some Lua table until the time comes for it to be deleted.
QUESTION
I'm a little lost here. I have a member of type "CLuaHook" in my class "CLuaTick" which I plan to use in the CLuaTick::Initialize() function. Because of the Linker I have to declare my member in the cpp file, although im not entirely sure why. Setting the member declaration in the cpp to a nullptr causes a runtime crash (Access violation) even though its not used anywhere yet.
The only constructor for CLuaHook is CLuaHook(const char * Hook);
.
EDIT: CLuaHook() Has to be called with valid arguments as it will be registered in an Internal list and would have to be removed afterwards.
Heres the code:
luatick.h
ANSWER
Answered 2017-Nov-20 at 02:03The error is very much as the compiler describes. There is no default constructor for the class CLuaHook
. In other words, the compiler doesn't know how to construct CLuaHook
with no arguments and therefore it can't construct CLuaTick
either.
You need to either provide a default constructor:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install LuaHook
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page