Author Topic: Extending HFL to ease memory hacking using CCF2 HookHelper  (Read 153 times)

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 963
Extending HFL to ease memory hacking using CCF2 HookHelper
« on: December 29, 2019, 06:39:06 PM »
I am thinking of pushing common memory hacks used in Outpost 2 missions into HFL. In the process, I wanted to provide a more general framework for future mission specific hacks. I think this already exists in the HookHelper contained in CCF2 and I'm assuming a lot of the other survivor missions. I think modifying and including HookHelper would work much better than antyhing I created on my own.

After pushing the HookHelper into HFL, I was going to push several of the general memory hacks contained in CCF2 into HFL and allow toggling them from a mission's main function. It would look something like:

Code: [Select]
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hinstDLL);
HFLInit();
DissableInitialAllyMessages(); // Stop each player from receiving ally messages at game start for coop missions
        HookPostMissionVideo(); // Show a movie at mission conclusion
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
HFLCleanup();
}

return true;
}

The target hacks would be optional items that one wouldn't want for every mission, but may be good to enable in specific instances. I wanted to add post mission videos to several of my missions, and this would allow that sort of activity without copy pasting the code everywhere.

All this would just be me formalizing things already created by others. I'm not sure if anyone minds?

I guess I'm asking if there is input from the community, (especially Arklon, sirbomber, or Hooman) before getting more in earnest in the work.

I have HFL toggling DissableInitialAllyMessages on my local copy of HFL, so it is certainly possible without a lot of work.

Thanks,

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4893
Re: Extending HFL to ease memory hacking using CCF2 HookHelper
« Reply #1 on: December 29, 2019, 08:28:51 PM »
Seems like a good idea. Kind of similar to the selection of common victory conditions offered by OP2Helper.

Would be curious to hear from people whose work it is.

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1225
Re: Extending HFL to ease memory hacking using CCF2 HookHelper
« Reply #2 on: December 30, 2019, 08:02:28 PM »
The CCF2 HookHelper and its OP2 patch code are quite out of date; I have since completely rewritten them. I don't think they should be rolled into HFL, particularly because Patcher (replacement for HookHelper) used by the rewrite brings in Capstone as a dependency, not that it's a terribly heavy one for what it is.
« Last Edit: December 30, 2019, 10:59:08 PM by Arklon »