-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatomic32.decls
More file actions
189 lines (106 loc) · 3.84 KB
/
atomic32.decls
File metadata and controls
189 lines (106 loc) · 3.84 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
.lib "atomic32.dll"
; Summ%(i1%,i2%) : "_Summ@8"
; debugbreak() : "_debugbreak@0"
;;;;; summ%(a%,b%) : "_summ@8"
;;;;; casX% (mem*, expectH, expectL, newvH, newvL) : "_casX@20"
;;;;; cmpxchg8bP%(mem*, expected*, newv*) : "_cmpxchg8bP@12"
summ% (a%,b%)
casX% (mem*, expectH, expectL, newvH, newvL)
debugbreak()
;;; ------ The following atomic functions were created by VirtLands ------ :
getsourcecode%(bank*, EIPstart%, EIPend%)
;;; GSC%(bank*, EIPstart%, EIPend%)
test11a%()
FuncPointer%() ;; ?????
Jmp%(address%)
JmpOut%(address%, preESP%); ;; ?????
getCS%() ;; returns the code segment (CS)
getDS%() ;; returns the data segment (DS)
getES%() ;; returns the extra segment (ES)
getFS%() ;; returns the FS segment
getGS%() ;; returns the GS segment
getESP%() ;; returns the stack pointer (ESP)
getEIP%() ;; returns the instruction pointer (EIP)
getSS%() ;; returns the stack segment (SS)
setESP%(v%);
RevBytesI%(a%)
RevBytesS%(a%)
meta%()
meta2i% (machinecode*, a%, b% ) ;;
meta2i_frame%(machinecode*, a%, b% ) ;;
;;atomic_meta%(mem*, expected%, newV%, offset%) ;; very experimental
atomic_meta_v1%(machinecode*, expected%, newV%, offset%);
atomic_meta_v2%(machinecode*, mem*, expected%, newV%, offset%);
cmpxchg8bP%(mem*, expected*, newv*)
cmpxchg_op% (mem*, expected%, newv%, opsize%) ;; opsize can be { 1,2,4 }
cmpxchg_op_off%(mem*, expected%, newv%, opsize%, offset%) ;; opsize can be { 1,2,4 }, offset is a byte offset into "mem"
cmpxchg_1%(mem*, expected%, newv%)
cmpxchg_2%(mem*, expected%, newv%)
cmpxchg_4%(mem*, expected%, newv%)
cmpxchg_1n%(mem*, expected%, newv%) ;; cmpxchg_1_n = NOT( cmpxchg1 )
cmpxchg_2n%(mem*, expected%, newv%) ;; cmpxchg_2_n = NOT( cmpxchg_2 )
cmpxchg_4n%(mem*, expected%, newv%) ;; cmpxchg_4_n = NOT( cmpxchg_4 )
;; 3 weird variations, ... The ZF is XORed into the sign bit of AL/AX/EAX ...
cmpxchgSBxor_1%(mem*, expected%, newv%)
cmpxchgSBxor_2%(mem*, expected%, newv%)
cmpxchgSBxor_4%(mem*, expected%, newv%)
;;---------------------------------------------------------------------------------
xchg_1%(mem*, v%)
xchg_2%(mem*, v%)
xchg_4%(mem*, v%)
AtomicAdd_1%(mem*,v%)
AtomicAdd_2%(mem*,v%)
AtomicAdd_4%(mem*,v%)
AtomicAdd_1o%(mem*,v%)
AtomicAdd_2o%(mem*,v%)
AtomicAdd_4o%(mem*,v%)
AtomicAdd_1z%(mem*,v%)
AtomicAdd_2z%(mem*,v%)
AtomicAdd_4z%(mem*,v%)
AtomicAdd_4nz%(mem*,v%)
AtomicAdd_1f%(mem*,v%)
AtomicAdd_2f%(mem*,v%)
AtomicAdd_4f%(mem*,v%)
;;;///////////////////
AtomicAdc_1%(mem*,v%,c)
AtomicAdc_2%(mem*,v%,c)
AtomicAdc_4%(mem*,v%,c)
AtomicAdc_1o%(mem*,v%,c)
AtomicAdc_2o%(mem*,v%,c)
AtomicAdc_4o%(mem*,v%,c)
AtomicAdc_1z%(mem*,v%,c)
AtomicAdc_2z%(mem*,v%,c)
AtomicAdc_4z%(mem*,v%,c)
AtomicAdc_1f%(mem*,v%,c)
AtomicAdc_2f%(mem*,v%,c)
AtomicAdc_4f%(mem*,v%,c)
;;/////////////////////////////////
;;;; clc() ;; Clears the carry flag ;; // ___THIS ONE DOESN'T WORK___
;;;; stc() ;; Sets the carry flag ;; // ___THIS ONE DOESN'T WORK___
Get_Eflags%() ;; Returns the Eflags (32-bit)
Test1%()
;;_______ The typical Pelles C IDE Settings for this project are as follows ::: _______
;;
;; __ COMPILER tab settings ::: __
;; Debug info: Full
;; Runtime library: Multithreaded(DLL)
;; Optimizations: Maximize speed
;; Floating-point model: Precise
;; Calling convention: __cdecl { -Gd }
;; Machine: X86
;; Inlining: Default
;; C Standard: C11
;; Enable Microsohft extensions
;; Enable Pelles C extensions
;; -- command line options (CCFLAGS): -std:C11 -Tx86-coff -Zi -MD -Ot -Ob1 -fp:precise -W1 -Gd -Ze -Zx
;;
;; __ Assembler tab settings ::: __
;; Debug information: Full
;; Calling convention: stdcall
;; Machine: X86
;; -- command line options (ASFLAGS): -AIA32 -Zi -Gz
;;
;; __ Linker tab settings ::: __
;; Debug information: CodeView & COFF format
;; Subsystem Type: Windows
;; Machine: X86