-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes upon loading bytecode #21
Comments
Short-term it wouldn't be a bad idea to short-circuit when we detect a bytecode buffer, bonus points if there's a good descriptive message in the error. Long-term we can implement a decompiler phase to the buffer load step - shouldn't be too hard. I do worry about decomp temporal stability though; emitted code must be the same no matter what. |
You could also just compile patches to Bytecode and only insert the instructions of the top level function (commonly referred to as a prototype) instead of just decompiling it, it removes a step that could cause performance issues I've made naively but I doubt performance would be a problem. For the past few days I've been working on a disassembler for multiple Lua versions (currently I have implemented Lua 5.1 and Lua 5.2) including LuaJIT so that should help make supporting bytecode a bit easier. |
My big concern is that the current patch system is fundamentally incompatible with bytecode as, at the very least, we would need to lazily decompile just to provide the pattern / regex patches something to compare against. The regex patch specifically would require the entire source document to be decompiled, so that strategy won't even work all of the time. Thankfully all of this stuff is easy to cache so performance probably isn't that big of a deal. I have a couple ideas on ways to move forward but I want to let them sit before I make any decisions. I will say though that this is absolutely something I want to support in the future. |
Some Love2D games do not have the source available like Balatro does, an example of such game is Intravenous 2: Mercenarism.
The injector crashes on
lovely-injector/crates/lovely-core/src/lib.rs
Lines 142 to 145 in ee3ba18
\033
(ASCII escape character).Patching games that use bytecode instead of source might prove to be a major headache as it would probably require writing a disassembler and assembler for Lua(JIT) bytecode.
The text was updated successfully, but these errors were encountered: