Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lookitsan00b

Pages: 1 2 3 [4] 5 6 ... 13
46
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: January 08, 2011, 11:51:10 pm »
grrr... I wanted to include a backup utility with this, but its failing.

My calc is one of the newer ones, so no pages 4-7.  I would think pages 2 and 3 would work well enough though... but apparently not.  The calc crashes when trying to parse BASIC with just a backup, and resets immediately upon return to ti-os with a backup and restore.

Scratch that, re-running the app after backup strangely prevents crashing, but the restore still fails.

Everything else mostly works.  That'd be the backdoor that still fails.

47
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: January 04, 2011, 07:17:37 pm »
Well, Mimas (or at least 0.2) cannot compile to an App.  Axe can, but it requires the source to be in hex format.  So... I compile with Mimas, dump the hex from the compiled source into a BASIC program, add the header and 'Asm(...)', and compile that to an App.

I found out that I am no good with zero-indexed arrays.  Ends up I was having a 1-byte memory leak into XFact, but I don't think that's my problem.

I had nothing better to do, so I made an editor for the hook.  It can edit the whole of smallEditRam, with Getkey equates and important labels included.  It can also fully uninstall the hooks, as well as re-installing them... at least in theory.  It freezes when you try to re-install, and, thanks to RAM clears, I have no idea what the problem is, although I bet its something with trying to code that routine in hex.  I managed to get one build to not freeze, but it gave me an ERROR: UNDEFINED.  This is useful if you don't want the default blocks.  For example, you could block kExtApps instead of kAppsMenu, or kOvrW and kOvrWAll instead of kLinkIO.

But yeah. GetKey equates. In a separate axe program... in a link below.  But be warned, its around 3kb.

PS:  I used dual-reverse-LBPS for the data in there, and '(' will jump to the beginning, and ')' to the end.

Edit: Lol yep. It had everything to do with trying to code in hex. I forgot the processor was little-endian :P

Also, please don't try things like kExtApps or kPointOn, the hook only recognises the key used to confirm that menu option.

PPS: Sorry. I like to make up my own terminology for complex ideas.  Dual-Reverse-LBPS refers to two length-prefixed strings, one starting at the bottom going up, the other at the top going down.

Update:
  the memory leak and re-installing are fixed
  this is now a piece of hybrid software, the editor/menus were included in the app.

Just wondering, anybody ever do Axe+ASM+BASIC, in one application? :hyper: (not App, application)

48
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: January 02, 2011, 11:07:12 pm »
I'm back!

I wrote a somewhat reliable (like 40%) hex dumper.  Been using that to compile to an app with Axe.

Had a problem finding the right number to ORG to, but bcall puts helped a bit.

Now I've sucessfully transferred what I had to an app.  Having interesting problems with the power-down routine, though.

First, pushing a USB cable (I know it causes an interrupt) doesn't 'wake up' the calculator.  I'm setting port 3 to $11, so I don't see what the problem is.  If you do push a cable while its 'off', it will refuse to recognize the 'off' key until you enter the password. Entering the password and re-enabling security fixes this though, presumably due to resetting and re-setting 7,(IY+$28).

Here are the relevant portions of code:
Code: [Select]
Raw Key Hook:
...
If unlocked other stuff including 'RES  7,(IY+$28)
...
SET  7,(IY+$28)
...
CPDR           ;check key pressed against keys to block
JR  Z,Block
CP  kOff
RET  NZ       ;let it go if none of those
DI
LD  B,3          ;number of interrupts to wake up.  The 'on' key seems to like to cause extra.
LD  A,2          ;turn off lcd
OUT  ($10),A
  Off:
LD  A,8        clear interrupts
OUT  (3),A
LD  A,$11     ;On key and link/usb port
OUT  (3),A
  OffLoop:
IN  A,(4)      ;interrupt state
AND  $F7      ;ignore the 'on' key status bit
JR  Z,OffLoop
DJNZ  Off      ;More interrupts needed to exit?
LD  B,A
LD  A,3        ;turn on lcd
OUT  ($10),A
LD  A,$0B     ;back to normal
OUT  (3),A
EI
LD  A,$10
AND  B     ;= BIT 4,B
JR  Z,Block
LD  A,$FF
LD  (CurKStr),A    ;see App Change Hook, also used as a pointer to the current key in the keystring
  Block:
XOR  A
RET
...
App Change Hook
DB  $83
PUSH  AF     ;seems to act funny if I don't restore this
SET  7,(IY+$28)     ;treats kOff as a keypress, disables PTT as a side-effect
LD  A,(CurKStr)
CP  $FF
JR  NZ,Fwd
RES  7,(IY+$28)     ;treat kOff as a command
  Fwd:
POP  AF
RET

49
The Axe Parser Project / Re: Axe Parser
« on: December 23, 2010, 02:57:46 pm »
Keeping in mind what calcdude84se pointed out about A and B, if either A or B will sometimes be non-boolean values (anything besides 0 and 1), you want to use the two separate if statements. If they will always be booleans, however, compare the following two blocks of code:

Code: [Select]
If A
  If B
    Do stuff
  End
End
  • A is false: 34 t-states
  • A is true: 68 t-states

Code: [Select]
If A and B
  Do stuff
End
  • 66 t-states

The second one is only faster if A will be true at least 16/17 of the time.


Thats excellent data!  So what that means is that even if A is true 94% of the time, its still worth it to make the change to two if statements :D  So as a general rule, the best thing to do is to use two different If statements if you are going for absolute speed.  Unless A is only false like once in every 9000th cycle :P

And if A is only false once in every 9000th cycle, you could probably do
Code: [Select]
:If B
:  If A
:    do stuff
:  End
:End

of course that requires the order to be interchangeable :P

50
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 21, 2010, 07:58:28 pm »
wow that seems like a lot of work...

but yeah the only thing I could get to not cause an error was
Code: [Select]
:AsmPrgmSECURITE
but that only gave me a 18-byte file, it should be around 200 bytes...

Can't wait till 0.4.7 :D

Till then, I might try loading the hooks to page 3...

51
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 21, 2010, 12:16:57 pm »
You can take the compiled Mimas ASM code and put it into an Axe program and compile the program as an app.

And in my opinion Brass and ZDS are really good assemblers.

How exactly would I do that?
Code: [Select]
:Asm(prgmSECURITE) doesn't seem to work...

:facepalm:

How about:
Code: [Select]
:[prgmSECURITE]
And I thought I had found a better way... involving appvars and indirect hooking... only to realize that you can't run code directly from appvars...

This might help a bunch, assuming 0.4.5 supports this :P

52
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 20, 2010, 10:38:57 am »
well last night I had my worst crash ever.

My hook for some reason returned k3 no matter what I pressed. (lol stack fail)

found out my backdoor was not working, and after messing with it, my powerdown routine works less reliably than ever, doesn't actually turn the screen off, and is way too large. But it returns the right numbers. :D

So it looks like this is going to be an app (<500 bytes). any suggestions as to which compiler to download? smaller = better, and I am porting from Mimas, so the less translation I have to do...

53
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 18, 2010, 12:55:32 am »
Wait so this trick prevents PTT from doing its appropriate effect? Or does it let you exit PTT? If it's the later, it would be cool if you found a way to exit PTT without using the conventional way and without having a patch installed.

Well.. not exactly. This just prevents my hooks from being deleted by PTT.

Previously, one could simply open the PTT menu to bypass my whole security system. This whole part blocks the whole PTT menu, thus making it harder to uninstall without the key.

Although a 30 byte program that lets you break out of a full PTT is possible, that's not really my goal here.  I'm just trying to make a practically unbreakable menu blocker.  So I guess it might not be much of a 'suite' after all...

54
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 18, 2010, 12:38:59 am »
I found a way past Push-To-Test! :w00t:

All I did was:

 tell it to not APD (wish it were possible to avoid this)

 tell it to interpret OFF as a keypress, which, when pressed, runs my own power-down code. (still a bit buggy, if you push it too fast it'll turn right back on)

 And, finally, tell it to tell itself these things again when it does much of anything.

But fitting that code in the same 97 bytes was difficult. Keystrings are now limited (in my not-fully-tested version) to 13 due to memory.

The backdoor I've left is:

1: turn the calc 'off'
2: insert a cable, turning it back on
3: wait for it to APD (it should if you don't leave the homescreen)
4: enter any of the 3 PTT combos, then F1 to back out.

... actually I don't have access to a cable, so I'm not sure it works. I'll check it tomorrow.

55
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 16, 2010, 07:48:50 pm »
ok thanks. also I majorly upgraded the post above. too lazy to undo and repost down here.

so yeah scroll up for an update ;) :P

56
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 16, 2010, 06:44:22 pm »
smallEditRam? what are the cases where it is touched? (and yes, my program will fit in there extremely easily, the appvar was 87 bytes + 1 byte per keypress, and that's with the header.)

umm... i wasn't getting ram clears.  just it wasn't running anything, no matter what I tried. I tried with/without padding two bytes for the length, all four page banks, and also incrementing and decrementing the page number! I got nothing. As in, it created the appvar, archived it, and definitely was finding it. but either it refused to set the hook (probably), or it was simply uninstalling it upon the first attempt to run...

now that I think about it, an app wouldn't work anyways. I'd still have to save the keystring somewhere, and that'd be just as easily corrupted as before.

Ok, the actual hook is 68 bytes, plus 2 bytes for string length and current entry, which leaves 37 bytes for the keystring :P wow that's a long one.

In other news:
 I really just need a way around PTT... all I can think of is IM 2. (which means another hook, depending on where I put the table and interrupt, i'm sure, but it'd be completely secure, anybody know a good place for the table? the interrupt will easily fit in between the four entries...)

 Also, the inclusion of ENTER in keystrings allows for extremely awesome and counter-intuitive keys, like "1/00[enter]" (if you have a buggy os, you can even force the user to crash it to unlock it :P)

 I'm pretty sure that pulling a battery when the OS has control does not result in a ram clear. I do know that at least 90% of the time it won't from the homescreen. So yay! don't have to worry about that.  Wow. Battery-pull proof... maybe...

 I might want to leave a backdoor. Other than re-sending the OS. Will simply plugging in a cable (without a calc on the other end) call an interrupt? if not, then that seems secure enough... otherwise, I'll have it auto-uninstall when anything is sent to the calc, unless it does that already. (or is the cable plug-in good enough?)

 Who else thinks an accessory program to modify the hook would be nice?  As in, changing which keys it blocks and which key re-enables it. It'd definitely be done in Axe :P

Either way, here is the program, moved to smallEditRam for security, and keystring upgraded to 37, as well as everything I may have mentioned before.

57
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 16, 2010, 04:47:35 pm »
what is this on-computer compiler you speak of ???
closest thing I have is wabbitsign.

EDIT: yeah that's actually been there a while. :P

EDIT2: then again, does Axe support Asm(prgmBLAHBLAH)? I gotta try ;)

58
TI Z80 / Re: YASS (Yet Another Security Suite)
« on: December 16, 2010, 02:44:38 pm »
Well I realized that appvar + hook = fail.

It works nice in an app, because apps always begin at the start of a page. Not so with an appvar. This makes referencing them interesting.

Also, I forgot about SMC: that fails.

So how do I compile an app with Mimas (0.2 :P)? I can LDIR my keystring and length every keypress (before checking to block it)... It shouldn't take much time at all. (after all, the hook has already loaded the rom page)

Any 8xp -> 8xk converters that would make my job easier?

59
TI-BASIC / Re: Speed of Asm(
« on: December 16, 2010, 11:44:05 am »
as far as I am aware, that doesn't even work.

you have to put it in a program first. (either that or you have to put the header in...)

60
TI-BASIC / Re: Fun with strings!
« on: December 16, 2010, 11:43:05 am »
That can work inside Output(?

You seem to always find a solution to everything I post. Could you actually post your entire source code on how to display STO character inside a BASIC program on the home screen?

EDIT: Actually that works, thanks. I have bad memories about Equ>String, though O.O (See the TI-OS glitches section)

actually, you have to have the " and/or -> already in a string var, then you can treat it just like a normal string. Any other way = syntax error. So yeah you have to include the string var with your program.

MathPrint OSes are just a bunch of glitches.  >:(

Hey! thats not true! take it back! where would we be without fnInt(, remainder(, randintnorep(, fractions, and the ability to scroll up and delete your previous entries (not to mention the CLASSIC token/mode :P)?  TI could've just made the OS ALL mathprint, after all... no mode setting to go back.

Wow. When I put it that way, it makes me almost LIKE TI O.O

Pages: 1 2 3 [4] 5 6 ... 13