Clean up payload.

This commit is contained in:
Andy Nguyen 2021-10-24 22:57:03 +02:00
parent 2a62c2b396
commit f202a5a495
3 changed files with 8 additions and 3 deletions

View File

@ -4,13 +4,13 @@ OBJS = start.o payload.o
CC = gcc CC = gcc
AS = as AS = as
OBJCOPY = objcopy OBJCOPY = objcopy
CFLAGS = -Os -fno-stack-protector -fpic -fpie CFLAGS = -Os -fno-stack-protector
LDFLAGS = -T linker.x -nostdlib -nostartfiles LDFLAGS = -T linker.x -nostdlib -nostartfiles
all: $(TARGET).bin all: $(TARGET).bin
%.bin: %.elf %.bin: %.elf
$(OBJCOPY) -S -O binary $^ $@ $(OBJCOPY) -S -j .text -j .data -j .rodata -j .bss -O binary $^ $@
$(TARGET).elf: $(OBJS) $(TARGET).elf: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)

View File

@ -2,6 +2,8 @@
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
int payload(int (* sceKernelDlsym)(int handle, const char *symbol, uintptr_t *address)) { typedef int32_t SceKernelModule;
int payload(int (* sceKernelDlsym)(SceKernelModule handle, const char *symbol, void **addrp)) {
return 1337; return 1337;
} }

View File

@ -1,2 +1,5 @@
.text
.global _start
_start: _start:
jmp payload jmp payload