TianYu online .pg file

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
ghost
Posts: 54
Joined: Tue Aug 19, 2014 10:30 am

TianYu online .pg file

Post by ghost »

Hello everyone,
I need help for TIANYUonline .It is a cool and beautiful game.Who can help me take a look at the game's files.
Here some pictures:
Image
Image
Image
Image


samples:http://pan.baidu.com/s/1dDCJ83J

The game's website:http://tianyu.163.com/download/
This is a link to the client :http://pg.gdl.netease.com/tianyu_download.exe
Thanks。
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: TianYu online .pg file

Post by Ekey »

Same format from JianLong. Table is encrypted and don't contain file names, only hashes. Try this script

Code: Select all

# Dragon Sword (JianLong) (BAG format) (IN PROGRESS)
#
# Written by Ekey (h4x0r) / a little from chrrox
# http://www.progamercity.net
#
# script for QuickBMS http://quickbms.aluigi.org
comtype lzo1x

get PAKSIZE asize
get ID long

if ID == 0x62616731
    set TotalFiles_Key "0xe7356461"
    set TableOffset_Key "0xcb449442"
    set UNK1_Key "0x698346bd"
    set UNK2_Key "0x867389fe"
    set UNK3_Key "0xabedc59d"
else ID == 0x62616732
    set TotalFiles_Key "0x27252421"
    set TableOffset_Key "0x3b343432"
    set UNK1_Key "0x5953565d"
    set UNK2_Key "0x6663696e"
    set UNK3_Key "0x7b7d757d"
endif

filexor TotalFiles_Key
get FILES long
math FILES - 1
filexor TableOffset_Key
get TABLEOFFSET long
filexor ""

set TABLESIZE = PAKSIZE
math TABLESIZE -= TABLEOFFSET
math TABLESIZE -= 4

goto TABLEOFFSET

for i = 0 < FILES
filexor UNK1_Key
get HASH long
filexor UNK2_Key
get OFFSET long
filexor UNK3_Key
get SIZE long
math HASH ^ TABLEOFFSET
math OFFSET ^ TABLEOFFSET
math SIZE ^ TABLEOFFSET
filexor ""
log MEMORY_FILE OFFSET SIZE
goto 0x18 MEMORY_FILE
math SIZE -= 0x18
if SIZE > 0
get tmp long MEMORY_FILE
if tmp = 0x5A5A5A5A
get TSIZE long MEMORY_FILE
math SIZE - 0x8
clog "" 0x20 SIZE TSIZE MEMORY_FILE
else
log "" 0x18 SIZE MEMORY_FILE
endif
else
log "" OFFSET 0x18
endif
math TABLEOFFSET += 12
next i
ghost
Posts: 54
Joined: Tue Aug 19, 2014 10:30 am

Re: TianYu online .pg file

Post by ghost »

Ekey wrote:Same format from JianLong. Table is encrypted and don't contain file names, only hashes. Try this script

Code: Select all

# Dragon Sword (JianLong) (BAG format) (IN PROGRESS)
#
# Written by Ekey (h4x0r) / a little from chrrox
# http://www.progamercity.net
#
# script for QuickBMS http://quickbms.aluigi.org
comtype lzo1x

get PAKSIZE asize
get ID long

if ID == 0x62616731
    set TotalFiles_Key "0xe7356461"
    set TableOffset_Key "0xcb449442"
    set UNK1_Key "0x698346bd"
    set UNK2_Key "0x867389fe"
    set UNK3_Key "0xabedc59d"
else ID == 0x62616732
    set TotalFiles_Key "0x27252421"
    set TableOffset_Key "0x3b343432"
    set UNK1_Key "0x5953565d"
    set UNK2_Key "0x6663696e"
    set UNK3_Key "0x7b7d757d"
endif

filexor TotalFiles_Key
get FILES long
math FILES - 1
filexor TableOffset_Key
get TABLEOFFSET long
filexor ""

set TABLESIZE = PAKSIZE
math TABLESIZE -= TABLEOFFSET
math TABLESIZE -= 4

goto TABLEOFFSET

for i = 0 < FILES
filexor UNK1_Key
get HASH long
filexor UNK2_Key
get OFFSET long
filexor UNK3_Key
get SIZE long
math HASH ^ TABLEOFFSET
math OFFSET ^ TABLEOFFSET
math SIZE ^ TABLEOFFSET
filexor ""
log MEMORY_FILE OFFSET SIZE
goto 0x18 MEMORY_FILE
math SIZE -= 0x18
if SIZE > 0
get tmp long MEMORY_FILE
if tmp = 0x5A5A5A5A
get TSIZE long MEMORY_FILE
math SIZE - 0x8
clog "" 0x20 SIZE TSIZE MEMORY_FILE
else
log "" 0x18 SIZE MEMORY_FILE
endif
else
log "" OFFSET 0x18
endif
math TABLEOFFSET += 12
next i

I'll try and thank you :lol: