QUOTE(BroodKiller @ Nov 15 2006, 05:35 PM)
I wonder how does SCML hijack the SC functions? Did you use some sort of function call overloading, or do you look for a pointer to an original function and put your own data in-there?
[right][snapback]589736[/snapback][/right]
It is mostly just what people would call hooking the functions. Basically, the value containing the address of a function is changed to the address of another function. The functions in particular that SCMLoader puts hooks on are SFileOpenArchive, SFileCloseArchive, SFileOpenFile, and SFileOpenFileEx. SCMLoader does various things before and after calling the actual functions before returning control back to SC.
Under certain conditions in SCMLoader's version of SFileOpenFileEx, it calls some functions straight from Starcraft.exe, first doing some processing to check whether they need to be called or not. The addresses of these functions were provided to me by DiscipleOfAdun.
Hmm, there was somewhere on this forum I explained more in detail what SCMLoader does. I think I'll see if I can find that.
-EDIT-
Ah, here it is:
http://www.staredit.net/index.php?showtopi...02entry578702