Skip to content

Commit 4519a21

Browse files
Merge pull request #2 from wally4000/main
Fix for GCC14 - PSPToolchain
2 parents 5f097d6 + 5cccf75 commit 4519a21

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

kernel_read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <pspsdk.h>
2-
2+
#include <psprtc.h>
33
/*
44
sceRtcCompareTick kernel exploit by davee, implementation by CelesteBlue
55
*/

kernel_write.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#include "libpspexploit.h"
3+
#include <stdint.h>
34

45
// allocate enough to scan sysmem
56
#define KRAM_BACKUP_SIZE (128*1024)
@@ -15,7 +16,7 @@ static int (* _sceKernelLibcTime)(u32 a0, u32 a1) = (void*)NULL;
1516
volatile static u32 packet[256];
1617
volatile static int is_exploited;
1718

18-
volatile static u32 patch_addr = NULL;
19+
volatile static u32 patch_addr = 0U;
1920
volatile static u32 patch_inst = 0;
2021

2122
void pspXploitExecuteKernel(u32 kernelContentFunction)
@@ -43,7 +44,7 @@ int pspXploitInitKernelExploit(){
4344
void* kram_copy = sceKernelGetBlockHeadAddr(memid);
4445

4546
// user read-only kxploit to dump sysmem
46-
pspXploitDumpKernel(kram_copy, 0x88000000, KRAM_BACKUP_SIZE);
47+
pspXploitDumpKernel(kram_copy, (u32*)0x88000000, KRAM_BACKUP_SIZE);
4748

4849
#ifdef DEBUG
4950
pspDebugScreenPrintf("Scanning sceKernelLibcTime address\n");

libpspexploit.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "libpspexploit.h"
2+
#include <pspsuspend.h>
23

34
static int AddressInRange(u32 addr, u32 lower, u32 higher){
45
return (addr >= lower && addr < higher);
@@ -59,7 +60,7 @@ u32 pspXploitFindImportRange(char *libname, u32 nid, u32 lower, u32 higher){
5960
if((stub->libname != libname) && AddressInRange((u32)stub->libname, lower, higher) \
6061
&& AddressInRange((u32)stub->nidtable, lower, higher) && AddressInRange((u32)stub->stubtable, lower, higher)) {
6162
if(strcmp(libname, stub->libname) == 0) {
62-
u32 *table = stub->nidtable;
63+
u32 *table =(u32*)stub->nidtable;
6364

6465
int j;
6566
for(j = 0; j < stub->stubcount; j++) {
@@ -220,7 +221,7 @@ static u32 FindSysMemStruct(){
220221
u32 pspXploitFindModuleByName(const char *modulename){
221222
u32 mod = FindSysMemStruct();
222223
while (mod){
223-
if (strcmp(mod+8, modulename) == 0){
224+
if (strcmp((const char *)(mod+8), modulename) == 0){
224225
return mod;
225226
}
226227
mod = _lw(mod);
@@ -286,7 +287,7 @@ int pspXploitSetUserLevel(int level)
286287
{
287288

288289
static int (*KernelGetUserLevel)() = NULL;
289-
if (!KernelGetUserLevel) KernelGetUserLevel = pspXploitFindFunction("sceThreadManager", "ThreadManForKernel", 0xF6427665);
290+
if (!KernelGetUserLevel) KernelGetUserLevel =(int(*)()) pspXploitFindFunction("sceThreadManager", "ThreadManForKernel", 0xF6427665);
290291

291292
// Backup User Level
292293
int previouslevel = KernelGetUserLevel();

0 commit comments

Comments
 (0)