discompiler custom luac file [xyq.163.com/htb 梦幻西游 LuaQ]

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
huhuang03
Posts: 3
Joined: Mon May 28, 2018 1:24 pm

discompiler custom luac file [xyq.163.com/htb 梦幻西游 LuaQ]

Post by huhuang03 »

I have dump the luac file by hook

Code: Select all

 luaL_loadbuffer.
in libgame.so.
But it's custom luac file, so I cant' discompile it to lua. Can you help me? And what's the book for analysis so file skill?

The name of game is 梦幻西游.

Updated on 2018-6-1:

I dump the wrong luac file which contains "REPLACEMENT CHARACTER". The right luac file is dump.zip. But I still can't decompiler it.
Last edited by huhuang03 on Fri Jun 01, 2018 2:00 am, edited 4 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: discompiler custom luac file

Post by aluigi »

Name of the game?
huhuang03
Posts: 3
Joined: Mon May 28, 2018 1:24 pm

Re: discompiler custom luac file

Post by huhuang03 »

aluigi wrote:Name of the game?

The name is 梦幻西游
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: discompiler custom luac file [xyq.163.com/htb 梦幻西游 LuaQ]

Post by aluigi »

I guess I solved the mistery.
For some unknown reasons these LUA files use the sequence of bytes 0xef 0xbf 0xbd at the place of the 0x00 byte, that sequence of 3 bytes is indeed often used as an unicode "REPLACEMENT CHARACTER"

Open one of these lua files with a hex editor and use the "Replace" feature for replacing all the occurrencies of these 3 bytes with the byte 0x00.
Save the file and try a decompiler like http://sourceforge.net/projects/unluac/files/ on it.
huhuang03
Posts: 3
Joined: Mon May 28, 2018 1:24 pm

Re: discompiler custom luac file [xyq.163.com/htb 梦幻西游 LuaQ]

Post by huhuang03 »

I have already solved this mistery.
Just use luadec to decomplier the luac file. Thank you!