Author Topic: Let's hack the HP Prime!  (Read 120104 times)

0 Members and 1 Guest are viewing this topic.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Let's hack the HP Prime!
« Reply #120 on: September 22, 2013, 02:00:29 am »
Yeah, HP calculators have long had keyboard customization possibilities that the 86 and TI-68k series' custom mode doesn't match. The HP-41C already had that user mode, but I don't know whether it was the first HP calculator to provide this feature.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline iconmaster

  • LV3 Member (Next: 100)
  • ***
  • Posts: 82
  • Rating: +5/-0
    • View Profile
Re: Let's hack the HP Prime!
« Reply #121 on: September 22, 2013, 10:07:09 am »
Here's a good example of the oddities of the CAS. Let's try using the @ sign in an expression. Nothing in the documentation says anything about the @ sign in an expression, so it'll be a syntax error if we use it, right?





...Wrong. It instead gives us double_deux_points, which is something I've never heard of, and the Catalog hasn't, either.



Copying this mysterious input does not help resolve questions. It's just another undocumented CAS convention. Re-inputting the same exact output gives us just 5, but copying the 'just' 5 gives us at::5 again. Will the wonders never cease?

EDIT: A deux point is French for a colon? Well, that's nice and literal.

EDIT 2: I installed the SDK OS. Well, one difference is this:


EDIT 3: I cannot seem to reproduce the above behavior, so it might not be an SDK thing. Just a bug thing. Also, it seems that ON+Help seems to do something, but I can't tell what. Anyone else with a non-SDK Os, does ON+Help not give you the Help screen like it should if ON+Help didn't do anything?

EDIT 4: Okay, on another note, I extracted all the known localized strings using the STRINGFROMID function. I thought there might be some secrets or whatnot in there. It's available here. Some entries in this list implies that the HP Connectivity Kit program exists inside the calculator, oddly enough.
« Last Edit: September 22, 2013, 03:19:52 pm by iconmaster »

Offline timwessman

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +32/-0
    • View Profile
Re: Let's hack the HP Prime!
« Reply #122 on: September 22, 2013, 03:19:38 pm »
I've reported both problems to HP-France, but I don't know if they did translate and forward them.

Definitely never made it to me...


As a general comment here, thanks for the details on things. As I suspected, the vast majority of the comments revolve around the CAS. I always monitor and collect issues/comments and get that into our systems to make sure they are addressed in some fashion.

When you find a spelling/grammatical issue with the built in help, please email me and I'll be sure it gets resolved in the next revision. Remember, there is 5MB(!) of compressed built in help on the system. Thus there is lots of chances to miss things. Any help here is greatly appreciated. If you've never had to proofread a large collection of information multiple times, it is nearly impossible to understand how the brain fills in and filters things to make them "right" in your brain. :-)
« Last Edit: September 22, 2013, 03:21:44 pm by timwessman »
TW

Although I work for the HP calculator group, the comments and opinions I post here are my own.

Offline iconmaster

  • LV3 Member (Next: 100)
  • ***
  • Posts: 82
  • Rating: +5/-0
    • View Profile
Re: Let's hack the HP Prime!
« Reply #123 on: September 22, 2013, 03:25:13 pm »
As a general comment here, thanks for the details on things.

Glad to help! Being an avid HP user, I'd be glad any day to help make the OS better.

When you find a spelling/grammatical issue with the built in help, please email me and I'll be sure it gets resolved in the next revision.

Oh, I've come across multiple minor Help issues; I'll be certain to forward a list to you soon.

Offline timwessman

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +32/-0
    • View Profile
Re: Let's hack the HP Prime!
« Reply #124 on: September 22, 2013, 03:30:53 pm »
Quote
After trying to type the following integral in, I got the weirdest, most undescriptive error that I've ever seen on a calculator. Trying to copy/paste yielded the same result, yet retyping the function gave the correct result.


Just a note on this one, it is a result of the "d(x)" having the integral included inside the variable declaration like d(x+int...). Definitely a problem with not showing the user clearly that you are still inside the variable declaration there.
« Last Edit: September 22, 2013, 03:31:23 pm by timwessman »
TW

Although I work for the HP calculator group, the comments and opinions I post here are my own.

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: Let's hack the HP Prime!
« Reply #125 on: September 23, 2013, 01:20:16 am »
I've reported both problems to HP-France, but I don't know if they did translate and forward them.

Definitely never made it to me...
Which is not surprising, IMHO. Big corporate companies tend to do that a lot. Blame bureaucracy for most of those occurences. Hence why everyone nicknames TI-Cares support service as TI-Doesnt-Care. The best that can happen is if one TI/Casio/HP employee who is involved in programming the calculator OS is active on forums where the product he worked on is popular, which is the case right now. Otherwise, there is usually some sort of person who filters e-mails and might just delete anything that is slightly negative or just not bother about sending the info to the appropriate team, which is made even worse if it's transmitted from HP France to another HP headquarter or vice-versa.

By the way, a Bug reports thread has been made here: http://ourl.ca/19642/361648;topicseen#new
« Last Edit: September 23, 2013, 01:27:37 am by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: Let's hack the HP Prime!
« Reply #126 on: September 24, 2013, 11:37:14 am »
Welcome to Omnimaga Iconmaster!
You know, it does kinda feel like a beta. The documentation isn't very good, some features feel incomplete, you know, the lot. It really feels that they rushed to ship this out. And yet they're still late...
Thank you for all your feedback this far, it will certainly be much appreciated by all future Prime users. I think, however, that most of these recent posts hardly have anything todo with the real hacking stuff. :-\

By the way, a Bug reports thread has been made here: http://ourl.ca/19642/361648;topicseen#new
Well done!

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: Let's hack the HP Prime!
« Reply #127 on: September 24, 2013, 02:29:57 pm »
Yeah this is why Sailerboy created a new topic just for bugs and feature requests (mostly bug reports, actually).

But yeah it does feel like a beta at times, because there are reports that the calculator package sold in stores comes with an outdated version of the emulator and no documentation (although it's available on-calc). This can make it a bit hard for people who are not used to help being built-in the calc, who will end up searching for hours for the guidebook. X.x
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Let's hack the HP Prime!
« Reply #128 on: September 26, 2013, 07:27:22 pm »
I don't know if this is exploitable, but there seems to be some reproducible steps to corrput the memory :
http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=251395#251395

Quote
Sorry to make so many threads, but I think this one deserves its own thread. This was partially mentioned in the EDITMAT thread.

You can get likely your calculator to hard crash and corrupt its memory in the following manner:

1. Create a new app and within the app have new bindings for the default views such as Plot, PlotSetup, etc. Your app should presumably creates new global variables.

2. Run the app and make sure everything is working.

3. Open the program editor with your app currently running. Simply open the source code to your app and close it.

4. Now, press a key corresponding to what your app overrides. For example, if your app has a new Plot() function, press plot.

At this point there is a good chance that your calculator resets, and possibly corrupts memory.

You can use my Graph 3D app, which I have slightly updated in a different thread. Here are the exact steps:

1. Follow the steps on how to install the app. Click here for the source.

2. Run the app and plot 1/390*(X^3*Y-X*Y^3) using the default window settings. After you see a graph, press [Num] to see a table of Z-values. (This is just to simulate having done stuff on the app.)

3. Now, with Graph 3D as the current app, go to the program editor (press [SHIFT][1]) and open the source to the Graph 3D app. Simply open and then close it with [ESC]. I have sometimes experienced a warmstart at this point.

4. Immediately try to plot using the [Plot] button and the calc will hang and eventually warmstart. Or try pressing [Num]. If it doesn't hang try turning it off... and then if can look at the matrices via [SHIFT][4]. M0 is a copy of Zvals, and I often get a huge matrix that is less than 1 kB in size!

What I think is happening:

After exiting the program editor, the calc tries to compile the source into an executable. The problem, however, is that when it's the currently running app, then function pointers are probably slightly changed and what was once a valid pointer is possibly no longer valid.

Current workaround:

Any time you close the program editor (after editing the currently running app), restart the app (exit to a different app and start your app again).

Here is a screenshot of the bug report, just in case : http://i.imgur.com/UVWwRCG.png

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: Let's hack the HP Prime!
« Reply #129 on: September 26, 2013, 11:40:52 pm »
Interesting. I hope that this bug can't brick our calcs, tho x.x
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Let's hack the HP Prime!
« Reply #130 on: September 27, 2013, 11:55:28 am »
Reflashing an OS would probably fix the OS and/or the filesystem.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

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: Re: Let's hack the HP Prime!
« Reply #131 on: September 27, 2013, 12:26:06 pm »
The problem though is if HP decides to never fix some bugs preventing programs from running, then some of our programs might only run on unnoficial OSes, which students might not necessarily have installed.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline iconmaster

  • LV3 Member (Next: 100)
  • ***
  • Posts: 82
  • Rating: +5/-0
    • View Profile
Re: Let's hack the HP Prime!
« Reply #132 on: September 28, 2013, 09:17:23 am »
I don't know if this is exploitable, but there seems to be some reproducible steps to corrput the memory :

This could be really good, if it didn't overwrite the part of memory we'd use to insert data into when it inevitably crashes. It's take an extremely in-depth knowledge about what memory location goes where, but I guess putting arbitrary data that might or might not be possible.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Let's hack the HP Prime!
« Reply #133 on: October 29, 2013, 03:12:24 am »
For information, I pointed to this topic on MoHPC, and Tim Wessman indicated that the calculator is not running Windows CE.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

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: Re: Let's hack the HP Prime!
« Reply #134 on: October 29, 2013, 11:25:51 am »
To be honest, I never thought it did either. The Prime OS is entirely based on the HP 39gII OS, except less buggy, with larger screen and color support, the addition of a CAS and to a certain extent, RPN. The 39gII OS was written from scratch.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)