Files
ps5-linux-loader/source/main.c
2026-05-17 11:54:10 +02:00

55 lines
1.3 KiB
C

#include "hv_defeat_0304.h"
#include "hv_defeat_0506.h"
#include "loader.h"
#include "prepare_resume.h"
#include "utils.h"
#include <unistd.h>
int main(void) {
if (setup_env()) {
notify("Something went wrong while initiating.\nPlease make sure your fw "
"is supported.");
return -1;
}
if (fetch_linux(&linux_i)) {
notify("Something went wrong while installing linux files.\n");
return -1;
}
void *shellcode_kernel;
size_t shellcode_kernel_len;
if (prepare_resume(&shellcode_kernel, &shellcode_kernel_len)) {
notify("Something went wrong while preparing resume.\n");
return -1;
}
if ((0x0300 <= fw) && (fw < 0x0500)) {
if (hv_defeat_0304(shellcode_kernel, shellcode_kernel_len))
goto err;
} else if ((0x0500 <= fw) && (fw < 0x0650)) {
if (hv_defeat_0506(shellcode_kernel, shellcode_kernel_len))
goto err;
} else {
goto err;
}
notify("Finished preparation. Going to rest mode in 5 seconds.\nPlease wait "
"for the orange light to stop "
"blinking and then wakeup to Linux :)\n");
sleep(5);
enter_rest_mode();
while (1) {
sleep(30);
}
return 0;
err:
notify("Something went wrong while defeating Hypervisor.\nPlease make sure "
"your fw is supported.");
return -1;
}