heres my code:
std::string src="/shared2/wc24/misc.bin";
std::string dst="/misc_fat.bin";
ISFS_Initialize();
s32 fd=ISFS_Open(src, ISFS_OPEN_READ);
s32 retr;
u8 *buffer;
if (Exists(fd)) {
buffer=(u8*)memalign(32, 0x400);
retr=ISFS_Read(fd, buffer, 0x400);
}
else {
return "I/O error.";
}
fatInitDefault();
ISFS_Close(fd);
std::ofstream bufo(dst, std::ios::binary);
bufo << buffer;
bufo.close();
std::string src="/shared2/wc24/misc.bin";
std::string dst="/misc_fat.bin";
ISFS_Initialize();
s32 fd=ISFS_Open(src, ISFS_OPEN_READ);
s32 retr;
u8 *buffer;
if (Exists(fd)) {
buffer=(u8*)memalign(32, 0x400);
retr=ISFS_Read(fd, buffer, 0x400);
}
else {
return "I/O error.";
}
fatInitDefault();
ISFS_Close(fd);
std::ofstream bufo(dst, std::ios::binary);
bufo << buffer;
bufo.close();