Gem Trader Story 宝石研物语

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Gem Trader Story 宝石研物语

Post by chrrox »

Here is a quickbms to decrypt the files of this game .png is not perfect on some files that are not a size that is a multiple of 4
but it still loads the png fine just last 0x40 bytes not correct.
http://gemtrader.cn/index.php/Download/index.html
Image

Code: Select all

#quickbms script
#by chrrox and aluigi
#quickbms.com
get NAME basename
get EXT extension
string NAME + _dec.
string NAME + EXT
if EXT == png
get SIZE asize
set NUM 0x40000000
set MEMORY_FILE binary ""
set MEMORY_FILE2 binary "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
set MEMORY_FILE3 binary ""
math SIZE x 0x20
math SIZE - 0x54
math SIZE / 0x20

math SIZE - 2
for i = 0 < 16
set OFF i
math OFF * 4
putvarchr MEMORY_FILE OFF NUM long
math NUM -= 1
next i

append
for i = 0 < SIZE
set OFF i
math OFF * 0x20
math OFF + 0x5C
log MEMORY_FILE 0 0x1C MEMORY_FILE2
putvarchr MEMORY_FILE OFF NUM long
math NUM -= 1
next i
append

get SIZE asize
#math SIZE y 4
math SIZE - 0x54
get SIZE2 asize MEMORY_FILE

if SIZE2 > SIZE
math NUM += 1
endif

for i = 0 < 16
set OFF i
math OFF * 4
math OFF + SIZE
putvarchr MEMORY_FILE OFF NUM long
math NUM -= 1
next i

encryption xor MEMORY_FILE
get SIZE asize
math SIZE - 0x14
log NAME 0x14 SIZE
else
encryption "incremental xor" 0x40000000 -1
math OFFSET = 0x14
get SIZE asize
math SIZE - OFFSET
log NAME OFFSET SIZE
endif