Pygecko: how to run OSFatal?

Discussion in 'Wii U - Hacking & Backup Loaders' started by H0neyBadger, Dec 16, 2015.

  1. H0neyBadger
    OP

    H0neyBadger Member

    Newcomer
    22
    7
    Oct 4, 2015
    France
    Hello,
    I try to run the OSFatal function from pygecko.
    I tried the following code, without success.

    Code:
    tcp = TCPGecko("192.168.1.1")
    OSFatal = tcp.get_symbol('coreinit.rpl', 'OSFatal')
    print(OSFatal("hello pygecko"))
    
    
    Traceback (most recent call last):
      File ".\hello_world.py", line 42, in <module>
      print(OSFatal("hello pygecko"))
      File "C:\wiiu\libwiiu\pyGecko\tcpgecko.py", line 353, in __call__
      return self.rpc.call(self.address, *args) #Pass in arguments, run address
      File " C:\wiiu\libwiiu\pyGecko\tcpgecko.py", line 241, in call
      request = struct.pack(">I8I", address, *arguments)
    struct.error: cannot convert argument to integer
    Then I tried to convert the python2.7 string into integer, but unfortunately system crash in a mess of pixels.

    Somebody have an example of python code?
     
  2. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,770
    1,439
    Aug 2, 2014
    Germany
    Code:
    print(OSFatal("hello pygecko"))
    This is the error I believe.

    You don't do it like that, OSFatal() shouldn't be nested in a print() statement.
     
  3. H0neyBadger
    OP

    H0neyBadger Member

    Newcomer
    22
    7
    Oct 4, 2015
    France
    The nested print doesn’t matter. It print the value returned by the OSFatal function in python console.
    But thanks for the advice.
     
  4. FaTaL_ErRoR

    FaTaL_ErRoR AKA ŦƕƎ ƠṀƐƝ

    Member
    491
    346
    Mar 9, 2014
    United States
  5. H0neyBadger
    OP

    H0neyBadger Member

    Newcomer
    22
    7
    Oct 4, 2015
    France
    No, OSFatal is not in tcp gecko. But pygecko allow us to run rpl symbols through python code.

    Indeed, I often forget the imports in my code samples.
    Code:
    from tcpgecko import TCPGecko
    tcp =TCPGecko("192.168.1.1")
    OSFatal= tcp.get_symbol('coreinit.rpl','OSFatal')
    OSFatal("hello pygecko")
    
    There is no need to import OSFatal since the get_symbol return a function.
    I have good knowledges in python. And it’s probably my main problem because I don’t really know others languages (and English is the first one)
     
  6. FaTaL_ErRoR

    FaTaL_ErRoR AKA ŦƕƎ ƠṀƐƝ

    Member
    491
    346
    Mar 9, 2014
    United States
  7. H0neyBadger
    OP

    H0neyBadger Member

    Newcomer
    22
    7
    Oct 4, 2015
    France
    Yes, This file is basically the (partial) source of pygecko. https://github.com/wiiudev/pyGecko/blob/master/tcpgecko.py

    The examples provided in sources are based on pokemem or readmem.
    https://github.com/wiiudev/pyGecko/blob/master/octoling.py


    The most significant example of symbol import can be found in FS* functions
    https://github.com/wiiudev/pyGecko/blob/master/tcpgecko.py#L147
    https://github.com/wiiudev/pyGecko/blob/master/tcpgecko.py#L161
    I think I have to work from this base.

    But if somebody has the solution … any help is appreciated.
    Thanks a lot guys!
     
    Last edited by H0neyBadger, Dec 17, 2015