Your idea is good, it's good that we have a number of brains to think about things, but I think it'd be difficult to implement, because it'd take disassembling and debugging, which would be harder than searching memory for the StarDraft idea, and also I'm not sure if there is any invalidate functionality in StarCraft. I think that StarCraft caches everything, except for a few exceptions like SMK files which are never loaded into memory as a whole. Those were the files that StarDraft couldn't patch.
At the moment it still looks like we should do what StarDraft did and overwrite files in memory. It's already been invented so I'm expecting that's the easiest thing to do at the moment.
Now I'll answer all your other questions...
QUOTE(Tuxedo-Templar)
Trouble is, I don't know how to hack squat lol.
Here's the basic idea.
Usually we get memory addresses by using a program to search a program's memory while it's running. So if you know your minerals are 112 at the moment, then you use a program to search the memory for 112, and then you change your minerals to say, 128, and then narrow down your search for memory locations that have changed to 128, and keep narrowing down until you have one memory location.
That's the main tool because it's faster and easier. Reading disassembled code is a lot harder to understand, it's really long, boring, and you can't really tell what it's doing because it's quite low level. For those I usually just look at string or DLL references and look at the code around them. String references or DLL references are like little beacons in the code for humans that say things like "This code is reading the string 'Psi limit exceeded'" and so they give you a place to start looking. I have found some useful memory locations for other games by doing this, but I have disassembled StarCraft several times before and found no obvious places to look in the code. StarCraft is not as simple as the other games I've disassembled, so I often wonder how everyone else managed to create programs like MPQDraft.
QUOTE(Tuxedo-Templar)
That goes to whoever knows disassembling, and has the patience to map out all the addresses SC uses to hold stuff in memory. After that, the task of changing whats at those addresses at the right moment (as the game starts on bnet) is the next challenge.
Well, what I had expected to do was, we'd search the memory for the original units.dat file, and then we'd see what would happen if we overwrote that. The program to do this should only take about an hour or less to make to be honest. Then we'd restart the game and search for units.dat, and see if its memory location changed. If it did, what I was thinking is, somewhere in StarCraft's memory there would probably be the string "arr\units.dat" or its MPQ hash code, and somewhere near that would be a pointer, so we'd just search for that and look at the memory around it.
I would think next we'd make our own SCM or SCX with a arr\units.dat file in it and see if we could find the SCM/SCX data in memory, and if we could we'd next have to try extracting it and reading it like an MPQ, extracting arr\units.dat out and overwriting it back into the system using what we learnt from the last experiment.
Finally we'd expand to try to overwrite all files, not just arr\units.dat. That plan I just wrote doesn't sound too hard to do at the moment, but I bet something will be different from what I expect it to.
QUOTE(UED77)
Does it mean that once it finds a file in a higher priority location, then it won't look for one anymore, and will go with that version, or does it mean that it reads the "list" backwards, starting with the lowest priority, and overwrites it if it finds a higher-priority one?
Hi UED77!
I have always been told it goes from highest to lowest. I'll have to think about that though, I can't think of a reason why a Blizzard programmer would want to waste memory by making it read backwards. Also, perhaps your CD would be more active during the game if it always read backwards like that.
QUOTE(UED77)
Are parts of the actual scenario data loaded into memory, or is it read directly from the scenario.chk? Will it be possible to replace not only "mod-related" game data in the memory, but also scenario data such as the string table, positions of locations, unit stats, etc.?
I think staredit\scenario.chk is one of those files I was mentioning before that is never fully memory (and so cannot be patched by StarDraft, not that it matters). However, unit stats, location positions, and everything else can still be edited. I have written StarGraft code to change unit stats mid-game, just for fun. Anything in memory can be edited with the right amount of knowledge.
QUOTE(LegacyWeapon)
Does StarDraft technology include "un-modding" the game?
Unfortunately not. The AutoModder will have to be clever enough to overwrite modded files with their originals.
QUOTE(Heimdal)
By the way, I'd strongly suggest doing this project in C++ - you have much more control over memory.
C++ would be fine if we were going to use a lot of pointers or something, but I was expecting that we'd be using those Win32 APIs to peek and poke memory of another process, so the main thing we'd be looking for when choosing a programming language would be one that had good data handling facilities. Perhaps we will choose C++ in the end, but I was hoping for C#...