Author Topic: IDA Pro  (Read 7380 times)

0 Members and 1 Guest are viewing this topic.

Offline bobbean

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 14
  • Rating: +2/-0
    • View Profile
IDA Pro
« on: September 13, 2013, 08:45:30 pm »
How would I set up IDA pro for a ti 84? I have an older version of IDA (6.1.1) if that makes any difference.
« Last Edit: October 30, 2013, 04:50:44 pm by bobbean »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: IDA Pro
« Reply #1 on: September 13, 2013, 08:57:55 pm »
You would load the binary files using the z80 disassembler and relocated to either address 0x9D93 or 0x4000, depending on whether you were disassembling a regular program or an app.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: IDA Pro
« Reply #2 on: September 13, 2013, 11:33:22 pm »
Congratulations on your purchase of IDA pro (lolz)

Anyways, here's a step by step for you. I'm running 5.2, but I assume everything is about the same. I'm also going to assume you want to dissassemble programs (and not the OS):
1. Close out of any windows so you just have the plain IDA screen
2. File>Open your program
3. Change processor type to Z80 Processors: Z80
4. Ram Section: start 0x8000 size 0x8000. Rom Section: start 0x0000 size 0x8000 (this isn't super important)
5. Loading address: 0x9d95
6. File Offset: If you're using a .8xp 0x004c. If you somehow have a raw binary, 0x0000 or maybe 0x0002

That will set IDA up like the calculator. The data starts at 9d95. Most likely you can press C on line 9d95 and you'll be set.

A few notes:
  • none of the ram addresses are mapped, so use this
  • bcalls don't work obviously, if you see rst 28h, go to the line of code after it and press D twice then look up the address in that link
  • you can probably not make a rom section if you get really annoyed at how tiny the scroll bar is


Have fun! (IDA is actually a lot of fun (if you're into that kind of thing))

Edit:
    If you're dissassembling an app, it's way harder. Let me know if you are. You can't just set the loading address to 0x4000, you'll have to modify the file first.
« Last Edit: September 13, 2013, 11:34:35 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline bobbean

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 14
  • Rating: +2/-0
    • View Profile
Re: IDA Pro
« Reply #3 on: September 14, 2013, 01:27:20 am »
Ok sweet, all of that worked. Thanks! But one thing, i'm able to open programs and read them, but how would I modify them? (and save them, of course)

Edit: Yea... my "purchase"...
« Last Edit: September 14, 2013, 01:28:55 am by bobbean »

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: IDA Pro
« Reply #4 on: September 14, 2013, 11:49:19 am »
Ok sweet, all of that worked. Thanks! But one thing, i'm able to open programs and read them, but how would I modify them? (and save them, of course)

Now you're treading into deep waters. There are two ways you can modify and them neither are easy.

1. Modify them in a patch way
This method is going to involve hex editing. In the simplest case you can simply patch the files without changing their size. To do this, I'm going to recommend calcsys. What you need to to is look at the original file (in ida) and find the code you want to change. Then, you need to determine what you want to change it to. (I'd recommend just making a fake little program with your code, assembling it, and then looking at what it assembled into). To actually change the file, make sure it's in ram, then open calcsys>6>1>1>find it. Now, take note of the "data loc". To find the location in this program that you want to modify, take (real address) - 0x9d95 + (data loc) + 4. Then press Alpha + H > Alpha + G > type location. From here you modify the necessary bytes and hope it works.

If you have to change the file size, well, I'm not going to write how to do that because it's really annoying.

2. Completely reassemble the program
This method is a lot more work, but you have way more flexibility. You need to completely disassemble the program in IDA. This means that you have all the code and data sections mapped out and all pointers actually pointing to labels (the most important part). If you manage to get this far, you can tell ida to produce a .asm file which you can then edit just like any other program. I have successfully used this method to rewrite a game, but, it is a bit of work up front.


Btw, you're getting these really long replies because you keep asking questions about what I love doing with the calculator.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112