summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2021-08-22 09:24:04 -0400
committerMalfurious <m@lfurio.us>2021-08-22 09:24:04 -0400
commitd0e68f51eae112447289f2bcf541c4a4882ec741 (patch)
tree62e6432750c4985446cb9d281f5cf72e4d21ba6d /templates
parent89c13129a55ccbecda31614c83e88612972c11a6 (diff)
downloadlib-des-gnux-d0e68f51eae112447289f2bcf541c4a4882ec741.tar.gz
lib-des-gnux-d0e68f51eae112447289f2bcf541c4a4882ec741.zip
Add Makefile for shellcode templates
The shell*.asm files are considered the default programs and the expected use-case for utilizing the templates is to edit these files to implement the desired shellcode. I figure that literal shellcode makes the most sense of what to expect by default. 'make all' will assemble and link the shellcode (so it can actually be directly executed via the output elf files), and feed the disassembly into shelltool for use elsewhere. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'templates')
-rw-r--r--templates/shellcode/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/shellcode/Makefile b/templates/shellcode/Makefile
new file mode 100644
index 0000000..2e67adc
--- /dev/null
+++ b/templates/shellcode/Makefile
@@ -0,0 +1,17 @@
+.PHONY: all
+
+all: shell32.elf shell64.elf
+ @objdump -d shell32.elf | ./shelltool.py
+ @objdump -d shell64.elf | ./shelltool.py
+
+shell32.o: shell32.asm
+ nasm -f elf shell32.asm -o shell32.o
+
+shell32.elf: shell32.o
+ ld -melf_i386 shell32.o -o shell32.elf
+
+shell64.o: shell64.asm
+ nasm -f elf64 shell64.asm -o shell64.o
+
+shell64.elf: shell64.o
+ ld shell64.o -o shell64.elf