forked from igroglaz/a2mgr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
class_mapobject.cpp
75 lines (67 loc) · 1.25 KB
/
class_mapobject.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "class_extend.h"
#include "class_mapobject.h"
#include "utils.h"
CEMapObject* _stdcall CEMapObject_Create()
{
return new CEMapObject();
}
void CEMapObject_Copy(CEMapObject* first, CEMapObject* second)
{
}
CEMapObject::CEMapObject()
{
log_format("object created.\n");
}
CEMapObject::~CEMapObject()
{
log_format("object destroyed.\n");
}
// CMapObject:
// 464CC0 == constructor
// 464F02 == copy constructor
// 472D10 == destructor
// inject to: 464EEA
void _declspec(naked) iCMapObject_Construct()
{
__asm
{
call CEMapObject_Create
push eax
push eax
mov eax, [ebp-0x1C] // this
push eax
call AssociateObject
mov eax, [ebp+0x08]
call GetAssociated
pop ebx
push eax
push ebx
call CEMapObject_Copy
mov [ebp-0x04], 0xFFFFFFFF
mov eax, [ebp-0x1C]
mov ecx, [ebp-0x0C]
mov fs:[0], ecx
mov esp, ebp
pop ebp
retn 4
}
}
// inject to: 465380
void _declspec(naked) iCMapObject_CopyConstruct()
{
__asm
{
/*call CEMapObject_Create
push eax
mov eax, [ebp-0x14] // this
push eax
call AssociateObject*/
mov [ebp-0x04], 0xFFFFFFFF
mov eax, [ebp-0x14]
mov ecx, [ebp-0x0C]
mov fs:[0], ecx
mov esp, ebp
pop ebp
retn
}
}