-
Notifications
You must be signed in to change notification settings - Fork 3
/
RPG maker vx.reg
95 lines (72 loc) · 4.29 KB
/
RPG maker vx.reg
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Cheat Engine\CustomTypes\RPG maker VX]
"Script"="-- http://forum.cheatengine.org/viewtopic.php?p=5456447 (thanks DB)
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(PreferedAlignment, 4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
TypeName:
db 'RPG VX type',0
ByteSize:
dd 4
PreferedAlignment:
dd 1
//The convert routine should hold a routine that converts the data to an nteger (in eax)
//function declared as: stdcall int ConvertRoutine(unsigned char *input);
//Note: Keep in mind that this routine can be called by multiple threads at the same time.
ConvertRoutine:
[32-bit]
push ebp
mov ebp,esp
push ecx
mov ecx,[ebp+8]
[/32-bit]
//at this point ecx contains the address where the bytes are stored
//put the bytes into the eax register
mov eax,[ecx] //second fun fact, addressing with 32-bit registers doesn't work in 64-bit, it becomes a 64-bit automatically (most of the time)
shr eax,1 //shift right by 1 bit (divide by 2)
//and now exit the routine
[64-bit]
ret
[/64-bit]
[32-bit]
pop ecx
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
[32-bit]
push ebp
mov ebp,esp
push edx //save the registers
push ecx
mov edx,[ebp+0c]
mov ecx,[ebp+08]
[/32-bit]
//at this point edx contains the address to write the value to
//and ecx contains the value
push eax
push edx
mov edx,[edx] //edx now contains the original value
and edx,1 //only save the first bit
mov eax,ecx //eax gets the user input value
shl eax,1 //shift left by 1 bit (multiply by 2)
or eax,edx //add the bits of the original value
pop edx
mov [edx],eax //write the new value into the old value
pop eax
[64-bit]
//everything is back to what it was, so exit
ret
[/64-bit]
[32-bit]
//cleanup first
pop ecx
pop edx
pop ebp
ret 8
[/32-bit]
"