Close

Results 1 to 7 of 7

Thread: RGH Explained

  1. #1
    DF Super Moderator BIG-TED's Avatar
    Join Date
    May 2001
    Location
    Leics UK
    Posts
    2,022
    Thanks
    447
    Thanked:        881
    Karma Level
    423

    Xbox 360 RGH Explained

    Blackaddr over at xbh posted this today good read.


    There seems to be a lot of confusion about exactly how the RGH works, and what clocks are involved, etc. Here is a brief technical summary that elaborates on the information provided already by Gligli and Tiros. This will focus on the hardware side, not the bootloader modifications. This information is already on XBH scattered in several threads, so I'm posting it in the General section because this is not new information, its been out there for some time.

    First, let's get the clocks straight since this seems to be the root of much confusion.

    Onboard XTAL: All consoles from Xenon to Trinity have a 27 MHz crystal on the board (Corona has 25 Mhz). Every other clock on the board is generated from this xtal reference clock using one or more PLLs. The Xenon generates fixed frequency clocks using a Cypress chip. All other consoles have programmable PLLs in their HANA which is what we're concerned with for this document.

    STBY_CLK: The 'standby' clock, so named because it is the main clock for the SMC processor. The SMC processor runs whenver the console is plugged in, even in standby mode. It runs at 48 MHz, it is generated by a PLL in the HANA. It is used by the RGH CPLD because the CPLD needs some kind of clock, and it's convienient. The actual frequency is not very relevant. It just needs to be a 'Goldilocks' frequency, not too fast that the CPLD can't keep up, not too slow that the glitch resolution isn't sufficient. Using an external clock instead of STBY_CLK accomplishes nothing with regards to Corona. The STBY_CLK is on Corona, and it has already been found by private researchers.

    CPU Reference Clock: this is a 100 MHz clock that comes from the HANA and connects to the CPU. The CPU will use this clock and it's own internal PLL(s) to generate any other internal clocks it needs (excluding PCIe, etc.), such as the CPU core clock, or perhaps a reset circuit clock. If you change this clock frequency by reprogramming the HANA (via I2C) you will also change the CPU Core Clock as a consequence.

    CPU Core Clock: this is the clock that runs the CPU instruction core. It is generated in the CPU from the CPU Reference clock, and will run much faster then the ref clock (think Gigahertz).

    Now onto the Reset Glitch Hack itself.

    THE EXPLOIT:
    Gligli was able to get the CPU to get past the CD authentication by pulsing the reset at just the right time, for just the right length. The idea is the successful authentication eventually boils down to a 'branch-if-register-equals-zero' instruction on a certain CPU register. If this register has been reset, it will think the check passed. The problem is other CPU registers have likely been reset by the glitch. If any of these registers contain values that are needed for continued booting, the system will crash. If no 'critical' registers got reset, the system will successfully continue loading the CD.

    HOW ITS DONE:
    Cjack's research discovered some methods of slowing down the CPU, including asserting CPU_PLL_BYPASS. Asserting this signal slows CPU execut1on down by a factor of 128. Gligli used this to his advantage to slow the CPU execut1on down enough that he could successfully exploit the system, originally using an external microcontroller. In order to make it more user-friendly, the exploit was ported to a CPLD, that ran off the 48 MHz SMC standby clock. This clock was chosen simply because it was convienient. The clock is fast enough that it provides sufficient temporal resolution to pulse the reset appropriately for the exploit.

    HOW ITS DONE (SLIMS):
    Unfortunately, Gligli and Tiros were unable to locate CPU_PLL_BYPASS on the Trinity system, and decided to take a different approach. Instead of using the CPU_PLL_BYPASS to slow down the core directly, they changed the frequency of the CPU reference clock (from the HANA) going into the CPU PLL which generates the core clock. So, if you slow down the CPU reference clock from 100 MHz to 100/128 ~= 781 Khz, then you've accomplished the same thing, the core will run the same speed as if you had used CPU_PLL_BYPASS. Unfortunately this doesn't work. Tiros found the HANA PLL wasn't stable at arbitrarily slow frequencies. It would wander and drift randomly around the target frequency. This meant the CPU execut1on speed was constantly changing, and when you tried to time the reset pulse, the CPU was rarely at the correct instruction anymore.

    BLACKADDR'S NARATIVE:
    *** this portion is based on my own experiments with RGH. I informed Tiros of my observations, he confirmed that he found the same behaviors when originally developing the Slim RGH ***

    ...continued from 'HOW IT'S DONE'

    Luckily, you'll find that you can still reduce the HANA PLL frequency, just not by as much as you probalby would like. The question becomes can you slow it enough to time the reset glitch properly, while keeping the HANA PLL stable. The answer is yes! But, something unexpected occurs. The CPU does not respond to the reset pulse in a consistent, predictable way like when you use CPU_PLL_BYPASS. Some HANA clock frequencies are more sucessful than others, the system seems to react differently with slightly different frequencies. The task is to find a clock slow enough to time the reset glitch, with a reset glitch length that results in the desired exploit behavior, with a reasonably high success rate. After much trial and error, it was found that a clock frequency of roughly 1/3rd the original was suitable.

    WHY SLIMS ARE HARDER:
    So, the CPU reset is not purely asynchronous and this is important. If it was, the effect of the length of the pulse would be the same regardless of what the CPU core runs at, but we know this is not the case. I tried combining both CPU_PLL_BYPASS with slowing the HANA clock to 1/3rd on a Falcon and compared to just using CPU_PLL_BYPASS. As expected, the CPU runs 3x slower with this extra slowdown from the HANA vs the conventional Falcon RGH. Also as expected, the correct wait time to trigger the reset pulse is 3x longer as well. What was not expected, is the length of the reset pulse needed to be approximately 8x as long to have any effect at all! This means instead of a 100ns reset pulse (convential Falcon RGH) you need a minimum of about 800 ns otherwise the system completely ignores it.

    What does this mean? It means the CPU reset appears pseudo-synchronous. THe effect of a reset pulse varies with the CPU reference clock. It is likely there is a reset-relationship with the CPU reference clock, as well as the CPU core clock. So why are slims harder?

    There are several factors that make glitching slims more challenging. The CPU is only slowed down by a factor of about 3, instead of 128 like on phat consoles. This means the CPLDs ability to trigger the reset at just the right moment is far less accurate, but still possible. The slowdown is instead achieved by reducing the CPU reference frequency from the HANA. This results in a complex reset behavior that is more random and thus less reliable. Some people will have slims glitch quickly and consistently. Others will struggle, trying every trick in the book and still have difficulty. That's simply the random nature in effect.

    WHAT ABOUT XENON:
    Gligli and Tiros found that the Xenon CPU could be slowed down and glitched just fine using CPU_PLL_BYPASS, the problem was when de-asserting it to bring the CPU back up to full speed after passing CD authentication. The CPU would reportedly crash. You can't alternatively use the slim method to slow down the CPU because Xenon's do not generate the CPU reference frequency inside the ANA, they have a fixed frequency clock generator chip. There is no technial reason why at the moment why RGH wont' work on Xenon. Gligli and Tiros chose to focus on HDMI phats and slims rather than fight with the Xenon. Big Hint: Try to find a time to de-assert CPU_PLL_BYPASS such that the chip doesn't crash.

    WHAT ABOUT CORONA:
    I'm gonna let you think about this one. What's different between Trinity and Corona with regard to all the clocks discussed? Hint: the HANA is still there. Why are the changes to the NAND important ?


    Link to original thread
    http://www.xboxhacker.org/index.php?topic=17701.0

    Ted
    Lots of my repairs and pictures of retro stuff on my twitter.

    https://twitter.com/Big_ted1?t=s9zEZ...Z-npEyeKA&s=09

    9 Thanks given to BIG-TED

    Armoured Hawk (30th January 2012),  Flat (31st January 2012),  furrry (29th January 2012),  Mario87 (1st February 2012),  raelmadrid (29th January 2012),  rids (30th January 2012),  Teajunkie (31st January 2012),  Thalamus (14th February 2012),  tronads (30th January 2012)  


  2. #2
    DF Admin Teajunkie's Avatar
    Join Date
    Dec 2009
    Location
    Devon
    Posts
    4,228
    Thanks
    1,827
    Thanked:        1,826
    Karma Level
    569

    Default Re: RGH Explained

    Good read that and lots of bits i never knew too.
    Have you joined the DF discord server. https://discord.com/invite/YajVGQxDaw

  3. #3
    DF VIP Member Mario87's Avatar
    Join Date
    Jan 2002
    Location
    Sunny Aberdeen
    Posts
    7,228
    Thanks
    115
    Thanked:        92
    Karma Level
    691

    Default Re: RGH Explained

    Excellent read. Takes my back to my uni days working with FPGA's, VHDL, Verilog & CPLD's.

  4. #4
    DF Probation macmilm's Avatar
    Join Date
    Dec 2000
    Location
    Suffolk, UK
    Posts
    3,817
    Thanks
    1,662
    Thanked:        1,295
    Karma Level
    559

    Default Re: RGH Explained

    Things have moved on a bit since my first ZX spectrum 48k !!
    You all know you miss the rubber keys:

    10 print "hello world"
    20 goto 10

    lol

  5. #5
    DF VIP Member REDBU11's Avatar
    Join Date
    Jan 2005
    Location
    WALES
    Posts
    430
    Thanks
    37
    Thanked:        32
    Karma Level
    253

    Default Re: RGH Explained

    quick question for u pro's , if i get my slim 360 glitched can i put any size etc harddrive in it to run stuff off ? or has it got to be a external harddrive ?

    thanks

  6. #6
    DF VIP Member fanni's Avatar
    Join Date
    Feb 2008
    Location
    West London
    Posts
    2,717
    Thanks
    150
    Thanked:        313
    Karma Level
    361

    Default

    Yes you can fit any hdd inside and external can only be up to 2tb

  7. #7
    DF VIP Member REDBU11's Avatar
    Join Date
    Jan 2005
    Location
    WALES
    Posts
    430
    Thanks
    37
    Thanked:        32
    Karma Level
    253

    Default Re: RGH Explained

    Cheers mate

Similar Threads

  1. Matrix Reloaded - Explained
    By Conkers in forum The Dog and Duck
    Replies: 78
    Last Post: 6th November 2003, 10:10 AM
  2. giggs bad form explained...
    By xdam in forum Football
    Replies: 4
    Last Post: 1st February 2003, 02:11 AM
  3. Replies: 8
    Last Post: 30th December 2002, 07:52 PM
  4. ATA and UDMA Explained
    By El Wappo in forum PC Hardware
    Replies: 2
    Last Post: 17th December 2002, 10:10 AM
  5. Replies: 7
    Last Post: 8th October 2002, 03:07 PM

Social Networking Bookmarks

Posting Permissions

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