Set Makefiles to use 'python' if 'python3' not present

This commit is contained in:
jam1garner 2020-02-11 17:52:47 -05:00
parent 992dc3fa7d
commit 1a0a137695
4 changed files with 29 additions and 13 deletions

View File

@ -1,9 +1,13 @@
python := python3
PYTHON := python3
ifeq (, $(shell which python3))
# if no python3 alias, fall back to `python` and hope it's py3
PYTHON := python
endif
EXPLOIT_DIR := homebrew
EXPLOIT_PATH := $(EXPLOIT_DIR)/exploit.mscsb
homebrew: $(EXPLOIT_PATH)
$(python) inject.py $<
$(PYTHON) inject.py $<
clean:
rm -r data

View File

@ -1,4 +1,8 @@
python=python3
PYTHON := python3
ifeq (, $(shell which python3))
# if no python3 alias, fall back to `python` and hope it's py3
PYTHON := python
endif
all: exploit.mscsb
@ -6,15 +10,15 @@ clean:
rm -f exploit.mscsb payload.s payload.bin main.s
exploit.mscsb: payload.s Scripts main.s
$(python) ../pymsc/asm.py
$(PYTHON) ../pymsc/asm.py
payload.s: payload.bin
$(python) generate_payload.py
$(PYTHON) generate_payload.py
payload.bin: crashText.txt
cp -f crashText.txt payload.bin
printf "\0" >> payload.bin
main.s: rop_setup.s
$(python) generate_rop.py
$(PYTHON) generate_rop.py

View File

@ -1,7 +1,11 @@
wiiuhaxx_common_path := ../wiiuhaxx_common/wiiu_browserhax_common.php
wiiuhaxx_common_cfg := wiiuhaxx_common_cfg.php
pymsc_asm_py := ../pymsc/asm.py
python=python3
PYTHON := python3
ifeq (, $(shell which python3))
# if no python3 alias, fall back to `python` and hope it's py3
PYTHON := python
endif
all: clean exploit.mscsb
@ -9,10 +13,10 @@ clean:
rm -f exploit.mscsb payload.s main.s
exploit.mscsb: $(pymsc_asm_py) payload.s Scripts main.s
$(python) ../pymsc/asm.py
$(PYTHON) ../pymsc/asm.py
payload.s: payload.bin
$(python) generate_payload.py
$(PYTHON) generate_payload.py
main.s: rop_setup.s $(wiiuhaxx_common_cfg) $(wiiuhaxx_common_path)
php generatepayload.php > main.s

View File

@ -1,4 +1,8 @@
python=python3
PYTHON := python3
ifeq (, $(shell which python3))
# if no python3 alias, fall back to `python` and hope it's py3
PYTHON := python
endif
all: exploit.mscsb
@ -6,15 +10,15 @@ clean:
rm -f exploit.mscsb payload.s payload.bin main.s
exploit.mscsb: payload.s Scripts main.s
$(python) ../pymsc/asm.py
$(PYTHON) ../pymsc/asm.py
payload.s: payload.bin
$(python) generate_payload.py
$(PYTHON) generate_payload.py
payload.bin: crashText.txt
cp -f crashText.txt payload.bin
printf "\0" >> payload.bin
main.s: rop_setup.s
$(python) generate_rop.py
$(PYTHON) generate_rop.py