Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: All 360s homebrew-able? :o

  1. #1
    Join Date
    Sep 2006
    Posts
    22,212
    Thanks
    172
    Thanked 385 Times in 241 Posts
    EP Points
    825

    Default All 360s homebrew-able? :o

    **********************************
    * The Xbox 360 reset glitch hack *
    **********************************

    Introduction / some important facts
    ===================================

    tmbinc said it himself, software based approaches of running unsigned code on the 360 mostly don't work, it was designed to be secure from a software point of view.

    The processor starts running code from ROM (1bl) , which then starts loading a RSA signed and RC4 crypted piece of code from NAND (CB).

    CB then initialises the processor security engine, its task will be to do real time encryption and hash check of physical DRAM memory. From what we found, it's using AES128 for crypto and strong (Toeplitz ?) hashing. The crypto is different each boot because it is seeded at least from:
    - A hash of the entire fuseset.
    - The timebase counter value.
    - A truly random value that comes from the hardware random number generator the processor embeds. on fats, that RNG could be electronically deactivated, but there's a check for "apparent randomness" (merely a count of 1 bits) in CB, it just waits for a seemingly proper random number.

    CB can then run some kind of simple bytecode based software engine whose task will mainly be to initialise DRAM, CB can then load the next bootloader (CD) from NAND into it, and run it.

    Basically, CD will load a base kernel from NAND, patch it and run it.

    That kernel contains a small privileged piece of code (hypervisor), when the console runs, this is the only code that would have enough rights to run unsigned code.
    In kernel versions 4532/4548, a critical flaw in it appeared, and all known 360 hacks needed to run one of those kernels and exploit that flaw to run unsigned code.
    On current 360s, CD contains a hash of those 2 kernels and will stop the boot process if you try to load them.
    The hypervisor is a relatively small piece of code to check for flaws and apparently no newer ones has any flaws that could allow running unsigned code.

    On the other hand, tmbinc said the 360 wasn't designed to withstand certain hardware attacks such as the timing attack and "glitching".

    Glitching here is basically the process of triggering processor bugs by electronical means.

    This is the way we used to be able to run unsigned code.

    The reset glitch in a few words
    ===============================

    We found that by sending a tiny reset pulse to the processor while it is slowed down does not reset it but instead changes the way the code runs, it seems it's very efficient at making bootloaders memcmp functions always return "no differences". memcmp is often used to check the next bootloader SHA hash against a stored one, allowing it to run if they are the same. So we can put a bootloader that would fail hash check in NAND, glitch the previous one and that bootloader will run, allowing almost any code to run.

    Details for the fat hack
    ========================

    On fats, the bootloader we glitch is CB, so we can run the CD we want.

    cjak found that by asserting the CPU_PLL_BYPASS signal, the CPU clock is slowed down a lot, there's a test point on the motherboard that's a fraction of CPU speed, it's 200Mhz when the dash runs, 66.6Mhz when the console boots, and 520Khz when that signal is asserted.

    So it goes like that:
    - We assert CPU_PLL_BYPASS around POST code 36 (hex).
    - We wait for POST 39 start (POST 39 is the memcmp between stored hash and image hash), and start a counter.
    - When that counter has reached a precise value (it's often around 62% of entire POST 39 length), we send a 100ns pulse on CPU_RESET.
    - We wait some time and then we deassert CPU_PLL_BYPASS.
    - The cpu speed goes back to normal, and with a bit of luck, instead of getting POST error AD, the boot process continues and CB runs our custom CD.

    The NAND contains a zero-paired CB, our payload in a custom CD, and a modified SMC image.
    A glitch being unreliable by nature, we use a modified SMC image that reboots infinitely (ie stock images reboot 5 times and then go RROD) until the console has booted properly.
    In most cases, the glitch succeeds in less than 30 seconds from power on that way.

    Details for the slim hack
    =========================

    The bootloader we glitch is CB_A, so we can run the CB_B we want.

    On slims, we weren't able to find a motherboard track for CPU_PLL_BYPASS.
    Our first idea was to remove the 27Mhz master 360 crystal and generate our own clock instead but it was a difficult modification and it didn't yield good results.
    We then looked for other ways to slow the CPU clock down and found that the HANA chip had configurable PLL registers for the 100Mhz clock that feeds CPU and GPU differential pairs.
    Apparently those registers are written by the SMC through an I2C bus.
    I2C bus can be freely accessed, it's even available on a header (J2C3).
    So the HANA chip will now become our weapon of choice to slow the CPU down (sorry tmbinc, you can't always be right, it isn't boring and it does sit on an interesting bus

    So it goes like that:
    - We send an i2c command to the HANA to slow down the CPU at POST code D8 .
    - We wait for POST DA start (POST DA is the memcmp between stored hash and image hash), and start a counter.
    - When that counter has reached a precise value, we send a 20ns pulse on CPU_RESET.
    - We wait some time and then we send an i2c command to the HANA to restore regular CPU clock.
    - The cpu speed goes back to normal, and with a bit of luck, instead of getting POST error F2, the boot process continues and CB_A runs our custom CB_B.

    When CB_B starts, DRAM isn't initialised so we chose to only apply a few patches to it so that it can run any CD, the patches are:
    - Always activate zero-paired mode, so that we can use a modified SMC image.
    - Don't decrypt CD, instead expect a plaintext CD in NAND.
    - Don't stop the boot process if CD hash isn't good.

    CB_B is RC4 crypted, the key comes from the CPU key, so how do we patch CB_B without knowing the CPU key?
    RC4 is basically:
    crypted = plaintext xor pseudo-random-keystream
    So if we know plaintext and crypted, we can get the keystream, and with the keystream, we can encrypt our own code. It goes like that:
    guessed-pseudo-random-keystream = crypted xor plaintext
    new-crypted = guessed-pseudo-random-keystream xor plaintext-patch
    You could think there's a chicken and egg problem, how did we get plaintext in the first place?
    Easy: we had plaintext CBs from fat consoles, and we thought the first few bytes of code would be the same as the new CB_B, so we could encrypt a tiny piece of code to dump the CPU key and decrypt CB_B!

    The NAND contains CB_A, a patched CB_B, our payload in a custom plaintext CD, and a modified SMC image.
    The SMC image is modified to have infinite reboot, and to prevent it from periodically sending I2C commands while we send ours.

    Now, maybe you haven't realised yet, but CB_A contains no checks on revocation fuses, so it's an unpatchable hack !

    Caveats
    =======

    Nothing is ever perfect, so there are a few caveats to that hack:
    - Even in the glitch we found is pretty reliable (25% success rate per try on average), it can take up to a few minutes to boot to unsigned code.
    - That success rate seems to depend on something like the hash of the modified bootloader we want to run (CD for fats and CB_B for slims).
    - It requires precise and fast hardware to be able to send the reset pulse.

    Our current implementation
    ==========================

    We used a Xilinx CoolRunner II CPLD (xc2c64a) board, because it's fast, precise, updatable, cheap and can work with 2 different voltage levels at the same time.
    We use the 48Mhz standby clock from the 360 for the glitch counter. For the slim hack, the counter even runs at 96Mhz (incremented on rising and falling edges of clock)
    The cpld code is written in VHDL.
    We need it to be aware of the current POST code, our first implementations used the whole 8 bits POST port for this, but we are now able to detect the changes of only 1 POST bit, making wiring easier.

    Conclusion
    ==========

    We tried not to include any MS copyrighted code in the released hack tools.
    The purpose of this hack is to run Xell and other free software, I (GliGli) did NOT do it to promote piracy or anything related, I just want to be able to do whatever I want with the hardware I bought, including running my own native code on it.

    Credits
    =======

    GliGli, Tiros: Reverse engineering and hack development.
    cOz: Reverse engineering, beta testing.
    Razkar, tuxuser: beta testing.
    cjak, Redline99, SeventhSon, tmbinc, anyone I forgot... : Prior reverse engineering and/or hacking work on the 360.
    Discuss?

  2. #2
    Join Date
    Dec 2003
    Location
    Indiana, United States
    Posts
    26,489
    Thanks
    61
    Thanked 221 Times in 99 Posts
    EP Points
    75

    Default

    If this pans out, I could possibly be convinced to buy another 360 and get an external HD for game storage.

  3. #3
    Join Date
    Jul 2008
    Posts
    3,049
    Thanks
    8
    Thanked 7 Times in 4 Posts
    Blog Entries
    1

    Default

    How will this ever come to be a viable way to hack the 360? Sounds like it needs quite a bit of knowledge and hardware just to attempt...

  4. #4
    Join Date
    Aug 2008
    Posts
    3,357
    Thanks
    68
    Thanked 158 Times in 80 Posts
    Blog Entries
    16
    EP Points
    160

    Default

    JTAGing is still easier if you have a 360 with the proper dashboard. Although those are starting to get harder to get.

    Here's a decent picture tutorial of the new hacking process on a 360 Slim. It looks to be considerably harder to do than a JTAG. Also, you'll need to buy 2 different pieces of extra hardware. Although other than the XC2C64A CoolRunner-II CPLD, you should be able to desolder the USB SPI Programmer after you're done flashing the 360s NAND. After that you should be able to just update your NAND through Xell if need be. Still, it's nice to see that there's still people working on further hacking of the 360.

    Although if I had a Slim I would probably just get an xKey.

  5. #5
    Join Date
    Jul 2008
    Posts
    3,049
    Thanks
    8
    Thanked 7 Times in 4 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Beelzebub View Post
    JTAGing is still easier if you have a 360 with the proper dashboard. Although those are starting to get harder to get.

    Here's a decent picture tutorial of the new hacking process on a 360 Slim. It looks to be considerably harder to do than a JTAG. Also, you'll need to buy 2 different pieces of extra hardware. Although other than the XC2C64A CoolRunner-II CPLD, you should be able to desolder the USB SPI Programmer after you're done flashing the 360s NAND. After that you should be able to just update your NAND through Xell if need be. Still, it's nice to see that there's still people working on further hacking of the 360.

    Although if I had a Slim I would probably just get an xKey.
    Oh wow, that's quite intensive... I can't see this ever really taking off to be honest, at least not for piracy. Maybe for the dedicated homebrew crowd.

  6. #6
    Join Date
    Sep 2006
    Posts
    22,212
    Thanks
    172
    Thanked 385 Times in 241 Posts
    EP Points
    825

    Default

    You'll just have to buy pre modded systems, there will be tons for sale once this new method takes off. Mark my words.

  7. #7
    Join Date
    Aug 2008
    Posts
    3,357
    Thanks
    68
    Thanked 158 Times in 80 Posts
    Blog Entries
    16
    EP Points
    160

    Default

    Quote Originally Posted by !nstaGib View Post
    Oh wow, that's quite intensive... I can't see this ever really taking off to be honest, at least not for piracy. Maybe for the dedicated homebrew crowd.
    < Needs to learn how to do this, and charge money for it.

    It would only be a small step up from the JTAGing process. People are going to be chomping at the bit to get this done. A lot of them will obviously lack the skills/tools to do this. First things first is to get a cheap used 360 Slim. I would only feel confident doing it on someone else's after doing it successfully on mine.

    Also, completely read through it and came across this.

    - Even in the glitch we found is pretty reliable (25% success rate per try on average), it can take up to a few minutes to boot to unsigned code.
    - That success rate seems to depend on something like the hash of the modified bootloader we want to run (CD for fats and CB_B for slims).
    I hope they get come up with a more streamlined modified bootloader. Those stats above would kind of shy me away from doing this hack in it's current form. I'm sure they'll end up improving it soon though.

  8. #8
    Join Date
    Mar 2009
    Location
    In a windowless van.
    Posts
    10,330
    Thanks
    98
    Thanked 701 Times in 329 Posts
    Blog Entries
    1
    EP Points
    1430

    Default


  9. #9
    Jackhammer's Avatar
    Jackhammer is offline Administrator
    Stroke The Goat
    ┌∩┐(◣_◢)┌∩┐
    Join Date
    Jan 2003
    Posts
    19,983
    Thanks
    1,373
    Thanked 2,270 Times in 270 Posts
    EP Points
    10020

    Default

    There's an in depth tutorial at assembler forums. After reading it, this was my reaction.

    http://assemblergames.com/forums/showthread.php?t=34890


    Edit: Pretty much the same as the one already posted in this thread...

  10. #10
    Join Date
    Jun 2010
    Posts
    3,730
    Thanks
    194
    Thanked 1,055 Times in 323 Posts
    Blog Entries
    5
    EP Points
    95

  11. #11
    Join Date
    Aug 2008
    Posts
    3,357
    Thanks
    68
    Thanked 158 Times in 80 Posts
    Blog Entries
    16
    EP Points
    160

    Default

    An update in the newly released 360 "Glitch Hack".

    >> BestPig released a new utility for the new homebrew Xbox 360 reset glitch hack to easily generate an ECC file:
    This new 'reset glitch hack' hack requires the creation of a ECC file based on a dump of your NAND. The official script is written in python, so I wrote a little GUI to make life easier for you
    No need to install python, ECC Glitch Generator is stand-alone and doesn't need any other software to operate.
    English News Source

    Original Source (French)

    So now we can cut the need to install Python out of the equation. That should save some time in the modified NAND-creation process.

    I give it 6 months at most before someone has a solder-less install kit out .

  12. #12
    Join Date
    May 2010
    Posts
    58
    Thanks
    0
    Thanked 10 Times in 7 Posts

    Default

    Quote Originally Posted by Beelzebub View Post
    < Needs to learn how to do this, and charge money for it.
    Good luck. I believe the process of bypassing these protection methods is illegal, with maybe an exception for fair use laws covering you doing it for your own personal system. Charging fees to service other's systems, or re-selling your modified unit, would be quite illegal.

    IIRC - There were a few people arresting for doing something similar with the original Xbox.

  13. #13
    Join Date
    Dec 2003
    Location
    Indiana, United States
    Posts
    26,489
    Thanks
    61
    Thanked 221 Times in 99 Posts
    EP Points
    75

    Default

    Quote Originally Posted by Virii View Post
    Good luck. I believe the process of bypassing these protection methods is illegal, with maybe an exception for fair use laws covering you doing it for your own personal system. Charging fees to service other's systems, or re-selling your modified unit, would be quite illegal.

    IIRC - There were a few people arresting for doing something similar with the original Xbox.
    There's a local computer shop that advertises on the radio for Xbox 360 reflow and DVD replacements. DVD replacement requires DVD key extraction and reflash on the new drive...which is exactly the same process as flashing the drive for playing backups. Ultimately, no one really cares about people making money hacking systems. They just go after the release groups and overly-blatant hackers that thumb their noses at the console manufacturers.

  14. #14
    Join Date
    May 2010
    Posts
    58
    Thanks
    0
    Thanked 10 Times in 7 Posts

    Default

    Hardware modifications via chips, soldering, or even softmod dashes aren't treated the same way as the mostly empty scare tactics used on 'rom downloading' offenses.

    They usually do crack down on 'physical' system violations, vs software violations.

    Here are a couple articles for the original Xbox.
    - http://xbox.ign.com/articles/571/571774p1.html
    - http://www.xbox-scene.com/xbox1data/...lZnNOPwElj.php

    Here's one for the 360.
    - http://scitech.blogs.cnn.com/2009/08...xbox-consoles/

    I'm sure I've seen more than these cases though. If someone were to do a more in depth search, I'm sure they'd find more cases.

    In the end all this really means is to be smart, you have to keep your modding details hidden in the internet underground. ie - Don't be a blatant fool when selling them.
    Last edited by Virii; 5th-September-2011 at 17:11.

  15. #15
    Join Date
    Sep 2006
    Posts
    22,212
    Thanks
    172
    Thanked 385 Times in 241 Posts
    EP Points
    825

    Default

    No real need to be so paranoid, there are so many people offering these services online. They can't physically go after everyone.

Posting Permissions

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

We are the oldest retro gaming forum on the internet. The goal of our community is the complete preservation of all retro video games. Started in 2001 as EmuParadise Forums, our community has grown over the past 18 years into one of the biggest gaming platforms on the internet.

Social