Add some targets

This commit is contained in:
Yorick Barbanneau 2023-03-30 01:21:49 +02:00
parent d58645151a
commit b87162a19b

View file

@ -27,15 +27,30 @@ $(BUILD_DIR)/%: %.S
build: $(addprefix $(BUILD_DIR)/, $(TGT)) build: $(addprefix $(BUILD_DIR)/, $(TGT))
PHONY: gdb PHONY: gdb_shellcode
gdb: build/shellcode configure gdb_shellcode: build/shellcode configure
PYTHONPATH=${PWD}/pframe${PYTHONPATH:+:${PYTHONPATH}} \ PYTHONPATH=${PWD}/pframe${PYTHONPATH:+:${PYTHONPATH}} \
setarch -R gdb ./$(BUILD_DIR)/shellcode setarch -R gdb ./$(BUILD_DIR)/shellcode
PHONY: gdb_anodin
gdb_anodin: build/anodin configure
PYTHONPATH=${PWD}/pframe${PYTHONPATH:+:${PYTHONPATH}} \
setarch -R gdb ./$(BUILD_DIR)/anodin
PHONY: gdb_exploit
gdb_exploit: build/exploit build/anodin configure
ifeq ($(A_ADDR),)
$(error A_ADDR must be defined, launch setarch -R gdb ./build/anodin to retriece it)
endif
echo '$(A_ADDR)' | ./$(BUILD_DIR)/exploit > hack.txt
PYTHONPATH=${PWD}/pframe${PYTHONPATH:+:${PYTHONPATH}} \
setarch -R gdb ./$(BUILD_DIR)/anodin --command=anodin.gdb
rm hack.txt
PHONY: opcode PHONY: opcode
opcode: build/shellcode opcode: build/shellcode
readelf -x .text build/shellcode | sed -e '$$ d' -e '1,2 d' \ readelf -x .text build/shellcode | sed -e '$$ d' -e '1,2 d' \
| awk '{$$1=$$6=""; print $$0}' \ | awk -F ' ' '{$$1=$$6=""; print $$0}' \
| tr -d '[ \n]' \ | tr -d '[ \n]' \
| sed 's/../0x&,/g' > opcode.txt | sed 's/../0x&,/g' > opcode.txt