7 #include "loadcore_add.h"
9 #define MODNAME "SyncEE"
10 IRX_ID(MODNAME
, 0x01, 0x01);
12 extern struct irx_export_table _exp_eesync
;
13 u8 memory
[16] = "rom0:SECRMAN";
15 void checkSecrman(void)
20 register int memorySize
;
23 for (i = 0; i < 12; i++) {
24 memory[i] = 0x70 - ((i+1) * 4);
27 *(u32*)&memory[0] ^= 0x5009071e;
28 *(u32*)&memory[4] ^= 0x13110b66;
29 *(u32*)&memory[8] ^= 0x0e05051e;
30 *(u32*)&memory[12] = 0;
33 //6c 68 64 60 5c 58 54 50 4c 48 44 40 00 00 00 00
34 //to memory an then dexors it to
36 //Why is it so freaking weird? Why did they want to hide it?
37 //I'm also not sure of the purpose of this funciton... all games do work fine without it
38 if ((fd
= open(memory
, O_RDONLY
)) >= 0)
40 length
= lseek(fd
, 0, SEEK_END
);
41 if (close(fd
) < 0) return;
42 if (length
< 0) return;
44 if (length
== 0x2731) memorySize
= 0x1900;
45 else memorySize
= 0x100;
47 AllocSysMemory(ALLOC_FIRST
, memorySize
, NULL
);
51 int PostResetCallback(void)
53 sceSifSetSMFlag(0x40000);
57 int _start(int argc
, char** argv
)
60 register u32 bootMode
;
62 if ((ret
= QueryBootMode(3)) != NULL
)
64 bootMode
= *(u32
*)((u32
)ret
+4);
65 if (((bootMode
& 1) != 0) || ((bootMode
& 2) != 0)) return MODULE_NO_RESIDENT_END
;
67 if (RegisterLibraryEntries(&_exp_eesync
) < 0) return MODULE_NO_RESIDENT_END
;
71 loadcore20((Callback
)PostResetCallback
, 2, 0);
73 return MODULE_RESIDENT_END
;