Author Topic: FLASHY - 83/4 series boot code modification  (Read 12249 times)

0 Members and 1 Guest are viewing this topic.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
FLASHY - 83/4 series boot code modification
« on: July 02, 2011, 04:13:32 am »
In response to TI's addition of anti downgrade protection to their recently updated bootcodes, Brandon Wilson has created Flashy, a program which can directly modify the boot code of a ti-83+SE, 84+, 84+SE, or the brand new ti-84 pocket. With the new ability to modify the boot code of these models, it is now possible to remove every last trace of Texas Instruments code from these calculators and replace it with custom made code. However, doing so is EXTREMELY dangerous, as any errors that may occur will result in the device being insta-bricked. TI-Bank states that Flashy allows bootcodes to:
-be upgraded
-be downgraded
-be custom modified
-be swapped between models (essentially allowing one model to 'become' another, although differences in hardware will still be an issue)

This program (which can be found here) has several features included to help avoid anything awful happening to your calculator, but you should still be absolutely certain that you know what you're doing before attempting to use it.
« Last Edit: July 03, 2011, 01:01:25 am by Eeems »

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: FLASHY - 83/4 series boot code modification
« Reply #1 on: July 02, 2011, 05:01:17 am »
Nice! We finally managed to unlock all the software of the 83+/84+, after something like 15 years... Well that's just awesome. :D

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline BrandonW

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +38/-1
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #2 on: July 02, 2011, 06:47:23 am »
To add some more information:

The main uses for this are:
   1. Testing code very early in the boot process. We can learn a lot more about the hardware now that we can get control very early in the boot process (the very first instruction executed!), and we've learned quite a bit in the past week or so.
   2. Downgrading boot code 1.03 calculators, such as the TI-84 Pocket.fr (and now the 84+ and 84+SE, which have started showing up with 1.03). I have upgraded my calculators to 1.03 and downgraded them back to 1.00/1.02 without incident. This means the anti-downrgade protection and added 2048-bit RSA key is useless (epic fail).
   3. Customizing the boot sectors. We can now add Calcsys-like functionality to normally read-only boot sectors and gain new emergency recovery abilities you wish you had in the past. Corrupted OS and you really need to get your programs off? Now you can (as soon as we write such a utility to flash to it). We can also change functionality we assume will always be there -- we can change (and I have changed) the ON+DEL keyboard shortcut to something secret or more complex (to prevent strangers from getting into your calculator), or whatever you want...sky's the limit.

Also, if the process to create the image AppVar looks a little scary/confusing to you, you can use the pre-built AppVars made from boot code dumps available elsewhere (for the 83+SE, 84+, and 84+SE, from versions 1.00 to 1.03). I'd link you to them, but it's not exactly legal to host them. I'm sure if you look around in the "usual places", you can find them. :)

This program tries to be as safe as possible. The boot image AppVars it uses have up to two MD5 hashes embedded with them, one for each page. Both of these hashes are checked twice, battery levels are checked twice, the images themselves are checked for code patterns that must be present for the model being flashed to, the boot page jump table is checked for valid page and address ranges, and warnings are thrown up if anything looks amiss.

It even installs a temporary cursor hook to steal back control in the unlikely event that the boot page is erased (filled with 0xFF bytes (which are interpreted as "rst 38h" instructions)), where it will attempt to complete the write.

I personally tested it on my real 83+SE, 84+, and 84+SE calculators, and several other people have used it multiple times without incident. I have yet to brick a calculator using this program, even after making some pretty scary patches.

So it's worth a shot, if you're brave enough.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #3 on: July 02, 2011, 09:09:13 am »
I personally tested it on my real 83+SE, 84+, and 84+SE calculators, and several other people have used it multiple times without incident. I have yet to brick a calculator using this program, even after making some pretty scary patches.

That's me. I've flashed like 12 images or so to my calculator, so I can confirm to you that it works. Just be sure to test it first in wabbitemu. Buckeye's latest debug release allows boot code modification and includes everything new we learned about the calculator hardware on boot (which is weird). If you are going to mod a page, be sure to test it because I've bricked wabbitemu about 6 times.

And I haven't said it yet, but great job Brandon!
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #4 on: July 02, 2011, 09:49:02 am »
Awesome stuff guys! Thank you for every thing you do. :)

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #5 on: July 02, 2011, 12:52:58 pm »
Excellent! :D
thepenguin has, as stated in the other topic (but I'll restate it here), created a modified boot code image that conditionally runs your own code before anything else happens, and Brandon's stated his intentions (he might have already done it) to make a similar version that either starts normally, runs what's on RAM page 0 (which is what thepenguin's does), or runs what's on $2C/$6C (which would be 84+(SE) only, I assume).
...everything new we learned about the calculator hardware on boot (which is weird)
Our current understanding, as I remember it, goes mostly as follows:
The calculator starts in a memory map mode that's mostly like mode 0 (port 6 controls bank 1, port 7 controls bank 2, port 5 controls bank 3) except that page $3F/$7F is swapped into bank 0 (where page $00 normally is). $00 is swapped into banks 1 and 2 and RAM page 0 into bank 3.
A jump ending in a bank swapped in because of port 6 (bank 1 in mode 0, additionally bank 2 in mode 1) swaps $00 back into bank 0.
Ports $0E and $0F have nothing to do with this; as far as we know they are worthless.
Last I checked thepenguin still has not managed to successfully initialize the LCD himself.
The initial states of other ports can be found in the appropriate topic (state of the calculator at boot, to be linked shortly).
thepenguin/BrandonW: I probably forgot something/got something wrong, so correct me if I did.
Edit: Fixed information regarding swapping $00 back.
« Last Edit: July 02, 2011, 03:41:18 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #6 on: July 02, 2011, 01:00:57 pm »
Calcdude, I figured out that you only have to execute code in a bank controlled by port (06).

Also, I figured out what was wrong with the LCD, I had a few "ld ($10), a" where I should have had "out ($10), a"
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #7 on: July 02, 2011, 01:05:06 pm »
Calcdude, I figured out that you only have to execute code in a bank controlled by port (06).
Ah, okay. Do we still not know why just executing TI's code from bank 1 directly doesn't work?

Quote
Also, I figured out what was wrong with the LCD, I had a few "ld ($10), a" where I should have had "out ($10), a"
Oops :P
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #8 on: July 02, 2011, 01:21:32 pm »
Calcdude, I figured out that you only have to execute code in a bank controlled by port (06).
Ah, okay. Do we still not know why just executing TI's code from bank 1 directly doesn't work?

I did something else wrong, it works now. (I almost feel like I didn't press ON.)
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #9 on: July 02, 2011, 01:26:13 pm »
I did something else wrong, it works now. (I almost feel like I didn't press ON.)
Oh, okay. So TI's method of switching to mode 1 and then to mode 0, ultimately ending up in bank 1, is officially pointless :P
« Last Edit: July 02, 2011, 01:26:36 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Netham45

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2103
  • Rating: +213/-4
  • *explodes*
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #10 on: July 02, 2011, 01:48:28 pm »
This is awesome. I almost want to upgrade my calc to 1.03, just so I can downgrade again. :P

Just curious, are there any major applications for this, other than just being able to be 100% open-source?
Omnimaga Admin

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #11 on: July 02, 2011, 01:51:32 pm »
Well, there's what Brandon said above. You could add utilities and recovery tools (or even a mini-OS, perhaps). We could get rid of OS validation, etc. But, admittedly, there isn't much use to changing the bootcode beyond that, at least AFAICT.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Netham45

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2103
  • Rating: +213/-4
  • *explodes*
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #12 on: July 02, 2011, 01:53:22 pm »
Well, OS validation is good to a point, it ensures that nothing to wipe the bootpages randomly gets written to a privlidged page on corruption. :P
Omnimaga Admin

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: FLASHY - 83/4 series boot code modification
« Reply #13 on: July 02, 2011, 02:43:02 pm »
This is awesome. Good job BrandonW. By the way is the reason why it doesn't mention the regular 83+ due to this program using the extra RAM page or something? I forgot.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: FLASHY - 83/4 series boot code modification
« Reply #14 on: July 02, 2011, 03:23:00 pm »
It's because the 83+ doesn't have the port that's been used to bypass the protection on the boot code.
We don't know whether or not modification of its boot code is possible yet, I think.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.