Is there a high-level overview of CvGameCoreDLL?

Well, as I said, Dependency Walker can provide a list of all exports and a list of exports that it thinks are actually called by the .exe
:wallbash: I have more or less written a perl script to do just that. However DW looks more trustworthy than my proof of concept script.

After that though I'm not sure what to do. I don't relish the idea of removing over 1000 DllExport's by hand, but otherwise you'd need to parse the C++ code somehow... Perhaps a simple but imperfect parser can be made, and then the remaining entries handled by hand?
Perl script to loop all .h files. Read them into an array of lines, loop that one and modify the lines containing DllExport if needed. Write the result back into the filename it just read from. I already have working scripts, which read through files line by line meaning the only real work is to write code that compares a line with the output of DW.
 
I too was about to embark on a journey of decompiling, when I decided to ask on Stackoverflow and thus found DW. Nice tool. :) Although I think it should be possible to fool it, if enough pointer trickery is involved. Let us hope this isn't the case.

Parsing line by line - would that work? Hmm... I guess you could look for lines that contain both "DllExport" and one of the "bad" names in it... but I'm not sure how accurate that would be. Couldn't there be two similarly named functions in different classes? The context (which class the function belongs to) should also be considered. So, the previous line with "class" in it should be considered... Sounds like it's worth a try! :)
 
Although I think it should be possible to fool it, if enough pointer trickery is involved. Let us hope this isn't the case.
I have a hard time imagine how that would work. If you have the function, it figures it out. If you declare a function pointer and set it to a function, the exe will still contain a reference to the function. I think it would have to be quite advanced pointer garbage to fool it.

Parsing line by line - would that work?
YES
So, the previous line with "class" in it should be considered... Sounds like it's worth a try! :)
That's the strategy I was planning on, but failed to mention.

Looking a bit at DW output, I have changed my plan. I read that file and make an array of functions for each class. In that class, it will then also check if parameters match and make sure all functions are present.

Next question is when I will actually start making such a script. But at least I have a plan. Also I will upload the script once I get it to work (which is what I usually do).
 
Pointer trickery - not that much, I think. If you start to use GetProcAddress() (quite conceivable in a plugin-related scenario), do you think that DW would be able to pick it up? I don't know, but I wouldn't be surprised if not.

Anyways, nice to hear that you've got a plan! :) I'm looking forwards to a clean CvGameCoreDLL! :)
 
Back
Top Bottom