I was cleaning out my desk drawer a little, and I came across an old binder. It was about an inch thick full of OP2 related stuff. Mostly a lot of printed pages of assembly that I was analysing at the time, but a few hand written pages too. It's all pretty much outdated and useless now, and I was thinking of throwing it out or using it as scrap paper, but after flipping through a few pages I couldn't help but feel a little nostalgic.
Just the first few pages had stuff from virtual function tables of units, to memory layouts of unit and technology info, and UNIT_PROP tags, to checksums and cheats, and what the EXE patches were (bytes changed, from what, to what, and why), to what looks like it was the plans for an early cheat detector but I'm not too sure anymore, to sizes of the exported classes, to calling conventions of the exported functions, and the memory layout of what function and data pointers to DLL code/data was where. It also had notes on how mines.txt was used, how GetSaveRegions should be used, what needed to be done to get BuildingGroups to work, and what oddities might popup, as well as some notes on the old NoCD patch that made actually having a CD useless rather than just not required. It also had a lot of details on network code, including important function addresses, network packet layouts, where internal IPs got encapsulated. It also had details on the internal Player class and where the CommandPackets were executed, and a little bit about the Filter class and user interface events.
And that was just the first few pages of mostly hand written notes. There were also a few nicely printed pages at the back on things like the network packet structure, the types of CommandPackets (before the table in the EXE that told us what they did was found), and a summary of EXE patches that were applied.
The main bulk of the binder is the assembly printouts. Lots of handwritten notes added off to the side, and a few diagrams of memory layouts or notes about what type of data structure was being used and how they worked. It covered code from starting SIGS and validation checking, to loading and parsing tech files, and some very interesting parts on how the data in the original VOL files gets decompressed. There were a few printouts of some of the files at that point. There was even a bit stream printed of part of morale.txt where the bits were broken down into the chunks that represented the output characters. I remember it being quite helpful in understanding how the code worked, especially since the representation of certain characters changed, due to the adaptive nature of the compression. There was also the checksumming algorithm for checking the EXE and the loaded data files, and locations of where things like the "ART" data was loaded. There's even a list of code locations where things get drawn, like the main map view, the mini map, the details pane, buttons, and BitBlt, CreateCompatibleDC, and CreateDIBSection are called. It's even got an attempt at deciphering what the name decoration used on the exported functions means (but there is a Windows API function that does this already, which I didn't know about at the time). Then there's a huge amount of code on CommandPacket processing, and details on how units are created (and wreckage in particular). Then there was a fairly detailed analysis of the network code that helped with the NAT-fix patches. And of course, the cheats. Nice details on how the game checks for cheat codes, including the hasing function, and what it does when the cheats were activated. I knew what the 4th cheat did long before I ever found a code to activate it.
Most of that stuff in now in posted txt files that are also backup up on many CDs, or in the OllyDbg comment file. Although, now that I've had another look through that stuff, I sort of wonder if there are a few things in there that aren't written anywhere else. Probably nothing of real great important though, or nothing that can't be figured out in a day. But a little bit here and there might add up I guess.