Wii U Functions List (For developers)

Discussion in 'Wii U - Hacking & Backup Loaders' started by NexoCube, Feb 13, 2016.

  1. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    I made this thread for Wii U Homebrew Develloppers to know all Functions (The ones that are not on Wii U Brew) Naturelly they are all C Code.

    How did i found them ?

    I found them on 2.12.13 Cafe OS SDK, making it public is illegal, and doesn't respect GBATemp posting rules

    List :

    Basic :

    • memcpy(dest, src, length) - dest become src (src = 1, dest = 0 | memcpy(dest, src, length) --> src = 1 ; dest = 1)
    • memset(src, value, lengthtobechange) - src = "John Cena" ; value = "Nexo" | memset(src, value, 4) --> src = "Nexo Cena" The 4 first letters of the string has been set to the value
    • OSFatal(str) - str = "Hello World" | OSFatal(str) -> Will froze your screen/console and prints the str
    • _Exit() - Exit the app running in background (Web Browser)
    • OSCreateThread(thread, entry, argc, args, stack, stack_size, priority, attr) - Create a Thread
    • OSResumeThread(thread) - Start a Thread

    I wrote above the essentially functions to Wii U Homebrewing.

    sysapp.rpl : (Thos that are not on Wii U Brew)

    • SYSLaunchAccount() - Launch the Account Management Application
    • SYSCheckSystemApplicationExists(id) - ID :
    E-Manual : 4
    Mini MiiVerse : 7
    Web Browser : 8
    MiiVerse : 9
    E-Shop : 10

    • SYSSwitchToEShopAocList(maybe title id ?) - TITLE ID - Jump to the DLC Game Page
    • SYSSwitchToEShopTicketList(title id too ?) - TITLE ID - Jump to subscriptions list page
    GX2 Many, Many Functions not listed :

    -snip- (No you won't)

    FS (File System) :

    • FSInit() and FSShutdown() - Init or Shutdown the fs librairy
    • FSAddClient(client, FSRetFlag flag) and FSDelClient(client, FSRetFlag flag) - Add or Delete a client
    • Look here for already known FS Functions
    • FSGetMountSource(client, cmd, type, source, FSRetFlag flag) - Get the Mount Source
    • FSMount(client, cmd, source, char *target, u32 bytes, FSRetFlag) - Mount SDcard or USB (Kernel)
    • FSUnmount(client, cmd, char *target, FSRetFlag flag) - Unmount a device
    • FSChangeDir(client, cmd, char *path) - Change Directory
    • FSOpenFile(client, cmd, char *path, char *mode, FSFileHandle, FSRetFlag flag) - Open file
    • FSCloseFile(client, cmd, FSFileHandle fileHandle, FSRetFlag flag) - Close a opened file
    • FSReadFile(client, block, void *dest, size, count, FSFileHandle fileHandle, FSFlag flag,FSRetFlag errHandling); - Read a opened file
    • FSOpenDir(client, cmd, char *path, dir_handle, FSRetFlag flag) - Open a directory
    • FSCloseDir(client, cmd, dir_handle, FSRetFlag flag) - Close a opened directory
    • FSReadDir(client, cmd, dir_handle, returned_dir_entry, FSRetFlag flag) - Read into a directory
    • FSMakeDir(client, cmd, char *path, FSRetFlag flag) - Create a directory
    • FSRemove(client, cmd, char *path, FSRetFlag flag) - Remove a new entry (directory ?)
    • FSRename(client, cmd char *oldPath, char *newPath, FSRetFlag flag) - Rename a file
    And others...

    DMAE.rpl :

    • DMAEWaitDone(DMAETimeStamp ts) - Wait for a DMA command to complete
    • DMAEIsDone(DMAETimeStamp ts) - Return true if yes or False for no
    • Some Semaphores functions (if you want me to add them, ask me in the comments)
    • DMAECopyMem(dst, src, u32 size, endian) - Issue a DMA command to copy memory from one range to another
    • DMAEFillMem(dst, u32 fillData, u32 size) - Issue a DMA command to fill a memory range with a specified value
    • DMAEFillMemPhys(dst-pa, u32 fillData, u32 size) - Issue a DMA command to fill a physical memory range with a specified value
    • DMAESetTimeout(u32 millisec) - Set a millisec timeout
    • DMAEGetTimeout(void) - Get a timeout
    Network (nsysnet.rpl etc...) :

    Everything that is here : wiiubrew.org/wiki/Nsysnet.rpl

    • bind(int fd, struct sockaddr *addr, int addrlen) - Bind a socket connection
    • socketclose(fd) - Close a socket (fd is a socket)
    And all of this xD :

    Code:
    extern int recvfrom(int fd, void *buffer, int len, int flags,struct sockaddr *from, int *fromlen);
    
    extern int recvfrom_ex(int fd, void *buffer, int len, int flags,struct sockaddr *from, int *fromlen,amsg msg, int msglen);
    
    extern int recvfrom_multi (int fd, int flags,struct recvfrom_multi_buffers *buffs, int recv_datagram_len, int recv_datagram_count,struct timeval *timeout);
    
    extern int send(int fd, const void *buffer, int len, int flags);
    
    extern int sendto(int fd, const void *buffer, int len, int flags,const struct sockaddr *dest_addr, int dest_len);
    
    extern int sendto_multi(int fd, const void *buffer, int len, int flags,const struct sockaddr *dest_addrs, int dest_count);
    
    extern int sendto_multi_ex (int fd, int flags,struct sendto_multi_ex_buffers *buffs, int send_datagram_count);
    
    extern int shutdown(int fd, int how);
    
    extern int socket(int family, int type, int proto);
    
    extern int socketclose(int fd);
    
    extern int inet_aton(const char *cp, struct in_addr *addr);
    
    extern char *inet_ntoa_r(struct in_addr in, char *buf);
    
    extern const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
    
    extern int inet_pton(int af, const char *src, void  *dst);
    
    extern int getpeername(int fd, struct sockaddr *name, int *addrlen);
    
    extern int getsockname(int fd, struct sockaddr *name, int *addrlen);
    
    extern int getsockopt(int fd, int level, int optname, void *optval,socklen_t *optlen);
    
    extern int setsockopt(int fd, int level, int optname, void *optval,socklen_t optlen);
    
    extern void setsocketlasterr(int err);
    
    extern int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
    
    extern int setsocklibopt (int liboptname, int optval);
    
    extern int getsocklibopt (int liboptname, int *optval);
    
    extern int somemopt (int req_type, char* mem, unsigned int memlen, int flags);
    
    extern u32 ntohl(u32 val);
    
    extern u32 htonl(u32 val);
    
    extern u16 ntohs(u16 val);
    
    extern u16 htons(u16 val);
    
    extern int icmp_create_handle(int family);
    
    extern int icmp_close_handle(int handle);
    
    extern int icmp_ping(int handle, const void* data, int len, const struct sockaddr *dest_addr, int dest_len, unsigned timeout, int flag);
    
    extern int icmp_cancel(int handle);
    
    extern int icmp_last_code_type(int handle);
    

    I can't write more for today ! ^^

    Feel free to ask me, what should i add or complete some parts, because all functions are not really here so ask in the comment section
     
    Last edited by Minox, Feb 13, 2016
  2. Whatnoww

    Whatnoww GBAtemp Regular

    Member
    184
    89
    Jan 27, 2016
    Canada
    Devs only as in only devs should see this, or that only devs should be able to understand this?
     
  3. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    Mmmh, i'll ask to change it to "For develloppers"
     
    Whatnoww likes this.
  4. oumoumad

    oumoumad GBAtemp Advanced Fan

    Member
    798
    727
    Apr 20, 2015
    France
    Be careful, the headers you've attached are copy righted "......They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo."
    So I think you can't share them here.

    Thank you for the effort in contributing to the community anyway :).
     
    NexoCube likes this.
  5. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    Ok i'll remove it then.
     
  6. shaneod

    shaneod GBAtemp Fan

    Member
    350
    258
    Mar 3, 2011
    These functions are intentionally not being put on wiiubrew because the developers don't like to rely on illegal source code to document functions. Otherwise they could have just uploaded the searchable SDK with all functions included onto wiiubrew.
     
    ScarletDreamz likes this.
  7. EpicLPer

    EpicLPer Nice unless you give me a reason to hate you ;)

    Member
    923
    604
    Mar 13, 2015
    Austria
    Austria
  8. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    Yes, but i don't want to.
     
  9. EpicLPer

    EpicLPer Nice unless you give me a reason to hate you ;)

    Member
    923
    604
    Mar 13, 2015
    Austria
    Austria
    ... but that's exactly why we have such a mash of different sources and so on and when it comes to actually searching infos everything is extremely spread around.

    I rather think that GBATemps is more for beginners, not for infos like this here. It's kind of stupid to spread useful information across multiple platforms like this...
     
  10. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    It's a bit late no, if someone want, he can put it in Wii U Brew xD (sorry ^^)
     
  11. oumoumad

    oumoumad GBAtemp Advanced Fan

    Member
    798
    727
    Apr 20, 2015
    France
    Yep people definitely need to update WiiUbrew and organize it a bit more, it's difficult to get information on it too.
     
    EpicLPer and NexoCube like this.
  12. Voxel

    Voxel Fable Junkie

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,209
    5,958
    Jun 27, 2015
    United Kingdom
    England, UK
    Good thread, kind of... it's a bit of an NDA violation; dunno if Ninty or the staff are gonna nag at the site because of this thread. :unsure:
    I have the Cafe SDK 2.12.13, so I don't really have much to say about this thread anyway.

    But one thing though - Will all of the functions documented in the Cafe SDK work in ELF files? Because I bet some wouldn't work in, for example, those old codeXXX.bin files.
     
  13. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    I think it work. (And yeah you gave me the SDK there's a bunch of time.)
     
    Voxel likes this.
  14. Voxel

    Voxel Fable Junkie

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,209
    5,958
    Jun 27, 2015
    United Kingdom
    England, UK
    Oh yeah, I forgot. :P
     
  15. shaneod

    shaneod GBAtemp Fan

    Member
    350
    258
    Mar 3, 2011
    Marcan and others on #WiiUDev don't want any functions posted on WiiUBrew that weren't obtained via RE. They don't want leaked functions.
     
  16. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    What is RE ? (Sorry, because, i suppose the french equivalent is different)
     
  17. Voxel

    Voxel Fable Junkie

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,209
    5,958
    Jun 27, 2015
    United Kingdom
    England, UK
    Reverse Engineer.
     
  18. NexoCube
    OP

    NexoCube stop using piracy :(

    Member
    1,184
    588
    Nov 3, 2015
    France
    Stack Pointer
    And i think you already tells me that, but how does it works, how can i use it ? ^^
     
  19. Voxel

    Voxel Fable Junkie

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,209
    5,958
    Jun 27, 2015
    United Kingdom
    England, UK
    Software reverse-engineering probably consists of disassembling/debugging the compiled files. I'm not very sure how it works myself...
     
    NexoCube likes this.
  20. twc

    twc Banned

    Banned
    55
    29
    Jan 18, 2016
    United States
    You realize most of them use shit from the sdk right? Lmao who wouldn't use the sdk

    — Posts automatically merged - Please don't double post! —

    Meh Nintendo won't care honestly just look at loadiine that was made with the sdk ;)
     
    Voxel and NexoCube like this.