From 20727ac6f170a19227f6dfc2124e14e3eb7305d8 Mon Sep 17 00:00:00 2001 From: dimok789 Date: Fri, 18 Nov 2016 09:20:17 +0100 Subject: [PATCH] - fixed fsa write function - fixed fsa remove function --- Makefile | 2 +- source/iosuhax.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index aa40dd8..3051b83 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ HDRINSTALL := $(PORTLIBS)/include #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -O2 -Wall -Wno-unused $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H +CFLAGS = -O2 -Wall -Wno-unused $(MACHDEP) $(INCLUDE) CXXFLAGS = $(CFLAGS) ASFLAGS := -g diff --git a/source/iosuhax.c b/source/iosuhax.c index 359f914..0dc83c8 100644 --- a/source/iosuhax.c +++ b/source/iosuhax.c @@ -51,6 +51,7 @@ #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 @@ -541,7 +542,7 @@ int IOSUHAX_FSA_WriteFile(int fsaFd, const void* data, u32 size, u32 cnt, int fi const int input_cnt = 5; - int io_buf_size = ((sizeof(u32) * input_cnt + 0x40) + 0x3F) & ~0x3F; + int io_buf_size = ((sizeof(u32) * input_cnt + size * cnt + 0x40) + 0x3F) & ~0x3F; u32 *io_buf = (u32*)memalign(0x20, io_buf_size); if(!io_buf) @@ -726,7 +727,7 @@ int IOSUHAX_FSA_Remove(int fsaFd, const char *path) int result; - int res = IOS_Ioctl(iosuhaxHandle, IOCTL_FSA_GETSTAT, io_buf, io_buf_size, &result, sizeof(result)); + int res = IOS_Ioctl(iosuhaxHandle, IOCTL_FSA_REMOVE, io_buf, io_buf_size, &result, sizeof(result)); if(res < 0) { free(io_buf);