Experienced Elementalist
- Joined
- Dec 8, 2012
- Messages
- 265
- Reaction score
- 41
Hi Guys Today I'll Be Sharing Memory Allocation For Server
This is not yet complete but working 80% I'm still hooking it on asm.
Source
Hook
Function
This is not yet complete but working 80% I'm still hooking it on asm.
Source
int totalAllocMemory;
__declspec(naked) void NKD_PUSH02()//0x442E72
{
__asm
{
PUSH totalAllocMemory
PUSH 0x0C4C
MOV jmp_addr, 0x442E79
JMP jmp_addr
}
}
JMP_NEAR(0x442E72, NKD_PUSH02, 2);
Hook
int totalPlayers = 0;
int i = 0;
for(; i < MAX_PLAYER; i ++)
{
if(cUser.Status != OFFLINE) //offline = 0
totalPlayers++;
}
if(totalPlayers <= 0 || totalPlayers > MAX_PLAYER)
Log("An Error Has Occured While Allocating The Memory", "-DLL", FALSE);
totalAllocMemory = totalPlayers++;
JMP_NEAR(0x442E72, NKD_PUSH02, 2);
Function
totalAllocMemory --;