IN DEVELOPMENT
De4Lua is a open source LUA deobfuscator. It is written in NodeJS and is designed to be used as a CLI. It is currently in development and is not yet ready for production use. I am hoping to one day intergrate this with LuaDebugger to allow for more advanced debugging & deobfuscation.
Read the Example.ts file to see how to add new deobfuscation methods. If you have any questions, feel free to ask on my discord.
Do NOT take the other files an a example, I am in process of refactoring them with better type and code system.
If you have any feature requests, send them to my discord or make a new issue.
- Inline functions: Make one line functions inline, and remove the function definition
- Loadstring: If loadstring is loading code locally, or from a variable, replace the loadstring with the code
- Inline Complex Functions: If a function is only called once, inline it. But this has to be careful, as the function could be called later on from obfucased code.
- Remove If statements if they are always true and keep the code
- Add Support for math calculating in function parameters
- Detect and emulate decrypt, and other static functions as such.
- Static string and other variable dumping
- Configs, so you can toggle on and off differnt deobfuscation methods
- Better Logging and Error Handling.
- Try to drastically reduce the amount of "any" types used in the code. Sadly I have been using them a lot due to the nature of the project.
- Implement Scope checks, to ensure you don't use a variable before it is defined and variables in wrong scopes.
- Replace ";" with new lines
- Recode the AST Builder, as it is currently very messy, doesn't support all syntax
Please report any bugs to my discord, or make a new issue. I will try to fix them as soon as possible.
- Some syntax is not yet supported, luraph syntax for example is not supported, by LuaParse and lua-fmt. I am working on my own forks of both of them to allow for this to be fixed
- Math expressions aren't being calculated if they contain a variable due the is_re_assigned function not working properly
De4Lua does NOT support virtualization. This means any code that uses virtualization will not be deobfuscated. De-virtualization is planned for a future release, after the deobfuscator is stable and has the features I want.
Go to the releases page and download the latest release. Extract the zip file and run npm install
in the directory.
De4Lua can be run using npm run start
.
The default input/ouput is inside the tests folder, to specify your own, specify it after the command. For example, npm run start myFile.lua myOutput.lua
Before running, you have to build it at least once with the command npm run build
. This will create a dist
folder with the compiled code.