-
Notifications
You must be signed in to change notification settings - Fork 3
/
CountSetBits - 8 byte.reg
227 lines (88 loc) · 3.06 KB
/
CountSetBits - 8 byte.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Cheat Engine\CustomTypes\CountSetBits 8byte]
"Script"="// mgr.inz.Player http://forum.cheatengine.org/viewtopic.php?t=565981
alloc(ConvertRoutine,1024)
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(PREFEREDALIGNMENT,4)
TypeName:
db 'CountSetBits 8byte',0
ByteSize:
dd 8
PREFEREDALIGNMENT:
dd 4
label(dat55)
label(dat33)
label(dat0f)
ConvertRoutine:
[32-bit]
push ebp
mov ebp,esp
mov eax,[ebp+8]
movq mm0,[eax]
movq mm1,mm0
psrlq mm1,01
pand mm0,[dat55]
pand mm1,[dat55]
paddq mm0,mm1
movq mm1,mm0
psrlq mm1,02
pand mm0,[dat33]
pand mm1,[dat33]
paddq mm0,mm1
movq mm1,mm0
psrlq mm1,04
paddq mm0,mm1
pand mm0,[dat0f]
movq mm1,mm0
psrlq mm1,08
paddq mm0,mm1
movq mm1,mm0
psrlq mm1,10
paddq mm0,mm1
movq mm1,mm0
psrlq mm1,20
paddq mm0,mm1
movd eax,mm0
and eax,7f
pop ebp
ret 4
[/32-bit]
[64-bit]
push rbx
mov rax,[rcx]
mov rbx,rax
shr rbx,1
and rax,[dat55]
and rbx,[dat55]
add rax,rbx
mov rbx,rax
shr rbx,2
and rax,[dat33]
and rbx,[dat33]
add rax,rbx
mov rbx,rax
shr rbx,4
add rax,rbx
and rax,[dat0f]
mov rbx,rax
shr rbx,8
add rax,rbx
mov rbx,rax
shr rbx,10
add rax,rbx
mov rbx,rax
shr rbx,20
add rax,rbx
and rax,7f
pop rbx
ret
[/64-bit]
ConvertRoutine+300:
dat55:
dq 5555555555555555
dat33:
dq 3333333333333333
dat0f:
dq 0f0f0f0f0f0f0f0f
"