Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: Michael_Lee on September 18, 2010, 09:51:55 pm

Title: Exporting/signing apps?
Post by: Michael_Lee on September 18, 2010, 09:51:55 pm
Does anybody know how I can export apps?
Also, what's 'signing apps'?  How does it work?
Title: Re: Exporting/signing apps?
Post by: meishe91 on September 18, 2010, 11:12:16 pm
Export apps from what?
Title: Re: Exporting/signing apps?
Post by: TC01 on September 18, 2010, 11:32:57 pm
Signing apps means packaging an application in TI's *.8xk format, with a digital signature (the 0104 key) so it can be sent to a calc. If an app is not signed, the calculator won't accept it (and I think TI-Connect won't even try to send it?). An app would run fine unsigned on a calculator (if compiled there using Axe), but if it wasn't signed it couldn't be sent to a computer.

For instance, ZDS (Zilog Developer Studio, one way to make apps- the only example I can think of) produces *.hex files. This contains all the code needed for an application. But you cannot send it to a real calculator without signing it first.

The 0104 key is the only signing key TI actually released, and it can be found in their 83+/84+/73 SDK (http://education.ti.com/educationportal/downloadcenter/SoftwareDetail.do?website=US&tabId=1&appId=177) along with Wappsign, a program to do that.

But Rabbitsign, a community-made program, can also sign apps, along with z80 OSes, 68k apps, and 68k OSes- as long as you download all the keys from BrandonW.net (http://www.brandonw.net).

Does that explain it?
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 18, 2010, 11:40:54 pm
If I recall, Wabbitemu will also refuse unsigned apps.

Is Wabbitsign any good, btw? What about the one that comes with Flash Debugger?
Title: Re: Exporting/signing apps?
Post by: TC01 on September 18, 2010, 11:47:09 pm
That's Wappsign- by "SDK" I meant "Flash Debugger". I knew there was something else it was usually called.

It does what it's supposed to do. I doubt it works with anything but a z80 app- don't know if it would work if I tried to run the TI-73 app signing key through it (I don't have a TI-73 app source to try, anyway). It also has a GUI.
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 18, 2010, 11:53:19 pm
Ah ok, yeah I was wondering cuz I prefer stuff with actual GUIs. I don't know if Revsoft's Wabbitsign have a GUI, does it have one?
Title: Re: Exporting/signing apps?
Post by: TC01 on September 18, 2010, 11:59:02 pm
Nope, it's a commandline program.

But it also serves as a linker for assembly programs, which Rabbitsign can't do.
Title: Re: Exporting/signing apps?
Post by: meishe91 on September 19, 2010, 12:03:47 am
I'm fairly sure Wabbit does allow unsigned apps because I'm pretty sure I've tried some and then later people are apologizing for not putting a signed one up.
Title: Re: Exporting/signing apps?
Post by: BuckeyeDude on September 19, 2010, 12:17:01 am
I'm fairly sure Wabbit does allow unsigned apps because I'm pretty sure I've tried some and then later people are apologizing for not putting a signed one up.
Wabbit does indeed accept unsigned apps...were too lazy to write a validator (although i suppose i could steal code from spasm). If you would like to check to see if an app is properly signed without sending it to a calc (the calc actually writes it to flash then erases it if it fails to validate), you can reset all memory on wabbit then load the app. This will simulate sending the app the long way and the os will actually validate it
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 12:25:43 am
Ah that seems cool then. They delete after 16 runs, though, right?
Title: Re: Exporting/signing apps?
Post by: SirCmpwn on September 19, 2010, 11:53:40 am
Yeah, I've noticed the delete thing, which really bugs me.  Perhaps we can patch this out?
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 12:40:47 pm
It might be nice, especially since resending the app later sometimes fails too (missing from APPs menu), due to the face Wabbitemu force-accept apps sent to it.
Title: Re: Exporting/signing apps?
Post by: SirCmpwn on September 19, 2010, 01:15:05 pm
I don't know much about patches, but I can look into it.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on September 19, 2010, 01:23:38 pm
...
So...

Apps won't run unless they're signed, and only Rabbitsign can do that?
Title: Re: Exporting/signing apps?
Post by: SirCmpwn on September 19, 2010, 01:29:37 pm
No, they will run, but only up to 16 times.  Also, Wappsign can do it as well as rabbitsign, even though I prefer rabbitsign for its versatility.
Title: Re: Exporting/signing apps?
Post by: TC01 on September 19, 2010, 01:30:52 pm
And there are three (probably more, actually) programs that can do it:

-Wappsign (TI's Flash Debugger, key included)
-Wabbitsign (ticalc.org, need to download key seperately)
-Rabbitsign (tiicalc.org, need to download key seperately)

Rabbitsign is probably the best program to use, though, because it can sign 68k flash apps and OSes for both.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on September 19, 2010, 01:32:31 pm
No, they will run, but only up to 16 times.

...
The calculator keeps track?  o.O
How?  Why?

Also, if I use Axe to make an app with an actual calculator, is it automatically signed?

Title: Re: Exporting/signing apps?
Post by: SirCmpwn on September 19, 2010, 01:34:32 pm
Axe does not sign applications, and I don't know how or why the calculator keeps track.  16 is an important number in computers (the total number of digits in hex), so perhaps there is something related to this?
Title: Re: Exporting/signing apps?
Post by: Lionel Debroux on September 19, 2010, 01:34:44 pm
Quote
The calculator keeps track?  o.O
How?
By using a 16-bit bitfield and clearing one bit at a time, IIRC.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on September 19, 2010, 01:39:35 pm
Axe does not sign applications

Ooh, you're right!  I just tried running an unsigned app 16 times in a row, and it deleted itself!  That's awesome!
Title: Re: Exporting/signing apps?
Post by: SirCmpwn on September 19, 2010, 01:43:06 pm
Ooh, you're right!  I just tried running an unsigned app 16 times in a row, and it deleted itself!  That's awesome!

*cough* not awesome *cough* it's actually quite an inconvenience.  You can sign in on-calc, but it takes roughly 12 minutes.
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 01:49:15 pm
You can? I thought Quigibo ditched app signing feature addition?

As for the 16, I think it has to do with trial APPs from TI. You could run them 16 times before they delete themselves.
Title: Re: Exporting/signing apps?
Post by: SirCmpwn on September 19, 2010, 01:51:05 pm
It's not Quigibo's program, it comes separate from Axe.
And trial APPs makes sense, come to think of it.
Title: Re: Exporting/signing apps?
Post by: calcdude84se on September 19, 2010, 01:51:34 pm
It's not in Axe, but an ASM program could be written. It is a slow process, though.
Edit: ninja'd :P
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 01:54:21 pm
Oh ok, is the on-calc app signer included with Axe download?
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on September 19, 2010, 01:55:08 pm
It doesn't look like it...
Title: Re: Exporting/signing apps?
Post by: calcdude84se on September 19, 2010, 01:55:25 pm
No, the signer included with Axe is computer-side.
I think brandonw wrote an on-calc version...
* calcdude goes and finds
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 01:57:08 pm
Oh I see. I remember Quigibo telling me he was trying to get help from BrandonW on that part of Axe back then, but finally I think he ditched the idea. BrandonW probably still wrote it regardless.
Title: Re: Exporting/signing apps?
Post by: calcdude84se on September 19, 2010, 02:04:44 pm
http://brandonw.net/calcstuff/resign.zip (http://brandonw.net/calcstuff/resign.zip)
It's for the OS, actually, but still ;D
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 02:34:51 pm
Does app signing uses the same key as for OS signing?
Title: Re: Exporting/signing apps?
Post by: calcdude84se on September 19, 2010, 02:37:54 pm
No, apps are signed with the 0104 key, OS's with 05 and 0A (for 83+(SE) and 84+(SE), respectively)
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 02:43:25 pm
So I assume it needs to be modified to use the other key instead?
Title: Re: Exporting/signing apps?
Post by: calcdude84se on September 19, 2010, 02:52:42 pm
Not to mention apps are signed differently (not with RSA but with some other method)
In the end, though, it's still slow. :(
Title: Re: Exporting/signing apps?
Post by: jnesselr on September 19, 2010, 03:44:26 pm
Not to mention apps are signed differently (not with RSA but with some other method)
In the end, though, it's still slow. :(
No, it does use RSA.  That's the only thing the keys are for.  The way signing works, is that you take some hash of the data to be signed, like MD5 or SHA hash (MD5 for calcs, IIRC), then use RSA to encrypt that.  Then when the calc checks it, it creates its own hash and signs it, and if they match, then the data has not been tampered with.
Title: Re: Exporting/signing apps?
Post by: calcdude84se on September 19, 2010, 03:48:26 pm
So it is. My bad, I had misread something earlier. :-[
But my main point is still valid ;D
Title: Re: Exporting/signing apps?
Post by: jnesselr on September 19, 2010, 03:59:45 pm
So it is. My bad, I had misread something earlier. :-[
But my main point is still valid ;D
Oh, of course. Yeah, the calculator isn't really good at large math like that.
Title: Re: Exporting/signing apps?
Post by: DJ Omnimaga on September 19, 2010, 11:13:04 pm
Personally signing on calc would only be useful for example when I go to a hockey game in Quebec city. During my city part of the 1.5 hour bus ride where I can actually sit down, I like to be able to code and stuff or listen to music. If I absolutely want to sign my app or something then, I would be able to do it. However, there still remains the fact it's a long wait and I may prefer to just wait until I get computer access to save 12 minutes of my time.
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 02:13:21 am
I'm trying to sign an .8xk and make an .8xk from it.
I've tried wabbitsign, rabbitsign, and the utility included with axe parser and none of them worked for me.
What are/is the best program and what is the syntax using 010A.key?
Title: Re: Exporting/signing apps?
Post by: jnesselr on October 31, 2010, 05:47:26 pm
what do you mean it doesn't sign it? Does it give an error, or will it not send?
Title: Re: Exporting/signing apps?
Post by: FloppusMaximus on October 31, 2010, 07:04:15 pm
You don't need to use 010A.key.

App signing does not use RSA, but rather, the Rabin (http://en.wikipedia.org/wiki/Rabin_cryptosystem) algorithm.

Darl181: when you run rabbitsign, what error message does it give?
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 07:17:58 pm
I don't know how to make it sign it.  I'm horrible at this command prompt stuff.  I wasn't able to understand the readme.
I'm not saying there was something wrong with the program, I'm asking how to use it.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on October 31, 2010, 07:19:22 pm
Even the utility included with Axe didn't work?
Did you do it right - drag your 8xk over the .bat file?
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 07:22:03 pm
Yes, I dragged it over and it said it didn't exist...
So I copied the app to the same directory as the .bat file and, again, it said it didn't exist...???
No, apps are signed with the 0104 key, OS's with 05 and 0A (for 83+(SE) and 84+(SE), respectively)
Though I've been told to use 010A.key so it works with 84's.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on October 31, 2010, 07:23:02 pm
It?  By 'it', do you mean the app or rabbitsign?
Title: Re: Exporting/signing apps?
Post by: FloppusMaximus on October 31, 2010, 07:30:19 pm
010A.key is a key that only works for the 84+.  0104 (which is included in the rabbitsign binary) works for both the 83+ and 84+.
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 07:40:59 pm
the bat file.
It pops up when I drag the app over it.
010A.key is a key that only works for the 84+.  0104 (which is included in the rabbitsign binary) works for both the 83+ and 84+.
Really?  I guess I'd better use 1014 then.
I still have no idea how to use the thing, though.

It says:

Quote
'rabbitsign' is not recognized as an internal or axternal command, operable program or batch file.
Signing Complete!
Press any key to continue..._

Yet nothing happens to the app.
Title: Re: Exporting/signing apps?
Post by: FloppusMaximus on October 31, 2010, 07:46:34 pm
It will use whichever key is specified by the app header (which is 0104 unless you're doing something unusual.)

Is rabbitsign.exe in the same folder with the batch file?  What happens if you just run rabbitsign itself?
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 08:14:08 pm
I've been trying to use 010A.  I'll try 0104, see if that makes any difference.
Same...
see pic
TWHGEdit is the app I'm trying to sign.
How would I do it manually?  what would I type in?
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on October 31, 2010, 08:16:22 pm
Could you try uploading the entire contents of that file so we can take a look at it?  Maybe something's wrong with the batch file.
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 08:20:40 pm
Could you try uploading the entire contents of that file so we can take a look at it?  Maybe something's wrong with the batch file.
Sure, see attachment.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on October 31, 2010, 08:26:02 pm
Hmm, it worked fine on my computer.  Maybe it's a difference between Windows XP and Windows 7?  Try opening and editing the batch file so it reads 'rabbitsign.exe', not 'rabbitsign' - maybe that'll work?
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 08:27:31 pm
Which bat file?
The drag app over me, or rabbitsign?
[offtopic]Hey, kind of fitting how on halloween we're talking about bats :P[/offtopic]
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on October 31, 2010, 08:29:28 pm
The 'Drag App Over Me'
Rabbitsign isn't a bat file - it's an exe, so you can't really edit it.
Title: Re: Exporting/signing apps?
Post by: Deep Toaster on October 31, 2010, 08:30:29 pm
Are you just dragging-and-dropping over the .bat file? Try cd'ing to the directory containing rabbitsign before you do that.

[offtopic]Hey, kind of fitting how on halloween we're talking about bats :P[/offtopic]
/me loses the game :P
Title: Re: Exporting/signing apps?
Post by: FloppusMaximus on October 31, 2010, 08:31:06 pm
What happens if you just run rabbitsign itself?
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 08:32:59 pm
The 'Drag App Over Me'
Rabbitsign isn't a bat file - it's an exe, so you can't really edit it.
*facepalms*
What happens if you just run rabbitsign itself?
It appears and dissappears.  I'll try and see what it does in command prompt...
Screenie. ↓

*!* Oh, you're the person who wrote it!
Title: Re: Exporting/signing apps?
Post by: FloppusMaximus on October 31, 2010, 08:42:23 pm
Well, that looks fine.  But then why wouldn't it work when run from the batch file?  Sorry, I'm not a Windows person.
Title: Re: Exporting/signing apps?
Post by: jnesselr on October 31, 2010, 08:48:41 pm
what is the app name and file?

EDIT:  This is so I can help you with the commands.
Title: Re: Exporting/signing apps?
Post by: Michael_Lee on October 31, 2010, 08:49:58 pm
I think it's included in the zip file he attached earlier.
Title: Re: Exporting/signing apps?
Post by: jnesselr on October 31, 2010, 08:55:02 pm
Cool, so first type "rabbitsign.exe -c TWHGEdit.8xk".  It should say there is no certificate.

If there isn't one, do this: "rabbitsign.exe -k 0104.key -t 8xk -o TWHG.8xk TWHGEdit.8xk"

That should work.
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 09:15:22 pm
Cool, so first type "rabbitsign.exe -c TWHGEdit.8xk".  It should say there is no certificate.

If there isn't one, do this: "rabbitsign.exe -k 0104.key -t 8xk -o TWHG.8xk TWHGEdit.8xk"

That should work.
I typed the first part and it said
Quote
TWHGEdit.8xk: error: incorrect application length
I tried the second part, and it gave me a bunch of errors.
Title: Re: Exporting/signing apps?
Post by: jnesselr on October 31, 2010, 09:22:58 pm
basically, the size byte field is wrong.  Run the second command again, but add a -r option.

Then, run the second command again, but a -f instead of a -r, and a "TWHG2.8xk" instead of "TWHG.8xk" and zip both those files up with the original "TWHGEdit.8xk" file and attach them.

EDIT: make sure the -r and the -f are case sensitive.
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 09:26:45 pm
where do I put the -r ?
Title: Re: Exporting/signing apps?
Post by: FloppusMaximus on October 31, 2010, 09:32:49 pm
rabbitsign.exe -r -k 0104.key -t 8xk -o TWHG.8xk TWHGEdit.8xk

(actually, the "-k 0104.key -t 8xk" is unnecessary)

In this case, you want -r, not -f (rabbitsign is complaining because there's a lot of empty space after the end of the app, probably because you transferred it from the calculator, and it didn't have a correctly formed signature to begin with.)
Title: Re: Exporting/signing apps?
Post by: Deep Toaster on October 31, 2010, 09:38:42 pm
Darl181, I think you're using the old command prompt. Use cmd.exe instead, and dragging-and-dropping should work.
Title: Re: Exporting/signing apps?
Post by: jnesselr on October 31, 2010, 10:12:14 pm
the reason I said -f is it compiles while ignoring errors.  yeah, the -k -t is unnecessary, but I figured it couldn't hurt.  Also, it shows him how to use prompts with 010A.key and so on.
Title: Re: Exporting/signing apps?
Post by: Darl181 on October 31, 2010, 11:58:28 pm
Well -f made the output app three pages.
But -r seemed to work.
So, let me see...
rabbitsign.exe -r -k <keyFile.key> -t <outputFormat?> -o <output.8xk> <input.8xk>
...the stuff in red being unnecessary.  Good to know.