-
Notifications
You must be signed in to change notification settings - Fork 86
/
HOW_TO_BUILD.txt
19 lines (15 loc) · 1.26 KB
/
HOW_TO_BUILD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
If you want to assemble the shellcode manually, you can use the following commands:
nasm (http://www.nasm.us/):
nasm w32-exec-calc-shellcode.asm -o w32-exec-calc-shellcode.bin
nasm w64-exec-calc-shellcode.asm -o w64-exec-calc-shellcode.bin
nasm win-exec-calc-shellcode.asm -o win-exec-calc-shellcode.bin
yasm (http://yasm.tortall.net/):
yasm w32-exec-calc-shellcode.asm -o w32-exec-calc-shellcode.bin
yasm w64-exec-calc-shellcode.asm -o w64-exec-calc-shellcode.bin
yasm win-exec-calc-shellcode.asm -o win-exec-calc-shellcode.bin
You can add the argument "-DSTACK_ALIGN=TRUE" to build shellcode that re-aligns the stack.
You can add the argument "-DFUNC=TRUE" to build shellcode as a function that supports returning with non-volatile registers preserved.
You can add the argument "-DFUNC=TRUE -DCLEAN=TRUE" to build shellcode as a function that supports returning with all registers preserved.
You can also combine FUNC (and CLEAN) and STACK_ALIGN to produce code that will align the stack and still support returning with registers preserved.
If you want to create a DLL-file that executes the shellcode, you can compile win-dll-run-shellcode.c
If you want to create an executable that executes the shellcode, you can compile win-exe-run-shellcode.c