Converting lua to LUAQ type

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Beastin_Cade
Posts: 94
Joined: Wed Jul 01, 2020 7:45 pm

Converting lua to LUAQ type

Post by Beastin_Cade »

trying to convert this normal lua script to this type of luac. the luac i provided has a LUAQ header, and i want to convert my .lua script to a LUAQ header .luac file
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Converting lua to LUAQ type

Post by LolHacksRule »

Sounds like a compiled Lua 5 file. Try using luac to compile.
Beastin_Cade
Posts: 94
Joined: Wed Jul 01, 2020 7:45 pm

Re: Converting lua to LUAQ type

Post by Beastin_Cade »

so i tried it with lua 5.1 and i get a luaq header, but its not the same type as it is a little different and has a bigger file size when i use luac and convert it to a luac luaq type
atom0s
Posts: 250
Joined: Sat Dec 27, 2014 8:49 pm

Re: Converting lua to LUAQ type

Post by atom0s »

You need to make sure your version of Lua and Luac are setup the same as the target expects.

For example, the compiled Lua file you gave us shows that it's compiled with a luac compiler that is:
- Lua 5.1
- Big Endian (Little-Endian is default for Lua which should be 01, but your script is 00 for big.)
- sizeof(lua_Number) == 4 which means lua_Number is defined as a float and not a double.
- The debug information is stripped from the script. (Use flag '-s' with luac when compiling scripts to get that same result.)


Last bumped by Beastin_Cade on Wed Nov 18, 2020 8:10 pm.