Page 13 of 13

Posted: Sat Sep 29, 2012 4:52 pm
by TassadarZeratul
The "don't ensnare robotic units" EXE edit was used in one of my mods, but I thought it wasn't fair to have something so specific in 1161.FGD. So I removed it.
Not fair? It could be useful, and it would allow others to see how you did it.

2 questions. First, I would like to be able to change the unit summoned by Spawn Broodlings, but with a plugin. Obviously the address to write to must be known, as there's an EXE Edit for it; how do I find the address in FireGraft's data files to use it in my plugin? Second, I'd like to make an edit/plugin that removes the splash from Recall, so that it only affects units it is directly cast on. (Sounds dumb, I know. >.> ) How would I go about that?

Posted: Mon Oct 01, 2012 7:33 am
by pastelmind
TassadarZeratul wrote:Not fair? It could be useful, and it would allow others to see how you did it.
Yeah, well, it wasn't a big deal, really. Nowadays I would use a plugin to do it.

TassadarZeratul wrote:2 questions. First, I would like to be able to change the unit summoned by Spawn Broodlings, but with a plugin. Obviously the address to write to must be known, as there's an EXE Edit for it; how do I find the address in FireGraft's data files to use it in my plugin? Second, I'd like to make an edit/plugin that removes the splash from Recall, so that it only affects units it is directly cast on. (Sounds dumb, I know. >.> ) How would I go about that?
(1) Open data.mpq and extraact the Firegraft/1161.fgd file. It's a text file (open with Notepad) that contains all of the EXE edits and their offsets. As for the Spawn Broodlings unit ID, I think you'll have to overwrite 0x004f4a0a and 0x004f49eb (both 1 byte) with the unit ID.

(2) It's hard to explain, but when I made the "remove splash from Ensnare" change, I redirected a call to EnsnareHit() with a call to EnsnareProc(). I think the same would work with Stasis Field.

Try examining the analysis of StarCraft.exe (IDB file), kindly provided by Heinermann. You'll need a copy of IDA Pro (w/ Hex-Rays disassembler) and open the IDB file with it.

Posted: Tue Oct 02, 2012 6:21 pm
by TassadarZeratul
The mod crashes as soon as I write to either of those addresses. >.> There's an error message, which says that it's crashing because it wrote to those addresses. ("The instruction at whatever referenced memory at 0x004f49eb" or similar.)

EDIT: Though, I did look at the file and yes it would seem that those are the correct addresses...?

Posted: Wed Oct 03, 2012 2:15 am
by pastelmind
To write to memory that is part of the executable code, you need to modify the memory protection of that particular address with VirtualProtect(). See the code for JmpCallPatch() in game.cpp:


Code: Select all

void JmpCallPatch(void *pDest, int pSrc, int nNops = 0) // From BWAPI by Kovarex
{
   DWORD OldProt = 0;
   VirtualProtect((LPVOID)pSrc, 5 + nNops, PAGE_EXECUTE_READWRITE, &OldProt);
   unsigned char jmp = 0xE9;
   memcpy((LPVOID)pSrc, &jmp, 1);
   DWORD address = (DWORD)pDest - (DWORD)pSrc - 5;
   memcpy((LPVOID)(pSrc + 1), &address, 4);
   for (int i = 0; i < nNops; ++i)
      *(BYTE*)((DWORD)pSrc + 5 + i) = 0x90;
   VirtualProtect((LPVOID)pSrc, 5 + nNops, OldProt, &OldProt);
}


Here, the function temporarily modifies the protection level of the memory at pSrc to PAGE_EXECUTE_READWRITE.

Posted: Wed Nov 14, 2012 1:51 pm
by pastelmind
It's been quite a while since the last update. Changes this time:

  • You can now (partially) modify the unit blacklist for Mind Control. By default, Spider Mines, Larvae, Eggs, Cocoons, and Lurker Eggs are blacklisted.
  • "Allow buildings to be Mind Controlled" has been changed to "Exclusion flag check for Mind Control".

The second change allows you to make Mind Control work on ground units only. Also, I wonder why Blizzard didn't want Spider Mines/Eggs/Cocoons to be Mind Controllable?

Re: 1.16.1 Fgraft exe edits

Posted: Sat Feb 02, 2013 11:14 pm
by bajadulce
Spent a good hour fixing up this thread.
WOW must say am very impressed at how much work Pastlemind put into this! :wub:
Will definitely have to find time to utilize all of this hard work and put it to some creative use.

firegraft_2012.11.14.zip is the most current update I could find.

Re: FireGraft 1.16.1 (exe edits)

Posted: Tue Feb 05, 2013 11:39 pm
by MofoMan2000
Great thread, I've been looking for an updated FireGraft all day. Good to finally find one.

Re: FireGraft 1.16.1 (primarily exe edit discussion)

Posted: Fri Feb 08, 2013 5:50 pm
by bajadulce
Pastlemind:
In your snooping around Scraft, did you happen to notice where the race selection box's default setting "random" might be?

If you recall in older versions of Starcraft, the race selection box used to be "Zerg" by default. Somewhere in a later patch it was changed to "Random". It would seem possible then, that an exe edit could change that back to Zerg or possibly even another race such as Terran.

I've attempted to look for this several times, but the answer has eluded me. Heinermann gave me good info on where to look and made a little bit of progress, but I never managed to come up with anything even w/ his help.

Re: FireGraft 1.16.1 (primarily exe edit discussion)

Posted: Mon Oct 30, 2017 10:05 am
by orochi114
guys... where can i find your attachments... they are gone now.
each attachement is replaced by:
Edit: File became outdated and subsequently removed.
:(