Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: dinosteven on August 06, 2012, 01:19:20 am

Title: Check Calc ID
Post by: dinosteven on August 06, 2012, 01:19:20 am
Is there any way I can check the calc's ID number and store it to a variable?
School's starting soon, and that means that my classmates are going to steal my calc and try to steal my in development games. I need a way to stop them from using them, so only I can run it! I used to store a key value to a variables, but they've taken to stealing all my variables, too! So I need to find a way to check the calc's ID number, and I thought Axe might be able to do it.
Title: Re: Check Calc ID
Post by: shmibs on August 06, 2012, 02:09:04 am
ask thepenguin; he'd know how to manage this, i bet./me bets it's somewhere in the certificate or something like that.
Title: Re: Check Calc ID
Post by: Hayleia on August 06, 2012, 02:20:46 am
(this topic needs to be moved)

my classmates are going to steal my calc and try to steal my in development games.
What do they steal ? Your sources or your executables ?
What you can do is also use zStart (http://ourl.ca/10110/303752) (check thepenguin77's sig for updates) and put a password to your calc. You'll say "they can remove a battery to RAM Clear and avoid the password" but no, zStart can also run a program on RAM Clears and your classmates will not be able to avoid the password.
And zStart has a lot of other features, like running programs on Homescreen, a label menu in Axe sources (very useful), editing archived programs (very useful too), etc... :D
Title: Re: Check Calc ID
Post by: shmibs on August 06, 2012, 02:31:30 am
zstart still has a fail-safe startup mode, so they might get around it if they're lucky; it's much less likely that they'll be able to bypass a hardware check, as they'd have to know axe and be able to pinpoint the line that does the checking. a check like that could be useful for other things as well, like a pokemon game that wants to determine if a pokemon has been traded or not.

oh, and this isn't the wrong section, per se. it would be better to post here (http://www.omnimaga.org/index.php?board=162.0), though.
Title: Re: Check Calc ID
Post by: dinosteven on August 06, 2012, 11:28:32 am
I've tried zStart, but it crashes every time I use it! I just tried it again, messing with settings randomly, and now my calc is messed up. Every time I start it, it doesn't; I pull the batteries, and it says RAM cleared, but when I try to do anything else, it messes up again. I've backed it up, but...
Anyways, I'll fix it by resetting the OS. zStart doesn't work for me, though.
I think that this topic should be moved, it'd be better there. Someone, please do it!
So, how can you check the ID?
Title: Re: Check Calc ID
Post by: parserp on August 06, 2012, 11:32:21 am
Hayleia's solution sounds fail proof to me, unless they know zStart and press ON+CLEAR when turning on. :-\
That, or you could just keep your calc in a safe place (like a pocket :P)

EDIT:
I've tried zStart, but it crashes every time I use it! I just tried it again, messing with settings randomly, and now my calc is messed up.
Are you sure you are using the latest version of zStart on the right calculator? (the 84+ version is super different than the 83+ version, which are both included in the .zip)
Title: Re: Check Calc ID
Post by: dinosteven on August 06, 2012, 11:54:29 am
version 1.3.005
Title: Re: Check Calc ID
Post by: TIfanx1999 on August 06, 2012, 11:56:51 am
Moved. ;) If you can get Zstart to work properly it's a great utility. Many here swear by it. =)
Title: Re: Check Calc ID
Post by: dinosteven on August 06, 2012, 12:05:01 pm
I installed it, turned on catalog help, and omnicalc, set Run on RAM Clear, did some stuff with Program settings, and exited. The cursor was blinking normally. Then I pressed the PRGM button (and after testing many times, it seems any button but 2nd, ALPHA, and ON do this,) and everything went blank. I had to pull the batteries, but it kept coming back. Eventually, I used the arrow key trick to disable apps. It also deleted my Groups.
I've got a TI-84+SE, bought it in ~March of this year.
Title: Re: Check Calc ID
Post by: thepenguin77 on August 06, 2012, 12:29:16 pm
Ok, for zStart, to simply get rid of it if it's causing problems, this sequence should always work:
1. Remove a battery
2. Wait longer than 5 seconds
3. Hold down the DEL button
4. Reinsert the battery while still holding DEL
5. Press ON
6. Press any key
7. Hold CLEAR
8. Press ON while holding CLEAR
9. Delete zStart from the Memory Management menu
10. Clear ram from the Reset menu

If you'd rather disable zStart than deleting it, change step 9 to "Delete the zStart appvar from the Memory Management menu (it's about 172 bytes)"

But as far as what's making zStart actually fail, I would love to know. The first thing you can try is to delete it's appvar. There's a chance that will fix it. Then, you can slowly reenable stuff until you find the conflicting setting. You don't have to do this if you don't want to, but if you figure it out, I can fix it for you.
Title: Re: Check Calc ID
Post by: Runer112 on August 06, 2012, 12:43:44 pm
Just about a year ago, mrmprog asked how to get the calc ID in Axe, and the answer is using assembly. Here (http://ourl.ca/9970/236945) is my answer from a year ago. :)




Since you're asking about just using the ID for checking, you could use a smaller piece of assembly combined with a bit of Axe to do what you need. For example, this code would cause any calculator except mine* to freeze:
Code: [Select]
Asm(EF7E80)
While 1
End!If {?849C}?-?E198
*1 in 65,536 calculators share this value, but the chance of a classmate's calculator sharing this value are low enough that you probably don't need to worry about this.

?E198 is a 2-byte value I took from my calculator ID. Obviously if you wanted to use this protection method, you wouldn't want to protect your program so only I could run it, you'd want to protect it so only you could run it. To find the value of those 2 bytes in your calculator ID, run the following code, and then replace E198 with the output:
Code: [Select]
Asm(EF7E80)
Disp {?849C}??Hex




As a second line of defense, if you think these people are smart enough to grab your source code and find and remove the check above, you can get really tricky and obfuscate one or two constant values. It would make your program slightly larger, but it would certainly make the ID-based protection harder to circumvent. The more strange the constant value you're replacing, the harder it would be for someone to decipher the true value. For example, here's some code I wrote recently in which I have obfuscated two 2-byte values with a 2-byte value from my calculator ID:
Code: [Select]
ReturnIf +P?r? and ?DF-({?849A}?-?BCBE)*3·({?849A}?-?481F)

That could would only execute properly on my calculator. Because of what this specific piece of code does in the program, this would not cause a crash on other calculators, but the game it's a part of would be unplayable. The format of these obfuscated constant values is ({?849A}?-(id_value+real_constant)). Find id_value using the code two blocks above for finding the value of {?849C}? for your calculator, and just change that to {?849A}?. And make sure to calculate (id_value+real_constant) manually! If you can't easily calculate with the hexadecimal value of {?849A}?, you can change the code to find its value to display the value with ?Dec instead.
Title: Re: Check Calc ID
Post by: DJ Omnimaga on August 06, 2012, 05:18:47 pm
I don't think much calcs got a duplicate ID, because when that happened in the past, it prevented some people from getting some paid flash apps or registering their calc on TI website. TI recalled the affected calcs.
Title: Re: Check Calc ID
Post by: lkj on August 06, 2012, 05:39:54 pm
But this code only checks 2 bytes of the ID, not the full one, so it might be the same on different calcs even though they don't have the same full ID. (I think)
Title: Re: Check Calc ID
Post by: DJ Omnimaga on August 06, 2012, 05:44:41 pm
Oh ok I thought it was the entire ID. There were episodes of duplicate IDs for real in the past, though: http://www.ticalc.org/archives/news/articles/5/54/54165.html
Title: Re: Check Calc ID
Post by: dinosteven on August 06, 2012, 07:49:45 pm
I got '4'. Does that mean
Code: [Select]
:Asm(EF7E80)
:!If {ᴇ849C}ʳ-ᴇ4
:Disp "You can't use this!"
:Return
:End
Will work?
Title: Re: Check Calc ID
Post by: Runer112 on August 06, 2012, 08:44:49 pm
"4" doesn't sound right... Disp value►Hex should always display four hexadecimal digits, not a single digit. Do you have MathPrint enabled perhaps? I know it can sometimes cause problems with printing text to the homescreen.

And that code is almost right. :P Just get rid of the ! before the If and it should work properly.
Title: Re: Check Calc ID
Post by: dinosteven on August 06, 2012, 10:17:17 pm
Yeah, I disabled MP, and it gave me 4C22. Now:
Code: [Select]
:Asm(EF7E80)
:If {ᴇ849C}ʳ-ᴇ4C22
:Disp "You can't use this!"
:End
It works! Thanx
Title: Re: Check Calc ID
Post by: ClrDraw on October 22, 2013, 12:05:01 pm
Here's an easier way. Make one program (SRC) and put the following code in it:
Code: [Select]
.RUN
:GetCalc("appv check",16)
:Archive "appv check"
( the appv var token can be found by pressing 2nd 8 )
MAKE SURE to include the space between appv and check, that's what makes the appv hidden.
Compile it with Axe and run it. Then delete prgmSRC and prgmRUN.
This will make a hidden appvariable that will not show up in the memory menu.

Then in all your sources, put this code at the beginning:
Code: [Select]
:!If GetCalc("appv check")
:Return
:End
This will make the program quit if the calculator doesn't have the hidden appvariable. So basically, only your calculator will work with the program.
Title: Re: Check Calc ID
Post by: Streetwalrus on October 22, 2013, 12:07:23 pm
Or you could combine both methods to make a license type thing. But it looks like you're necroposting a lot. Please avoid this.
Title: Re: Re: Check Calc ID
Post by: DJ Omnimaga on October 22, 2013, 02:45:06 pm
Also while hidden appvars might be useful to prevent people from deleting them by mistake and losing save files and preventing cluttering the memory menu, it makes it much harder for people to delete them as they see fit (especially if archived, in which case someone could create a program with malicious intents such as filling the user's archive, forcing him to reset its entire content).
Title: Re: Check Calc ID
Post by: ClrDraw on October 24, 2013, 09:31:10 pm
That would be a very mean program. I actually use hidden appvariables in my programs like Terminal (http://ourl.ca/19766.new;topicseen#new) but it's just so they don't show up with the other appvariables when the user lists them. I made it delete them when it exits too.