Author Topic: Prog2hex, the first on-calc Axe unsquisher  (Read 4164 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Prog2hex, the first on-calc Axe unsquisher
« on: June 08, 2012, 12:58:33 pm »
Hi guys !

I wrote a simple on-calc unsquisher in Axe, which can unsquish any 8xp compiled ASM program into his hex translation ! Here is a screenie of it working by unsquishing ZPROT and executing the unsquished version (protecting the program in Str0) :




But as you can see at the end of the screenie, and due to Axe bugs, you must archive all your stuffs on your calculator and clear the RAM manually to be able to use your calc normally afterwards ! (I'm not responsible ;D )
Problem solved ! Thanks to Runer112.

You can download it here (it's only 528 508 bytes in Noshell !) : http://mattias.refeyton.fr/espace-ti/PROG2HEX.zip (link updated)

Please comment ;)
« Last Edit: June 10, 2012, 02:00:07 pm by Matrefeytontias »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #1 on: June 08, 2012, 01:06:05 pm »
nice ö can't you make it that it translates those hex'es to their appropriate command? that would be great, because i don't know many users know all the hex things xp

but it's really cool, although it should be possible to remove the RAM clear glitch, have you any clue what causes the must-reset-thing?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #2 on: June 08, 2012, 01:08:23 pm »
I did much research, and anything I found is that's an Axe bug, so I don't know what to do to resolve it :'(

And an hex decompiler is a reaaaaaally hard thing to do :banghead: I'm not sure that I'll do it, since there are lots of it for computer. But who knows ...
« Last Edit: June 08, 2012, 01:09:47 pm by Matrefeytontias »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #3 on: June 08, 2012, 02:14:45 pm »
Hmm... I should look over it sometime, pretty sure I can track the problem.
I'm not a nerd but I pretend:

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #4 on: June 08, 2012, 02:20:42 pm »
Doing a bit of disassembly of my own, I discovered how your program was corrupting RAM! And it's not a fatal Axe bug, so it's easily fixable. :)

When you initially create the output program, you store its size to C. You then use this as the loop variable for converting the input program to hexadecimal, but this is a problem because you convert one byte of binary data into two bytes of hexadecimal data per iteration. This results in the conversion loop converting about twice the amount of data that it should, corrupting an amount of RAM approximately equal to twice the size of the input program! :o

This is easy to fix though, and it even optimizes the program in the process! Just change the line that looks like this:
!If GetCalc(Str0P,{P-2}r*2-2→C)→H
To this:
!If GetCalc(Str0P,{P-2}r-1→C*2)→H
And then delete the C++ before the conversion loop and it should work as intended. :)

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #5 on: June 08, 2012, 02:22:19 pm »
Uh, lol. That was faster than I could ever do it.
Also runer optimize it :P
I'm not a nerd but I pretend:

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #6 on: June 08, 2012, 03:13:49 pm »
Thank you Runer for the solving :) (what a stupid error, I never noticed it <_< )

I'll try to optimize it myself, even I don't see much things too optimize right now =/

EDIT : the link is updated with the safe version :thumbsup:
« Last Edit: June 09, 2012, 06:28:55 am by Matrefeytontias »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #7 on: June 09, 2012, 11:23:18 am »
Pretty cool stuff there Matrefeytontias, nice work! ^^

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #8 on: June 09, 2012, 11:24:05 am »
Thanks :)

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #9 on: June 09, 2012, 02:23:10 pm »
So if you use a computer hex-to-command program, you can actually retrieve the original basic source of a program you may have lost, and still had a compiled version of it?
If so, many people who lost their source will be very happy I think. :)


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #10 on: June 10, 2012, 10:16:31 am »
Yeah, that's an use of it :) it can be really helpful if people loose their ASM source but keep their compiled version.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #11 on: June 10, 2012, 10:18:13 am »
^
But it won't help if you lose your Axe source D:
I'm not a nerd but I pretend:

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #12 on: June 10, 2012, 10:37:57 am »
Yeah, I haven't done any hex -> Axe disassembler yet ;D

EDIT : link updated with a zip containing a smaller version and a readme.
« Last Edit: June 10, 2012, 10:40:45 am by Matrefeytontias »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #13 on: June 10, 2012, 10:42:41 am »
is it even possible to dissassemble to axe or to convert hex to axe? since there are several ways to reach the same result in compiled code i think, so it would be hard to have the exact code, isn't it?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Prog2hex, the first on-calc Axe disassembler
« Reply #14 on: June 10, 2012, 10:45:19 am »
I think it's impossible, that's too difficult ...

But thanks to my own disassembler, I disassembled little Axe programs containing only one routine, so I saw how several functions were working :)
« Last Edit: June 10, 2012, 10:45:37 am by Matrefeytontias »