Page 1 of 3

James Cameron Avatar .pak

Posted: Wed Nov 25, 2009 6:15 pm
by JeffT
The contents of this post was deleted because of possible forum rules violation.

Re: James Cameron Avatar .pak

Posted: Sat Nov 28, 2009 11:42 pm
by Mr.Mouse
sendspace fucks up. Can you upload it somewhere else?

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 8:02 am
by CMihai
From where's the file ? PC Demo or XBOX360 ? Just got the xbox360 version today :dance: . And i unpacked the dvd on my pc, so i would like to see a unpacker for this too

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 9:53 am
by johntus
sound_english.pak - http://multi-up.com/177670
From PC Demo.

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 11:55 am
by aluigi
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:

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

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 1:50 pm
by OrangeC
I have tested this and it works well on the 360 pak version, not on pc.

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 3:58 pm
by CMihai
What program are you using to extract the xbox360 iso ? Also the script don't work for the demo files :?

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 4:18 pm
by OrangeC
Try WXripper for 360 iso's.

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 6:03 pm
by aluigi
does the script really work at 100% with the x360 archives of this game???
cool :)

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 6:08 pm
by OrangeC
I got no errors with the 360 extraction.

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 6:14 pm
by CMihai
Thanks, about the script, Im getting this error ( x360 files)
Error: invalid datatype longlong at line 68
Edit: Hmm works now, maybe i was using a old vs of quickbms cause i got the one from the script, and works now

Thanks

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 6:19 pm
by aluigi
update quickbms, you have an old version

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 6:25 pm
by CMihai
Im the only one who get just around 3.03 gb of files (from x360 ofc) ?

Re: James Cameron Avatar .pak

Posted: Sun Nov 29, 2009 6:43 pm
by OrangeC
Ive got 1gib on sounds.pak, but i need to update my quicbms too.

Re: James Cameron Avatar .pak

Posted: Sun Jan 24, 2010 12:37 pm
by zedEXt
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:
I do not know English. My language is Russian.
Что нужно подправить(дописать) в скрипте, чтобы распаковать файлы *.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)"