Important information: this site is currently scheduled to go offline indefinitely by end of the year.

LEGO Pirates of the Caribbean

The Original Forum. Game archives, full of resources. How to open them? Get help here.
hunpatrik
veteran
Posts: 101
Joined: Mon Jan 04, 2010 9:21 pm
Has thanked: 10 times
Been thanked: 5 times

LEGO Pirates of the Caribbean

Post by hunpatrik »

Hello!
Is there anyone who knows where the game stores the texts, and how can i extract it? I think the .dat files store it, but i don't know which, (game0 game1...game4) i can't upload them (1gb+ each) if you want part of a file, i do it with winrar or total commander? Thank you!
Giggity
ultra-n00b
Posts: 2
Joined: Tue May 17, 2011 5:14 pm

Re: LEGO Pirates of the Caribbean

Post by Giggity »

I've tried QuickBMS with the "ttgames.bms" script, but that only extracted some of the files. Realy wanted the hidden Armada of the Damned music from that game and maybe some other unreleased cues 8D
RickyOs
n00b
Posts: 13
Joined: Mon Nov 29, 2010 5:54 pm
Been thanked: 5 times

Re: LEGO Pirates of the Caribbean

Post by RickyOs »

Try this one:

Code: Select all

# Traveller's Tales games DAT files extractor (script 0.5)
#  LEGO Harry Potter
#  LEGO Star Wars III
#  LEGO Pirates of the Caribbean
#
# this script is expansion to the original script from aluigi
# original script for QuickBMS http://aluigi.org/papers.htm#quickbms

comtype lz2k

get INFO_OFF long
if INFO_OFF & 0x80000000
    math INFO_OFF ^= 0xffffffff
    math INFO_OFF <<= 8
    math INFO_OFF += 0x100
endif
get INFO_SIZE long
log MEMORY_FILE INFO_OFF INFO_SIZE

get TYPE_BOH long MEMORY_FILE
get FILES long MEMORY_FILE
savepos INFO_OFF MEMORY_FILE

math TMP = FILES
math TMP *= 16  
math NAME_INFO = INFO_OFF
math NAME_INFO += TMP

goto NAME_INFO MEMORY_FILE
get NAMES long MEMORY_FILE
savepos NAME_INFO MEMORY_FILE

math TMP = NAMES
math TMP *= 8   
math NAME_OFF = NAME_INFO
math NAME_OFF += TMP

goto NAME_OFF MEMORY_FILE
get NAMECRC_OFF long MEMORY_FILE
savepos NAME_OFF MEMORY_FILE

math NAMECRC_OFF += NAME_OFF
goto NAMECRC_OFF MEMORY_FILE
for i = 0 < FILES
    get CRC long MEMORY_FILE
    putarray 0 i CRC
next i

if TYPE_BOH <= -2
    get DUMMY1 long MEMORY_FILE
    get DUMMY2 long MEMORY_FILE
    if DUMMY1 > 0
        print "Error: not implemented yet"
        cleanexit
    endif
endif

# print "files:       %FILES%"
# print "names:       %NAMES%"
# print "info_off:    %INFO_OFF%"
# print "info_size:   %INFO_SIZE%"
# print "name_info:   %NAME_INFO%"
# print "name_off:    %NAME_OFF%"
# print "namecrc_off: %NAMECRC_OFF%"

set NAMEZ long 0
set FULLNAME string ""
set FULLPATH string ""

for i = 0 < FILES
    do
        goto NAME_INFO MEMORY_FILE
        get NEXT short MEMORY_FILE
        get PREV short MEMORY_FILE
        get OFF long MEMORY_FILE
        savepos NAME_INFO MEMORY_FILE

        math OFF += NAME_OFF
        goto OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        if NEXT & 0x8000    # 16bit sign conversion
            math NEXT |= 0xffff0000
        endif

        if PREV != 0
            getarray FULLPATH 1 PREV
        endif
        putarray 1 NAMEZ FULLPATH

        if NEXT > 0 # folder
            if NAME != ""
                string FULLPATH += NAME
                string FULLPATH += \
            endif
        else #file
        endif

        math NAMEZ += 1

    while NEXT > 0
    set FULLNAME string FULLPATH
    string FULLNAME += NAME

        math CRC = 0x811c9dc5
        strlen NAMESZ FULLNAME
        for j = 0 < NAMESZ
            getvarchr CHR FULLNAME j
            if CHR >= 0x61
                if CHR <= 0x7a
                    math CHR -= 0x20
                endif
            endif
            math CRC ^= CHR
            math CRC *= 0x199933
        next j
        for j = 0 < FILES
            getarray TMP 0 j
            if CRC == TMP
                break
            endif
        next j
        if j >= FILES
            print "Alert: the crc of the file %FULLNAME% has not been found, it can't be extracted!"
            #cleanexit
            # all wrongs!
            math j = i
            #math TMP = NEXT
            #math j = 0
            #math j -= NEXT
            #math j -= 1
        endif
        math TMP = j

        math TMP *= 16
        math TMP += INFO_OFF
        goto TMP MEMORY_FILE
        get OFFSET long MEMORY_FILE
        math OFFSET <<= 8
        get ZSIZE long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get PACKED long MEMORY_FILE

        goto OFFSET
        getdstring SIGN 4
        if SIGN == "LZ2K"
            set PACKED long 2
        else
            set PACKED long 0
        endif

        if PACKED & 2
            callfunction UNLZ2K
            log FULLNAME 0 SIZE MEMORY_FILE2
        else
            if SIZE != 0
            if ZSIZE != 0
            if SIZE != ZSIZE
                print "SIZE (%SIZE%) and ZSIZE (%ZSIZE%) differ, contact me"
                cleanexit
            endif
            endif
            endif
            log FULLNAME OFFSET SIZE
        endif
next i

startfunction UNLZ2K
    putvarchr MEMORY_FILE2 SIZE 0
    log MEMORY_FILE2 0 0
    append
    for TMPSZ = 0 < ZSIZE
        goto OFFSET
        getdstring SIGN 4
        if SIGN != "LZ2K"
            print "Error: the signature at offset %OFFSET% (%SIGN%) is not LZ2K, contact me"
            cleanexit
        endif
        get LZ2K_SIZE long
        get LZ2K_ZSIZE long
        savepos OFFSET
        if LZ2K_ZSIZE == LZ2K_SIZE
            log MEMORY_FILE2 OFFSET LZ2K_SIZE
        else
            clog MEMORY_FILE2 OFFSET LZ2K_ZSIZE LZ2K_SIZE
        endif
        math OFFSET += LZ2K_ZSIZE
        savepos TMP MEMORY_FILE2
        math TMPSZ += 12
        math TMPSZ += LZ2K_ZSIZE
    next
    append
endfunction
Giggity
ultra-n00b
Posts: 2
Joined: Tue May 17, 2011 5:14 pm

Re: LEGO Pirates of the Caribbean

Post by Giggity »

Thanks man :D this script did the job very well.

As from what i can tell here's a small list of what the .DAT files contains:

GAME :
Contains various folders, Audio, Movies, common objects/vehicles/creature/character/GUI textures, scripts and some TXT files

GAME0 :
Titles, main quest hub textures and some textures for loading screens/credits and parts of the Curse of the Black Pearl level

GAME1 : Curse of the Black Pearl level data/textures
GAME2 : Dead Men's Chest level data/textures
GAME3 : At World's End level data/textures
GAME4 : On Stranger Tides level data/textures
hunpatrik
veteran
Posts: 101
Joined: Mon Jan 04, 2010 9:21 pm
Has thanked: 10 times
Been thanked: 5 times

Re: LEGO Pirates of the Caribbean

Post by hunpatrik »

Nice script thank you :)
hunpatrik
veteran
Posts: 101
Joined: Mon Jan 04, 2010 9:21 pm
Has thanked: 10 times
Been thanked: 5 times

Re: LEGO Pirates of the Caribbean

Post by hunpatrik »

Is there anyone who know where are the save games?
beyondsight
ultra-n00b
Posts: 2
Joined: Thu May 26, 2011 1:19 am

Re: LEGO Pirates of the Caribbean

Post by beyondsight »

Giggity wrote:this script did the job very well.
Did you manage to extract the music? I've been looking for Armada of the Damned's tracks, too. Though I suppose they might be hard to distinguish from the movie's score...
hunpatrik
veteran
Posts: 101
Joined: Mon Jan 04, 2010 9:21 pm
Has thanked: 10 times
Been thanked: 5 times

Re: LEGO Pirates of the Caribbean

Post by hunpatrik »

I have some issues:
1. Where are the save game file(s)?
I found it: C:\Documents and Settings\Your_Name\Application Data\DisneyInteractiveStudios\LEGOPirates\SavedGames
Or: C:\Users\Your_Name\AppData\Roaming\DisneyInteractiveStudios\LEGOPirates
2. Is there anyway to import bigger files than the original?
3. Is there anyway to run the game with extracted files?

Thank you, if someone can help me!
nickx
beginner
Posts: 20
Joined: Sat Jun 25, 2011 12:08 am
Has thanked: 2 times

Re: LEGO Pirates of the Caribbean

Post by nickx »

RickyOs wrote:Try this one:
the script isnt reinjecting the files back into the dat file correctly (on the new lego harry potter), could you have a closer look
User avatar
aluigi
VVIP member
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: LEGO Pirates of the Caribbean

Post by aluigi »

some files can't be reinjected because they use MEMORY_FILEs operations due to the usage of chunks (the file is splitted in various compressed pieces)
patcher999
ultra-n00b
Posts: 1
Joined: Mon Feb 20, 2012 8:20 pm

Re: LEGO Pirates of the Caribbean

Post by patcher999 »

Can you sort of reverse the script and put files into GAME.DAT? If so, how?
lllccc
mega-veteran
mega-veteran
Posts: 215
Joined: Thu Apr 12, 2012 12:27 am
Has thanked: 18 times
Been thanked: 1 time

Re: LEGO Pirates of the Caribbean

Post by lllccc »

RickyOs wrote:Try this one:

Code: Select all

# Traveller's Tales games DAT files extractor (script 0.5)
#  LEGO Harry Potter
#  LEGO Star Wars III
#  LEGO Pirates of the Caribbean
#
# this script is expansion to the original script from aluigi
# original script for QuickBMS http://aluigi.org/papers.htm#quickbms

comtype lz2k

get INFO_OFF long
if INFO_OFF & 0x80000000
    math INFO_OFF ^= 0xffffffff
    math INFO_OFF <<= 8
    math INFO_OFF += 0x100
endif
get INFO_SIZE long
log MEMORY_FILE INFO_OFF INFO_SIZE

get TYPE_BOH long MEMORY_FILE
get FILES long MEMORY_FILE
savepos INFO_OFF MEMORY_FILE

math TMP = FILES
math TMP *= 16  
math NAME_INFO = INFO_OFF
math NAME_INFO += TMP

goto NAME_INFO MEMORY_FILE
get NAMES long MEMORY_FILE
savepos NAME_INFO MEMORY_FILE

math TMP = NAMES
math TMP *= 8   
math NAME_OFF = NAME_INFO
math NAME_OFF += TMP

goto NAME_OFF MEMORY_FILE
get NAMECRC_OFF long MEMORY_FILE
savepos NAME_OFF MEMORY_FILE

math NAMECRC_OFF += NAME_OFF
goto NAMECRC_OFF MEMORY_FILE
for i = 0 < FILES
    get CRC long MEMORY_FILE
    putarray 0 i CRC
next i

if TYPE_BOH <= -2
    get DUMMY1 long MEMORY_FILE
    get DUMMY2 long MEMORY_FILE
    if DUMMY1 > 0
        print "Error: not implemented yet"
        cleanexit
    endif
endif

# print "files:       %FILES%"
# print "names:       %NAMES%"
# print "info_off:    %INFO_OFF%"
# print "info_size:   %INFO_SIZE%"
# print "name_info:   %NAME_INFO%"
# print "name_off:    %NAME_OFF%"
# print "namecrc_off: %NAMECRC_OFF%"

set NAMEZ long 0
set FULLNAME string ""
set FULLPATH string ""

for i = 0 < FILES
    do
        goto NAME_INFO MEMORY_FILE
        get NEXT short MEMORY_FILE
        get PREV short MEMORY_FILE
        get OFF long MEMORY_FILE
        savepos NAME_INFO MEMORY_FILE

        math OFF += NAME_OFF
        goto OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        if NEXT & 0x8000    # 16bit sign conversion
            math NEXT |= 0xffff0000
        endif

        if PREV != 0
            getarray FULLPATH 1 PREV
        endif
        putarray 1 NAMEZ FULLPATH

        if NEXT > 0 # folder
            if NAME != ""
                string FULLPATH += NAME
                string FULLPATH += \
            endif
        else #file
        endif

        math NAMEZ += 1

    while NEXT > 0
    set FULLNAME string FULLPATH
    string FULLNAME += NAME

        math CRC = 0x811c9dc5
        strlen NAMESZ FULLNAME
        for j = 0 < NAMESZ
            getvarchr CHR FULLNAME j
            if CHR >= 0x61
                if CHR <= 0x7a
                    math CHR -= 0x20
                endif
            endif
            math CRC ^= CHR
            math CRC *= 0x199933
        next j
        for j = 0 < FILES
            getarray TMP 0 j
            if CRC == TMP
                break
            endif
        next j
        if j >= FILES
            print "Alert: the crc of the file %FULLNAME% has not been found, it can't be extracted!"
            #cleanexit
            # all wrongs!
            math j = i
            #math TMP = NEXT
            #math j = 0
            #math j -= NEXT
            #math j -= 1
        endif
        math TMP = j

        math TMP *= 16
        math TMP += INFO_OFF
        goto TMP MEMORY_FILE
        get OFFSET long MEMORY_FILE
        math OFFSET <<= 8
        get ZSIZE long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get PACKED long MEMORY_FILE

        goto OFFSET
        getdstring SIGN 4
        if SIGN == "LZ2K"
            set PACKED long 2
        else
            set PACKED long 0
        endif

        if PACKED & 2
            callfunction UNLZ2K
            log FULLNAME 0 SIZE MEMORY_FILE2
        else
            if SIZE != 0
            if ZSIZE != 0
            if SIZE != ZSIZE
                print "SIZE (%SIZE%) and ZSIZE (%ZSIZE%) differ, contact me"
                cleanexit
            endif
            endif
            endif
            log FULLNAME OFFSET SIZE
        endif
next i

startfunction UNLZ2K
    putvarchr MEMORY_FILE2 SIZE 0
    log MEMORY_FILE2 0 0
    append
    for TMPSZ = 0 < ZSIZE
        goto OFFSET
        getdstring SIGN 4
        if SIGN != "LZ2K"
            print "Error: the signature at offset %OFFSET% (%SIGN%) is not LZ2K, contact me"
            cleanexit
        endif
        get LZ2K_SIZE long
        get LZ2K_ZSIZE long
        savepos OFFSET
        if LZ2K_ZSIZE == LZ2K_SIZE
            log MEMORY_FILE2 OFFSET LZ2K_SIZE
        else
            clog MEMORY_FILE2 OFFSET LZ2K_ZSIZE LZ2K_SIZE
        endif
        math OFFSET += LZ2K_ZSIZE
        savepos TMP MEMORY_FILE2
        math TMPSZ += 12
        math TMPSZ += LZ2K_ZSIZE
    next
    append
endfunction
hey i just wanted to know will this extract all the files? in the dat file?

Update:
thanks you soo much it extracted all the files with out any problems
Last edited by lllccc on Wed Aug 08, 2012 8:47 pm, edited 1 time in total.
lllccc
mega-veteran
mega-veteran
Posts: 215
Joined: Thu Apr 12, 2012 12:27 am
Has thanked: 18 times
Been thanked: 1 time

Re: LEGO Pirates of the Caribbean

Post by lllccc »

nickx wrote:
RickyOs wrote:Try this one:
the script isnt reinjecting the files back into the dat file correctly (on the new lego harry potter), could you have a closer look
hey nickx how do you reinject back into the .dat file? i want to try modding the credits for a test
and if anyone knows how to do this can you tell me?
User avatar
aluigi
VVIP member
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: LEGO Pirates of the Caribbean

Post by aluigi »

Finally I have updated my ttgames.bms script for working correctly with all the games of the LEGO series included Lord of the Rings:

http://aluigi.org/papers/bms/ttgames.bms
rip88
ultra-n00b
Posts: 2
Joined: Sun Oct 28, 2012 3:10 pm

Re: LEGO Pirates of the Caribbean

Post by rip88 »

TY Aluigi,
Export and ReImport LEGO Lord of the Rings works Perfectly.
Post Reply