-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmanual
217 lines (153 loc) · 4.78 KB
/
manual
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
===========| IF STATEMENT |===========
if (var1 == <var2/string/int/hex>){
do something
break;
}
;; The if statement right side must be a variable, string, int, or hex.
++++++++++++++++++++++++++++++++++++++
===========| Infinite While loop |===========
while(TRUE){
if (<var1> == <var2/string/int/hex>){
do something
break;
}
}
;; Only infinite while loops work for now
;; If statements only work inside infinite loops to allow the user to break upon condition.
;; Wait for future updates to accept if statements outside loops.
++++++++++++++++++++++++++++++++++++++
===========| Define Structs |===========
typedef struct <structure_name> {
struct body;
struct body;
struct body;
}<struct alias>, *<optional_pointer>;
Example 1:
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING, *PUNICODE_STRING;
Example 2:
typedef struct _OBJECT_ATTRIBUTES {
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES;
++++++++++++++++++++++++++++++++++++++
===========| Main Function |===========
<MAIN>
{
line 1;
line 2;
line 3;
line 4;
}
;; The main function starts with <MAIN>, unlike C language int main()
++++++++++++++++++++++++++++++++++++++
===========| Variables definition |===========
<type> <variable_name> = <var,NULL,int,string,constant>;
Example 1:
PVOID remoteAddress = NULL;
HANDLE hProcess = NULL;
Example 2:
DWORD DesiredAccess = PROCESS_ALL_ACCESS;
Example 3:
DWORD ProcInfo = 0x5;
DWORD ProcInfo2 = 2;
;; The variable type has to match one of the types in the constants.py file.
;; A new type could be added to the file as you go. Make sure you add the correct size of that type.
++++++++++++++++++++++++++++++++++++++
===========| Variable assignment |===========
Example 1:
BaseAddress = 0;
BaseAddress += 1;
BaseAddress -= 1;
RegionSize = dwRet;
mystring = "Hello world";
++++++++++++++++++++++++++++++++++++++
===========| Structure instance |===========
Example 1:
UNICODE_STRING NtImagePath;
Example 2:
CLIENT_ID clientId = NULL;
++++++++++++++++++++++++++++++++++++++
===========| Struct member assignment |===========
Example 1:
clientId.UniqueThread = NULL;
Example 2:
ObjectAttributes.Length = 23;
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
++++++++++++++++++++++++++++++++++++++
===========| Function call |===========
<function_name>(param1, param2, param3);
<function_name(param1,
param2,
param3);
Example 1:
NtAllocateVirtualMemory(hProcess, &BaseAddress, ZeroBits, &RegionSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
Example 2:
NtAllocateVirtualMemory(hProcess,
&BaseAddress,
ZeroBits,
&RegionSize,
MEM_COMMIT | MEM_RESERVE,
PAGE_EXECUTE_READWRITE
)
++++++++++++++++++++++++++++++++++++++
===========| Returned structure from a function call |===========
;; Same as a normal structure, but with the word "hidden" added before.
Example 1;
hidden struct _SYSTEM_PROCESS_INFORMATION {
line 1;
line 2;
line 3;
} SYSTEM_PROCESS_INFORMATION;
===========| Getting value from a returned structure |===========
<var> = (<structure_name>)<returned pointer>->struct_member1->nested_member;
Example 1:
imageName = (SYSTEM_PROCESS_INFORMATION)newBaseAddress->ImageName->Buffer;
;; In the above example, "ImageName" is the variable that will store the value coming from the returned structure
;; "Buffer" is a nested member inside "ImageName"
;; (SYSTEM_PROCESS_INFORMATION) is the structure defined earlier
;; "newBaseAddress" holds the address returned of the returned structure, mostly coming after a function call.
++++++++++++++++++++++++++++++++++++++
===========| Initializing a unicode string |===========
InitUnicodeStr(<variable_to_assign>, "<string>")
Example 1:
InitUnicodeStr(processName, "Chrome.exe");
Example 2:
InitUnicodeStr(processName, "C:\\Windows\System32\calc.exe");
++++++++++++++++++++++++++++++++++++++
===========| Assigning string variable |===========
##### Assigning string variable #######
PVOID <var_name> = "<string>";
Example 1:
PVOID buffer = "Hello world!";
++++++++++++++++++++++++++++++++++++++
===========| Special constants and functions |===========
<<< Functions >>>
sizeof();
;; The sizeof gets the size of a string from a variable, or direct string, or structure.
Example 1:
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
Example 2:
PVOID buffer = "hello world";
ULONG NumberOfBytesToWrite = sizeof(buffer);
<<< Constants >>>
- MEM_COMMIT
- MEM_RESERVE
- MEM_RELEASE
- PAGE_EXECUTE_READWRITE
- PAGE_READWRITE
- PAGE_READONLY
- PROCESS_ALL_ACCESS
- THREAD_ALL_ACCESS
- False
- True
- NTSTATUS
- NULL
++++++++++++++++++++++++++++++++++++++