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

Uncharted 2

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Uncharted 2

Post by chrrox »

Here is a script i made to extract dds textures from uncharted 2 pac files.
It may mess up weather its a dxt1 or 5 if its green and fuzzy looking just change it to dxt5 and your all set.
Image
quickbms script

Code: Select all

FindLoc START string \x00\x00\x00\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF
print "%START%"
goto START
savepos BASEOFF
print "%BASEOFF%"
goto 0
for
ENDIAN BIG
FindLoc START string "z:/"
math start - 0x54
goto start
get unk01 long
get unk02 long
get unk03 long
get unk04 long
get unk05 long
get unk06 long
get unk07 long
get unk08 long
get unk09 long
get OFFSET long
math OFFSET + BASEOFF
get SIZE long
get unk12 long
get TYPE long
get unk14 long
get unk15 long
get MIPS long
get WIDTH long
get HEIGHT long
get unk19 long
get unk20 long
get unk21 long
getdstring null 0x3
get name string
string name - 24
string name + .dds
if unk19 == 0x1
print "%name%"
callfunction addDDSheader
math size + 0x80
log NAME 0 size MEMORY_FILE
endif
next


startfunction addDDSheader
endian little
set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x0A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x05\x00\x00\x00\x44\x58\x54\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x10\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
putVarChr MEMORY_FILE 0x10 WIDTH long
putVarChr MEMORY_FILE 0xC HEIGHT long
putVarChr MEMORY_FILE 0x1C MIPS long
if type == 0x1
putVarChr MEMORY_FILE 0x57 0x31
endif
if type == 0x2
putVarChr MEMORY_FILE 0x57 0x35
endif
endian big
   append
   log MEMORY_FILE OFFSET SIZE
   append
endfunction
You do not have the required permissions to view the files attached to this post.
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Uncharted 2

Post by Tosyk »

wow, very unexpected, thanks chrrox.
Thank you for all you do here
my blog | my forum
lahbibnabil
ultra-n00b
Posts: 3
Joined: Mon Nov 01, 2010 8:08 pm

Re: Uncharted 2

Post by lahbibnabil »

(thanks) this script do not extract 3d model
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Uncharted 2

Post by Tosyk »

lahbibnabil wrote:(thanks) this script do not extract 3d model
you right, and it shouldn't.
Thank you for all you do here
my blog | my forum
User avatar
RAWTalent
ultra-n00b
Posts: 5
Joined: Fri Jul 08, 2011 1:39 pm
Been thanked: 1 time

Re: Uncharted 2

Post by RAWTalent »

Wow, now if only extracting models too we'd be all set!
User avatar
Skykila
advanced
Posts: 47
Joined: Sat Apr 03, 2010 8:03 am
Location: Russia
Has thanked: 154 times
Been thanked: 6 times

Re: Uncharted 2

Post by Skykila »

Thanks for the great script! But unfortunately it does not support Uncharted 3, is it possible to support and Uncharted 3 too?
http://www.multiupload.com/4KXDC2RZYM
Strelok
ultra-n00b
Posts: 3
Joined: Thu Jan 12, 2012 8:37 pm

Re: Uncharted 2

Post by Strelok »

What about models? Why you did not support them?
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: Uncharted 2

Post by fadi002 »

Wow, thank you! I'm going to try this with Uncharted 3 later, hopefully it will work...
If it doesn't, you should make a new code that works with Uncharted 3 and hopefully extracts everything from the files.

I'm so glad you did this! :] :) :D :)

Edit: Doesn't work for Uncharted 3.
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: Uncharted 2

Post by fadi002 »

I was able to make this script work for Uncharted 3 PAK files by changing the beginning of the script to this:

Code: Select all

FindLoc START string \x00\x00\xFF\xFF\x55\x55\x55\x55\x00\x00\xFF\xFF\x55\x55\x55\x55
print "%START%"
But, unfortunately, it only works ~30% of the time and the dds textures come up messed up all the time. At least it's something... (The original script finds 0 textures 100% of the time if a U3 pak is being used with it)

If anyone with more experience with BMS scripts can help me out, I would really appreciate it. :D :) It doesn't seem like it would need too much work (I could be totally wrong though).

If a U3 pak file sample is needed, go to Skykila's post. He has a link of one.
fadi002
beginner
Posts: 21
Joined: Thu Apr 12, 2012 6:10 am
Has thanked: 4 times
Been thanked: 4 times

Re: Uncharted 2

Post by fadi002 »

Well, I used the U3 script edit for some more paks and I was able to get some things to be extracted and actually show some of the file clearly, but it still needs fixes (that I have no idea how to do) to be as good as the U2 one. :)

Anyways, I've also figured out the edit needed for it to work with UDF Pak files, but the dds textures come up even more messed up than the U3 ones.

Here it is: (for UDF)

Code: Select all

FindLoc START string \xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00
print "%START%"
UDF= Uncharted: Drake's Fortune
modz2014
ultra-n00b
Posts: 4
Joined: Thu Dec 30, 2021 3:42 pm

Re: Uncharted 2

Post by modz2014 »

how do i run this script please
Post Reply