PyGecko coreinit.rpl OSLogRetrieve

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

  1. H0neyBadger
    OP

    H0neyBadger Member

    Newcomer
    22
    7
    Oct 4, 2015
    France
    Hello,
    I try to translate the rpc.py’s get_logs function into PyGecko call.
    But the log size is always null "0".

    Code:
    import struct
    from binascii import hexlify
    
    tcp = TCPGecko("192.168.1.100")
    
    def get_logs(filename='logdump.bin', save_addr=0x1e800000):
        address = save_addr
        for x in range(0,32):
            tcp.pokemem(address, 0x00000000)
            address += 4
           
        #OSLogRetrieve = tcp.get_symbol('coreinit.rpl', 'OSLogRetrieve')
        #result = OSLogRetrieve((1<<11)|(1<<12), save_addr, 0x01000000)
        result = tcp.function('coreinit.rpl', 'OSLogRetrieve', False, 0, (1<<11)|(1<<12), save_addr, 0x01000000)
        size = int(hexlify(tcp.readmem(save_addr, 4)),16)
        print("OSLogRetrieve result:{0}".format(result))
        print("OSLogRetrieve size:{0}!".format(size))
        logs = []
        if size:
            for addr in range(save_addr, save_addr + size, 500):
                print(addr)
                logs += list(tcp.readmem(addr, 4))
                print(logs)
    
            dump = open(filename, 'wb')
            for word in logs:
                print(word)
                dump.write(struct.pack(">I", word))
            dump.close()
    
    
    get_logs()
    tcp.s.close()
    print("Done.")
    
    Did I miss something?