Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/15/11 17:16
Read: times


 
#184214 - Keep in mind what a disassembler is ...
Responding to: ???'s previous message
A disassembler is a tool for creating an 'assemble-able" file from a binary object (presumably executable) file.

Referring specifically to 805x and it's kin, there are some things that can be done with a disassembler that might not work so well with a general-purpose microprocessor. The 805x microcontroller has a number of "features" that are definec by the physical architecture, particularly if the object code in question is, in fact, designed for the specific version of the MCU that you're investigating. The disassembler, if you're referring to the one that's most popular here, on 8052.COM, will generate an "assemble-able" source file, together with a symbol cross-reference, albeit without meaningful symbol names, and, IIRC, a symbol table. Between those two, you can inject a considerable amount of "meaning" into the otherwise pretty meaningless source code by substituting known SFR names for their respective addresses. I'm not sure, but the disassembler may, in fact, do some of that for you, based on predefined symbol names. The code is formatted as ASM code compatible with the "generic" assembler, so, with a little imagination and a considerable amount of effort, you can write a program to run on your PC, that will replace any known addresses with symbol names in the disassembler's output that will make it more meaningful. Subsequent study will reveal even more, allowing you to repeat the process until you have a good enough understanding of what's going on to enable you to decide whether you can "use" this code, or whether you should rewrite it, possibly in HLL, based on what understanding you have. Disassembling someone else's code, no matter how well you understand the author's coding style, is a BIG task, and seldom yields useable code.

A few years ago, I asked the group whether anyone had available source code for ULTRAMON51, which is a debug monitor for 805x MCU's, that has most of the desirable debugger features plus a line-by-line assembler and a line-by-line disassembler, so it functions much like the old MSDOS "DEBUG.COM", in addition to which it has a loader that allows it to accept files in various formats, notably XMODEM and locate them in local memory for trial/debugging, etc. Someone more familiar with the disassembler than I actually did the job for me and sent me the disassembled file with a considerable amount of the work done. I fiddled with that disassembled file somewhat further and was able to make it do what I needed at the time, though, frankly, I don't recall what, exactly, that was. With some more effort, I was able to make the Ultramon debugger work with an external UART, thereby allowing me to use the external UART in place of the on-chip UARTs, which were needed for non-standard purposes.

Most of my successful efforts with disassemblers were NOT for the purpose of gaining insight into someone else's code for purposes of reusing it, but, rather, for the purpose of understanding what it does, hence, the inline disassembler paired with the line-by-line assembler were effective tools for allowing me to discover the consequence of small tweaks in the code. Back in the '80's, I used disassembly to bypass the "dongle" on dongle-keyed software products when the dongle interface didn't work properly, as I was anxious to use the protected code I'd already acquired legally, but which was defective. I've also used it to redirect I/O, and perform other simple modifications on existing code in-situ.

A disassembler is NOT a useful tool for stealing someone else's intellectual property, no matter how diligent your effort, nor is it suitable for reworking a large piece of code. Small bits, such as the just-under-8KB debugger, to which I referred earlier, are difficult enough to rework.

I'd say that public-domain code snippets and a good simulator will help you more than will a disassembler if you are trying to figure out how something in a specific MCU is supposed to work, with the goal of writing your own solution to a given problem. The odds of understanding what the code does improve considerably when you do write the code yourself.

RE




List of 14 messages in thread
TopicAuthorDate
Disassemblers are they really that good?            01/01/70 00:00      
   worthless            01/01/70 00:00      
   It depends on what you want ...            01/01/70 00:00      
   Wishes of Birthday            01/01/70 00:00      
   Disassemblers            01/01/70 00:00      
      I don't think it's that bad ...            01/01/70 00:00      
         one good 'disassembler'            01/01/70 00:00      
            That has to be handy!            01/01/70 00:00      
               Shouldn't need a disassembler fo that            01/01/70 00:00      
            Code profiler            01/01/70 00:00      
               Profiler?            01/01/70 00:00      
   Only as good as the information they have to work on            01/01/70 00:00      
   I though this tool would teach me something about binary fil            01/01/70 00:00      
   Keep in mind what a disassembler is ...            01/01/70 00:00      

Back to Subject List