Why I'm Learning Assembly

Feel like posting Off Topic? Do it here.

Moderator: MaxCoderz Staff

User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Why I'm Learning Assembly

Post by waeV »

The reason I got into assembly is pretty funny, I think. I planned to make a program in TiBasic and have some form of copy protection on it, and my friend challenged me to make a form of copy-protection that she couldn't break. I accepted, but the problem was that everything I could think of could be easily circumvented by simply editing the copy-protection out of the program. So I was browsing the user manual and discovered the Asm( command and looked it up, finding assembly.

The premise of my program is that there will be some variable on my calculator that the program checks for as it starts to run. If the variable is correct, it displays a congratulations message on the screen. What I consider to be the better part of the program is that if the copy protection fails once, the program rewrites a .db so that the copy-protection will fail every time.

So I'll run it on my calculator, proving it works. then I'll let her copy it over and look for the hidden variable on my calculator, but it won't work when she plugs it in, assuming she runs it at least once! She's going to be banging her head against the wall trying to solve it. :twisted:
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Could she possibly just skip passed to variable check? Or even just modify the programs validation data with calcsys.

One way would be to encrypt a portion of the program using the calcs unique ID as a key.

Asm is fun for any reason :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

tr1p1ea wrote:Asm is fun for any reason :).
Z80 asm is fun :twisted:
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

waeV, you should know that there is no unbreakable copyright protection possible, partly since the cpu will need some starting point to begin doing something with the program. And if the CPU has it, anyone has it. And then, no matter how you encrypted the program, anyone could use the starting point to decrypt (and edit) it, they wouldn't even have to re-encrypt it (since validation code can be removed).

You can make it very hard to break though..

This problem hold for all static data, if communication is involved then it's possible to agree on a shared key without ever sending any data that could be used by a passive-listener to reconstruct the key (unless they solve the discrete logarithm problem)

If you want simple copy protection (to avoid sending over the link), you could try a link hook that refuses to send anything that looks like your program (or anything at all since pattern matching is quite hard), a problem is that hooks can be disabled easily though - unless of course you make the program hack into the OS (with flash-unlock hack) and write it's protective code there. Still, if the program can do it, so can anyone else, but it would at least be hard to break.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

There's no way to do unbreakable encryption unless it never gets decrypted.

And ARM ASM is at least as fun as Z80. What other instruction set has a "bleq" instruction?
You know your hexadecimal output routine is broken when it displays the character 'G'.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

branch if less or equal?
even x86(-64) asm can be fun, especially SSE (which is so weird it becomes fun, to some people)

SSM asm is not fun though, it only has about 20 instructions! You can't do any proper tricks with it.. boring stack machine..
User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Post by waeV »

King Harold wrote:waeV, you should know that there is no unbreakable copyright protection possible, partly since the cpu will need some starting point to begin doing something with the program. And if the CPU has it, anyone has it. And then, no matter how you encrypted the program, anyone could use the starting point to decrypt (and edit) it, they wouldn't even have to re-encrypt it (since validation code can be removed).

You can make it very hard to break though..

This problem hold for all static data, if communication is involved then it's possible to agree on a shared key without ever sending any data that could be used by a passive-listener to reconstruct the key (unless they solve the discrete logarithm problem)

If you want simple copy protection (to avoid sending over the link), you could try a link hook that refuses to send anything that looks like your program (or anything at all since pattern matching is quite hard), a problem is that hooks can be disabled easily though - unless of course you make the program hack into the OS (with flash-unlock hack) and write it's protective code there. Still, if the program can do it, so can anyone else, but it would at least be hard to break.
Of the five other people I know in my school who know how to use any kind of programming language (QBASIC / TiBASIC), only one even knew that you could use strings as variables on a ti-calculator.

I think I'm safe. :roll:
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

qarnos wrote:
tr1p1ea wrote:Asm is fun for any reason :).
Z80 asm is fun :twisted:
word. wouldn't have it any other way. Although Dwedit, I'm not quite ready to jump from z80 to dual ARMs on DS. I think I'll stick to C for that for now ^^
Image Image Image
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

perhaps you should encrypt it, at which that variable holds the key to decrypting it... so if it's copied, it's no good, just a bunch of gibberish.
User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Post by waeV »

That's a good idea, but I want it to say "You Fail" every time she runs it.

Plus, having be gibberish might tip her off to the idea that she needs to copy over the program AND the variable at the same time.

I think if I just put the hidden variable in Str9 or something she won't know how to send it over anyways.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

I think you can also create hidden variables that do not appear in any menus, but can be referred to from TI Basic programs.
Not 100% sure about this though.
You know your hexadecimal output routine is broken when it displays the character 'G'.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Just start the variable name with a space or less ($20 or less, I'm not sure how it reacts to zero though)
User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Post by waeV »

Ooh, I'll have to use that one. So the program she'll be copying over only says "Asm(prgm_TEST"

except what could _ be?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

If you want it to be completely hidden, an ASCII char less than or equal to $20 (space)
But then you wouldn't be able to do anything with it (you can't even delete it, unless you reset the calc) except from within ASM programs
So a hidden program / appvar could be used as a "secret" variable, but remember that such a secret can not be kept long..
User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Post by waeV »

So name it " BREAK" and have another called "BREAK" that calls it up?
My ethicator machine must have had a built-in moral compromise spectral release phantasmatron! I'm a genius!
Image
Post Reply