This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OMF51 format

Hey there.

I'm trying to make a program that reads and prints out the information contained in the object files that come out of the A51 assembler.
It's going to read the records and output it all in some kind of readable manner.

However I have already banged my head against the first of possibly many problems:

My program is written in C++ and opens a file in binary mode and as input. It then uses the get() function associated with the ifstream to read byte after byte.

Right now I have it print it all out in hexadecimal format. BUT -

As I can see from the OMF51 specification, the first part of the .OBJ file should be 02h (meaning record type MODULE HEADER RECORD). However, the first byte is showing 70h.

When I print it out as characters in ASCII I can see that a bit further down the road there are ASCII characters showing names of some files.

Is the OMF51 specification I have wrong, or does the A51 assembler output a different file format? There also is no record type with the specification 70h. So I am a bit confused now.

Any help?

- Rune

Parents Reply Children
  • That makes sense. The problem is, that after reverse engineering a bit, that they put the data in a record type called 07H instead of 06H. And the format is a bit different, where as in 06H there are 3 bytes of data before the actual code data (instructions). In 07H there are 4 bytes of data.

    So I dont think it is possible to actually read anything from the file, unless I can somehow get the specification from the actual Keil OMF51 format...

  • In the good old days, when I was involved with the use of Keil products, I frequently used an INTEL OMF-51 viewer plugin for total commander. You might want to try and find the author to see if he could give you details.

    The only link I could find is: www.totalcmd.net/.../ObjView.html

  • if you have the OMF51 format, you 'must' have the source.
    if you do not have the source 'reverse engineering' is illegal

    Erik

  • Note that the laws of reverse engineering varies a lot depending on where you live.

    Next thing, is that reverse engineering of file formats can be allowed even when reverse engineering of program code isn't.

  • As Per said, this isn't a universal truth. Reverse engineering is explicitly legal in Germany.

  • Im not trying to reverse engineer any programs just yet ;) Im actually writing my own application for an EnOcean STM300 for a company project. What I want the object viewer for is to see how the code and data is placed in the memory.

    There are some things about the source code for the firmware that comes with the STM300 (that I have the source code for), which doesn't make sense.

    As far as I can see there are no re-allocation of global variables from Flash memory and to the RAM.

    So im just trying to get a better view of what is actually going on. And, because I like the low-level stuff :)

    Anyway, it looks like the Keil OMF51 format uses the normal records+1 so 06h will be 07h. They have added some new fields that I don't really now what are, but I think I will be able to make the program now.

    - Rune

  • Doesn't the Linker Map file tell you that??

    "I'm actually writing my own application for an EnOcean STM300 for a company project"

    If there's a genuine commercial application for it, why not contact Keil themselves?
    (maybe via EnOcean, if it could be of benefit to them).

    Have you looked at "standard" object file viewers like objdump, objcopy, etc...?

    SRecord supports some object formats: srecord.sourceforge.net/

    The above two are open-source; so, even if they don't already have direct support, I would think their communities should be a good place to ask...