There are 2 different ways to order bytes: One is known as Little-endian, where the lest significant byte is stored first.
Note: When you put bytes together to form larger data types, you need to think about what order the bytes are stored in (Endianness). Name:-Number of Bytes:-Values: (Can signed (- and +) or unsigned (just +))Ĭharacter-1-0 to 255 or -127 to 127 Here's a basic overview of the different common data types stored in binary files: These bytes, alone or in groups, can be use to represent all sorts or data from characters to numbers to strings of text. etc, represented in hexadecimal (base 16) notation, and on the right, the exact same bytes are represented as ASCII characters. Again, notice on the left side of the Hexplorer window you can see the individual bytes that make up the file 43 42 42 58 00 7E 42 BB. While a binary file may be a very long string of 1s and 0s (bits), for practical purposes they are treated as a string of 8-bit bytes. Now, before you go any further, it's important to understand about basic data types and how they are represented in a binary file. ğor our example, it can be guessed that the '.col' files in the 'col' directory contain collision data for the game's 3D models, because col is probably short for collision, and since most all the '.msh' files in the meshes directory that would need collision data have a corresponding '.col' file in the 'col' directory.
Is it an image file of some sort? Is it an audio file? Does it hold data for a 3D model? or maybe its an archive used to hold other files and folders? Once you know the type of data being represented in the binary file, you can start to figure out exactly how it's organized, and how to write a program to extract the data from the file. Now, the first thing you need to keep in mind when trying to analyze a binary file is what kind of data is the binary file going to contain. You're going to need both of these representations to analyze the file. On the left hand side is the hexadecimal representation of the contents of the binary file, and on the right is the exact same data, only represented as ASCII characters. Open the 'l' file with Hexplorer and you should see something like this: Inside the new 'z02LGI' folder should be another folder called 'col', the 'l' file should be inside this directory. After a short pause, this should create a folder named 'z02LGI' at the location you specified. Once you open the z02LGI.bod/z02LGI.bob archive with LI2Explore, in the LI2Explorer's menu bar under 'Edit' select 'Export' and then choose a location on your hard drive (I like to use my Desktop for things like this).
If you want to get this file for yourself, you'll need to download my LI2Explorer tool ( ) and use it to open the z02LGI.bod/z02LGI.bob archive located in the '_data' directory of the LEGO Island 2 folder (The path should be "C:\Program Files\LEGO Media\LEGO Island 2\_data"). The 'l' file from the 'col' directory inside the z02LGI.bod/z02LGI.bob archive.
You can analyze any binary file you want, but for this tutorial I'll be using a file from LEGO Island 2. You can also change the editor's text color scheme from this window as well.)
This should open a windows that lets you pick the font used by the editor. To fix this, launch Hexplorer, then in the menu bar, under "View" select "Options.". (Note: if you use Hexplorer, on some computers, the default font used by the program is too small to read. To start, you're going to need a hex editor. Analyzing binary files used by a video game (like LEGO Island 2) can be helpful for writing modding tools, because once you understand how the different binary file formats used by a game are structured, you (or someone you share the information with) can write a program to convert that type of file to a more usable format (for example: converting the binary LEGO Island 2 '.msh' format into the text-based and widely used '.obj' format). Segatendo wanted me to post a topic on this subject, so I've taken the liberty of writing a small tutorial on how to analyze binary files using a program called a 'hex editor'.