RetroArch
Macros | Functions | Variables
iosuhax.c File Reference
#include <string.h>
#include <malloc.h>
#include "os_functions.h"
#include "iosuhax.h"
Include dependency graph for iosuhax.c:

Macros

#define IOSUHAX_MAGIC_WORD   0x4E696365
 
#define IOCTL_MEM_WRITE   0x00
 
#define IOCTL_MEM_READ   0x01
 
#define IOCTL_SVC   0x02
 
#define IOCTL_MEMCPY   0x04
 
#define IOCTL_REPEATED_WRITE   0x05
 
#define IOCTL_KERN_READ32   0x06
 
#define IOCTL_KERN_WRITE32   0x07
 
#define IOCTL_FSA_OPEN   0x40
 
#define IOCTL_FSA_CLOSE   0x41
 
#define IOCTL_FSA_MOUNT   0x42
 
#define IOCTL_FSA_UNMOUNT   0x43
 
#define IOCTL_FSA_GETDEVICEINFO   0x44
 
#define IOCTL_FSA_OPENDIR   0x45
 
#define IOCTL_FSA_READDIR   0x46
 
#define IOCTL_FSA_CLOSEDIR   0x47
 
#define IOCTL_FSA_MAKEDIR   0x48
 
#define IOCTL_FSA_OPENFILE   0x49
 
#define IOCTL_FSA_READFILE   0x4A
 
#define IOCTL_FSA_WRITEFILE   0x4B
 
#define IOCTL_FSA_STATFILE   0x4C
 
#define IOCTL_FSA_CLOSEFILE   0x4D
 
#define IOCTL_FSA_SETFILEPOS   0x4E
 
#define IOCTL_FSA_GETSTAT   0x4F
 
#define IOCTL_FSA_REMOVE   0x50
 
#define IOCTL_FSA_REWINDDIR   0x51
 
#define IOCTL_FSA_CHDIR   0x52
 
#define IOCTL_FSA_RENAME   0x53
 
#define IOCTL_FSA_RAW_OPEN   0x54
 
#define IOCTL_FSA_RAW_READ   0x55
 
#define IOCTL_FSA_RAW_WRITE   0x56
 
#define IOCTL_FSA_RAW_CLOSE   0x57
 
#define IOCTL_FSA_CHANGEMODE   0x58
 
#define IOCTL_FSA_FLUSHVOLUME   0x59
 
#define IOCTL_CHECK_IF_IOSUHAX   0x5B
 

Functions

int IOSUHAX_Open (const char *dev)
 
int IOSUHAX_Close (void)
 
int IOSUHAX_memwrite (uint32_t address, const uint8_t *buffer, uint32_t size)
 
int IOSUHAX_memread (uint32_t address, uint8_t *out_buffer, uint32_t size)
 
int IOSUHAX_memcpy (uint32_t dst, uint32_t src, uint32_t size)
 
int IOSUHAX_SVC (uint32_t svc_id, uint32_t *args, uint32_t arg_cnt)
 
int IOSUHAX_FSA_Open (void)
 
int IOSUHAX_FSA_Close (int fsaFd)
 
int IOSUHAX_FSA_Mount (int fsaFd, const char *device_path, const char *volume_path, uint32_t flags, const char *arg_string, int arg_string_len)
 
int IOSUHAX_FSA_Unmount (int fsaFd, const char *path, uint32_t flags)
 
int IOSUHAX_FSA_FlushVolume (int fsaFd, const char *volume_path)
 
int IOSUHAX_FSA_GetDeviceInfo (int fsaFd, const char *device_path, int type, uint32_t *out_data)
 
int IOSUHAX_FSA_MakeDir (int fsaFd, const char *path, uint32_t flags)
 
int IOSUHAX_FSA_OpenDir (int fsaFd, const char *path, int *outHandle)
 
int IOSUHAX_FSA_ReadDir (int fsaFd, int handle, directoryEntry_s *out_data)
 
int IOSUHAX_FSA_RewindDir (int fsaFd, int dirHandle)
 
int IOSUHAX_FSA_CloseDir (int fsaFd, int handle)
 
int IOSUHAX_FSA_ChangeDir (int fsaFd, const char *path)
 
int IOSUHAX_FSA_OpenFile (int fsaFd, const char *path, const char *mode, int *outHandle)
 
int IOSUHAX_FSA_ReadFile (int fsaFd, void *data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags)
 
int IOSUHAX_FSA_WriteFile (int fsaFd, const void *data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags)
 
int IOSUHAX_FSA_StatFile (int fsaFd, int fileHandle, fileStat_s *out_data)
 
int IOSUHAX_FSA_CloseFile (int fsaFd, int fileHandle)
 
int IOSUHAX_FSA_SetFilePos (int fsaFd, int fileHandle, uint32_t position)
 
int IOSUHAX_FSA_GetStat (int fsaFd, const char *path, fileStat_s *out_data)
 
int IOSUHAX_FSA_Remove (int fsaFd, const char *path)
 
int IOSUHAX_FSA_ChangeMode (int fsaFd, const char *path, int mode)
 
int IOSUHAX_FSA_RawOpen (int fsaFd, const char *device_path, int *outHandle)
 
int IOSUHAX_FSA_RawRead (int fsaFd, void *data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle)
 
int IOSUHAX_FSA_RawWrite (int fsaFd, const void *data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle)
 
int IOSUHAX_FSA_RawClose (int fsaFd, int device_handle)
 

Variables

static int iosuhaxHandle = -1
 

Macro Definition Documentation

◆ IOCTL_CHECK_IF_IOSUHAX

#define IOCTL_CHECK_IF_IOSUHAX   0x5B

◆ IOCTL_FSA_CHANGEMODE

#define IOCTL_FSA_CHANGEMODE   0x58

◆ IOCTL_FSA_CHDIR

#define IOCTL_FSA_CHDIR   0x52

◆ IOCTL_FSA_CLOSE

#define IOCTL_FSA_CLOSE   0x41

◆ IOCTL_FSA_CLOSEDIR

#define IOCTL_FSA_CLOSEDIR   0x47

◆ IOCTL_FSA_CLOSEFILE

#define IOCTL_FSA_CLOSEFILE   0x4D

◆ IOCTL_FSA_FLUSHVOLUME

#define IOCTL_FSA_FLUSHVOLUME   0x59

◆ IOCTL_FSA_GETDEVICEINFO

#define IOCTL_FSA_GETDEVICEINFO   0x44

◆ IOCTL_FSA_GETSTAT

#define IOCTL_FSA_GETSTAT   0x4F

◆ IOCTL_FSA_MAKEDIR

#define IOCTL_FSA_MAKEDIR   0x48

◆ IOCTL_FSA_MOUNT

#define IOCTL_FSA_MOUNT   0x42

◆ IOCTL_FSA_OPEN

#define IOCTL_FSA_OPEN   0x40

◆ IOCTL_FSA_OPENDIR

#define IOCTL_FSA_OPENDIR   0x45

◆ IOCTL_FSA_OPENFILE

#define IOCTL_FSA_OPENFILE   0x49

◆ IOCTL_FSA_RAW_CLOSE

#define IOCTL_FSA_RAW_CLOSE   0x57

◆ IOCTL_FSA_RAW_OPEN

#define IOCTL_FSA_RAW_OPEN   0x54

◆ IOCTL_FSA_RAW_READ

#define IOCTL_FSA_RAW_READ   0x55

◆ IOCTL_FSA_RAW_WRITE

#define IOCTL_FSA_RAW_WRITE   0x56

◆ IOCTL_FSA_READDIR

#define IOCTL_FSA_READDIR   0x46

◆ IOCTL_FSA_READFILE

#define IOCTL_FSA_READFILE   0x4A

◆ IOCTL_FSA_REMOVE

#define IOCTL_FSA_REMOVE   0x50

◆ IOCTL_FSA_RENAME

#define IOCTL_FSA_RENAME   0x53

◆ IOCTL_FSA_REWINDDIR

#define IOCTL_FSA_REWINDDIR   0x51

◆ IOCTL_FSA_SETFILEPOS

#define IOCTL_FSA_SETFILEPOS   0x4E

◆ IOCTL_FSA_STATFILE

#define IOCTL_FSA_STATFILE   0x4C

◆ IOCTL_FSA_UNMOUNT

#define IOCTL_FSA_UNMOUNT   0x43

◆ IOCTL_FSA_WRITEFILE

#define IOCTL_FSA_WRITEFILE   0x4B

◆ IOCTL_KERN_READ32

#define IOCTL_KERN_READ32   0x06

◆ IOCTL_KERN_WRITE32

#define IOCTL_KERN_WRITE32   0x07

◆ IOCTL_MEM_READ

#define IOCTL_MEM_READ   0x01

◆ IOCTL_MEM_WRITE

#define IOCTL_MEM_WRITE   0x00

◆ IOCTL_MEMCPY

#define IOCTL_MEMCPY   0x04

◆ IOCTL_REPEATED_WRITE

#define IOCTL_REPEATED_WRITE   0x05

◆ IOCTL_SVC

#define IOCTL_SVC   0x02

◆ IOSUHAX_MAGIC_WORD

#define IOSUHAX_MAGIC_WORD   0x4E696365

Function Documentation

◆ IOSUHAX_Close()

int IOSUHAX_Close ( void  )
Here is the caller graph for this function:

◆ IOSUHAX_FSA_ChangeDir()

int IOSUHAX_FSA_ChangeDir ( int  fsaFd,
const char *  path 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_ChangeMode()

int IOSUHAX_FSA_ChangeMode ( int  fsaFd,
const char *  path,
int  mode 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_Close()

int IOSUHAX_FSA_Close ( int  fsaFd)
Here is the caller graph for this function:

◆ IOSUHAX_FSA_CloseDir()

int IOSUHAX_FSA_CloseDir ( int  fsaFd,
int  handle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_CloseFile()

int IOSUHAX_FSA_CloseFile ( int  fsaFd,
int  fileHandle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_FlushVolume()

int IOSUHAX_FSA_FlushVolume ( int  fsaFd,
const char *  volume_path 
)
Here is the call graph for this function:

◆ IOSUHAX_FSA_GetDeviceInfo()

int IOSUHAX_FSA_GetDeviceInfo ( int  fsaFd,
const char *  device_path,
int  type,
uint32_t out_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_GetStat()

int IOSUHAX_FSA_GetStat ( int  fsaFd,
const char *  path,
fileStat_s out_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_MakeDir()

int IOSUHAX_FSA_MakeDir ( int  fsaFd,
const char *  path,
uint32_t  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_Mount()

int IOSUHAX_FSA_Mount ( int  fsaFd,
const char *  device_path,
const char *  volume_path,
uint32_t  flags,
const char *  arg_string,
int  arg_string_len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_Open()

int IOSUHAX_FSA_Open ( void  )
Here is the caller graph for this function:

◆ IOSUHAX_FSA_OpenDir()

int IOSUHAX_FSA_OpenDir ( int  fsaFd,
const char *  path,
int *  outHandle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_OpenFile()

int IOSUHAX_FSA_OpenFile ( int  fsaFd,
const char *  path,
const char *  mode,
int *  outHandle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_RawClose()

int IOSUHAX_FSA_RawClose ( int  fsaFd,
int  device_handle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_RawOpen()

int IOSUHAX_FSA_RawOpen ( int  fsaFd,
const char *  device_path,
int *  outHandle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_RawRead()

int IOSUHAX_FSA_RawRead ( int  fsaFd,
void data,
uint32_t  block_size,
uint32_t  block_cnt,
uint64_t  sector_offset,
int  device_handle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_RawWrite()

int IOSUHAX_FSA_RawWrite ( int  fsaFd,
const void data,
uint32_t  block_size,
uint32_t  block_cnt,
uint64_t  sector_offset,
int  device_handle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_ReadDir()

int IOSUHAX_FSA_ReadDir ( int  fsaFd,
int  handle,
directoryEntry_s out_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_ReadFile()

int IOSUHAX_FSA_ReadFile ( int  fsaFd,
void data,
uint32_t  size,
uint32_t  cnt,
int  fileHandle,
uint32_t  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_Remove()

int IOSUHAX_FSA_Remove ( int  fsaFd,
const char *  path 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_RewindDir()

int IOSUHAX_FSA_RewindDir ( int  fsaFd,
int  dirHandle 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_SetFilePos()

int IOSUHAX_FSA_SetFilePos ( int  fsaFd,
int  fileHandle,
uint32_t  position 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_StatFile()

int IOSUHAX_FSA_StatFile ( int  fsaFd,
int  fileHandle,
fileStat_s out_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_Unmount()

int IOSUHAX_FSA_Unmount ( int  fsaFd,
const char *  path,
uint32_t  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_FSA_WriteFile()

int IOSUHAX_FSA_WriteFile ( int  fsaFd,
const void data,
uint32_t  size,
uint32_t  cnt,
int  fileHandle,
uint32_t  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOSUHAX_memcpy()

int IOSUHAX_memcpy ( uint32_t  dst,
uint32_t  src,
uint32_t  size 
)

◆ IOSUHAX_memread()

int IOSUHAX_memread ( uint32_t  address,
uint8_t out_buffer,
uint32_t  size 
)

◆ IOSUHAX_memwrite()

int IOSUHAX_memwrite ( uint32_t  address,
const uint8_t buffer,
uint32_t  size 
)
Here is the call graph for this function:

◆ IOSUHAX_Open()

int IOSUHAX_Open ( const char *  dev)
Here is the caller graph for this function:

◆ IOSUHAX_SVC()

int IOSUHAX_SVC ( uint32_t  svc_id,
uint32_t args,
uint32_t  arg_cnt 
)
Here is the call graph for this function:

Variable Documentation

◆ iosuhaxHandle

int iosuhaxHandle = -1
static