FireGraft 1.16.1 (primarily exe edit discussion)

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
TassadarZeratul
Posts: 19
Joined: Fri Jun 05, 2009 7:21 pm

Postby TassadarZeratul » Sat Sep 29, 2012 4:52 pm

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?
pastelmind
Posts: 57
Joined: Fri Nov 19, 2010 7:50 am

Postby pastelmind » Mon Oct 01, 2012 7:33 am

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.
TassadarZeratul
Posts: 19
Joined: Fri Jun 05, 2009 7:21 pm

Postby TassadarZeratul » Tue Oct 02, 2012 6:21 pm

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...?
pastelmind
Posts: 57
Joined: Fri Nov 19, 2010 7:50 am

Postby pastelmind » Wed Oct 03, 2012 2:15 am

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.
pastelmind
Posts: 57
Joined: Fri Nov 19, 2010 7:50 am

Postby pastelmind » Wed Nov 14, 2012 1:51 pm

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?
User avatar
bajadulce
Posts: 52
Joined: Fri Feb 01, 2013 7:02 pm

Re: 1.16.1 Fgraft exe edits

Postby bajadulce » Sat Feb 02, 2013 11:14 pm

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.
MofoMan2000
Posts: 6
Joined: Tue Feb 05, 2013 10:48 pm

Re: FireGraft 1.16.1 (exe edits)

Postby MofoMan2000 » Tue Feb 05, 2013 11:39 pm

Great thread, I've been looking for an updated FireGraft all day. Good to finally find one.
Last edited by Guest on Wed Feb 06, 2013 12:26 am, edited 2 times in total.
User avatar
bajadulce
Posts: 52
Joined: Fri Feb 01, 2013 7:02 pm

Re: FireGraft 1.16.1 (primarily exe edit discussion)

Postby bajadulce » Fri Feb 08, 2013 5:50 pm

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.
orochi114
Posts: 1
Joined: Mon Oct 30, 2017 9:30 am

Re: FireGraft 1.16.1 (primarily exe edit discussion)

Postby orochi114 » Mon Oct 30, 2017 10:05 am

guys... where can i find your attachments... they are gone now.
each attachement is replaced by:
Edit: File became outdated and subsequently removed.
:(

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest