diff --git a/gdb_stub/Makefile b/gdb_stub/Makefile index 635e2a5..8986eb8 100644 --- a/gdb_stub/Makefile +++ b/gdb_stub/Makefile @@ -14,7 +14,7 @@ payload.bin: payload.elf file payload.bin | fgrep -q 'payload.bin: DOS executable (COM)' payload-kek.elf: ../lib/lib.a dbg.c main.c ps4libs.c - gcc -g -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -fPIE -ffreestanding -static ../lib/lib-elf-ps5.a -D__PS4__ -DINTERRUPTER_THREAD -DNO_BREAKPOINT_EMULATION -DPS5KEK -DPS4LIBS dbg.c main.c ps4libs.c -o payload-kek.elf -Wl,-z,max-page-size=16384 -Wl,-zcommon-page-size=16384 + gcc -g -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -fPIE -ffreestanding -static ../lib/lib-elf-ps5.a -D__PS4__ -DINTERRUPTER_THREAD -DNO_BREAKPOINT_EMULATION -DPS5KEK -DPS4LIBS dbg.c main.c ps4libs.c -o payload-kek.elf -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384 payload-kek.bin: payload-kek.elf objcopy payload-kek.elf --only-section .text --only-section .data --only-section .bss --only-section .rodata --set-section-flags .bss=alloc,load,contents -O binary payload-kek.bin diff --git a/prosper0gdb/Makefile b/prosper0gdb/Makefile index 0714814..8f051eb 100644 --- a/prosper0gdb/Makefile +++ b/prosper0gdb/Makefile @@ -13,7 +13,7 @@ prosper0gdb.o: r0gdb.c r0run.o offsets.c offsets.h offsets/offset_list.txt gcc -O0 -g -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -r -Wl,--unique='*' -ffunction-sections -fdata-sections $(EXTRA_CFLAGS) -DPS5KEK r0gdb.c r0run.o offsets.c -o prosper0gdb.o -fPIE -ffreestanding -fno-unwind-tables -fno-asynchronous-unwind-tables payload.elf: ../lib/lib-elf-ps5.a main.c prosper0gdb.o dbg.c - gcc -O0 -g -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -static ../lib/lib-elf-ps5.a $(EXTRA_CFLAGS) main.c prosper0gdb.o -DPS5KEK dbg.c -o payload.elf -fPIE -ffreestanding -Wl,-no-pie -Wl,-zmax-page-size=16384 -Wl,-zcommon-page-size=16384 + gcc -O0 -g -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -static ../lib/lib-elf-ps5.a $(EXTRA_CFLAGS) main.c prosper0gdb.o -DPS5KEK dbg.c -o payload.elf -fPIE -ffreestanding -no-pie -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384 payload.bin: payload.elf objcopy payload.elf --only-section .text --only-section .data --only-section .bss --only-section .rodata -O binary payload.bin diff --git a/ps5-kstuff/Makefile b/ps5-kstuff/Makefile index 7b5230c..9adaee5 100644 --- a/ps5-kstuff/Makefile +++ b/ps5-kstuff/Makefile @@ -13,7 +13,7 @@ structs.inc: structs-ps5.inc cp structs-ps5.inc structs.inc payload.elf: ../lib/lib-elf-ps5.a ../prosper0gdb/prosper0gdb.o main.c kelf uelf/uelf.bin - gcc -O0 -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -static ../lib/lib-elf-ps5.a ../prosper0gdb/prosper0gdb.o $(EXTRA_CFLAGS) main.c -DPS5KEK ../prosper0gdb/dbg.c -Wl,-gc-sections -o payload.elf -fPIE -ffreestanding -no-pie -Wl,-z,max-page-size=16384 -Wl,-zcommon-page-size=16384 + gcc -O0 -isystem ../freebsd-headers -nostdinc -nostdlib -fno-stack-protector -static ../lib/lib-elf-ps5.a ../prosper0gdb/prosper0gdb.o $(EXTRA_CFLAGS) main.c -DPS5KEK ../prosper0gdb/dbg.c -Wl,-gc-sections -o payload.elf -fPIE -ffreestanding -no-pie -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384 payloa%.bin: payloa%.elf objcopy $< --only-section .text --only-section .data --only-section .bss --only-section .rodata -O binary $@ diff --git a/ps5-kstuff/build_bearssl.sh b/ps5-kstuff/build_bearssl.sh index bd21491..f7f7644 100644 --- a/ps5-kstuff/build_bearssl.sh +++ b/ps5-kstuff/build_bearssl.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + cd BearSSL for i in clean "lib -j$(nproc)"; do make CC='gcc -nostdlib -nostdinc -isystem /proc/'$$'/cwd/../../freebsd-headers -isystem '"'${x86intrin_path//"'"/"'"'"'"'"'"'"'"}'"' -O3 -march=znver2 -g -ffreestanding -ffunction-sections -fdata-sections -fvisibility=hidden -include /proc/'$$'/cwd/../overrides.h' $i; done diff --git a/ps5-kstuff/build_libtomcrypt.sh b/ps5-kstuff/build_libtomcrypt.sh index 920d567..5b5459e 100644 --- a/ps5-kstuff/build_libtomcrypt.sh +++ b/ps5-kstuff/build_libtomcrypt.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + cd libtomcrypt for i in clean -j$(nproc); do make CC='gcc -nostdlib -nostdinc -isystem /proc/'$$'/cwd/../../freebsd-headers -isystem '"'${x86intrin_path//"'"/"'"'"'"'"'"'"'"}'"' -O3 -march=znver2 -g -ffreestanding -ffunction-sections -fdata-sections -fPIE -fPIC -fvisibility=hidden -include /proc/'$$'/cwd/../overrides.h' $i; done