Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: compu on April 21, 2011, 02:47:34 pm

Title: Rooted Nspire document browser
Post by: compu on April 21, 2011, 02:47:34 pm
By changing some strings in the OS image, you can make the document browser view all files in all folders.
I can't publish it here because I have changed the values in the phoenix.raw file.
Screenshots:
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 21, 2011, 03:08:58 pm
By changing some strings in the OS image, you can make the document browser view all files in all folders.
I can't publish it here because I have changed the values in the phoenix.raw file.
Screenshots:
Sweet! OS 2.0.1 CAS?
Title: Re: Rooted Nspire document browser
Post by: Munchor on April 21, 2011, 03:10:27 pm
View Hidden files? On that's great!
Title: Re: Rooted Nspire document browser
Post by: Adriweb on April 21, 2011, 03:10:52 pm
Extremely awesomely great !

Mind to share which line/lines on the .raw file we have to edit ? (pm if needed :P)

Thanks
Title: Re: Rooted Nspire document browser
Post by: compu on April 21, 2011, 03:12:27 pm
Sweet! OS 2.0.1 CAS?
Yes. :P

Extremely awesomely great !

Mind to share which line/lines on the .raw file we have to edit ?

Thanks
I want to make a patcher for this, but the "documents" string is located at 0x6807F8 in the raw image.. just fill it with 0x00s


Ninja'd twice...
Title: Re: Rooted Nspire document browser
Post by: Adriweb on April 21, 2011, 03:13:22 pm
will try..

Is the address for CAS or Non-CAS ?

Thanks
Title: Re: Rooted Nspire document browser
Post by: compu on April 21, 2011, 03:14:16 pm
will try..

Is the address for CAS or Non-CAS ?

Thanks
It is for CAS 2.0.1, I don't know if it's the same in non-CAS.

EDIT: This will not show any files, I had to fill all ".tns" strings with zeros too, currently I'm looking which of the replaced ".tns"es is responsible for file displaying ::)
Title: Re: Rooted Nspire document browser
Post by: Adriweb on April 21, 2011, 03:18:57 pm
I think the address for the OS 3.0.1 (1753) would be 0x864AE8 (phoenix.raw, CAS model) and fill with 0x00s until the end of the string.

NOT TESTED...
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 21, 2011, 03:25:24 pm
I'm really not trying to derail your thread, but does anyone have suggestions on getting OSLauncher to load DummyOS? Every time I try it, I get short lines on the display and the nspire locks up. (nspire non-cas, OS 2.0.1)

Also, do you know the size of the decompressed OS image for OS 2.0.1 CAS or basic?
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 21, 2011, 03:28:17 pm
It would be best if this was shown to work on a real calculator :)
Indeed, that's where the main problem lies: modifying an OS image, and launching the modified version, in such a way that it will work on a real calculator - and preferably work reliably - is much harder :)
Title: Re: Rooted Nspire document browser
Post by: compu on April 21, 2011, 03:32:34 pm
Also, do you know the size of the decompressed OS image for OS 2.0.1 CAS or basic?
phoenix.raw (CAS) is 7946612 bytes

It would be best if this was shown to work on a real calculator :)
I will try it on my Nspire and post a picture ;)
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 21, 2011, 03:37:19 pm
Note that OSLauncher takes zipped files as input :)
Title: Re: Rooted Nspire document browser
Post by: compu on April 21, 2011, 03:39:02 pm
I know :P
I'm using OSLauncher on the emulator too.
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 21, 2011, 03:45:11 pm
Of course ;)
The note was more aimed at mikehill than at you, because he was asking for the uncompressed size of phoenix.raw.
Title: Re: Rooted Nspire document browser
Post by: compu on April 21, 2011, 03:51:53 pm
Of course ;)
The note was more aimed at mikehill than at you, because he was asking for the uncompressed size of phoenix.raw.
;D

Real Nspire ;)

EDIT: Damn, it is huge....
EDIT(shmibs): here's a resized version :p
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 21, 2011, 04:01:17 pm
Best, then ;)

I suggest making a framework for patching TI's OS, similar to the one I made for patching TI's TI-68k OS (tiosmod+amspatch, ticalc.org POTY 2010 in the "PC utilities" category - but well, it was the only contender :D). That will ease the making of patches.
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 21, 2011, 04:04:58 pm
Of course ;)
The note was more aimed at mikehill than at you, because he was asking for the uncompressed size of phoenix.raw.
Thanks :)
You do need to know the approximate size of the OS to dump it right? Or do you just dump an extra 2mb and clean it after checking for code?

And OSLauncher works great in the emulator with OS1.7, it just has never worked on my nspire. (I haven't tested it in the emulator with OS2.0.1 because I haven't dumped it yet.)

Also, is there a way to directly dump the RAM of the emulator? I can do it fine with an ndless program, but I haven't figured out how to get that dump out of the nand image.

I apologize if some of these questions have obvious answers, but I have been quite busy with other projects recently. (One of which I may post a video of here soon [iOS 3D game, both 3D as in rendered scenes and 3D as in red/blue glasses required]:D)

Edit: compu, you have the same nspire model as I do....Now I'm really confused.
Title: Re: Rooted Nspire document browser
Post by: GB on April 21, 2011, 05:24:29 pm
Does this complete document browser allow for the deletion of system files?
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 21, 2011, 05:27:28 pm
Does this complete document browser allow for the deletion of system files?
Wow, I didn't think of that... I can't test it so I don't know, but it easily could, so I guess be careful.
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 22, 2011, 01:56:49 am
Note that unlike tiosmod+amspatch, which cannot easily run on the TI-68k calculator because amspatch is turning 0 bits back to 1 (which, in Flash memory, requires erasing a whole sector), a patcher/patchset pair for Phoenix could easily run on the Nspire (CAS) calculator, and fiddle with either the host OS or the one that is currently being force launched, as the OS is executed from RAM :)
Title: Re: Rooted Nspire document browser
Post by: compu on April 22, 2011, 01:47:49 pm
I suggest making a framework for patching TI's OS, similar to the one I made for patching TI's TI-68k OS (tiosmod+amspatch, ticalc.org POTY 2010 in the "PC utilities" category - but well, it was the only contender :D). That will ease the making of patches.
I have tried to make an on-calc patcher, but it seems that a hot reboot is necessary and I fail at using your code, the emulator hangs at "Launching system..." always. :banghead:
You do need to know the approximate size of the OS to dump it right? Or do you just dump an extra 2mb and clean it after checking for code?
I'm using another method to get dumps (with GDB, described on yAronet), I can post it here again if you want to.
Also, is there a way to directly dump the RAM of the emulator? I can do it fine with an ndless program, but I haven't figured out how to get that dump out of the nand image.
Emulation -> Enter debugger
w <output file> <start address> <size>
Edit: compu, you have the same nspire model as I do....Now I'm really confused.
Touchpad non-CAS, but I'm using a clickpad most of the time ;)
Does this complete document browser allow for the deletion of system files?
Yes :)
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 22, 2011, 01:56:31 pm
Quote
I'm using another method to get dumps (with GDB, described on yAronet), I can post it here again if you want to.
Thanks, I'll try that now.(I have the link :D)

Quote
Emulation -> Enter debugger
w <output file> <start address> <size>
Thanks!

Quote
Touchpad non-CAS, but I'm using a clickpad most of the time ;)
:banghead: Does it work with the touchpad? (I don't have a clickpad to test.)
Title: Re: Rooted Nspire document browser
Post by: compu on April 22, 2011, 01:58:07 pm
:banghead: Does it work with the touchpad? (I don't have a clickpad to test.)
I think I will try it :)
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 22, 2011, 02:07:23 pm
:banghead: Does it work with the touchpad? (I don't have a clickpad to test.)
I think I will try it :)
Thanks!
Title: Re: Rooted Nspire document browser
Post by: compu on April 22, 2011, 02:14:06 pm
Worked at first try.
Are you using the latest ndless installer? Might be the reason.
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 22, 2011, 02:16:51 pm
Worked at first try.
Are you using the latest ndless installer? Might be the reason.
Yes, r387... I just re-downloaded ndless and OSLauncher, am dumping the 2.0.1 non-cas OS and will try with everything fresh in a few minutes.
Thanks for all the help.
Title: Re: Rooted Nspire document browser
Post by: willrandship on April 22, 2011, 06:59:00 pm
So, theoretically with this you could back up your 84+ ROM images, on the same calc!
Title: Re: Rooted Nspire document browser
Post by: shmibs on April 22, 2011, 07:30:21 pm
sweet! that sounds very useful.
oh, and i hope you don't mind my resizing that 2816*2112 image, compu ;)
Title: Re: Rooted Nspire document browser
Post by: alberthrocks on April 22, 2011, 08:07:38 pm
I'm playing around with this on an emulator, and I see tons of "document" in an hex editor of a 2.0 ROM,
like "documents/MyLib/numtheory.tns", "documents/SD", etc. Which one is it?
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 22, 2011, 08:09:00 pm
I'm playing around with this on an emulator, and I see tons of "document" in an hex editor of a 2.0 ROM,
like "documents/MyLib/numtheory.tns", "documents/SD", etc. Which one is it?
Does OSLauncher work for you in the emulator? The "Documents" you need to remove is at 0x6807F8
Title: Re: Rooted Nspire document browser
Post by: alberthrocks on April 22, 2011, 08:11:42 pm
I'm playing around with this on an emulator, and I see tons of "document" in an hex editor of a 2.0 ROM,
like "documents/MyLib/numtheory.tns", "documents/SD", etc. Which one is it?
Does OSLauncher work for you in the emulator? The "Documents" you need to remove is at 0x6807F8
I'm using a 2.0 ROM (basically created from a TNO file and installed), so that offset is incorrect for me. :P
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 22, 2011, 08:13:42 pm
I'm playing around with this on an emulator, and I see tons of "document" in an hex editor of a 2.0 ROM,
like "documents/MyLib/numtheory.tns", "documents/SD", etc. Which one is it?
Does OSLauncher work for you in the emulator? The "Documents" you need to remove is at 0x6807F8
I'm using a 2.0 ROM (basically created from a TNO file and installed), so that offset is incorrect for me. :P

I don't quite understand what you need. What file are you editing?

EDIT: Can someone please confirm that these files are correct:
ndless_installer_os-2.0.1.tns--115,151 bytes--CRC-32:1DF117C2
ndless_resources.tns--7,160 bytes--CRC-32:70D37DC5
oslauncher.tns--1,712 bytes--CRC-32:D6A57DA8
DummyOS's .zip.tns--550 bytes--CRC-32:6F4FC1D7

I'm unable to launch DummyOS on either my calc or the emulator, and I have a feeling my build of ndless is too old. (I downloaded it from the build server today, but I can't compile ndless to test it myself as the latest update somehow killed my build system)

Nevermind, I've got other projects to work on. Any chance of a Prizm Emu sometime soon?
Title: Re: Rooted Nspire document browser
Post by: DJ Omnimaga on April 22, 2011, 09:01:21 pm
Nice stuff! I like how you can browse directly from the root directory. Just make sure to warn people to be careful to not delete anything precious if this can brick the calc.
Title: Re: Rooted Nspire document browser
Post by: willrandship on April 22, 2011, 09:04:50 pm
Nah, DJ, worst case scenario is an OS corruption, in which case the boot2 is quite capable of reinstalling a new one, perhaps even without loss of files!
Title: Re: Rooted Nspire document browser
Post by: DJ Omnimaga on April 22, 2011, 10:12:30 pm
Ah ok, so this cannot access Boot2, right?
Title: Re: Rooted Nspire document browser
Post by: mikehill2003 on April 22, 2011, 10:25:34 pm
Ah ok, so this cannot access Boot2, right?
No, boot2 is safe from this.
Title: Re: Rooted Nspire document browser
Post by: DJ Omnimaga on April 22, 2011, 10:36:41 pm
Ok good. If anyone ever managed to make it accessible with this, it would be best that such feature comes with some sort of giant key combination to access with a warning prior that that it could be dangerous.
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 26, 2011, 03:31:53 am
A patcher program, whether on-calc (where it can be combined with OSLauncher, but doesn't need to be) or computer-based, would be the only "easy enough" way to distribute OS modifications :)

In the computer-based (as I wrote, it was hard, slow and more unsafe to make it an on-calc patcher, so I didn't) tiosmod, I used two layers of I/O functions that can be built upon: read/write/search from/to current file position, read/write/search from/to absolute address.
But for an on-calc patcher fiddling with the host or launched OS (when all interrupts are disabled, of course :D), or a computer-based patcher modifying the file in a memory-mapped way, only one layer is needed: read/write/search from/to absolute address.

For maximum ease of use, a computer-based patcher needs to:
* perform the extraction+decryption+decompression of the OS file from TI-Nspire.img;
* apply the patch;
* recompress (deflate) the OS file.
Since it has a UI and it performs decompression and recompression, IMO, the TNOC code base would be a good starting point for a computer-based patcher. extraction+decryption was made by the latest version of imgdump. And the computer-based patching code can be adapted from tiosmod. IOW, we have all the pieces we need ;)


EDIT: I think I'm going to tackle an on-calc patcher code myself.
Title: Re: Rooted Nspire document browser
Post by: compu on April 26, 2011, 05:19:35 am
A computer patcher might be useful, but in this case, I have to write only at two addresses and I think this could be better done with an on-calc patcher. Modifying an OS Image and loading it with OSLauncher would waste around 3,5MB of space on the calc.
Title: Re: Rooted Nspire document browser
Post by: Lionel Debroux on April 26, 2011, 05:43:36 am
Definitely :)

Please send me the addresses, I've made the building blocks for an on-calc patcher+patchset, and I'd like to test them. TIA ;)