Important information: this site is currently scheduled to go offline indefinitely by end of the year.
James Cameron Avatar .pak
James Cameron Avatar .pak
The contents of this post was deleted because of possible forum rules violation.
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: James Cameron Avatar .pak
I worked on this format some days ago (there is a thread here viewtopic.php?f=21&t=3899) but there are some fields missing or that require additional checks/reversing mainly in the part regarding the chunks of compressed data because the rest should be complete.
for reference (it works for the first files till encounters one of the those chunks wrongly compressed, so final users stay far away from this) I post my quickbms script written till now:
for reference (it works for the first files till encounters one of the those chunks wrongly compressed, so final users stay far away from this) I post my quickbms script written till now:
Code: Select all
# Avatar: The Game (UNFINISHED, DO NOT USE!)
# script for QuickBMS http://aluigi.org/papers.htm#quickbms
set MAX_CHUNKSZ long 0x10000
idstring "PAK!"
get DUMMY long
get OFFSET long
get ZSIZE asize
math ZSIZE -= OFFSET
log MEMORY_FILE OFFSET ZSIZE
math TMP = ZSIZE
math TMP += MAX_CHUNKSZ
putvarchr MEMORY_FILE TMP 0
get OFFSET long MEMORY_FILE
goto OFFSET MEMORY_FILE
get CHUNKS long MEMORY_FILE
math CHUNKS -= 1
append
for i = 0 < CHUNKS
get OFFSET1 long MEMORY_FILE
get OFFSET2 long MEMORY_FILE
if OFFSET2 & 0x80000000
set ZIP long 1
else
set ZIP long 0
endif
math OFFSET1 &= 0x7fffffff
math OFFSET2 &= 0x7fffffff
math ZSIZE = MAX_CHUNKSZ
goto OFFSET1 MEMORY_FILE2
#goto OFFSET2 MEMORY_FILE
if ZIP == 0
log MEMORY_FILE2 OFFSET2 MAX_CHUNKSZ MEMORY_FILE
else
clog MEMORY_FILE2 OFFSET2 ZSIZE MAX_CHUNKSZ MEMORY_FILE
endif
next i
append
goto 0 MEMORY_FILE2
comtype lzo1x
get DUMMY byte MEMORY_FILE2
get FILES long MEMORY_FILE2
savepos INFO_OFF MEMORY_FILE2
for extract = 0 < 2
for i = 0 < FILES
get OFFSET long MEMORY_FILE2
get SIZE long MEMORY_FILE2 # full filesize
get DUMMY long MEMORY_FILE2
math CHUNKS = SIZE
math CHUNKS /= MAX_CHUNKSZ
math TMP = SIZE
math TMP %= MAX_CHUNKSZ
if TMP != 0
math CHUNKS += 1
endif
if extract == 0
for j = 0 < CHUNKS
get ZCHUNKSZ short MEMORY_FILE2
get CHUNKSZ short MEMORY_FILE2
next j
else
savepos TMP MEMORY_FILE2
goto NAME_OFF MEMORY_FILE2
get DUMMY longlong MEMORY_FILE2
get NAMESZ byte MEMORY_FILE2
getdstring NAME NAMESZ MEMORY_FILE2
savepos NAME_OFF MEMORY_FILE2
goto TMP MEMORY_FILE2
callfunction unpack
endif
next i
if extract == 0
savepos NAME_OFF MEMORY_FILE2
endif
goto INFO_OFF MEMORY_FILE2
next extract
startfunction unpack
putvarchr MEMORY_FILE SIZE 0
log MEMORY_FILE 0 0
append
for j = 0 < CHUNKS
get ZCHUNKSZ short MEMORY_FILE2
get CHUNKSZ short MEMORY_FILE2
if CHUNKSZ == 0
set CHUNKSZ long MAX_CHUNKSZ
endif
if ZCHUNKSZ == 0
log MEMORY_FILE OFFSET CHUNKSZ
math OFFSET += CHUNKSZ
else
if CHUNKSZ == 0xffff
get TMP asize MEMORY_FILE
log MEMORY_FILE OFFSET ZCHUNKSZ
math TMP += CHUNKSZ
putvarchr MEMORY_FILE TMP 0
else
clog MEMORY_FILE OFFSET ZCHUNKSZ CHUNKSZ # problem here
endif
math OFFSET += ZCHUNKSZ
endif
next j
append
log NAME 0 SIZE MEMORY_FILE
endfunction
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: James Cameron Avatar .pak
does the script really work at 100% with the x360 archives of this game???
cool :)
cool :)
- CMihai
- veteran
- Posts: 131
- Joined: Sun Jul 05, 2009 12:58 pm
- Has thanked: 13 times
- Been thanked: 1 time
Re: James Cameron Avatar .pak
Thanks, about the script, Im getting this error ( x360 files)
Thanks
Edit: Hmm works now, maybe i was using a old vs of quickbms cause i got the one from the script, and works nowError: invalid datatype longlong at line 68
Thanks
Last edited by CMihai on Sun Nov 29, 2009 6:20 pm, edited 1 time in total.
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: James Cameron Avatar .pak
I do not know English. My language is Russian.aluigi wrote:I worked on this format some days ago (there is a thread here viewtopic.php?f=21&t=3899) but there are some fields missing or that require additional checks/reversing mainly in the part regarding the chunks of compressed data because the rest should be complete.
for reference (it works for the first files till encounters one of the those chunks wrongly compressed, so final users stay far away from this) I post my quickbms script written till now:
Что нужно подправить(дописать) в скрипте, чтобы распаковать файлы *.pak(PC)?(What it is necessary to correct to (add) in a script to unsqueeze files *.pak (PC)?) 100% unpacked, only: "patch.pak"(avatar_1.01_rus.exe -patch Buka russian ), shadersobj.pak, sound_english.pak. Other(data.pak, sound.pak, data_english.pak): "Error: the compressed LZO input is wrong or incomplete (-6)", "Error: there is an error with the decompression the returned output size is negative (-1)"
Last edited by zedEXt on Sun Jan 24, 2010 12:45 pm, edited 1 time in total.