Welcome! Log In Create A New Profile

Advanced

isfs Commands?

Posted by pokeglobe 
isfs Commands?
October 03, 2009 03:58AM
I am having trouble reading files within isfs. I want to read the
isfs/title/00000001/00000002/content/00000043.app
But I don't know the commands to read from it. I tried Xyzzy's Source and found some Isfs commands but they aren't working.
Anybody Know any?
Re: isfs Commands?
October 03, 2009 05:09AM
did you initialize ISFS?
Re: isfs Commands?
October 03, 2009 05:11AM
I'm assuming you're new to Wii programming, but you know what pointers are and what malloc does. Try using:

s32 ISFS_Read(s32 fd,void *buffer,u32 length);

Create a buffer (either on the stack or the heap), pass the function the file descriptor (fd), a pointer to your buffer (*buffer), and the buffer's (length) (VERY IMPORTANT, OTHERWISE PROGRAM GO BOOM BOOM)

If you want to just put the whole file in an array, you can use

s32 ISFS_GetFileStats(s32 fd,fstats *status);

to get the length of the file (status->file_length). Again, create an fstats struct on stack or heap, and pass the function the file descriptor of the open file and a pointer to that fstats struct.

Then you can use the file_length field to malloc an appropriately sized buffer.
Re: isfs Commands?
October 03, 2009 05:50AM
@giantpune I don't know how.. I have been looking all over.

@kmeisthax You have officially lost me. I am not really good at any of this yet. Mind explaining?
Re: isfs Commands?
October 03, 2009 11:38AM
Look at the source of fstoolbox.

First of all, you need to execute ISFS_Initialize() before you are able to use ISFS_ commands to access files on nand. How to actually access them, you will see in fstoolbox' source, but there's a problem. You need the rights to access the file you want. If you have updated via nintendo or got your Wii with 3.3v2 or higher, none of your IOS has something that allows you to access the files from the system menu.

If you have 3.2, load IOS36(it has to be v1042) and use ES_Idenitfy to identify as system menu or as "SU"(see AnyTitleDeleter source). With that you are allowed to read a few files(but not all), including the system menu .dol.

If you have a cIOS, do nothing, cIOS has patched nand permissions especially to allow reading and writing all files on nand with the ISFS_ commands.

If you have preloader, use the system menu IOS(on 4.0/4.1 it's IOS60) and then use ES_Identify.

If you have none of this, you can't access the system menu files. A downgrade to 3.2 is not an option, as downgrade is fail and bricks new Wiis. Sorry, i can't describe here how to get your Wii in a state you are able to do what you want, because all tools that allow this, allow piracy at the same time.

Another option would be to write a mini project of course. There you don't have to worry about permissions, but it's more complicated, there's no example code, and requires another development environment.

PS: WARNING: If you read files from nand, always round the buffer size up to 32 bytes chunks. The ISFS_Read command returns more data than it should and you get an eception if you only allocate as much as required memory.



Edited 1 time(s). Last edit at 10/03/2009 11:39AM by WiiPower.
Sorry, only registered users may post in this forum.

Click here to login