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

Spider Man 3 XBOX 360

Post questions about game models here, or help out others!
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Tue May 04, 2021 11:26 pm Having looked at the other samples, some of them don't fit the logic of my script. Some of them have the file table starting in a slightly different place. There's no obvious offset to the start of this table because the logic used doesn't always work, so I'm stumped on how to calculate it accurately for every file.
So I think that the solution is edit script every time before extraction new file - it's not a problem. How do you know where the table has starting? Could you give please a tip?
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Spider Man 3 XBOX 360

Post by DKDave »

The way it was calculated was to look for the hex sequence 0xa1a1a1a1 and subtract the size of the file table to get the start, but this didn't always work. The file table usually starts at 0x394 in GAME.XEPACK, 0x368 in GAME.PCPACK, somewhere after the string of 0x01 bytes. In LOCATION_BLACK_CAT_1.XEPACK, the file table starts at 0x3c0.
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Thu May 06, 2021 7:41 pm The way it was calculated was to look for the hex sequence 0xa1a1a1a1 and subtract the size of the file table to get the start, but this didn't always work. The file table usually starts at 0x394 in GAME.XEPACK, 0x368 in GAME.PCPACK, somewhere after the string of 0x01 bytes. In LOCATION_BLACK_CAT_1.XEPACK, the file table starts at 0x3c0.
Hmm, okay, I understand how to calculate where table is starting, thanks. But how to decide where ENTRIES must start?

Code: Select all

Goto 0x54
Get ENTRIES Long
Get TEMPNAME basename
If offset is different so that place where we appoint ENTRIES must be also different - not 0x54 every time, isn't it? How to choose this number?
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Spider Man 3 XBOX 360

Post by DKDave »

The location of entries is always at 0x54, or at least it is in all of your samples.
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Thu May 06, 2021 11:10 pm The location of entries is always at 0x54, or at least it is in all of your samples.
So what string in script I need to change for taking account the starting of the table? (0x349 for one file and 0x3c0 for other)
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Spider Man 3 XBOX 360

Post by DKDave »

If you delete the following line:

XMath ENTRY "OFFSET - (ENTRIES * 0x10)"

And replace it with:

Math ENTRY = 0x3c0 (or whatever it is)
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Fri May 07, 2021 12:30 pm If you delete the following line:

XMath ENTRY "OFFSET - (ENTRIES * 0x10)"

And replace it with:

Math ENTRY = 0x3c0 (or whatever it is)
OMG, YES!! It really works! This string is working for most of all other files!

Code: Select all

Math ENTRY = 0x3c0
Great thanks for you!!!

Now I got the last problem, It looks like you solved at the first time. There is script that decrypts NCH PCPACK to clean PCPACK:

Code: Select all

comtype lzo1x
get PCPACK_SIZE asize
log MEMORY_FILE 0 0
append 1
for i = 0
    savepos TMP_OFF
    if TMP_OFF == PCPACK_SIZE
        break
    endif
    idstring "NCH\0"
    get ZSIZE long
    get DUMMY_CRC long
    get SIZE long
    get XOFFSET long
    get DUMMY_CRC long
    get XSIZE long
    get ZIP long
    savepos OFFSET
    goto XOFFSET MEMORY_FILE
    if ZIP == 0
        log MEMORY_FILE OFFSET ZSIZE
    else
        clog MEMORY_FILE OFFSET ZSIZE SIZE
    endif
    math TMP_OFF + XSIZE
    goto TMP_OFF
    padding 0x1000
next i
append
get NAME basename
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE
I need to decrypt the same NCH *XEPACK files and maybe this is the same problem with big-endian reading, maybe no.

Sample of PCPACK with NCH encryption: https://mega.nz/file/IN8lUKza#cRwyOzfK5 ... AOvTA_D3RU
Sample of XEPACK with NCH encryption: https://mega.nz/file/IclnEAgB#0bmDGxpBB ... JfP8QNaXiQ

Could you pleace check it? I will be soooo appreciative of it (:
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Spider Man 3 XBOX 360

Post by DKDave »

Yes, if you add the following line at the very start of the script, it will decompress the NCH.XEPACK files:

Endian Big

It looks like that's the only change needed, at least for the XEPACK sample, so it should work fine with the others.
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Fri May 07, 2021 7:25 pm Yes, if you add the following line at the very start of the script, it will decompress the NCH.XEPACK files:

Endian Big

It looks like that's the only change needed, at least for the XEPACK sample, so it should work fine with the others.
Oh yeah, It really works, big thanks for all!!!
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Fri May 07, 2021 7:25 pm Yes, if you add the following line at the very start of the script, it will decompress the NCH.XEPACK files:

Endian Big

It looks like that's the only change needed, at least for the XEPACK sample, so it should work fine with the others.
And also it has appeared new problem. I asked Aluigi if he could upgrade his script (also for working with *36 files). He made it, and script extract all files, but they were empty. Right names, but without extension and empty. After my question he thought and said that it's impossible and better try to use hex2obj.

Maybe you ever encountered with this?

There is original script to extract textures for PC:

Code: Select all

# script for QuickBMS http://aluigi.org/papers.htm#quickbms

//idstring "APKF"
findloc PHYS string "PHYS"
goto PHYS
savepos TMP
goto 0x14 0 SEEK_CUR
get infoOffset long
xmath OFFSET "infoOffset + TMP + 0x14"
goto 0x1c
findloc TEX binary "\x54\x45\x58\x00"
goto TEX
goto 0xc 0 SEEK_CUR
savepos TMP1
get tableLoc long
get FILES long
math tableLoc + TMP1
goto tableLoc
for i = 0 < FILES
	savepos TMP2
	get nameOffset long
    math nameOffset + TMP2
    get hash long
	get type long
	get SIZE long
    savepos TMP3
    goto nameOffset
    get NAME string
	findloc hashID long hash
	goto hashID
	goto 0xc 0 SEEK_CUR
	get WIDTH long
	get HEIGHT long
	goto 8 0 SEEK_CUR
	get FORMAT long //14, 15, 32, 33 ,DXT1, DXT3, DXT5
	if FORMAT == 0x31545844 //DXT1
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\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\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\xDD\xDD\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		putVarChr MEMORY_FILE 0x54 FORMAT long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE
	elif FORMAT == 0x33545844 //DXT3
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\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\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\xDD\xDD\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		putVarChr MEMORY_FILE 0x54 FORMAT long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE
	elif FORMAT == 0x35545844 //DXT5
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\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\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\xDD\xDD\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		putVarChr MEMORY_FILE 0x54 FORMAT long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE	
	elif FORMAT == 0x14 //RGB
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE	
	elif FORMAT == 0x15 //ARGB
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\x00\x00\x00\x00\xFF\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE	
	elif FORMAT == 0x32 //L8 (R8)
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x08\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE	
	elif FORMAT == 0x33 //A8L8 (A8 R8)
		set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x10\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
		putVarChr MEMORY_FILE 0XC HEIGHT long
		putVarChr MEMORY_FILE 0x10 WIDTH long
		putVarChr MEMORY_FILE 0x14 SIZE long
		string NAME + ".dds"
		log NAME 0 0x80 MEMORY_FILE	
	else
		print "Wrong offset, so we try again!"
		findloc hashID long hash
		goto hashID
		print "%hashID|h% :hashid"
		goto 0xc 0 SEEK_CUR
		get WIDTH long
		print "%width|hex% :width"
		get HEIGHT long
		print "%height|hex% :height"
		goto 8 0 SEEK_CUR
		get FORMAT long //15, 32, 33 ,DXT1, DXT3, DXT5
		print "%FORMAT|hex% :format"
		if FORMAT == 0x31545844
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\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\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\xDD\xDD\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			putVarChr MEMORY_FILE 0x54 FORMAT long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE
		elif FORMAT == 0x33545844
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\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\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\xDD\xDD\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			putVarChr MEMORY_FILE 0x54 FORMAT long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE
		elif FORMAT == 0x35545844
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\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\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\xDD\xDD\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			putVarChr MEMORY_FILE 0x54 FORMAT long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE	
		elif FORMAT == 0x14 //RGB8 (24)
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE	
		elif FORMAT == 0x15 //ARGB8 (32)
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\x00\x00\x00\x00\xFF\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE	
		elif FORMAT == 0x32 //L8 (R8)
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x08\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE	
		elif FORMAT == 0x33 //A8L8 (A8 R8)
			set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x10\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
			putVarChr MEMORY_FILE 0XC HEIGHT long
			putVarChr MEMORY_FILE 0x10 WIDTH long
			putVarChr MEMORY_FILE 0x14 SIZE long
			string NAME + ".dds"
			log NAME 0 0x80 MEMORY_FILE	
		endif
	endif
	append
	log NAME OFFSET SIZE
	append
    math OFFSET + SIZE
	goto TMP3	
next i
And there is upgraded version made for extracting textures from xbox files:

Code: Select all

# APKF (script 0.1a)

idstring "APKF"
get DUMMY long
get ZERO long   # 0 or 4 (xbox?)
get DUMMY long  # -1
get DUMMY long  # 2
endian guess DUMMY
savepos TMP
get OFFSET long
math OFFSET + TMP
get ZERO long
math MAX_TYPES = 4
for TYPE = 0 < MAX_TYPES
    getdstring PATH 4
    get DUMMY long
    get STRUCT_TYPE long
    savepos TMP
    get INFO_OFF long
    math INFO_OFF + TMP
    get FILES long
    get DUMMY5 long
    get FLAGS long

    savepos BACKUP_OFF
    goto INFO_OFF
    for i = 0 < FILES
        savepos TMP
        get NAME_OFF long
        math NAME_OFF + TMP
        get CRC long
        get SIZE long
        if STRUCT_TYPE == 1
        elif STRUCT_TYPE == 2
            get DUMMY long
        else
            print "Error: unknown structure %STRUCT_TYPE%, contact me"
            cleanexit
        endif
        savepos TMP
        goto NAME_OFF
        get NAME string
        goto TMP
        string NAME p "%s/%s" PATH NAME
        log NAME OFFSET SIZE
        math OFFSET + SIZE
    next i
    goto BACKUP_OFF
next TYPE
I would be so appreciate of it if you could check this (:
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Spider Man 3 XBOX 360

Post by DKDave »

I've had a look, but I'm not sure either. It's a bit of a weird format, but as Luigi says, sometimes if the format can't be worked out properly then you might need to extract the files manually with a hex editor.
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
PaHaNchickT
beginner
Posts: 26
Joined: Tue Dec 22, 2020 10:23 pm
Has thanked: 10 times

Re: Spider Man 3 XBOX 360

Post by PaHaNchickT »

DKDave wrote: Sun May 09, 2021 6:35 pm I've had a look, but I'm not sure either. It's a bit of a weird format, but as Luigi says, sometimes if the format can't be worked out properly then you might need to extract the files manually with a hex editor.
Yeah, I tried to find the way to extract textures from hex. The only way I found is TextureFinder, but it doesn't work right with this files. I know about hex2obj, but it's extracting only meshes, isn't it?

If you could give an advise how to understand where texture starts, ends and how to calculate size so I can try to find needed strings and separate them to textures.

Or maybe you know another way to extract it using hex?
ben10x
ultra-n00b
Posts: 3
Joined: Sun Apr 10, 2022 8:10 am
Has thanked: 3 times

Re: Spider Man 3 XBOX 360

Post by ben10x »

DKDave wrote: Sat May 01, 2021 6:22 pm I'm not sure from looking at the script. I've rewrote a QuickBMS script using the same logic that should work for both file versions, if you want to give this a try:

s3.zip
It's working great!!!
Post Reply