Mario-Kart-8-Exploit/Makefile
2020-02-11 15:37:19 +01:00

65 lines
2.6 KiB
Makefile

#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
endif
export PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH)
PREFIX := powerpc-eabi-
export AS := $(PREFIX)as
export CC := $(PREFIX)gcc
export CXX := $(PREFIX)g++
export AR := $(PREFIX)ar
export READELF := $(PREFIX)readelf
export OBJCOPY := $(PREFIX)objcopy
DEFINES :=
COREINIT_CONFIG_PATH := coreinit.yml
GX2_CONFIG_PATH := gx2.yml
TURBO_CONFIG_PATH := turbo.yml
NSYSNET_CONFIG_PATH := nsysnet.yml
COREINIT_PATH := tmp/$(FIRMWARE)/coreinit.rpl
GX2_PATH := tmp/$(FIRMWARE)/gx2.rpl
TURBO_PATH := tmp/Turbo.rpx
NSYSNET_PATH := tmp/$(FIRMWARE)/nsysnet.rpl
TARGET_FILENAME := ropgadget_addr.py
GADGET_FINDER_PATH := bin/rpxgadgetfinder.jar
all: locate550
locate550:
make locatespecific FIRMWARE=550 ADDRESS_OFFSET_COREINIT=$$((0x02000000-0x0101c400)) ADDRESS_OFFSET_GX2=$$((0x02000000-0x0114EC40)) ADDRESS_OFFSET_NSYSNET=$$((0x02000000-0x010BFD80)) ADDRESS_OFFSET_TURBO=$$((0x0C180000))
checkrpl: $(COREINIT_PATH) $(GX2_PATH)
$(COREINIT_PATH):
if [ -a $(COREINIT_PATH) ]; then $(error missing $(COREINIT_PATH) for FW $(FIRMWARE)); fi;
$(GX2_PATH):
if [ -a $(GX2_PATH) ]; then $(error missing $(GX2_PATH) for FW $(FIRMWARE)); fi;
$(CONFIG_FILENAME):
if [ -a $(CONFIG_FILENAME) ]; then $(error missing $(CONFIG_FILENAME)); fi;
$(GADGET_FINDER_PATH):
if [ -a $(GADGET_FINDER_PATH) ]; then $(error missing $(GADGET_FINDER_PATH)); fi;
locatespecific: checkrpl $(GADGET_FINDER_PATH) $(CONFIG_FILENAME)
@echo "Finding symbols for FW $(FIRMWARE)"
@C:/jdk-11.0.2/bin/java.exe -jar $(GADGET_FINDER_PATH) -cin $(COREINIT_CONFIG_PATH) -bin $(COREINIT_PATH) -aoff -$(ADDRESS_OFFSET_COREINIT) > $(TARGET_FILENAME)
@C:/jdk-11.0.2/bin/java.exe -jar $(GADGET_FINDER_PATH) -cin $(GX2_CONFIG_PATH) -bin $(GX2_PATH) -aoff -$(ADDRESS_OFFSET_GX2) >> $(TARGET_FILENAME)
@C:/jdk-11.0.2/bin/java.exe -jar $(GADGET_FINDER_PATH) -cin $(NSYSNET_CONFIG_PATH) -bin $(NSYSNET_PATH) -aoff -$(ADDRESS_OFFSET_NSYSNET) >> $(TARGET_FILENAME)
@C:/jdk-11.0.2/bin/java.exe -jar $(GADGET_FINDER_PATH) -cin $(TURBO_CONFIG_PATH) -bin $(TURBO_PATH) -aoff $(ADDRESS_OFFSET_TURBO) >> $(TARGET_FILENAME)
clean:
rm -rf ropgadget_addr.py