converting hex file to asm file

Discussion in 'Embedded Systems and Microcontrollers' started by nuttertools, Dec 18, 2008.

  1. nuttertools

    Thread Starter New Member

    Dec 18, 2008
    3
    0
    I have Flash EEPROM configuration data file for a faulty Wireless Subsciber terminal unit. I obtained the file by EEPROM Universal Programmer.

    I'm convinced that segments of the file are corrupt because the device works if I burn in, with the Programmer, a configuration data file of a working device.

    Since each device has unique serial number and other parameters encoded in configuration file, it is improper to program a faulty device with a configuration file of a working device, ie, no two devices must have same serial numbers.

    I wish to convert this bad file to asm and edit to reprogram the faulty device, hoping that will get it back to normal operation. I have a rather shallow knowledge about the subject but I'm confident that a detailed systematic procedure would help. Could the hex-ascii display on the eeprom application software and the original compiled hex file be any different? The target is a motorola processor.

    Thanks and regards
     
    Last edited: Dec 21, 2008
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    You can either take the file apart by hand with the device's instruction listing as a guide, or perhaps make up or find a disassembler.
     
  3. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    The EPROM stores both configuration data and machine code. I'll bet the machine code will all be the same and only the configuration data is different. A disassembler will not offer great help in this case.

    How the configuration data is arranged might not be easy for one to pick apart and most certainly the manufacturer would try to encode the data to make cloning the EPROM for another unit difficult.

    If you know the serial number of the "good" unit, you can use a HEX or binary editor to load both the "bad" file and the "good" file and see if there are any similarities between the two or you can actually see the serial number in "plain view".

    I'm afraid that is all you can do.
     
    Last edited: Dec 19, 2008
  4. nuttertools

    Thread Starter New Member

    Dec 18, 2008
    3
    0
    I know the serial numbers for all the devices. I could also use IDM UltraEdit and UltraCompare application software to do comparisons and editing. How do I see the serial numbers in “plain view”? Forgive me, however may I know if each byte of hex code represents an instruction or a stored value or both?
     
  5. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    You are only lucky if you can see the serial number in plain view. By that I meant the manufacturer has NOT encoded the serial number so it can be seen using just about any binary editor.

    There is nothing you can do to make it appear in "plain view".
     
  6. RiJoRI

    Well-Known Member

    Aug 15, 2007
    536
    26
    First you will need to compare the two files. Hopefully, only the serial numbers will be different, or at least readily recognizable. They WILL show as ASCII numbers: "1235" will show as "31 32 33 35".

    Load BOTH the good and the bad .HEX files into the editor. Go to the line(s) in the bad file with the serial number, and copy the line(s). Go to the same line in the good .HEX file, and make sure the surrounding lines are the same in both files. If so, replace the line(s) in the good .HEX file with the one from the BAD .HEX file.

    If you are really screwed, just copy the ASCII serial number from the bad file over the serial number in the good file. Now get out your hex calculator. The Intel Hex format is defined as follows:
    Take your calculator, and figure out the checksum for the affected line(s). You may first want to practice on a known-good line and replace it with the new checksum.

    Good luck!
    --Rich
    (Gone 'til next year)
     
  7. nuttertools

    Thread Starter New Member

    Dec 18, 2008
    3
    0
    Thanks Rich,

    I'm wondering if the hex-ascii display as seen on the eeprom application software could be different from the original compiled Motorola S hex file format as a result of mapping to different functions by the OP-Code instructions of the EEPROM. If so, could I revert to the original Motorola S hex file format before I do any calculations? I'm terribly stuck on this.

    Thanks in advance.
     
    Last edited: Dec 21, 2008
Loading...