File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- ;; define the SYSTEM_CALL macro
2-
3-
1+ ;;; Define the SYSTEM_CALL macro
2+ ;;; YOU MUST USE A %DEFINE IF YOU USE THIS MACRO
3+ ;;; Will emit a hlt instruction if no %define is present
4+
45%macro SYSTEM_CALL 0
56 %ifdef INT80
67 int 0x80
1112 %elifdef CALLGATE32
1213 call [ gs :eiz + 0x10 ]
1314 %else
14- hlt ;YOU MUST USE A %DEFINE IF YOU USE THIS MACRO
15+ hlt
16+ %endif
17+ %endmacro
18+
19+ %macro SYSTEM_CALL 1
20+
21+ %ifdef INT80
22+ xor eax , eax ;used most frequently with 32bit shellcode
23+ mov al , % 1
24+ SYSTEM_CALL
25+
26+ %elifdef SYSENTER
27+ push byte % 1
28+ pop rax ;used most frequently with 64bit shellcode
29+ SYSTEM_CALL
30+
31+ %elifdef SYSCALL
32+ int3
33+ hlt
34+ %elifdef CALLGATE32 ;32bit only
35+ xor eax , eax
36+ mov al , % 1
37+ SYSTEM_CALL
38+ %else
39+ hlt
1540 %endif
1641%endmacro
You can’t perform that action at this time.
0 commit comments