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

Convert *.ROM to Writing language

Hi,everybody!

It's great to discuss together about everythings. Would you please help me!

Can we convert the *.ROM to Writing Language? Would you please help me!

Thanks!

Parents
  • Can we convert the *.ROM to Writing Language?

    Do you mean "Can a machine code file be converted to high level language?" ?

    I don't really see the connection to Keil tools here, but I'll try to answer: To some degree, it may be possible, but the results are dissatisfying in almost every case. This is because much of the information contained in a high level language source code file is lost during compilation (such as function names, the precise type of loop constructs, variable names, and so on).

    Even translating a machine code file back to assembly will look nothing like the "original", since definitions, macros, jump labels, and so on, all are lost during assembling.

Reply
  • Can we convert the *.ROM to Writing Language?

    Do you mean "Can a machine code file be converted to high level language?" ?

    I don't really see the connection to Keil tools here, but I'll try to answer: To some degree, it may be possible, but the results are dissatisfying in almost every case. This is because much of the information contained in a high level language source code file is lost during compilation (such as function names, the precise type of loop constructs, variable names, and so on).

    Even translating a machine code file back to assembly will look nothing like the "original", since definitions, macros, jump labels, and so on, all are lost during assembling.

Children
  • hi, thanks,

    no I have code in *.ROM and want to rebuild project with KEIL compiler for diferent processor.

    thanks for your help! the comunity is good.

  • no I have code in *.ROM and want to rebuild project with KEIL compiler for diferent processor.

    I'm afraid that if the *.ROM is the only piece of information you have, you are looking at an extremely difficult task.

    Even though so-called "decompilers" exist, one might not exist for the particular processor architecture you are using. And even if one exists for the architecture, the generated source code will most likely require lots of additional work to run on a different architecture.

    A better way to approach this would be to find out as much as possible about the original software, i.e. design document, (partial) source code, etc. Then you can make a list of requirements that the software has to fulfill, and then implement this list of requirements on the new platform.

  • Note that reverse engineering may be considered a criminal act in a number of countries, depending on what license the original program has.

    Also, there are "normal" copyright and patent issues to think about.

    Exactly why do you want to reverse-engineer a binary?

  • hi, thanks again,

    the code is a *.ROM for a old project. but The code man Left b4 me and HE lost aLL code.

    yes i know it is very very bad bad and i have to now get project on diferent procesor.

    your help is good for my problem.

  • Time to pick up the manual and read what the unit is expected to do. Also look for any project documentation. Then, I would recommend that you start from scratch.

    Since a lot of embedded compilers plays with function parameters and performs optimizations based on call flow, it can be really hard to understand the code.

    If you are going to switch to a new processor, then you must also know everything about both the old and the new processor, so that you don't overlook special cases that are only relevant for the old chip.

    In the end, you will get a program that may - or may not - work. Just the same as if you started from scratch. The only difference is that if you start from scratch, you will know which design documents you based your application on, and you will know how to test if your application fulfills the requirements of that document.

  • hi, thanks again,

    yes, i am very sad but I know you are right.

    if i see the coder man again I will try to not be angry with him bcoz he gives me A lot of heavy work.

    thanks to you all who help me

  • I agree with Per - trying to decompile the ROM is most likely not worth the effort.

    If the previous software guy was really so negligent as to lose all the source code, you have to ask yourself whether it was actually worth keeping...

    Start again from the basic requirements.
    Use the existing product as your "benchmark" to prove that your new code is working correctly.

    Most importantly, ensure that you have proper backup and source code management systems in place, and use them!

    Be sure to test your backup system to confirm that you really can recover everyhing to a completely clean machine!