Linux payload implementing HV exploits to run a custom bootloader
C
Cleanup Makefile and linker.ld.
Andy Nguyen6a95a5ee8247
diff --git a/include/linux.h b/include/linux.hindex 8305187..bc3e37a 100644--- a/include/linux.h+++ b/include/linux.h@@ -1,6 +1,7 @@#ifndef __LINUX_H__#define __LINUX_H__+#include <stdint.h>#include <unistd.h>#define X86_SUBARCH_PS5 5diff --git a/shellcode_hv/Makefile b/shellcode_hv/Makefileindex 5aae236..75dcfff 100644--- a/shellcode_hv/Makefile+++ b/shellcode_hv/Makefile@@ -1,8 +1,3 @@-ifndef PS5_PAYLOAD_SDK- PS5_PAYLOAD_SDK = /opt/ps5-payload-sdk/-endif--# 1. Variablesifeq ($(shell uname -m),aarch64)CC = x86_64-linux-gnu-gccLD = x86_64-linux-gnu-ld@@ -12,8 +7,8 @@ CC = gccLD = ldOBJCOPY = objcopyendif-CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -fcf-protection=none -m64 -I$(PS5_PAYLOAD_SDK)/target/include-LDFLAGS = -T linker.ld+CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -fcf-protection=none -m64+LDFLAGS = -T linker.ld -Wl,--no-warn-rwx-segmentsTARGET = shellcode_hv.elfTEXT_BIN = shellcode_hv.bindump = shellcode_hv.hdiff --git a/shellcode_kernel/Makefile b/shellcode_kernel/Makefileindex 042aab6..9d3ec17 100644--- a/shellcode_kernel/Makefile+++ b/shellcode_kernel/Makefile@@ -1,8 +1,3 @@-ifndef PS5_PAYLOAD_SDK- PS5_PAYLOAD_SDK = /opt/ps5-payload-sdk/-endif--ifeq ($(shell uname -m),aarch64)CC = x86_64-linux-gnu-gccLD = x86_64-linux-gnu-ld@@ -12,16 +7,15 @@ CC = gccLD = ldOBJCOPY = objcopyendif-CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -m64 -I$(PS5_PAYLOAD_SDK)/target/include-LDFLAGS = -T linker.ld+CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -fcf-protection=none -m64+LDFLAGS = -T linker.ld -Wl,--no-warn-rwx-segmentsTARGET = shellcode_kernel.elfTEXT_BIN = shellcode_kernel.bin+dump = shellcode_kernel.hSRC = main.c utils.c boot_linux.cOBJ = $(SRC:.c=.o)-dump = shellcode_kernel.h-all: $(dump)$(TARGET): $(OBJ)@@ -31,7 +25,7 @@ $(TARGET): $(OBJ)$(CC) $(CFLAGS) -c $< -o $@$(TEXT_BIN): $(TARGET)- $(OBJCOPY) -O binary -j .text $(TARGET) $(TEXT_BIN)+ $(OBJCOPY) -O binary -j .shell_code $(TARGET) $(TEXT_BIN)clean:rm -f $(OBJ) $(TARGET) $(TEXT_BIN) $(dump)diff --git a/shellcode_kernel/linker.ld b/shellcode_kernel/linker.ldindex 98598d4..611bd59 100644--- a/shellcode_kernel/linker.ld+++ b/shellcode_kernel/linker.ld@@ -4,15 +4,15 @@ ENTRY(main)SECTIONS{. = 0x1000; /* 0x1000 to avoid warnings from linker */- .text :+ /* Place our custom header first */+ .shell_code :{*(.entry_point)*(.text)*(.text.*)- *(.data)- *(.data.*)+ *(.data*)*(.rodata*)*(.bss)*(.bss.*)}-}\ No newline at end of file+}