mirror of
https://github.com/ufrisk/pcileech.git
synced 2026-09-07 01:33:46 +08:00
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
# compile instructions for the FreeBSD x64 kernel module code
|
|
#
|
|
#================================ STAGE 1 ================================
|
|
#
|
|
# COMPILE ASM TO EXE (SAME CODE AS FOR WINDOWS)
|
|
ml64 wx64_stage1.asm /link /NODEFAULTLIB /RELEASE /MACHINE:X64 /entry:main
|
|
#
|
|
# EXTRACT SHELLCODE (shellcode saved as wx64_stage1.bin, c-ify by xxd -i wx64_stage1.bin)
|
|
shellcode64.exe -o wx64_stage1.exe
|
|
#
|
|
#================================ STAGE 2 ================================
|
|
#
|
|
# COMPILE ASM TO EXE
|
|
ml64 fbsdx64_stage2.asm /link /NODEFAULTLIB /RELEASE /MACHINE:X64 /entry:main
|
|
#
|
|
# EXTRACT SHELLCODE (shellcode saved as fbsdx64_stage2.bin, c-ify by xxd -i fbsdx64_stage2.bin)
|
|
shellcode64.exe -o fbsdx64_stage2.exe
|
|
#
|
|
#================================ STAGE 3 ================================
|
|
#
|
|
# COMPILE C CODE TO OBJ FILE
|
|
cl.exe /O1 /Os /Oy /FD /MT /Zp1 /GS- /J /GR- /FAcs /W4 /Zl /c /TC /kernel fbsdx64_stage3_c.c
|
|
#
|
|
# COMPILE ASM AND LINK C OBJ FILE TO EXE
|
|
ml64 fbsdx64_stage3.asm /link /NODEFAULTLIB /RELEASE /MACHINE:X64 /entry:main "fbsdx64_stage3_c.obj"
|
|
#
|
|
# EXTRACT SHELLCODE (shellcode saved as fbsdx64_stage3.bin, c-ify by xxd -i fbsdx64_stage3.bin)
|
|
shellcode64.exe -o fbsdx64_stage3.exe |