Olygame



Results 1 to 1 of 1
  1. #1
    Administrator
    Join Date
    Jun 2011
    Location
    Tropical Island
    Posts
    1,783
    Total Thanks Given
    210
    Total Thanks Received
    6,148
    Total Thanked Posts
    1,360
    Gamer IDs

    Gamertag: garyopa PSN ID: opagary

    ps3 naehrwert shares details on exploit used to dump lv0ldr/bootldr

    A closer look to 'The Exploit' inside...

    naehrwert has shared his lv0 exploit, which was used of course to dump the PS3 lv0ldr/bootldr, just a few weeks ago.


    Just a few weeks after the the massive lv0 keys leak and the exploit to dump lv0ldr/bootldr, PS3 dev naehrwert has shared more reverse-engineering info about it on his blog.

    Take a look at the info from "The Exploit" below:

    As the exploit that was used to dump lv0ldr/bootldr/howeveryouliketocallit is public now, let’s have a closer look at it to understand what’s going on. Here is what I have reversed from lv0 (it shares the syscon portion of the code with its SPU counterpart):

    Code:
    //In .data section.
    static u8 tmp_pkt[0x800];
    
    //Get size from sc packet.
    #define GET_SIZE(pkt) ((pkt[4] << 8) | pkt[5])
    
    int read_cmpl_msg(/*...*/, u8 *payload_buf /*r5*/, int min_size /*r6*/, /*...*/)
    {
        u16 pkt_size;
    
        //Get packet header.
        memcpy_aligned_64(tmp_pkt, MMIO_SC_PKT, 0x10);
    
        //Check packet size.
        pkt_size = GET_SIZE(tmp_pkt);
        if(pkt_size - 4 < min_size || pkt_size + 8 > 0x800)
            return ERR;
    
        //Run first sc_checksum.
        if(!sc_checksum(...))
            return ERR;
    
        //Read packet again (plus header!).
        pkt_size = GET_SIZE(tmp_pkt);
        memcpy_aligned_64(tmp_pkt, MMIO_SC_PKT, size + 0x1B);
    
        //Get size again (not checked now).
        //I suspect that this is actually a compiler 'quirk' and not a
        //programmer mistake. The original source probably accesses the
        //packet size through a structure and the compiler noticed the
        //non const access of the packet and generated this read of the
        //size member because it could have changed.
        pkt_size = GET_SIZE(tmp_pkt);
    
        //Let's have some fun (payload_buf on caller stack).
        memcpy(payload_buf, tmp_pkt + 8, size - 4);
    
        //Run second sc_checksum.
        if(!sc_checksum(...))
            return ERR;
    
        //...
    }
    The syscon library implements some high level functions, e.g. to shutdown the console on panic or to read certain configuration values. Every of this functions internally uses another function to exchange packets with syscon and the exchange function uses the read_cmpl_msg one to get the answer packet. The top-level function will pass a fixed size buffer to the exchange function. So if we are able to control syscon packets, e.g. by emulating MMIO (and thanks to IBM we are), we can change the packet size between the two packet readings and overwrite the caller stack. And if we first copy a little stub to shared LS and let the return address point to it, we can easily dump the whole 256 kB.

    Nothing more left to say now, let’s wait and see if this is going to be fixed in future firmware versions (we just have to check lv0 fortunately).
    NEWS SOURCE #1: News Article #3109 (via) EurAsia
    NEWS SOURCE #2: Naehrwert shares his lv0 reverse engineering (via) PSX-Scene

    Our thanks to 'Gauss' for this news item!

  2.          
  3. The Following 4 Users Say Thank You to GaryOPA For This Useful Post:

    gDrive (11-22-2012), Olympiacos (11-22-2012), PatrickBatman (11-22-2012), Yuu (11-22-2012)


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
EachGame