diff --git a/content/secu_logicielle/td5-stackoverflow_shellcode/files/q2/Makefile b/content/secu_logicielle/td5-stackoverflow_shellcode/files/q2/Makefile index d1d8ad5..b84fc26 100644 --- a/content/secu_logicielle/td5-stackoverflow_shellcode/files/q2/Makefile +++ b/content/secu_logicielle/td5-stackoverflow_shellcode/files/q2/Makefile @@ -23,9 +23,17 @@ $(BUILD_DIR)/%: %.c build: $(addprefix $(BUILD_DIR)/, $(TGT))) +PHONY: gdb_anodin +gdb_anodin: build/anodin configure + PYTHONPATH=${PWD}/pframe${PYTHONPATH:+:${PYTHONPATH}} \ + setarch -R gdb ./$(BUILD_DIR)/anodin PHONY: gdb + gdb: build/exploit build/anodin configure - echo '0x7fffffffe490' | ./$(BUILD_DIR)/exploit > hack.txt +ifeq ($(A_ADDR),) + $(error A_ADDR must be defined, launch make gdb_anofin then run 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