detect access via usb
detect access via usb
hello everybody!
I wanted to know how to know ( =) ) when data is tranferring over usb during an usb-pc connection.
in other words, do you remember the bar that goes to the left and to the right on the vsh when usb connection to memory stick is active? ok, how can i detect that event? how can i know that there is "something happening" at the usb port?
i think maybe is easier to look at the memory stick led, and detect when it is flashing, but how to do this?
would this work when flashes and umd are toggled via usb as well?
thanks very much!
I wanted to know how to know ( =) ) when data is tranferring over usb during an usb-pc connection.
in other words, do you remember the bar that goes to the left and to the right on the vsh when usb connection to memory stick is active? ok, how can i detect that event? how can i know that there is "something happening" at the usb port?
i think maybe is easier to look at the memory stick led, and detect when it is flashing, but how to do this?
would this work when flashes and umd are toggled via usb as well?
thanks very much!
Ciao! from Italy
-
- Posts: 25
- Joined: Mon Mar 24, 2008 12:16 pm
yes my app DID start usb.Torch wrote:I had some sample code showing how to read the bytes transferred. Can't seem to find it. Its only applicable if YOUR app started the USB.phobox wrote:thanks, but how can i "check the amount of data transferred"
I wrote a working usb utility, now i want to add the possibility to know if data is tranferring over osb...
where did you get that sample code?
Ciao! from Italy
I dunno :Sphobox wrote:yes my app DID start usb.Torch wrote:I had some sample code showing how to read the bytes transferred. Can't seem to find it. Its only applicable if YOUR app started the USB.phobox wrote:thanks, but how can i "check the amount of data transferred"
I wrote a working usb utility, now i want to add the possibility to know if data is tranferring over osb...
where did you get that sample code?
Ask Hellcat or Cory1492. Both of their apps show the bytes transferred.
Oh... Its definitely in Hellcats EPBM.cory1492 wrote:???
I've never added bytes transfer to USB before... in fact, I was curious to see how this topic turned out. If I had to guess and start somewhere, I'd look for a function I could hook so I could monitor len/size info before dispatching to the original function.
Maybe Torch meant jas0nuk?
I guess hooking sceIoRead to msstor0: could work, but the vsh probably uses another approach, I bet they use one of these functions with unkown prototype:
Code: Select all
0x16173D42 sceUSB_Stor_Ms_driver_16173D42
0x18EB011A sceUSB_Stor_Ms_driver_18EB011A
0x4B10A7F5 sceUsbstorMsRegisterEventFlag
0x56AA41EA sceUSB_Stor_Ms_driver_56AA41EA
0x762F7FDF sceUsbstorMsNotifyEventDone
0x9569F268 sceUsbstorMsSetVSHInfo
0x9C029B16 sceUSB_Stor_Ms_driver_9C029B16
0xABE9F2C7 sceUsbstorMsGetApInfo
0xFF0C3873 sceUsbstorMsUnregisterEventFlag
I remember doing this, including counting the ammount of data transfered, im my old pandora menu....
I hooked somewhere in the IoRead/IoWrite functions of the driver IIRC, set a flag to tell my other functions about a transfer in progress and counted the bytes in a global variable....
The solution I puzzled together wasn't all that nice (I'd guess there are way better ways to do it) but it worked pretty nicely :)
I'm not at home ATM, but when I am, I can see to dig out the code that did it....
I hooked somewhere in the IoRead/IoWrite functions of the driver IIRC, set a flag to tell my other functions about a transfer in progress and counted the bytes in a global variable....
The solution I puzzled together wasn't all that nice (I'd guess there are way better ways to do it) but it worked pretty nicely :)
I'm not at home ATM, but when I am, I can see to dig out the code that did it....
Here's some good, old, well known xD USB code snipped, that I had modified a while back for checking USB access and counting the ammount of data.
Not too nice, but does the job.
http://pb.area-42.net/?show=22
Not too nice, but does the job.
http://pb.area-42.net/?show=22