Sometimes when I'm bored i like to open up random files(notepad) and see what makes them tick(How games save data etc.) So when i open some files ex: a save file it some times contain data like
*Ø[NUL][NUL][NUL][NUL][GS][ACK][NUL][NUL][NUL]
what does this mean, i know NUL means nothing but it's obviously a reason why it says NUL and why do people write it like that why not just use normal letters?
No advanced answer wanted just say if its binary and the notepad can't read it or something.
Duh! Its because the mass of the flux spectrometer is at 80% and the capacitor is at 53*
On the serious note, Nul means there is nothing there. I would think it is just a space. Like...
This > < is a space
I had a hard time understanding this too. From what I gather it's going to be quicker to read in 4 bytes for an int than trying to parse a number and putting it into an int. If not quicker, the file size would be smaller.
[img]http://scienceblogs.com/insolence/upload/2009/10/data_weeps_does_brent_spiner_have_anti-v/DataHolmes.jpg[/img]
Data is on the case.
Take some nuls out and put some in at random places after [gs] or something. Also add numbers.
Broke my automerge :(
[editline]06:59PM[/editline]
OR. It could be a sign of co-ordinates like....
To get to the middle of the map and it is on a scale of 10 Grid Reference... That means it would be [NUL][NUL][NUL][NUL][NUL][GS][NUL][NUL][NUL][NUL][NUL]
GS Meaning change axis...
Nvm, i found it it's all representations of ASCII code, apparently GS means group separator and ACK stands for acknowledge? would still like to know why programmers use these weird signs so much though :/
(I'm making a small game and analyzing different ways of making a save file)
Could be binary. It's very efficient for files that only the program has to read and write to.
Probably only binary, and those characters are their seemingly random ASCII representations. The first few characters in the ASCII table are stuff like that that mean ltos of things like new lines ,escape characters, the such.
It's a binary data file. You aren't going to learn much of anything looking at it in Notepad, especially if you expect the program to treat it as an ASCII string (which it isn't).
If you really want to know how the program parses the data, reverse the program, don't try to analyse random data.
I'm not trying to reverse engineer the program just trying to see how the pros are setting up their save files.
[QUOTE=chrbarrol;21331159]I'm not trying to reverse engineer the program just trying to see how the pros are setting up their save files.[/QUOTE]The point is, you're not going to see that looking at random binary data. If you want to see how this program stores that data, and it's source code isn't available, you'll need to reverse the function(s) in the program that handle the data.
If you want to see how people save data to the disk, this isn't exactly the best learning experience.
[QUOTE=chrbarrol;21331159]I'm not trying to reverse engineer the program just trying to see how the pros are setting up their save files.[/QUOTE]
Then read the file in binary. Their ASCII representation means nothing to no-one. Those symbols weren't picked by the programmers, they're coincidence.
Using a language like C, you open the file in binary mode and read in data as bytes.
So if you want to read in a number you'd do something like:
[code]
FILE *f = fopen("binfile", "rb");
int num;
fread(&num, 4, 1, f);
[/code]
That's telling it to read the next 4 bytes in the file, and store it into the int named num. You can than use this number like any other normal number.
int isn't necessarily four bytes though, you should use sizeof(int) if you really wanted to read an int, or int32_t if you wanted to read a four byte integer (defined in stdint.h).
The NULL might be a representation of ASCII's '\0' character, which delineates the end of a string.
[QUOTE=Kirth;21350102]The NULL might be a representation of ASCII's '\0' character, which delineates the end of a string.[/QUOTE]
Those are called C strings; as such, most programming languages don't actually do that. There's no ASCII '\0' character (although 0 is defined as the NUL character), but in many programming languages with C style character escape sequences you can use the escape sequence \0 for the null-terminating character.
[QUOTE=Kirth;21350102]The NULL might be a representation of ASCII's '\0' character, which delineates the end of a string.[/QUOTE]It's 0x00, which is what compilers escape '\0' to. But in this file, it doesn't actually mean anything as a symbol. It's a binary data file, it isn't meant to be read as an ASCII string.
Sorry, you need to Log In to post a reply to this thread.