-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patharch64.py
89 lines (82 loc) · 1.8 KB
/
arch64.py
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
from aenum import Enum, Constant
class x64Regs(Enum):
_order_ = 'RAX RBX RCX RDX RSI RDI RBP RSP R8 R9 R10 R11 R12 R13 R14 R15 RIP'
RAX = 'RAX'
RBX = 'RBX'
RCX = 'RCX'
RDX = 'RDX'
RSI = 'RSI'
RDI = 'RDI'
RBP = 'RBP'
RSP = 'RSP'
R8 = 'R8'
R9 = 'R9'
R10 = 'R10'
R11 = 'R11'
R12 = 'R12'
R13 = 'R13'
R14 = 'R14'
R15 = 'R15'
# special
RIP = 'RIP'
class x32Regs(Enum):
_order_ = 'EAX EBX ECX EDX ESI EDI EBP ESP R8d R9d R10d R11d R12d R13d R14d R15d'
EAX = 'eax'
EBX = 'ebx'
ECX = 'ecx'
EDX = 'edx'
ESI = 'esi'
EDI = 'edi'
EBP = 'ebp'
ESP = 'esp'
R8d = 'r8d'
R9d = 'r9d'
R10d = 'r10d'
R11d = 'r11d'
R12d = 'r12d'
R13d = 'r13d'
R14d = 'r14d'
R15d = 'r15d'
class x16Regs(Enum):
_order_ = 'AX BX CX DX SI DI BP SP R8w R9w R10w R11w R12w R13w R14w R15w'
AX = 'ax'
BX = 'bx'
CX = 'cx'
DX = 'dx'
SI = 'si'
DI = 'di'
BP = 'bp'
SP = 'sp'
R8w = 'r8w'
R9w = 'r9w'
R10w = 'r10w'
R11w = 'r11w'
R12w = 'r12w'
R13w = 'r13w'
R14w = 'r14w'
R15w = 'r15w'
class x8Regs(Enum):
_order_ = 'AL BL CL DL SIL DIL BPL SPL R8b R9b R10b R11b R12b R13b R14b R15b'
AL = 'al'
BL = 'bl'
CL = 'cl'
DL = 'dl'
SIL = 'sil'
DIL = 'dil'
BPL = 'bpl'
SPL = 'spl'
R8b = 'r8b'
R9b = 'r9b'
R10b = 'r10b'
R11b = 'r11b'
R12b = 'r12b'
R13b = 'r13b'
R14b = 'r14b'
R15b = 'r15b'
class x64RegInfo(Constant):
MaxValue = 9223372036854775808
x64RegList = [i.value for i in list(x64Regs)]
x32RegList = [i.value for i in list(x32Regs)]
x16RegList = [i.value for i in list(x16Regs)]
x8RegList = [i.value for i in list(x8Regs)]
x64RegCommonList = [i.value for i in list(x64Regs) if i.value != x64Regs.RIP.value]