forked from peterferrie/win-exec-calc-shellcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOW_TO_BUILD.txt
24 lines (18 loc) · 1.57 KB
/
HOW_TO_BUILD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
Release versions are build using SkyBuild (https://code.google.com/p/skybuild/), which is a python script that uses
nasm to assemble and Microsoft Visual Studio to compile the source into binary formats. It reads
build_config.py and build_info.txt to find out what to do and stores a build number in the later.