- — File Parsing Boot Camp — - (Some file structures added)

Started by Xiggah, January 24, 2012, 06:26:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

In this thread, we will train ourselves to parse Brawl's files, so Brawlbox will be able to edit more files and be capable of more hacks. In layman's terms, parsing a file means sorting out different parts of the file, similar to separating stacked lego blocks. We can do this through hexing Brawl's files and finding patterns in its code. There will be more tutorials, but until then feel free to use this thread to ask questions about file parsing and hexing.

Here's a short list of file types that need parsed:
Files needing parsed:
- BLOC     File container, like ARC or BRRES, used commonly in Subspace Emissary files.
- REFF     Normally seen in files with AI data, such as CPU controlled characters and items.
- SCL0     No idea?...
- SHP0     (SHaPe) Vertex morph, an animation file used to change a character's facial expression.
- PAT0     (PATtern) Texture pattern, an animation file that switches textures to simulate an animated texture.
- Havok Physics     Physics engine files, used for many things including hair and cape physics.

Tutorials
Sorry but you are not allowed to view spoiler contents.


Now you should have a basic animation file, 1 frame without any animation data. Right-Click and export the NEWCHR animation (CHR0) so it can be hexed. Open up the animation CHR0 in your hex editor, any hex editor will work, I'll be using Notepad++ but the results will be the same. Assuming you didn't rename the CHR0, it should look more or less like this, depending on your view settings:
Sorry but you are not allowed to view spoiler contents.


So you might be thinking "i could never read what these random numbers mean!" but let's get into that right now. Since there aren't any animations in this file, it's pretty much empty. Open the animation in Brawlbox and change the Translation X keyframe value to 1, export the CHR0 and open it in hex again.
Sorry but you are not allowed to view spoiler contents.


You can see some changes here and there, but how do we find out what they mean? Thanks to Brawlbox, we know that this animation file has a single keyframe with a value of 1. That number (keyframe value, not amount of keyframes) was translated into a 8-digit value called a Float value, which can be translated with this webpage. Tools like these are a hexer's best friend.

Using that webpage, you can see that 1.0 in hexidecimal is 3F 80 00 00. You should be able to find that number in your hex editor: if not, then It's highlighted in the previous image. Any single number, even 99999 or 3.14, will be displayed as an 8-digit float value. If you change the keyframe value in Brawlbox, then the only difference will be that float value: everything else remains the same.

Now let's do something cool with your hex editor: Click on the beginning of the float value and type 44 a7 20 00, save and open in Brawlbox. You just hexed the keyframe value from 1 to 1337. Pretty neat, right?

This is what Brawl hackers do to change simple number values that aren't editable in Brawlbox, as well as hacking computer files in general. Try using your new knowledge of float values and hexing to change numbers in other Brawl files, or add more keyframes with numbers and see where each number ends up.

In the meantime, I'll set up the next tutorial about identifying file structures.



Download links:
HXD, a commonly-used hex editor.
Notepad++, a handy program based off of Notepad with a Hex Plugin.
Hexidecimal Number Converter (website, not a download)


File structures:

BLOC
Sorry but you are not allowed to view spoiler contents.


DAT (Event Data)
Sorry but you are not allowed to view spoiler contents.


SHP0
Sorry but you are not allowed to view spoiler contents.


Havok Physics
Sorry but you are not allowed to view spoiler contents.


PAT0
Sorry but you are not allowed to view spoiler contents.

Also, I want this second post, just in case.

And I'll take this last post too. No more needed.

ill add some stuff bout PAT0 files in the morning :P

mostly the header tho... im still going through the other sections in PAT0
https://privateladyescorts.com - Free Local Dating - No Selfie - Anonymous Casual Dating -   Video Chat Private Lady

Let's see..... we'll have this download link for the hex editor I use, HXD, and some basic tutorial writing for now.

Thanks for the info Nymph, I could use some of those header informations. I'll probably have to use some pages from the Mario Kart Wiki page for now

no problem! i've like fixed alot of V4 PAT0 files and they were able to open file in BB once replaced with the unfixed file... so yeah :P

edit:
btw i've added u on msn... so ya hope u got my invite lol
https://privateladyescorts.com - Free Local Dating - No Selfie - Anonymous Casual Dating -   Video Chat Private Lady

January 24, 2012, 07:35:23 AM #6 Last Edit: January 26, 2012, 08:27:11 PM by Nymph
this post is reserved by me


SCN0 Discussion:
Stage lighting, fog, and camera for stages! More soon to come

Header for brawl SCN0's:
QuoteVersion# Offset: 00x8
Frame Offset:
Loop Offset:
---------------------------------------------------------------------------------------------------
PAT0 Discussion:
(PATtern) Texture pattern, an animation file that switches textures to simulate an animated texture.

Sorry but you are not allowed to view spoiler contents.


---------------------------------------------------------------------------------------------------
From Pikazz helpful Info:
Sorry but you are not allowed to view spoiler contents.
https://privateladyescorts.com - Free Local Dating - No Selfie - Anonymous Casual Dating -   Video Chat Private Lady


There's a tutorial for hexing, I'll write one for file structures next.

PAT0 is already complete by me  :>.>palm: *looking for my files*
when a "nice looking form" by E_Y

EDIT: dont tell me that Smashboard deleted one section ;_;
Stupid Tinypic :C

Quote from: pikazz on January 24, 2012, 09:57:09 AM
PAT0 is already complete by me  :>.>palm: *looking for my files*

EDIT: dont tell me that Smashboard deleted one section ;_;
:srs:
dont tell me u dont keep a backup saved in a .txt file :notimp:
https://privateladyescorts.com - Free Local Dating - No Selfie - Anonymous Casual Dating -   Video Chat Private Lady

Quote from: Nymph on January 24, 2012, 10:01:49 AM:srs: dont tell me u dont keep a backup saved in a .txt file :notimp:
nope cause it was over one year old :oshi: cause it was on smashboard and I never though they would delete that section but I can redo it cause I still remember 70-75% of it without using an PAT0 file as a reference D:
Stupid Tinypic :C

Quote from: pikazz on January 24, 2012, 10:07:10 AM
nope cause it was over one year old :oshi: cause it was on smashboard and I never though they would delete that section but I can redo it cause I still remember 70-75% of it without using an PAT0 file as a reference D:
hmm.... well give me wat u kno... and ill add it then, but with major credit to u :P
https://privateladyescorts.com - Free Local Dating - No Selfie - Anonymous Casual Dating -   Video Chat Private Lady

I've joined your camp simply by being cool :vyse:

all I can contribute to here is my REFF template for HexEdit 4.0 =3=
(I'm on wii so I can't do anything other than tell you about it) X(

EDIT:
I could use some help in the Melee area >_>
(Me and Milun can't do it all)

you can DL UMC 2.6d and my last (crappy) HexEdit 4.0 template (it works) if your interested in learning the files
NOTE: everything in my template needs to be renamed...

I think I have a download over at Brawl Imports...
if not, then my src is on gist.github.com
(search for 'DAT Template' on google and look for the gist link)

EDIT2:
btw, I only keep backups of my informative format posts:
UMC TMP format
MDL0 format (v9 and v11 (soon to merge))
Melee DAT format (needs an update BADLY)
others that I can't quite rmbr atm :P

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

I might join. Also, there's a whole bunch of SSE filetypes to sift through.

FC: 2191-7379-6272