complied & Place to the root directory of Dragon nest
Code:
//cl GPKitClt.cpp /Zl /O2 /LD
#include "windows.h"
EXTERN_C BOOL WINAPI _DllMainCRTStartup(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
{
return TRUE;
}
__declspec(dllexport) void API_init();
__declspec(dllexport) void API_unused();
void func3arg();
void func1arg();
typedef struct{
void* link;
void* func3a;
void* unknown;
void* func3b;
void* func1;
} data;
data d;
data *dp;
__declspec(naked dllexport) void API_init()
{
__asm{
pop eax
add esp, 8
push eax
}
dp = &d;
d.link = &(d.func3a);
d.func3a = func3arg;
d.func3b = func3arg;
d.func1 = func1arg;
__asm{
mov eax, dp
retn
}
}
__declspec(naked dllexport) void API_unused()
{
__asm{
pop eax
push eax
mov eax, 1
retn
}
}
__declspec(naked) void func3arg()
{
__asm{
pop eax
add esp, 12
push eax
mov eax, 1
retn
}
}
__declspec(naked) void func1arg()
{
__asm{
pop eax
add esp, 4
push eax
mov eax, 1
retn
}
}