Multiple LuaQ files help

Doubts, help and support about QuickBMS and other game research tools
fifabrowny
Posts: 4
Joined: Sun Feb 16, 2020 2:41 am

Multiple LuaQ files help

Post by fifabrowny »

Hi all,

Looking to get some help to extract the attached file , could it be done in quickbms?

The file header is LuaQ , which is a compiled version of a lua file.

However there are multiple LuaQ file headers throughout the file, so I believe this is why I cannot decompile these using LuaDec or unluac .

Would anyone be able to write a bms file that would extract this bin archive in to the multiple LuaQ files ? I am a novice to unpacking scripts so it would be much appreciated. Hoping it's a straight forward file as it has file names in clear text.

That should allow me to decompile the individual luac files
fifabrowny
Posts: 4
Joined: Sun Feb 16, 2020 2:41 am

Re: Multiple LuaQ files help

Post by fifabrowny »

So I have gotten further with this.

It appears like the file starts with a 12 byte header
then 3 null bytes in a row
then a name size


however with my limited bms knowledge now I need to know the filesize and offset. From doing some research, it seems that these are stored in a seperate file (attached)

How the hell do I find the filesize and offsets for these files in that file ? It looks completely random. Also is it possible to reference them in quickbms or would I just manually input all the filesize and offsets per file (tedious but ill do whatever required)

Would appreciate any help available

My current script goes like this (first time)

get FILES Long
for i=0 < FILES
get HEADER1 long
get HEADER2 long
get null short
get null byte
get NSIZE byte
getdstring NAME NSIZE

##find filesize and offset from other .bin file##
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Multiple LuaQ files help

Post by aluigi »

Code: Select all

findloc OFFSET binary "\x1bLua"
do
    goto OFFSET
    get DUMMY long
    findloc NEXT_OFFSET binary "\x1bLua" 0 ""
    if NEXT_OFFSET == ""
        get SIZE asize
    else
        math SIZE = NEXT_OFFSET
    endif
    math SIZE -= OFFSET
    log "" OFFSET SIZE
    math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""