For those interested in extracting and unpacking game files, here is a great tutorial for making BMS Scripts by
ThatTrueStruggle over at
VG-Resource.com.
To quote: At first glance, creating a QuickBMS script seems very difficult. However, creating them is not very difficult! Throughout this tutorial, we'll go through a sample file, figure out the format and write a QuickBMS script in order to extract the contents.
Before we start, let's get prepared:
Download a Hex Editor, and get the sample file
demo_file.kyp (350 KB -
Mirror) that we'll be working on in this tutorial. My personal preference is H x D Editor, it's free and very lightweight, though anyone will do
Open up your hex editor and open the kyp file.
So first thing is to figure out the endianness. The endianness is the way bytes are read from the file. Take the value 0x0c80 for example. In Little Endian, this value would be read as 0x800c, so basically the value is read backwards. Big Endian is 0x0c80, so the value stays the same. So in order to figure out the endianness, there are a few ways to figure this out.
Look at the file and look for some definite values and compare.
- This is the method I use in order to figure out the endianness. Say I find a value that looks like a size. I can compare it to the file's actual size and see if it's correct. Or if I find a pointer to an offset, I can compare it to an actual value. If the value is reversed, then it's a Little Endian file. If it's a complete match, it's a Big Endian file.
- Guess if it's Little or Big.
I really don't recommend this, as this can lead to mistakes. I'd recommend just using the first method.
So using one the methods above, we can come to the conclusion that this is a Big Endian format. However we need to set this in our script. QuickBMS defaults to Little Endian so we need to set our script to run in Little.
So what we do is at the top of the script is write out the function, "endian big". This sets our script to run in Big Endianness.
endian big
Next, we need to read through the...