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;
}
|
|