1.13c Pointer and struct for Spawn a Monster ?
Moderators: Nefarius, Havvoric
-
- Posts: 17
- Joined: Sun Feb 26, 2017 8:29 pm
1.13c Pointer and struct for Spawn a Monster ?
Someone has pointer and struct for spawn a monster ?
Re: 1.13c Pointer and struct for Spawn a Monster ?
I use PlugY Source
Function:
Stub:
Function:
Code: Select all
D2FUNC(D2GAME, D2SpawnMonster, DWORD, __fastcall, (Game* ptGame, Room* ptRoom, DWORD zero1, DWORD x, DWORD y, DWORD minusOne, DWORD superuniqueID, DWORD zero2), 0x24950)
Code: Select all
NAKED DWORD __fastcall D2SpawnMonster(Game* ptGame, Room* ptRoom, DWORD zero1, DWORD x, DWORD y, DWORD minusOne, DWORD superuniqueID, DWORD zero2)
{
__asm
{
PUSH DWORD PTR SS:[ESP+0x10]
PUSH DWORD PTR SS:[ESP+0x10]
PUSH DWORD PTR SS:[ESP+0x10]
PUSH EDX
PUSH ECX
MOV EAX,DWORD PTR SS:[ESP+0x18]
MOV EDX,DWORD PTR SS:[ESP+0x2C]
MOV ECX,DWORD PTR SS:[ESP+0x28]
CALL D2GAME_D2SpawnMonster
RETN 0x18
}
}
- kidpaddle94
- Principality
- Posts: 2057
- Joined: Thu Aug 13, 2009 2:54 pm
- Location: localhost
Re: 1.13c Pointer and struct for Spawn a Monster ?
You can use this function. Technically the function is a fastcall function you can use as is without any stub, but I stubbed it to reorder args
Code: Select all
__declspec (naked) Unit* __fastcall D2GAME_SpawnMonster(Game* pGame, DrlgRoom* pRoom, int nMonster, int nMode, int nPosX, int nPosY, int nA7, int nA8)
{
/*
push nA8
push nA7
push nPosY
push nPosX
push pRoom
push pGame
mov edx, nMode
mov ecx, nMonster
call D2GAME_6FD0F650
*/
__asm
{
push [esp+0x18]
push [esp+0x18]
push [esp+0x18]
push [esp+0x18]
push edx
push ecx
mov edx, [esp+0x20]
mov ecx, [esp+0x1C]
call D2GAME_6FD0F650
retn 0x18
}
}