Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

reverse-engineering a file format

Name: Anonymous 2007-02-05 15:05

I don't know if this belongs in /prog/... since I intend to write a viewer for the (unnamed game's) environments, though, I suppose it does.

When reverse-engineering a file format in a certain game that holds the world data, what sort of things should I take into account considering it's a game that runs on PS2 architecture?

As the game would be slow loading its areas if it did a bunch of field-size conversions during load-time, the DVD would likely store its data as the PS2 hardware would most readily see it... for lack of a better way to put it.  This is what I have to determine first before I even consider figuring out the file structures through trial and error.... For example, would vertices (x,y,z,etc) values more likely to be stored as 32-bit floats or 64-bit floats, going by the PS2's FPU specifications?  And what about endianness?  Does the PS2's math registers store numbers in big-endian or little-endian?  And, *if* different from the endianness on my own computer, then how come ASCII text strings in binary files don't look all switched-around?

Name: Anonymous 2007-02-05 15:13 (sage)

for teh (unnamed game's) environments

If you don't tell us what game it is, how can we help? anyway, gtfo

Name: Anonymous 2007-02-05 15:38 (sage)

64-bit floats are for SCIENCE not games

Name: Anonymous 2007-02-05 16:18

Reversing fileformats on the PC is easy for me -- since I know how files are usually written.

Reverse-engineering something for a mysterious architecture?  I think not.

Name: Anonymous 2007-02-05 16:34

And, *if* different from the endianness on my own computer, then how come ASCII text strings in binary files don't look all switched-around?

First of all, they're probably not ASCII at all, which is a 7-bit character set, but rather some 8-bit set, like windows latin, or whatever.

Anyways, endianness affects how bytes are ordered in values that require more than one byte to hold, like utf-16 characters, which come in both big-endian and little-endian flavor. 8-bit characters require a single byte to hold (you should know this), so they're not affected by endianness.

Name: Anonymous 2007-02-05 16:51

TELL US WHICH GAME OR FUCK OFF

Name: Anonymous 2007-02-05 16:51 (sage)

>>4
Fileformats differ very little between architectures. For general formats, you usually only need to pay attention to endianness. Of course things like textures and audio often are stored in a very architecture-specific way, but you can usually still easily figure out the headers.

Disassembling executables and figuring out what they do with the files also tends to help (PS2 = MIPS = easy). If you're really lucky there could even be some debugging info left (like a symbol table).

Name: Anonymous 2007-02-07 17:20

MIPS = Big-endian
PS2 = 64-bit MIPS (thus 64-bit float.)

>>3
LOL FAIL GB2/b/

Name: Anonymous 2007-02-07 17:23

>>8

Floating-point units don't necessary have the same bit width as the machine's integer arithmetic registers.

Floating point registers on modern Intels are 80-bit, be it on a 32-bit or 64-bit architecture.

Name: Anonymous 2007-02-07 17:41

>>9
They should have extended it from 80 to 128 on the 64-bit arch. :(

What a missed opportunity.

Name: Anonymous 2007-02-07 17:43 (sage)

>>8
fp registers are usually big, yes, but that's irrelevant. this is about file formats, and for games storing 64-bit floats is very wasteful.

fail more, retard.

Name: Anonymous 2007-02-07 17:48

>>11
why are you so mean ;__;

Name: Anonymous 2007-02-08 2:36

>>11
Truth, games don't need that level of accuracy, and they will probably be converted to 32-bit floats before they are sent to the graphics card anyway.  If the card supports 64-bit floats, then it takes twice as long to send the data instead.

Name: Anonymous 2007-02-08 4:48

>>12

Shut up, you useless shit. This is no place for your whining.

Name: Anonymous 2007-02-08 19:36

>>14
FATALITY

Name: Anonymous 2009-01-14 14:05

Slower then Ruby

Name: Anonymous 2009-03-06 15:16


come today I think Intel has budgeted!

Name: Anonymous 2009-03-06 15:53

>>8
I will see you there.

Name: Trollbot9000 2009-07-01 8:47

Fail hard 9 There.

Name: Anonymous 2010-06-25 14:53

WARNING: NECRO POST

Name: Anonymous 2011-01-31 21:34

<-- check em dubz

Name: Anonymous 2011-03-22 23:27

almost all modern file formats designed for large files are compressed
it's almost always faster to load the compressed file and uncompress it than to load the raw file from slow media

the real way to do reverse engineer the file format, if you must, is to run an emulator and see what happens when the files are loaded and how the loaded data is used

Name: Anonymous 2011-03-23 6:13

>>23
Do you realise that >>1, his children and all of his grandchildren are likely already died because of age?

Name: Anonymous 2011-03-23 6:24

>>24
>mfw /prog/rider with children

Name: Anonymous 2011-03-23 8:27

>>25
'>mfw noko

Name: Anonymous 2011-03-23 9:38

>>25
>>26
>mfw when u got not faec

Name: Anonymous 2011-03-23 9:51

>>24
If you don't want to help, you are free to refrain from posting. We're posting here either way, so no point in whining about it.

>>1
First, I'd try this (very) blunt test: right-click the file (after copying all the files to a folder on your HDD), then select "Extract here". Yes, you read that right. That is, providing you have any decent archiving program with shell extensions. ``Decent'', as in, can extract archives inside files regardless of their extension. (For example, 7zip can extract the packages found in installation EXE files.)

This test is the lazy way of searching for valid archive headers in the files. It will most likely fail, but if it succeeds you're lucky as shit and things would start getting more interesting and a whole lot easier.

This actually works with countless games' data files.

Name: Sgt.Kabuչ᫱kiman龡ಶ 2012-05-28 22:16

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List