Hi!
In time, I make test on flash0, just for me, it's test!(Don't think I want release the hundredth HB about flash0^^) and for security I want make prx to toggle USB (flash0). So I have done this prx (I have seen Wildcard src witch I have adapted for 4.xx kernel), but I have probleme, when I run this (via an eboot), my pc detect the device but I can't open it (I see the device, but it put message like I connect my psp in USB/MS without MS^^)
So I have few questions :
1- The probleme can come of attribute of my prx? (0x1006)
2- I must add an assigment?
[resolved] toggle usb/flash0...
[resolved] toggle usb/flash0...
Last edited by peb on Mon Sep 08, 2008 7:30 pm, edited 1 time in total.
Sorry for my English, I'm french.
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
#include <psppower.h>
#include <kubridge.h>
#include <pspusb.h>
#include <pspwlan.h>
#include <pspumd.h>
#include <pspctrl.h>
#include <pspusbstor.h>
#include <pspusbdevice.h>
PSP_MODULE_INFO("PSPRevealed", 0, 1, 1);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main() {
pspDebugScreenInit();
SetupCallbacks();
pspDebugScreenSetTextColor(0x0000FF);
SceCtrlData pad;
printf("PSPRevealed by RZX15.\n");
printf("Below is a list of some of your PSP's basic information.\n\n");
printf("Ethernet Address: sceWlanGetEtherAddr(8)\n");
while(1) {
if (sceWlanDevIsPowerOn() == 1) {
printf("Your Wlan Switch is on.\n\n");
}
else {
printf("Your Wlan Switch is turned off.\n\n");
}
break;
}
while(1) {
if (scePowerIsLowBattery() == 1) {
printf("Your Battery is Low.\n");
}
else {
printf("Your Battery is not Low.\n");
}
break;
}
while(1) {
if (scePowerIsBatteryExist() == 1) {
printf("A Battery Exists.\n");
}
break;
}
printf("Your Battery Percentage is scePowerGetBatteryLifePercent().\n");
printf("Battery Temperature: scePowerGetBatteryTemp().\n");
printf("Battery Volt Level: scePowerGetBatteryVolt().\n");
while(1) {
if (scePowerIsBatteryCharging() == 1) {
printf("Your Battery is Charging.\n");
}
else {
printf("Your Battery is Not Charging.\n\n");
}
break;
}
while(1) {
if (kuKernelGetModel() == PSP_MODEL_SLIM_AND_LITE) {
printf("Your PSP is a Slim.\n");
}
break;
}
while(1) {
if (kuKernelGetModel() == PSP_MODEL_STANDARD) {
printf("Your PSP is a Fat.\n");
}
break;
}
kuKernelLoadModule("flash0:/kd/semawm.prx", 0, NULL);
kuKernelLoadModule("flash0:/kd/usbstor.prx", 0, NULL);
kuKernelLoadModule("flash0:/kd/usbstormgr.prx", 0, NULL);
kuKernelLoadModule("flash0:/kd/usbstorms.prx", 0, NULL);
kuKernelLoadModule("flash0:/kd/usbstorboot.prx", 0, NULL);
kuKernelLoadModule("flash0:/kd/usbdevice.prx", 0, NULL);
printf("Press X to Toggle USB.\n");
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS) {
sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
sceUsbActivate(0x1c8);
}
break;
}
printf("When USB is Toggled, press O to Terminate.\n");
while(1) {
if(pad.Buttons & PSP_CTRL_CIRCLE) {
sceUsbDeactivate(0x1c8);
sceUsbStop(PSP_USBSTOR_DRIVERNAME, 0, 0);
sceUsbStop(PSP_USBBUS_DRIVERNAME, 0, 0);
}
break;
}
printf("Press [] to Toggle USB (FLASH0)\n");
while(1) {
if(pad.Buttons & PSP_CTRL_SQUARE) {
pspUsbDeviceSetDevice(0, 0, NULL);
sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
sceUsbActivate(0x1c8);
}
break;
}
printf("When USB is Toggled (FLASH0), press Triangle to Terminate.");
while(1) {
if(pad.Buttons & PSP_CTRL_TRIANGLE) {
sceUsbDeactivate(0x1c8);
sceUsbStop(PSP_USBSTOR_DRIVERNAME, 0, 0);
pspUsbDeviceFinishDevice();
sceUsbStop(PSP_USBBUS_DRIVERNAME, 0, 0);
}
break;
}
sceKernelSleepThread();
return 0;
}
Code: Select all
TARGET = psprevealed
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspkernel -lpspdebug -lpsppower -lpspkubridge -lpspusb -lpspwlan -lpspumd -lpspctrl -lpspusbstor -lpspusbdevice
LDFLAGS =
PSP_FW_VERSION = 371
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = PSPRevealed
BUILD_PRX = 1
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
=D
Angelo
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am