SceUsbstorVStorDriver: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
! Version !! World !! Privilege
! Version !! World !! Privilege
|-
|-
| 1.69 || Non-secure || Kernel
| 1.69-3.60 || Non-secure || Kernel
|}
|}


Line 18: Line 18:
| 1.69 || [[SceUsbstorVStorDriver#SceUsbstorVStorForDriver|SceUsbstorVStorForDriver]] || Non-secure || Kernel || 0xFD5BA349
| 1.69 || [[SceUsbstorVStorDriver#SceUsbstorVStorForDriver|SceUsbstorVStorForDriver]] || Non-secure || Kernel || 0xFD5BA349
|-
|-
| 1.69 || [[SceUsbstorVStorDriver#SceUsbstorVStor|SceUsbstorVStor]] || Non-secure || User || 0x17F294B9
| 3.60 || [[SceUsbstorVStorDriver#SceUsbstorVStorForDriver|SceUsbstorVStorForDriver]] || Non-secure || Kernel || not present
|-
| 1.69-3.60 || [[SceUsbstorVStorDriver#SceUsbstorVStor|SceUsbstorVStor]] || Non-secure || User || 0x17F294B9
|}
|}
== Types ==
<source lang="C">
#define USBSTOR_DEVICE_TYPE_DIRECT_ACCESS_BLOCK_DEVICE 0 // used for sceUsbstorVStorStart
</source>


== SceUsbstorVStorForDriver ==
== SceUsbstorVStorForDriver ==


=== Set Device Name ===
=== sceUsbstorVStorSetDeviceInfoForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x3F02417C
| 0x3F02417C
|}
|}
This is a guessed name.
This name shows up in the USB descriptor.
This name shows up in the USB descriptor.


<source lang="c">int SceUsbstorVStorForDriver_0x3F02417C_set_name(const char *name);</source>
<source lang="c">int sceUsbstorVStorSetDeviceInfoForDriver(const char *name);</source>


=== Set Image Path ===
=== sceUsbstorVStorSetImgFilePathForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x78B42CC8
| 0x78B42CC8
|}
|}
The filesystem image to use as USB storage. This is limited to the CMA installer ISO and a FAT image at <code>ux0:/umass/fat.img</code>. Other paths will return error.


<source lang="c">int SceUsbstorVStorForDriver_0x78B42CC8_set_path(const char *path);</source>
This is a guessed name.
 
Sets the filesystem image to use as USB storage. This is limited to the CMA installer ISO and a FAT image at <code>ux0:/umass/fat.img</code>. Other paths will return error.


=== Activate USB storage device ===
<source lang="c">int sceUsbstorVStorSetImgFilePathForDriver(const char *path);</source>
 
=== sceUsbstorVStorStartForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x31F7BBAD
| 0x31F7BBAD
|}
|}
The user is responsible for making sure no other UDC driver is active. This activates UDC as a <code>"PS Vita" Type A</code> device.


<source lang="c">int SceUsbstorVStorForDriver_0x31F7BBAD_activate(int unk);</source>
This is a guessed name.


=== Stop USB Storage ===
The user is responsible for making sure that no other UDC driver is active. This activates UDC as a <code>"PS Vita" Type A</code> device.
 
<source lang="c">int sceUsbstorVStorStartForDriver(int unk);</source>
 
=== sceUsbstorVStorStopForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x99C2BC8A
| 0x99C2BC8A
|}
|}


<source lang="c">int SceUsbstorVStorForDriver_0x99C2BC8A_stop(int unk);</source>
This is a guessed name.
 
<source lang="c">int sceUsbstorVStorStopForDriver(int unk);</source>


== SceUsbstorVStor ==
== SceUsbstorVStor ==


=== Set Device Name ===
=== sceUsbstorVStorSetDeviceInfo ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x3F02417C
| 0x3F02417C
|}
|}
User wrapper for <code>0x14455C20</code>. Must have correct permissions to call.


=== Set Image Path ===
This is a guessed name.
 
User wrapper for [[#sceUsbstorVStorSetDeviceInfoForDriver]]. Must have correct permissions to call.
 
=== sceUsbstorVStorSetImgFilePath ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x8C9F93AB
| 0x8C9F93AB
|}
|}
User wrapper for <code>0x78B42CC8</code>. Must have correct permissions to call.


=== Activate USB storage device ===
This is a guessed name.
 
User wrapper for [[#sceUsbstorVStorSetImgFilePathForDriver]]. Must have correct permissions to call.
 
=== sceUsbstorVStorStart ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0xB606F1AF
| 0xB606F1AF
|}
|}
User wrapper for <code>0x31F7BBAD</code>. Must have correct permissions to call.


=== Stop USB Storage ===
This is a guessed name.
 
User wrapper for [[#sceUsbstorVStorStartForDriver]]. Must have correct permissions to call.
 
=== sceUsbstorVStorStop ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version
! Version !! NID
! NID
|-
|-
| 1.69
| 1.69 || 0x0FD67059
| 0x0FD67059
|}
|}
User wrapper for <code>0x99C2BC8A</code>. Must have correct permissions to call.
 
This is a guessed name.
 
User wrapper for [[#sceUsbstorVStorStopForDriver]]. Must have correct permissions to call.


== Sample Usage ==
== Sample Usage ==
<source lang="c">
<source lang="c">
int start_usb_storage(void)
int start_usb_storage(void) {
{
     int ret = SceMtpIfForDriver_0xFDF8C3C0_stop(1); // stop MTP driver (it calls SceUsbMtpForDriver_08CD359F)
     int ret;
 
    ret = SceMtpIfForDriver_0xFDF8C3C0_stop(1); // stop MTP driver (it calls SceUsbMtpForDriver_08CD359F)
     printf("Stop: 0x%08X\n", ret);
     printf("Stop: 0x%08X\n", ret);
     ret = SceUsbstorVStorForDriver_0x3F02417C_set_name("\"PS Vita\" MC", "1.00");
     ret = SceUsbstorVStorForDriver_0x3F02417C_set_name("\"PS Vita\" MC", "1.00");
Line 134: Line 147:
     ret = SceUsbstorVStorForDriver_0x31F7BBAD_activate(0);
     ret = SceUsbstorVStorForDriver_0x31F7BBAD_activate(0);
     printf("Activate: 0x%08X\n", ret);
     printf("Activate: 0x%08X\n", ret);
     return 0;
     return 0;
}
}


int start_usb_storage_unchecked(void)
int start_usb_storage_unchecked(void) {
{
     int ret = SceMtpIfForDriver_0xFDF8C3C0_stop(1); // stop MTP driver
     int ret;
 
    ret = SceMtpIfForDriver_0xFDF8C3C0_stop(1); // stop MTP driver
     printf("Stop: 0x%08X\n", ret);
     printf("Stop: 0x%08X\n", ret);
     ret = SceUsbstorVStorForDriver_0x3F02417C_set_name("\"PS Vita\" MC", "1.00");
     ret = SceUsbstorVStorForDriver_0x3F02417C_set_name("\"PS Vita\" MC", "1.00");
Line 148: Line 157:
     ret = SceUsbstorVStorForDriver_0x78B42CC8_set_path("ux0:/any/path/here.img");
     ret = SceUsbstorVStorForDriver_0x78B42CC8_set_path("ux0:/any/path/here.img");
     printf("SetPath: 0x%08X\n", ret);
     printf("SetPath: 0x%08X\n", ret);
     // activate without tests
     // activate without tests
     //*(int*)0x013F9054 = 0; // set 1 for RO access
     //*(int*)0x013F9054 = 0; // set 1 for RO access
Line 157: Line 165:
     ret = SceUdcdForDriver_0x4FDEA423_activate(1491);
     ret = SceUdcdForDriver_0x4FDEA423_activate(1491);
     printf("Activate: 0x%08X\n", ret);
     printf("Activate: 0x%08X\n", ret);
     return 0;
     return 0;
}
}


int stop_usb_storage(void)
int stop_usb_storage(void) {
{
     int ret = SceUsbstorVStorForDriver_0x99C2BC8A_stop(1); // stop storage driver
     int ret;
 
    ret = SceUsbstorVStorForDriver_0x99C2BC8A_stop(1); // stop storage driver
     printf("Stop: 0x%08X\n", ret);
     printf("Stop: 0x%08X\n", ret);
     return ret;
     return ret;
}
}
</source>


</source>


[[Category:Modules]]
[[Category:Modules]]
[[Category:Kernel]]
[[Category:Kernel]]

Revision as of 20:06, 6 October 2022

Module

Version World Privilege
1.69-3.60 Non-secure Kernel

Libraries

Known NIDs

Version Name World Visibility NID
1.69 SceUsbstorVStorForDriver Non-secure Kernel 0xFD5BA349
3.60 SceUsbstorVStorForDriver Non-secure Kernel not present
1.69-3.60 SceUsbstorVStor Non-secure User 0x17F294B9

Types

#define USBSTOR_DEVICE_TYPE_DIRECT_ACCESS_BLOCK_DEVICE 0 // used for sceUsbstorVStorStart

SceUsbstorVStorForDriver

sceUsbstorVStorSetDeviceInfoForDriver

Version NID
1.69 0x3F02417C

This is a guessed name.

This name shows up in the USB descriptor.

int sceUsbstorVStorSetDeviceInfoForDriver(const char *name);

sceUsbstorVStorSetImgFilePathForDriver

Version NID
1.69 0x78B42CC8

This is a guessed name.

Sets the filesystem image to use as USB storage. This is limited to the CMA installer ISO and a FAT image at ux0:/umass/fat.img. Other paths will return error.

int sceUsbstorVStorSetImgFilePathForDriver(const char *path);

sceUsbstorVStorStartForDriver

Version NID
1.69 0x31F7BBAD

This is a guessed name.

The user is responsible for making sure that no other UDC driver is active. This activates UDC as a "PS Vita" Type A device.

int sceUsbstorVStorStartForDriver(int unk);

sceUsbstorVStorStopForDriver

Version NID
1.69 0x99C2BC8A

This is a guessed name.

int sceUsbstorVStorStopForDriver(int unk);

SceUsbstorVStor

sceUsbstorVStorSetDeviceInfo

Version NID
1.69 0x3F02417C

This is a guessed name.

User wrapper for #sceUsbstorVStorSetDeviceInfoForDriver. Must have correct permissions to call.

sceUsbstorVStorSetImgFilePath

Version NID
1.69 0x8C9F93AB

This is a guessed name.

User wrapper for #sceUsbstorVStorSetImgFilePathForDriver. Must have correct permissions to call.

sceUsbstorVStorStart

Version NID
1.69 0xB606F1AF

This is a guessed name.

User wrapper for #sceUsbstorVStorStartForDriver. Must have correct permissions to call.

sceUsbstorVStorStop

Version NID
1.69 0x0FD67059

This is a guessed name.

User wrapper for #sceUsbstorVStorStopForDriver. Must have correct permissions to call.

Sample Usage

int start_usb_storage(void) {
    int ret = SceMtpIfForDriver_0xFDF8C3C0_stop(1); // stop MTP driver (it calls SceUsbMtpForDriver_08CD359F)
    printf("Stop: 0x%08X\n", ret);
    ret = SceUsbstorVStorForDriver_0x3F02417C_set_name("\"PS Vita\" MC", "1.00");
    printf("SetName: 0x%08X\n", ret);
    ret = SceUsbstorVStorForDriver_0x78B42CC8_set_path("ux0:/umass/fat.img");
    printf("SetPath: 0x%08X\n", ret);
    ret = SceUsbstorVStorForDriver_0x31F7BBAD_activate(0);
    printf("Activate: 0x%08X\n", ret);
    return 0;
}

int start_usb_storage_unchecked(void) {
    int ret = SceMtpIfForDriver_0xFDF8C3C0_stop(1); // stop MTP driver
    printf("Stop: 0x%08X\n", ret);
    ret = SceUsbstorVStorForDriver_0x3F02417C_set_name("\"PS Vita\" MC", "1.00");
    printf("SetName: 0x%08X\n", ret);
    ret = SceUsbstorVStorForDriver_0x78B42CC8_set_path("ux0:/any/path/here.img");
    printf("SetPath: 0x%08X\n", ret);
    // activate without tests
    //*(int*)0x013F9054 = 0; // set 1 for RO access
    ret = SceUdcdForDriver_0x9FD733EA_start("USBDeviceControllerDriver", 0, 0);
    printf("StartUSB: 0x%08X\n", ret);
    ret = SceUdcdForDriver_0x9FD733EA_start("USBStor_Driver", 0, 0);
    printf("StartStor: 0x%08X\n", ret);
    ret = SceUdcdForDriver_0x4FDEA423_activate(1491);
    printf("Activate: 0x%08X\n", ret);
    return 0;
}

int stop_usb_storage(void) {
    int ret = SceUsbstorVStorForDriver_0x99C2BC8A_stop(1); // stop storage driver
    printf("Stop: 0x%08X\n", ret);
    return ret;
}