2019-01-06 18:10:45 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# 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
|
2015-12-05 01:03:57 +01:00
|
|
|
DEFINES :=
|
|
|
|
|
2019-02-25 18:59:47 +01:00
|
|
|
COREINIT_CONFIG_PATH := coreinit.yml
|
|
|
|
GX2_CONFIG_PATH := gx2.yml
|
|
|
|
COREINIT_PATH := tmp/$(FIRMWARE)/coreinit.rpl
|
|
|
|
GX2_PATH := tmp/$(FIRMWARE)/gx2.rpl
|
|
|
|
TARGET_FILENAME := wiiuhaxx_rop_sysver_$(FIRMWARE).php
|
|
|
|
GADGET_FINDER_PATH := bin/rpxgadgetfinder.jar
|
2019-01-06 18:10:45 +01:00
|
|
|
|
|
|
|
all: loader locateall
|
|
|
|
|
2019-01-23 21:10:08 +01:00
|
|
|
loader: wiiuhaxx_loader.bin wiiuhaxx_searcher.bin
|
|
|
|
|
|
|
|
wiiuhaxx_loader.bin: wiiuhaxx_loader.s
|
2019-01-06 18:10:45 +01:00
|
|
|
$(CC) -x assembler-with-cpp -nostartfiles -nostdlib $(DEFINES) -o wiiuhaxx_loader.elf wiiuhaxx_loader.s
|
|
|
|
$(OBJCOPY) -O binary wiiuhaxx_loader.elf wiiuhaxx_loader.bin
|
2019-01-23 21:10:08 +01:00
|
|
|
|
|
|
|
wiiuhaxx_searcher.bin: wiiuhaxx_searcher.s
|
2019-01-10 23:27:08 +01:00
|
|
|
$(CC) -x assembler-with-cpp -nostartfiles -nostdlib $(DEFINES) -o wiiuhaxx_searcher.elf wiiuhaxx_searcher.s
|
|
|
|
$(OBJCOPY) -O binary wiiuhaxx_searcher.elf wiiuhaxx_searcher.bin
|
2019-01-06 18:10:45 +01:00
|
|
|
|
|
|
|
locateall: locate532 locate550
|
2019-02-25 18:59:47 +01:00
|
|
|
|
2019-01-06 18:10:45 +01:00
|
|
|
locate532:
|
2019-02-25 18:59:47 +01:00
|
|
|
make locatespecific FIRMWARE=532 ADDRESS_OFFSET_COREINIT=$$((0x02000000-0x0101c400)) ADDRESS_OFFSET_GX2=$$((0x02000000-0x0114EC40))
|
2019-01-23 21:10:08 +01:00
|
|
|
|
2019-01-06 18:10:45 +01:00
|
|
|
locate550:
|
2019-02-25 18:59:47 +01:00
|
|
|
make locatespecific FIRMWARE=550 ADDRESS_OFFSET_COREINIT=$$((0x02000000-0x0101c400)) ADDRESS_OFFSET_GX2=$$((0x02000000-0x0114EC40))
|
2019-01-23 21:10:08 +01:00
|
|
|
|
2019-02-25 18:59:47 +01:00
|
|
|
checkrpl: $(COREINIT_PATH) $(GX2_PATH)
|
2019-01-23 21:10:08 +01:00
|
|
|
|
|
|
|
$(COREINIT_PATH):
|
2019-02-25 18:59:47 +01:00
|
|
|
if [ -a $(COREINIT_PATH) ]; then $(error missing $(COREINIT_PATH) for FW $(FIRMWARE)); fi;
|
2019-01-23 21:10:08 +01:00
|
|
|
|
|
|
|
$(GX2_PATH):
|
2019-02-25 18:59:47 +01:00
|
|
|
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;
|
2019-01-23 21:10:08 +01:00
|
|
|
|
2019-02-25 18:59:47 +01:00
|
|
|
locatespecific: checkrpl $(GADGET_FINDER_PATH) $(CONFIG_FILENAME)
|
|
|
|
@echo "Finding symbols for FW $(FIRMWARE)"
|
|
|
|
@echo "<?php" > $(TARGET_FILENAME)
|
|
|
|
@java -jar $(GADGET_FINDER_PATH) -cin $(COREINIT_CONFIG_PATH) -bin $(COREINIT_PATH) -aoff -$(ADDRESS_OFFSET_COREINIT) >> $(TARGET_FILENAME)
|
|
|
|
@java -jar $(GADGET_FINDER_PATH) -cin $(GX2_CONFIG_PATH) -bin $(GX2_PATH) -aoff -$(ADDRESS_OFFSET_GX2) >> $(TARGET_FILENAME)
|
|
|
|
@echo "?>" >> $(TARGET_FILENAME)
|
2015-12-05 01:03:57 +01:00
|
|
|
|
|
|
|
clean:
|
2019-02-25 18:59:47 +01:00
|
|
|
rm -rf wiiuhaxx_loader.elf wiiuhaxx_loader.bin wiiuhaxx_searcher.elf wiiuhaxx_searcher.bin wiiuhaxx_rop_sysver_*
|
2015-12-05 01:03:57 +01:00
|
|
|
|