Homebrew Official libiosuhax - PPC IPC library for communication to /dev/iosuhax

dimok

Well-Known Member
OP
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States

PPC IPC Library

If you are an end user just skip to next (FT2SD) section :P. Otherwise here is some explanation on what this is:

I was working on something for developers on the PPC side to allow them easier interaction with iosuhax. I created a new /dev/iosuhax node which can be accessed from the PPC side and which can receive many different commands. It has at least the power of the wupclient.py but is quite a bit faster as it uses the native PPC <-> ARM interprocess communication queue of the system.

Now I wrote up some IOCTL commands to allow easy FSA access and to allow SVC syscalls, memcpy in and out, IOS kernel read and other usefull stuff from the PPC side. This is still in development and can be extended with more usefull commands. You can see all the changes on my iosuhax fork here:
https://github.com/dimok789/iosuhax

You can build that fork for sysNAND or redNAND depending on what make target you use (either "make redNAND" or "make cfw").

Furthermore I prepared a (hopefully) easy to use library for PPC developers to link against. I called it libiosuhax. You can find the library here:
https://github.com/dimok789/libiosuhax

The library includes the necessary IOS_Ioctl wrappers to do the work for several functions and a quite usefull multi-functional devoptab which can be used to map different path within IOSU FS to a path accessible from the PPC. The devoptab lib can also mount different devices to a virtual path and map those for the PPC to access.

A little insight on a possible usage.
Code:
  // initialize IOSUHAX
  int res = IOSUHAX_Open();
  if(res < 0)
  {
  // handle error
  }
  // initialize FSA fd
  int fsaFd = IOSUHAX_FSA_Open();
  if(fsaFd < 0)
  {
  // handle error
  }
  // mount "/dev/odd03" to "/vol/storage_virt_odd" and bind it to our virt PPC path "odd:/"
  // if 3rd parameter is NULL it only binds the /vol path (e.g. /vol/system)  to our virt PPC path
  res = mount_fs("odd", fsaFd, "/dev/odd03", "/vol/storage_virt_odd");
  if(res < 0)
  {
  // handle error
  }

  FILE *pFile = fopen("odd:/code/some.rpx", "rb");
  // do some read/write I/O
  ...

This all shall help make user friendly IOSU applications on the PPC side. With this developers could actually access the IOSUHAX and do all kind of stuff in there directly from a (in best case) good looking GX2 PPC application.

FT2SD

So this above was all only usefull to developers. Now let's get to the part that is interessting for end users. I prepared something for you guys to play with. A tool which utilizes the new library and shows it in action and how to use it.

I created a new application called FT2SD (File Tree 2 SD). This application is a file tree dumper to SD. It can dump several (currently) predefined paths directly to your SD card, like for example game disc content, updates, tickets, slc content, vWii content, mlc...Think of this tool as a very pimped ddd alternative. It might even miss some interessting paths but those can be added quite easy.
The application is currently only a console application but I think i will improve it later with a GX2 GUI and make a nice explorer tool out of it where the user can change paths and copy stuff back and forth.

This is how it looks in action:
Yg5HaPF.jpg
iojIz6X.jpg


Here is a HBL ELF for that application which you have to run once you have a /dev/iosuhax node (a.k.a. run the custom fw.img). You can use it on both sysNAND or redNAND. It doesn't matter as long as you have the /dev/iosuhax node in your fw.img or some other launch method.

http://www2.zippyshare.com/v/VR6842HO/file.html

Have fun dumping stuff.

FTPiiu everywhere

Now this tool is only for advanced users ONLY. This is an extension to the existing ftpiiu tool. It mounts all the paths listed in the FT2SD tool and offers them on the FTP. This includes SLC and MLC! You can also add files or remove files on the FTP which makes it quite dangerous if you do this on sysNAND. So therefore here is a fair warning:

DO NOT TOUCH THIS TOOL IF YOU DON'T KNOW WHAT YOU DO. IF YOU MODIFY FILES ON sysNAND YOU MIGHT BE SCREWED!!!

If you brick your WiiU because you modified some files on sysNAND with this, then it is your own fault.

If you are aware of the risk and want to only explore the files on your WiiU here is the application:

http://www45.zippyshare.com/v/QHVbAby9/file.html

PzL0Lzn.jpg
MXHF7sB.jpg


The same rules apply to this application as to the above

Sources

cfw redNAND and sysNAND fw.img:
https://github.com/dimok789/iosuhax

PPC IPC library for /dev/iosuhax:
https://github.com/dimok789/libiosuhax

FT2SD and FTPiiu everywhere:
https://github.com/dimok789/ft2sd
https://github.com/dimok789/ftpiiu/tree/ftpiiu_everywhere

How to compile

cfw redNAND and sysNAND fw.img:
There is a nice thread somewhere around made by FIX94 that explains it.

PPC IPC library for /dev/iosuhax:
Just use "make" and "make install". Then link the library with -liosuhax in your makefile and use it. There is a already build library in the releases section.
 
Last edited by dimok,

DeslotlCL

GBAtemp's scalie trash
Member
Joined
Oct 28, 2015
Messages
2,847
Trophies
0
XP
2,755
Country
United States
Question, what exactly should i do to dump one of my discs? Select the dump disc content odd03 or odd04? What will be the disc format output? Loadiine ready or an instalable wud?
 

dimok

Well-Known Member
OP
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
Question, what exactly should i do to dump one of my discs? Select the dump disc content odd03 or odd04? What will be the disc format output? Loadiine ready or an instalable wud?
Usually odd03 has the content. Some games have content on odd04. The data you get from there is /code /content /meta, as required by loadiine. You dont get the wud image.

Is dumping with FT2SD just as slow as wupserver or is it fast and speedy?
As described above its a direct copy and therefore quite faster.
 

DeslotlCL

GBAtemp's scalie trash
Member
Joined
Oct 28, 2015
Messages
2,847
Trophies
0
XP
2,755
Country
United States
Usually odd03 has the content. Some games have content on odd04. The data you get from there is /code /content /meta, as required by loadiine. You dont get the wud image.


As described above its a direct copy and therefore quite faster.
Ah I see, that's alright. Thanks :)
 

subcon959

@!#?@!
Member
Joined
Dec 24, 2008
Messages
5,845
Trophies
4
XP
10,100
Country
United Kingdom
Trying to use ftpiiu everywhere but I keep getting a List Error. I can only seem to browse the SD, everything else gives that error. I'm using FlashFXP.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,648
Country
France
I had issue with flashFXP in the past (broke my SD card inserted in Wii with ftpii, it couldn't be detected, even the HBC bubble never popped out when inserting/removing it. the card works on PSP and PC... not on wii), but it was an old version so maybe it's fixed now.
I don't know if it was ftpii or flashfxp issue, but I'm now using filezilla instead.
 

subcon959

@!#?@!
Member
Joined
Dec 24, 2008
Messages
5,845
Trophies
4
XP
10,100
Country
United Kingdom
I had issue with flashFXP in the past (broke my SD card inserted in Wii with ftpii, it couldn't be detected, even the HBC bubble never popped out when inserting/removing it. the card works on PSP and PC... not on wii), but it was an old version so maybe it's fixed now.
I don't know if it was ftpii or flashfxp issue, but I'm now using filezilla instead.
In case it was flashfxp, I just tried pasting the ftp address straight into explorer and same thing happened. I can browse SD fine, but anywhere else and it throws up an error as if I don't have permissions. I'm launching dimok's iosuhax beforehand so that shouldn't be an issue.
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
I personally feel like forcing permissions in IOS is the proper solution for this, to be honest. You can access the entire MLC partition like this as long as permissions are stripped away. You can test this by just chmod'ing a file with perms 0x777 and any application will be able to access it. Having a separate devoptab and extra hooks just to communicate with IOS kinda feels like a mess of a way to go about doing things, and I can't really think of any reasons for PPC to be poking IOS memory when wupserver is OK at that already. At the very least it's at least kinda neat? I just can't think of any real uses for it, personally.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,648
Country
France
subcon, you are using his new fw.img ? not an old one you had, right?
He added "IOSU Node" on his new IOSUHax yesterday, you need these nodes (API) to "attach" ftpii to it.
 

dimok

Well-Known Member
OP
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
I updated the lib and added FSA raw open/read/write/close functions as ioctl commands now.
@aliaspider @FIX94 now we can try and see if we can use libfat from PPC ;). Screw that Nintendo FS library with zero caching.

Trying to use ftpiiu everywhere but I keep getting a List Error. I can only seem to browse the SD, everything else gives that error. I'm using FlashFXP.
You are very likely not using a new build of the iosuhax. I uploaded the sources yesterday and you have to re-build it.

I personally feel like forcing permissions in IOS is the proper solution for this, to be honest. You can access the entire MLC partition like this as long as permissions are stripped away. You can test this by just chmod'ing a file with perms 0x777 and any application will be able to access it. Having a separate devoptab and extra hooks just to communicate with IOS kinda feels like a mess of a way to go about doing things, and I can't really think of any reasons for PPC to be poking IOS memory when wupserver is OK at that already. At the very least it's at least kinda neat? I just can't think of any real uses for it, personally.
Actually this is how the system is intended to access FSA and hardware in generell in the first place, through IPC.
Changing permissions of files on the systems is usually a very bad idea as that is quite permanent. From my point of view this is actually not the way to go. At least not for normal users. What wupserver can do is quite awesome but accessing wupserver from PPC through a local TCP socket seems kind of weird when there is something on the system that is faster and is already designed exactly for that interprocess communication. This whole thing's purpose is for creating nice PPC applications.

Besides you still have to mount some devices as they are not always mounted so you have to have some communication to the ARM side.
 
Last edited by dimok,

AboodXD

I hack NSMB games, and other shiz.
Member
Joined
Oct 11, 2014
Messages
2,880
Trophies
1
Location
Not under a rock.
XP
2,921
Country
United Arab Emirates
Can somebody tell me what FTP program is @dimok using?
FileZilla only succeeds to mount the SD...

It says Directory listing failed for everything except SD.
I'm using redNAND BTW.

Edit: oh, I have to rebuild iosuhax...
 
Last edited by AboodXD,
  • Like
Reactions: efen3001

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: @Veho @AncientBoi's favorite