Files
metasploit-gs/external/source/shellcode/linux/ia32/Makefile
T

44 lines
1.2 KiB
Makefile
Raw Normal View History

2007-04-29 20:27:23 +00:00
STAGERS=stager_sock_bind stager_sock_bind_udp stager_sock_bind_icmp \
stager_egghunt stager_sock_find stager_sock_reverse \
stager_sock_reverse_icmp stager_sock_reverse_udp \
2012-09-03 23:21:49 -05:00
stager_sock_reverse_udp_dns
2007-04-29 20:27:23 +00:00
STAGES=stage_tcp_shell stage_udp_shell
SINGLE=single_adduser single_bind_tcp_shell single_find_tcp_shell \
single_reverse_tcp_shell single_reverse_udp_shell single_exec
2012-09-03 23:21:49 -05:00
2007-04-29 20:27:23 +00:00
OBJS=${STAGERS} ${STAGES} ${SINGLE}
2012-09-03 23:21:49 -05:00
.SUFFIXES:
.SUFFIXES: .asm .hex .disasm .o
# Tell Make not to delete these intermediate files
.PRECIOUS: %.hex %.disasm
all: $(SINGLE) $(STAGES) $(STAGERS)
%.o: %.asm %.bin %.hex %.disasm
@nasm -o $@ -f elf $<
%.bin: %.asm
@nasm -o $@ -f bin $<
# Replace 00 with \x00. Put quotes at beginning and end of line. Put plus at
# end of all lines but the last. This ends up outputting an escaped string
# suitable for use in a Ruby script.
%.hex: %.bin
@xxd -c 16 -ps $< | \
sed -e 's/\([0123456789abcdef][0123456789abcdef]\)/\\x\1/g' \
-e 's/^/"/;s/$$/"/;$$ b;s/$$/+/;' > $@
%.disasm: %.bin
@ndisasm -b 32 $< > $@
$(SINGLE) $(STAGES) $(STAGERS): %: %.o
@echo "Building $@... (`wc -c $(<:.o=.bin)|awk '{print $$1}'` bytes)"
@ld -i -m elf_i386 $< -o $@
@chmod +x $@
2007-04-29 20:27:23 +00:00
clean:
2012-09-03 23:21:49 -05:00
rm -f *.bin *.tmp *.o *.hex ${OBJS} *.disasm