Code: Select all
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspidstorage.h>
#include <string.h>
PSP_MODULE_INFO("KernelStuff_driver", 0x1006, 3, 2);
PSP_MAIN_THREAD_ATTR(0);
//Get Fuse Id
u64 sceSysreg_driver_4F46EEDE();
int sceSyscon_driver_7EC5A957(u32 *baryon);
u32 sceSysreg_driver_E2A5D1EE(void);
int ReadKey(int key, char *buffer)
{
int err;
u32 k1;
k1 = pspSdkSetK1(0);
memset(buffer, 0, 512);
err = sceIdStorageReadLeaf(key, buffer);
pspSdkSetK1(k1);
return err;
}
int WriteKey(int key, char *buffer)
{
int err;
u32 k1;
k1 = pspSdkSetK1(0);
err = sceIdStorageWriteLeaf(key, buffer);
sceIdStorageFlush();
pspSdkSetK1(k1);
return err;
}
void GetMoboInfo(int* baryon, int* tachyon)
{
u32 by, ty;
int k;
k = pspSdkSetK1(0);
ty = sceSysreg_driver_E2A5D1EE();
sceSyscon_driver_7EC5A957(&by);
pspSdkSetK1(k);
(*baryon) = by;
(*tachyon) = ty;
}
u64 GetFuseId()
{
u64 fuseId = sceSysreg_driver_4F46EEDE();
return fuseId;
}
int module_start(SceSize args, void *argp)
{
return 0;
}
int module_stop()
{
return 0;
}
Code: Select all
# Define the exports for the prx
PSP_BEGIN_EXPORTS
# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_END
PSP_EXPORT_START(kernel_driver, 0, 0x4001)
PSP_EXPORT_FUNC_HASH(GetFuseId)
PSP_EXPORT_FUNC_HASH(GetMoboInfo)
PSP_EXPORT_FUNC_HASH(ReadKey)
PSP_EXPORT_FUNC_HASH(WriteKey)
PSP_EXPORT_END
PSP_END_EXPORTS
Code: Select all
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspmoduleinfo.h>
#include <kubridge.h>
#include "kernel.h"
#define printf pspDebugScreenPrintf
/* Define the module info section */
PSP_MODULE_INFO("tpb", 0x1000, 1, 0);
int main(int argc, char *argv[])
{
pspDebugScreenInit();
int r = kuKernelLoadModule("kernelstuff.prx",0,NULL);
if (r < 0)
{
printf( "Error 0x%08X loading/starting pspdecrypt.prx.\n", r);
sceKernelDelayThread(7000000);
}
sceKernelStartModule(r, 0, NULL, 0, NULL);
u32 sceSysreg_driver_E2A5D1EE(void);
u32 sceSyscon_driver_E7E87741(u32 *pommel);
u32 sceSyscon_driver_7EC5A957(u32 *baryon);
u32 tachyon;
u32 pommel;
u32 baryon;
tachyon = sceSysreg_driver_E2A5D1EE();
sceSyscon_driver_E7E87741(&pommel);
sceSyscon_driver_7EC5A957(&baryon);
int bar,tac;
GetMoboInfo(&bar,&tac);
printf("%i - %i\n",bar,tac);
printf("Tachyon: 0x%08X\n", tachyon);
printf("Pommel: 0x%08X\n", pommel);
printf("Baryon: 0x%08X\n", baryon);
printf("%#llx",GetFuseId());
char wifi_module_mac[512];
ReadKey(0x44, wifi_module_mac);
printf("Mac : %s",wifi_module_mac);
sceKernelDelayThread(10000000);
return 0;
}