Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: About HDMod dll plugin (started by sandruse in November 2025)
About HDMod dll plugin
sandruse
sandruse

Tavern Dweller
posted November 03, 2025 03:51 PM
Edited by sandruse at 16:10, 03 Nov 2025.

About HDMod dll plugin FOR HELP

Hello there! I try to create a small HDMod dll plugin. However, the game will crash when the logic run into the if area. Any Friend could help me? Thanks!

#include <stdint.h>
#include "patcher_x86.hpp"

Patcher* _P;
PatcherInstance* _PI;
static _bool_ plugin_On = 0;

int __stdcall SS(LoHook* h, HookContext* c)
{
   int SSName = *(int*)(c->ebp + 0x08);  // SS ID
   unsigned char SSLevel = *(unsigned char*)(c->esi + c->ecx + 0x0C9);  // Curent SS Level
   if (SSName == 11 && SSLevel == 1)// SKILL_EAGLE_EYE
   {
       // ADD Primary Skill
       *(uint8_t*)(c->ecx + 0x476) = 15;
   }
   __asm // The asm LoHook ocupy
   {
     add     al, byte ptr [ebp+0Ch]
     mov     [edx], al
   }
   return EXEC_DEFAULT;
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
 switch ( ul_reason_for_call )
 {
    case DLL_PROCESS_ATTACH:
       
       if ( !plugin_On )
       {
          plugin_On = 1;
          _P = GetPatcher();
          _PI = _P->CreateInstance("HD.Plugin.Rules_1.7");
          _PI->WriteLoHook(0x4E255D, SS);
       }

    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
       break;
 }
 
 return TRUE;
}

 View Profile
Jump To: Next Thread »
Post New Poll   Post New Topic   Post New Reply

Page compiled in 0.0230 seconds