Hey, ProgrammerGuy here. I'm pretty new to C++, but I've read a couple basic tutorials and done a little bit of programming.
But the main reason I started learning C++ was to make a graphics decompressor for an old video game...
I know it would require reading hex bytes from the game, as well as inserting hex bytes to the game. So how would I go about writing hex bytes to a certain position of the game and reading hex bytes from the game to an array?
Also, how would I go about deleting and inserting hex bytes using C++?
Basically, knowing the stuff I mentioned above, would make it easier for me to write the decompressor as I already know how the routine works in ASM. Even if you guys just link to tutorials, it will help.
The end program would basically take a compressed graphics file from a game and decompress it.
What sort of "Old" video game?
and just how old are you talking about?
Is it DOS? Is it PRE-DOS/ Post DOS? Is it Encrypted, and if so, then do you already the the required keys?
Have you considered streaming the output to a file for editing and re-working?
Do you have access to the source code?
Sure, you can insert bites into compiled code, but it ain't an easy task, as you're more likely to crash it than not. - Provided you can locate it's data store.
Maybe you might try to de-compile it and post it - (provided that that is allowed in this forum- chk with admin 1st) and then de-bugging THAT code wold be a lot easier.
You just need to open the file for input in binary mode.
The concept of hex here is just a convenience to make the data legible to humans.
You simply read the byte or bytes from the file. After that your program can compare it to another byte. If you choose to specify the value in hex or decimal makes no difference to the end result, since by the time it has been compiled, it is in binary format in any case.