diff --git a/source/ios_exploit.c b/source/ios_exploit.c index ed68fe4..c9b8505 100644 --- a/source/ios_exploit.c +++ b/source/ios_exploit.c @@ -238,7 +238,7 @@ static const int final_chain[] = { 0x0, // 0x1F0 0x101063db, // 0x1F4 POP {R1,R2,R5,PC} 0x0, // 0x1F8 - sizeof(ios_kernel_bin), // 0x1FC our code size + sizeof(ios_kernel), // 0x1FC our code size 0x0, // 0x200 0x10123983, // 0x204 POP {R1,R3,R4,R6,PC} 0x00140000, // 0x208 our code source location @@ -310,15 +310,15 @@ static void uhs_exploit_init(int dev_uhs_0_handle) { memcpy((char *) (0xF4120000), second_chain, sizeof(second_chain)); memcpy((char *) (0xF4130000), final_chain, sizeof(final_chain)); - memcpy((char *) (0xF4140000), ios_kernel_bin, sizeof(ios_kernel_bin)); + memcpy((char *) (0xF4140000), ios_kernel, sizeof(ios_kernel)); payload_info_t *payloads = (payload_info_t *) 0xF4148000; - payloads->size = sizeof(ios_usb_bin); - memcpy(payloads->data, ios_usb_bin, payloads->size); + payloads->size = sizeof(ios_usb); + memcpy(payloads->data, ios_usb, payloads->size); payloads = (payload_info_t *) 0xF4160000; - payloads->size = sizeof(ios_mcp_bin); - memcpy(payloads->data, ios_mcp_bin, payloads->size); + payloads->size = sizeof(ios_mcp); + memcpy(payloads->data, ios_mcp, payloads->size); pretend_root_hub[33] = 0x500000; @@ -327,7 +327,7 @@ static void uhs_exploit_init(int dev_uhs_0_handle) { DCStoreRange(pretend_root_hub + 33, 200); DCStoreRange((void *) 0xF4120000, sizeof(second_chain)); DCStoreRange((void *) 0xF4130000, sizeof(final_chain)); - DCStoreRange((void *) 0xF4140000, sizeof(ios_kernel_bin)); + DCStoreRange((void *) 0xF4140000, sizeof(ios_kernel)); DCStoreRange((void *) 0xF4148000, ((uint32_t) 0xF4180000) - 0xF4148000); } diff --git a/source/ios_kernel/.gitignore b/source/ios_kernel/.gitignore index 19ee97e..a0e9f58 100644 --- a/source/ios_kernel/.gitignore +++ b/source/ios_kernel/.gitignore @@ -1,4 +1,6 @@ build/ *.bin *.bin.h +ios_kernel.c +ios_kernel.h *.elf diff --git a/source/ios_kernel/Makefile b/source/ios_kernel/Makefile index 083d180..a352de8 100644 --- a/source/ios_kernel/Makefile +++ b/source/ios_kernel/Makefile @@ -26,6 +26,12 @@ OFILES += $(SFILES:source/%.s=build/%.o) PROJECTNAME = ${shell basename "$(CURDIR)"} CWD = "$(CURDIR)"" +#--------------------------------------------------------------------------------- +# path to tools +#--------------------------------------------------------------------------------- +DEVKITPATH=$(shell echo "$(DEVKITPRO)" | sed -e 's/^\([a-zA-Z]\):/\/\1/') +export PATH := $(DEVKITPATH)/tools/bin:$(DEVKITPATH)/devkitPPC/bin:$(PATH) + #--------------------------------------------------------------------------------- # canned command sequence for binary data, taken from devkitARM #--------------------------------------------------------------------------------- @@ -49,7 +55,8 @@ $(PROJECTNAME).bin: $(PROJECTNAME).elf @$(OBJCOPY) -j .text -j .rodata -j .data -O binary $(PROJECTNAME).elf $@ $(PROJECTNAME).bin.h: $(PROJECTNAME).bin - @xxd -i $< | sed "s/unsigned/static const unsigned/g;s/$(PROJECTNAME)$*/$(PROJECTNAME)/g" > $@ + @raw2c $< + @cp $(PROJECTNAME).c $@ $(PROJECTNAME)_syms.h: @echo "#ifndef $(PROJECTNAME)_SYMS_H" > $@ @@ -60,7 +67,7 @@ $(PROJECTNAME)_syms.h: clean: @rm -f build/*.o build/*.d - @rm -f $(PROJECTNAME).elf $(PROJECTNAME).bin $(PROJECTNAME)_syms.h $(PROJECTNAME).bin $(PROJECTNAME).bin.h + @rm -f $(PROJECTNAME).elf $(PROJECTNAME).bin $(PROJECTNAME)_syms.h $(PROJECTNAME).bin $(PROJECTNAME).bin.h $(PROJECTNAME).h $(PROJECTNAME).c @echo "all cleaned up !" -include $(DFILES) diff --git a/source/ios_mcp/.gitignore b/source/ios_mcp/.gitignore index 19ee97e..417a9cb 100644 --- a/source/ios_mcp/.gitignore +++ b/source/ios_mcp/.gitignore @@ -1,4 +1,6 @@ build/ *.bin *.bin.h +ios_mcp.c +ios_mcp.h *.elf diff --git a/source/ios_mcp/Makefile b/source/ios_mcp/Makefile index bac5d03..0319862 100644 --- a/source/ios_mcp/Makefile +++ b/source/ios_mcp/Makefile @@ -31,6 +31,12 @@ OFILES += $(SFILES:source/%.s=build/%.o) PROJECTNAME = ${shell basename "$(CURDIR)"} CWD = "$(CURDIR)"" +#--------------------------------------------------------------------------------- +# path to tools +#--------------------------------------------------------------------------------- +DEVKITPATH=$(shell echo "$(DEVKITPRO)" | sed -e 's/^\([a-zA-Z]\):/\/\1/') +export PATH := $(DEVKITPATH)/tools/bin:$(DEVKITPATH)/devkitPPC/bin:$(PATH) + #--------------------------------------------------------------------------------- # canned command sequence for binary data, taken from devkitARM #--------------------------------------------------------------------------------- @@ -54,7 +60,8 @@ $(PROJECTNAME).bin: $(PROJECTNAME).elf @$(OBJCOPY) -j .text -j .rodata -j .data -O binary $(PROJECTNAME).elf $@ $(PROJECTNAME).bin.h: $(PROJECTNAME).bin - @xxd -i $< | sed "s/unsigned/static const unsigned/g;s/$(PROJECTNAME)$*/$(PROJECTNAME)/g" > $@ + @raw2c $< + @cp $(PROJECTNAME).c $@ $(PROJECTNAME)_syms.h: @echo "#ifndef $(PROJECTNAME)_SYMS_H" > $@ @@ -65,7 +72,7 @@ $(PROJECTNAME)_syms.h: clean: @rm -f build/*.o build/*.d - @rm -f $(PROJECTNAME).elf $(PROJECTNAME).bin $(PROJECTNAME)_syms.h $(PROJECTNAME).bin $(PROJECTNAME).bin.h + @rm -f $(PROJECTNAME).elf $(PROJECTNAME).bin $(PROJECTNAME)_syms.h $(PROJECTNAME).bin $(PROJECTNAME).bin.h $(PROJECTNAME).c $(PROJECTNAME).h @echo "all cleaned up !" -include $(DFILES) diff --git a/source/ios_usb/.gitignore b/source/ios_usb/.gitignore index 19ee97e..f071487 100644 --- a/source/ios_usb/.gitignore +++ b/source/ios_usb/.gitignore @@ -1,4 +1,6 @@ build/ *.bin *.bin.h +ios_usb.c +ios_usb.h *.elf diff --git a/source/ios_usb/Makefile b/source/ios_usb/Makefile index 083d180..a352de8 100644 --- a/source/ios_usb/Makefile +++ b/source/ios_usb/Makefile @@ -26,6 +26,12 @@ OFILES += $(SFILES:source/%.s=build/%.o) PROJECTNAME = ${shell basename "$(CURDIR)"} CWD = "$(CURDIR)"" +#--------------------------------------------------------------------------------- +# path to tools +#--------------------------------------------------------------------------------- +DEVKITPATH=$(shell echo "$(DEVKITPRO)" | sed -e 's/^\([a-zA-Z]\):/\/\1/') +export PATH := $(DEVKITPATH)/tools/bin:$(DEVKITPATH)/devkitPPC/bin:$(PATH) + #--------------------------------------------------------------------------------- # canned command sequence for binary data, taken from devkitARM #--------------------------------------------------------------------------------- @@ -49,7 +55,8 @@ $(PROJECTNAME).bin: $(PROJECTNAME).elf @$(OBJCOPY) -j .text -j .rodata -j .data -O binary $(PROJECTNAME).elf $@ $(PROJECTNAME).bin.h: $(PROJECTNAME).bin - @xxd -i $< | sed "s/unsigned/static const unsigned/g;s/$(PROJECTNAME)$*/$(PROJECTNAME)/g" > $@ + @raw2c $< + @cp $(PROJECTNAME).c $@ $(PROJECTNAME)_syms.h: @echo "#ifndef $(PROJECTNAME)_SYMS_H" > $@ @@ -60,7 +67,7 @@ $(PROJECTNAME)_syms.h: clean: @rm -f build/*.o build/*.d - @rm -f $(PROJECTNAME).elf $(PROJECTNAME).bin $(PROJECTNAME)_syms.h $(PROJECTNAME).bin $(PROJECTNAME).bin.h + @rm -f $(PROJECTNAME).elf $(PROJECTNAME).bin $(PROJECTNAME)_syms.h $(PROJECTNAME).bin $(PROJECTNAME).bin.h $(PROJECTNAME).h $(PROJECTNAME).c @echo "all cleaned up !" -include $(DFILES)