Hex Editing: How To Extract Texture Names from IFF Files

Patchmaking tutorials for NBA 2K11.

Hex Editing: How To Extract Texture Names from IFF Files

Postby JaoSming on Wed Aug 24, 2011 9:50 am

First off, the easiest way to do this is by hex editing the compressed iff file. There is no way to compress an iff file after it has been decompressed so you may need to get it off your disc or hope that you decompressed the file with the Mod Tool.

If you decompress iff files with the Mod Tool, it automatically creates a backup file for you. For example, if I decompress the global.iff file with the mod tool, it automatically creates a global.BAK file in the NBA 2K11 folder which is the same iff but still compressed.

This tutorial will show you how to extract the names from the global.iff file.

----

Take the compressed global.iff file and open it in your hex editor.

Image

Goto the end of the file

Image

Notice how I highlighted the S.u.r.f.a.c.e and the cooresponding hex. In all iff files there are those 00's in between each text input. Just so you can fully understand, 53 in hex = S, 75 = u, etc etc.

These are the names we are going to be extracting, but first, we need to scroll up to see where the names begin.

Image

We can see that the beginning of the names begins near the offset 0183D5A0. We want to select everything from this point all the way down to the bottom of the file.

Image

After you select all the names, copy, and paste them into a new file to isolate the names.

Image

Now that the names are isolated, we want to make them more legible. We are going to format this mess to look proper in Notepad.

The last thing we need to do in the Hex Editor is do a Find/Replace. We are going to find every instance of 000000 in the file (which represent a space between names) and replace it with 0D0A (which signifies an enter in notepad). Since we are not directly hex editing a file for the game, you are allowed to change the size of the file.

Image

After that is done, you can save the file to your desktop and open it in Notepad. On the Left is how your file should look. On the right you will see what the text file would look like if we skipped that last step.

Image

Now we need to make this more legible using the Notepad find/replace command (Ctrl + H). For each of these, we want to keep the Replace with field completely blank, this will delete all instances of the Find What field.

So first, we want to enter a single " " space in the Find What field while keeping the Replace With field empty. This will delete all the excess spaces in the file.

Image

Much better. The TXTR, DRAM, VRAM, SRAM, SCOS, AUDO, AUSB, SPCX, , SCOS, SCNE, LAYT, curveanim, SingleMoCap, and FxTweakablesV2 labels are the next things to get deleted with the same method. These are identifiers for DDS textures and scenes for the game.

Image

Next you need to delete all these excess enter spaces. Personally I use a filter in Open Office that deletes blank cells but I don't think NotePad's find and replace can get rid of the excess enters.

Image

And There you have it! A Complete list of the names in the global.iff file.


Now, if you scroll down to the 0, 1, 2 part of the extracted names, everything above that is a texture name, well, a name that cooresponds to a subfile when you open the global.iff file in the Mod Tool. Everything below that is "hidden" stuff that is located in the file that can only be edited with hex.

Image

To use this to our advantage, lets look something up like "light". Decompress the global.iff file (idealy, make a copy first). Then open it in the hex editor, you will notice that the names list is no longer at the end of the file.

Let's look up all the instances of "light" in the file. Again, the text seems to be separated by .'s so we need to search for "l.i.g.h.t".

My hex editor automatically thinks that when the user inputs . in a text field that the cooresponding hex is "20" instead of "00" which is what we want. So instead of just typing in l.i.g.h.t into the search field, I need to do the following.

Take - light
Find the Hex for light - 6C69 6768 74
Add 00's inbetween each byte - 6C00 6900 6700 6800 74
Then search for - 6C0069006700680074

Image

Unfortunatelly, that is the extend of my knowledge of finding shit in these iff files. If you have more to add, please do.
Opinions are my own.

JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29904
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: How To Extract Texture Names from IFF Files

Postby Look my voice to LP on Wed Aug 24, 2011 5:37 pm

Hello dear JaoSming!
You always help me so im wright to you in direct PM!
I have a question
How can i find a string in Hex Editing NBA 2k11 for contest shot animations? I want to replace some of them to more realistic ones,thank you!
ImageImage
I am godfather of the Paint
User avatar
Look my voice to LP
 
Posts: 618
Joined: Thu Aug 21, 2008 6:46 am
Location: Ukraine

Re: Hex Editing: How To Extract Texture Names from IFF Files

Postby Sportsgamer on Sat Oct 08, 2011 4:55 am

Yooo JaoSming! You mind sharing that wallpaper of yours?
Image
User avatar
Sportsgamer
 
Posts: 804
Joined: Tue Oct 02, 2007 12:36 am

Re: Hex Editing: How To Extract Texture Names from IFF Files

Postby JaoSming on Mon Oct 10, 2011 6:42 am

Yep, I'll add finishing up that wallpaper to my to-do list.
Opinions are my own.

JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29904
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K


Return to NBA 2K11 Tutorials & FAQs

Who is online

Users browsing this forum: No registered users and 2 guests