-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbig endian - double.reg
More file actions
224 lines (95 loc) · 4.12 KB
/
big endian - double.reg
File metadata and controls
224 lines (95 loc) · 4.12 KB
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
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Cheat Engine\CustomTypes\Double Big Endian]
"Script"="// http://forum.cheatengine.org/viewtopic.php?t=551054
// \"it's not a perfect conversion\"
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(UsesFloat,4)
alloc(PreferedAlignment,4)
alloc(TEMPVAL,8)
TypeName:
db 'Double Big Endian',0
ByteSize:
dd 08
UsesFloat:
dd 01
PreferedAlignment:
dd 04
TEMPVAL:
dq 00
ConvertRoutine:
[32-bit]
push ebp
mov ebp,esp
//[ebp+8]=input
//example:
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax]
bswap eax
mov [TEMPVAL+4],eax
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax+4]
bswap eax
mov [TEMPVAL],eax
/*
// caused crash at one time, doesn't use SSE (newer instruction set)
finit
fld qword ptr [TEMPVAL]
fstp dword ptr [TEMPVAL]
*/
cvtss2sd xmm0,qword ptr [TEMPVAL]
movsd dword ptr [TEMPVAL],xmm0
mov eax,[TEMPVAL]
pop ebp
ret 4
[/32-bit]
[64-bit]
//rcx=address of input
mov rcx,[rcx] //rcx now contains the bytes 'input' pointed to
bswap rcx
mov [TEMPVAL],rcx
finit
fld qword ptr [TEMPVAL]
fstp dword ptr [TEMPVAL]
mov eax,[TEMPVAL]
ret
[/64-bit]
ConvertBackRoutine:
[32-bit]
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
//example:
push eax
push ebx
mov ebx,[ebp+c] //load the address into ebx
finit
fld dword ptr [ebp+8]
fstp qword ptr [TEMPVAL]
mov eax,[TEMPVAL+4]
bswap eax
mov [ebx],eax //write the value into the address
mov eax,[TEMPVAL]
bswap eax
mov [ebx+4],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]
[64-bit]
//ecx=input
//rdx=address of output
mov [TEMPVAL],ecx
finit
fld dword ptr [TEMPVAL]
fstp qword ptr [TEMPVAL]
mov rax,[TEMPVAL]
bswap rax
mov [rdx],rax //place the integer the 8 bytes pointed to by rdx
ret
[/64-bit]
"