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

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 realized I had to edit the Makefile still but another error:
Code:
LIBS    := -lz -liosuhax
Code:
c:/devkitPro/portlibs/ppc/lib\libiosuhax.a(iosuhax.o): In function `IOSUHAX_Open':
iosuhax.c:(.text.IOSUHAX_Open+0x3e): undefined reference to `IOS_Open'
iosuhax.c:(.text.IOSUHAX_Open+0x42): undefined reference to `IOS_Open'
iosuhax.c:(.text.IOSUHAX_Open+0x72): undefined reference to `IOS_Ioctl'
iosuhax.c:(.text.IOSUHAX_Open+0x76): undefined reference to `IOS_Ioctl'
iosuhax.c:(.text.IOSUHAX_Open+0xaa): undefined reference to `IOS_Close'
iosuhax.c:(.text.IOSUHAX_Open+0xb2): undefined reference to `IOS_Close'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/d/Consoles/WiiU/Applications/Browser/tcpgecko/tcpgecko.elf] Error 1
make: *** [build] Error 2
It doesn't find the IOSU functions referenced in the library which is odd. How come?
They have to be defined? As far as browser stuff goes, you have to import and define everything manually. WUT and HBC samples have things which do this but for browser it's a little more tricky.
 

BullyWiiPlaza

Nintendo Hacking <3
Member
Joined
Aug 2, 2014
Messages
1,932
Trophies
0
XP
2,477
Country
Germany
They have to be defined? As far as browser stuff goes, you have to import and define everything manually. WUT and HBC samples have things which do this but for browser it's a little more tricky.
This is for the Homebrew Launcher. It builds an ELF. It's not for the browser (anymore).
 
Last edited by BullyWiiPlaza,

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

Nerdtendo

Your friendly neighborhood idiot
Member
Joined
Sep 29, 2016
Messages
1,770
Trophies
1
XP
4,648
Country
United States
So I was directed to this forum because I am considering developing. I'm still just learning programming (I've made 1 basic game using Python and am working on a more complex one) and I'm also pretty young (I would rather not specify my age) so who here can give me a noob rundown of homebrew development and how it works?
 

BullyWiiPlaza

Nintendo Hacking <3
Member
Joined
Aug 2, 2014
Messages
1,932
Trophies
0
XP
2,477
Country
Germany
So I was directed to this forum because I am considering developing. I'm still just learning programming (I've made 1 basic game using Python and am working on a more complex one) and I'm also pretty young (I would rather not specify my age) so who here can give me a noob rundown of homebrew development and how it works?
You learn C programming and then install devkitPro/with libraries potentially to get started with compiling projects. You better use some existing project and modify it to do what you want instead of starting from scratch.
 

Nerdtendo

Your friendly neighborhood idiot
Member
Joined
Sep 29, 2016
Messages
1,770
Trophies
1
XP
4,648
Country
United States
You learn C programming and then install devkitPro/with libraries potentially to get started with compiling projects. You better use some existing project and modify it to do what you want instead of starting from scratch.
Alright, that she all i need to know. I'll probably tinker with Python a bit more beforehand moving on to C but I'll look into this.
 

BullyWiiPlaza

Nintendo Hacking <3
Member
Joined
Aug 2, 2014
Messages
1,932
Trophies
0
XP
2,477
Country
Germany
Well, I used this library now but the console crashes on the very first call to IOSUHAX_Open(). Here is the code:
Code:
case COMMAND_IOSUHAX_READ_FILE: {
    log_print("COMMAND_IOSUHAX_READ_FILE");

    // TODO Crashes console on this call
    int returnValue = IOSUHAX_Open(NULL);
    log_print("IOSUHAX_Open Done");
    log_printf("IOSUHAX_Open: %i", returnValue);

    if (returnValue < 0) {
        goto IOSUHAX_OPEN_FAILED;
    }

    int fileSystemFileDescriptor = IOSUHAX_FSA_Open();
    log_printf("IOSUHAX_FSA_Open: %i", fileSystemFileDescriptor);

    if (fileSystemFileDescriptor < 0) {
        goto IOSUHAX_FSA_OPEN_FAILED;
    }

    int fileDescriptor;
    const char *filePath = "/vol/storage_usb/usr/title/0005000e/1010ed00/content/audio/stream/pBGM_GBA_CHEESELAND_F.bfstm";
    returnValue = IOSUHAX_FSA_OpenFile(fileSystemFileDescriptor, filePath, "rb", &fileDescriptor);
    log_printf("IOSUHAX_FSA_OpenFile: %i", returnValue);

    if (returnValue < 0) {
        goto IOSUHAX_OPEN_FILE_FAILED;
    }

    fileStat_s fileStat;
    returnValue = IOSUHAX_FSA_StatFile(fileSystemFileDescriptor, fileDescriptor, &fileStat);
    log_printf("IOSUHAX_FSA_StatFile: %i", returnValue);

    if (returnValue < 0) {
        goto IOSUHAX_READ_FILE_FAILED_CLOSE;
    }

    void *fileBuffer = MEMBucket_alloc(fileStat.size, 4);
    log_printf("File Buffer: %p", fileBuffer);

    if (!fileBuffer) {
        goto IOSUHAX_READ_FILE_FAILED_CLOSE;
    }

    size_t totalBytesRead = 0;
    while (totalBytesRead < fileStat.size) {
        size_t remainingBytes = fileStat.size - totalBytesRead;
        int bytesRead = IOSUHAX_FSA_ReadFile(fileSystemFileDescriptor,
                                             fileBuffer + totalBytesRead,
                                             0x01,
                                             remainingBytes,
                                             fileDescriptor,
                                             0);
        log_printf("IOSUHAX_FSA_ReadFile: %i", bytesRead);

        if (bytesRead <= 0) {
            goto IOSUHAX_READ_FILE_FAILED_CLOSE;
        } else {
            totalBytesRead += bytesRead;
        }
    }

    log_printf("Bytes read: %i", totalBytesRead);

    IOSUHAX_READ_FILE_FAILED_CLOSE:

    returnValue = IOSUHAX_FSA_CloseFile(fileSystemFileDescriptor, fileDescriptor);
    log_printf("IOSUHAX_FSA_CloseFile: %i", returnValue);

    IOSUHAX_OPEN_FILE_FAILED:

    returnValue = IOSUHAX_FSA_Close(fileSystemFileDescriptor);
    log_printf("IOSUHAX_FSA_Close: %i", returnValue);

    IOSUHAX_FSA_OPEN_FAILED:

    returnValue = IOSUHAX_Close();
    log_printf("IOSUHAX_Close: %i", returnValue);

    IOSUHAX_OPEN_FAILED:

    break;
}
I intend to read a file from Mario Kart 8 from the USB and hard-coded the path for testing. In case there is something wrong with it, thanks for any indications.

Only the first log is printed so it is obvious that it crashed exactly at the first call:
6jhzdxfw.png

I tried in the Wii U menu and in some Wii U game but same result. Why does it crash? Since the code compiled to begin with, the function is not undefined or anything so it should execute correctly. I didn't modify the libiosuhax at all. I only used CBHC booting the system menu with patches however, no Mocha. With Mocha, it freezes after the TCP Gecko Installer when the Wii U menu loads :/
 
Last edited by BullyWiiPlaza,

Maschell

Well-Known Member
Member
Joined
Jun 14, 2008
Messages
1,090
Trophies
2
XP
4,648
Country
Germany
Check the logs of the console with ftpiiu everywhere

Edit: ONLY Mocha supports libiosuhax on dev/iosuhax, so I guess thats the problem. It shouldn't crash though.
(CBHC needs some workarround I personally don't really like)
Probabaly the fact that the TCP Installer is crashing after using Mocha is the problem
 
Last edited by Maschell,

BullyWiiPlaza

Nintendo Hacking <3
Member
Joined
Aug 2, 2014
Messages
1,932
Trophies
0
XP
2,477
Country
Germany
Check the logs of the console with ftpiiu everywhere
What's the file path to check the logs?
Edit: ONLY Mocha supports libiosuhax on dev/iosuhax, so I guess thats the problem. It shouldn't crash though.
(CBHC needs some workarround I personally don't really like)
Probabaly the fact that the TCP Installer is crashing after using Mocha is the problem
So CBHC should use Mocha to avoid having more problems and the TCP Gecko Installer should be fixed so it doesn't crash in certain circumstances? It seems like it because I also don't like how some dimok tools don't work with CBHC's system menu patches. There is just no reason for that :D
 

Maschell

Well-Known Member
Member
Joined
Jun 14, 2008
Messages
1,090
Trophies
2
XP
4,648
Country
Germany
I also don't like how some dimok tools don't work with CBHC's system menu patches. There is just no reason for that :D
The otherway round. CBHC doesn't support libiosuhax, because it's "just" patching some function and is no real CFW.
I personally would just use Mocha and no CBHC at all ;)

The logs are in "storage_slc/logs"
 
  • Like
Reactions: BullyWiiPlaza

brienj

Trying to avoid getting cancer
Member
Joined
Jan 3, 2016
Messages
1,232
Trophies
0
Website
twitter.com
XP
2,142
Country
United States
Check the logs of the console with ftpiiu everywhere

Edit: ONLY Mocha supports libiosuhax on dev/iosuhax, so I guess thats the problem. It shouldn't crash though.
(CBHC needs some workarround I personally don't really like)
Probabaly the fact that the TCP Installer is crashing after using Mocha is the problem
I'm glad to learn I'm not the only one ...

I have a few homebrew projects I haven't bothered releasing, cause I didn't feel like making it work with the MCP hooks in Haxchi/CBHC.
 
  • Like
Reactions: Maschell

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
  • DinohScene @ DinohScene:
    run h2testw on it
  • DinohScene @ DinohScene:
    when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying
    DinohScene @ DinohScene: when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying