Any interest for an ARM disassambler? - page 3 - General Discussion and Assistance - CHDK Forum  

Any interest for an ARM disassambler?

  • 28 Replies
  • 10883 Views
*

Offline RaduP

  • *****
  • 908
Re: Any interest for an ARM disassambler?
« Reply #20 on: 06 / April / 2009, 14:43:54 »
Advertisements
Yes, I am looking for constants, at least those relative to PC.
Copy and paste is kind of hard though with my current implementation, especially in a multi platform application. However, I could, later on, add a button to print the selected text in a file, possibly with different formating.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Any interest for an ARM disassambler?
« Reply #21 on: 06 / April / 2009, 16:15:52 »
Oh and the one thing that makes our current gpl tools pretty powerful is that I can set it to batch disassemble everything automatically. Since the result is plain text, writing simple tools to batch find similar things from all dumps is quite straightforward without having to open 60 disassemblies each in turn in a disassembler gui...

*

Offline RaduP

  • *****
  • 908
Re: Any interest for an ARM disassambler?
« Reply #22 on: 06 / April / 2009, 16:37:45 »
Oh and the one thing that makes our current gpl tools pretty powerful is that I can set it to batch disassemble everything automatically. Since the result is plain text, writing simple tools to batch find similar things from all dumps is quite straightforward without having to open 60 disassemblies each in turn in a disassembler gui...

Can you give me an example of what kind of situation that would be useful for?

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Any interest for an ARM disassambler?
« Reply #23 on: 06 / April / 2009, 17:13:56 »
Can you give me an example of what kind of situation that would be useful for?

Since I don't have a perfect example, I'll give three worse real world ones:

Often a feature is developed which requires a Canon firmware function. It's easy to find and test for your own camera, a lot of work to port it to all other cameras. Often our simple signature finder fails. In that case it helps to be able to go thru all firmwares in a batch fashion semi manually instead of opening them up one by one.

Another thing that I once did was that I wrote a script that scanned for event procedures, output them as stubs that could be added to the disassembly making more sense to it. It's now now unnecessary for ported firmwares since lists exported from ida are in drop.io.

The most usual thing is just that it's nice to have all dissemblies on my hdd for easy reference and comparison. The last time I compared a random firmware to that from my camera side by side to help out on irc was a couple of days ago.


*

Offline RaduP

  • *****
  • 908
Re: Any interest for an ARM disassambler?
« Reply #24 on: 06 / April / 2009, 17:25:04 »
Well, I guess in this case the other tools are better. My disassembler can't be an "end all be all" program, because it is developed as a hobby, in my free time.
But I think once I add more features, it will be useful at least for some of the work.

*

Offline RaduP

  • *****
  • 908
Re: Any interest for an ARM disassambler?
« Reply #25 on: 08 / April / 2009, 19:08:49 »
Just to keep you updated:
I added a navigation system, consisting of two bars. One is the 'fast' bar, where you can jump in increments of code_size/bar_length, and the other to jump in increments of code_size%bar_length, from the position of the 'fast' bar.
I think this navigation system is really nice for large code files, where one single, linear bar is totally inadequate.

Also, you can click on the b/bl addresses and it will take you there.

Maybe in a few days I will post a binary, if there is interest for it.

*

Offline RaduP

  • *****
  • 908
Re: Any interest for an ARM disassambler?
« Reply #26 on: 09 / April / 2009, 04:33:15 »
One of the next steps will be to build a code analyzer, to separate the code from data, and find functions, see how many time each function is called, and so on.
I have a pretty good idea how to do it, but by looking at a code dump I see something really puzzling, and I wonder if I don't get something obvious, or if the people who wrote the compiler are stupid.

Most functions begin with something like STMFD SP!, {... LR}
Makes sense, it saves the necessary registers.
Then it ends similarly with a LDMFD SP!,{...PC}
So PC becomes LR, wich means, go back to whre you came from, right?
Then why in the world is the next line MOV PC,LR ???


*

Offline foofighter69

  • *
  • 15
  • Canon A470
Re: Any interest for an ARM disassambler?
« Reply #27 on: 19 / May / 2009, 14:41:42 »
An emulator would be a nice piece.
http://www.emu8086.com/ <-- is a very good example what I am thinking of.


*

Offline RaduP

  • *****
  • 908
Re: Any interest for an ARM disassambler?
« Reply #28 on: 22 / May / 2009, 00:14:42 »
Well, there is QEMU and some people had various degreees of success running the firmware through it, but it seems some instructions are not supported.
The ARM architecture is a big PITA to emulate, because the instructions contain their operands so there are all kind of shifting and addressing modes, and the documentation is not that great.

BTW, the disassembler is working, but not all the features are implemented, and I don't have a lot of free time now. If someone is interested let me know.

 

Related Topics