is there any application to convert motorola ASM to C.
i am having a 68hc11 assembly code written by sum1 and it is very difficult to do the reverse engineering.so i thought if there is any software for converting assembly to C
I read once some where an explanation on why what you are asking is totally impossible. I don't racall the arguments (something how about compiler optimizations works), only the end statement. Forget it.
I agree with pardal.
I have never heard of an application to convert from assembly to C.
To me, it sounds impossible to make such software.
Several different C statements can generate the same assembly code, so it's impossible to go back from assembly to C.
I think that this is very interesting topic for discussion.
There is no need to convert any assembly routine to any HLL (high level language).
When you write and compile some HLL routine you get object code. With linker you link all object files to binary executable. Linker use only object files not HLL routine or assembly source.
You can interface any HLL program with assembly routine using compiled assembly source and function/procedure declaration in HLL program.
In C you can interface assembly routine without passing arguments and return value ussing declaration.
extern void assembly_routine_name()
If you want to convert whole assembly program to C I suggest this code
extern void assembly_start_label();
void main()
{
assembly_start_label();
}
In your assembly source declare program origin assembly_start_label as public to other modules.
assembly_start_label:
.
.
.
end
You need to compile c source and asm source and link object files. So this is whole conversion.
Instead C or Assembly it is better to think about functions and routines.
When you use functions from standard C libraries you don't use sources only function prototypes.
For example you don't know how is char *strcpy(char *s1, char *s2) implemented? Is it C or assembly?It is standard C string function and it's implementation varies from platform to platform.
From programmers point of view it is always same strcpy function.
If you want to convert your assembly program to C to make it portable it is not simple task. If you don't need portability there is no need for any conversion.
I think that this is very interesting topic for discussion.
There is no need to convert any assembly routine to any HLL (high level language).
When you write and compile some HLL routine you get object code. With linker you link all object files to binary executable. Linker use only object files not HLL routine or assembly source.
You can interface any HLL program with assembly routine using compiled assembly source and function/procedure declaration in HLL program.
In C you can interface assembly routine without passing arguments and return value ussing declaration.
extern void assembly_routine_name()
If you want to convert whole assembly program to C I suggest this code
extern void assembly_start_label();
void main()
{
assembly_start_label();
}
In your assembly source declare program origin assembly_start_label as public to other modules.
assembly_start_label:
.
.
.
end
You need to compile c source and asm source and link object files. So this is whole conversion.
Instead C or Assembly it is better to think about functions and routines.
When you use functions from standard C libraries you don't use sources only function prototypes.
For example you don't know how is char *strcpy(char *s1, char *s2) implemented? Is it C or assembly?It is standard C string function and it's implementation varies from platform to platform.
From programmers point of view it is always same strcpy function.
If you want to convert your assembly program to C to make it portable it is not simple task. If you don't need portability there is no need for any conversion.
Well, Hero
Regarding my programing capabilities you jumped a bit further than I can follow. Although i learned something.
The point is that your view of convert assembly to C is very different of what snsriram79 has asked.
He wants an imaginary tool to help him to reverse engeneering his target, but if it was that easy all existing and worthing software would have been already reversed engeneered.
Imagine the consequences of this.
snsriram79 thanks for your confidence but I'm afraid I have to disapoint you.
I don't have enough knowledge to help you on this. I read their description and in fact they claim that the assembler to C conversion is possible with their products, but there is no way to test it (exept asking them to do it).
Other, more pro, incoms on this subject are wellcome. I got curious.
It is allways possible to convert assambler to c .. is a matter of graphs
the questions is wiil the code look like the original code ...
the algorithm that produced the assamblee code is still there ..in the equivalent form ..but is machine dependant .. it was reduced to fit
the machine where it runs ..so there is a lot of junk with it, and also
a lot now missing .Because probably the machine instructions set implements some instructions very powerfully .But still is always possible
to produce the a program that will reverse engineer the code. but once again this program will be machine dependant ..
In other words a decompiler for SPARC will look very diffrent from a
decompiler for a X86 .. and probably nobody will be interested in producing
one for the motorola microntroller .
There is a program called dcc a doctorate thesis that explains it all
i have played a lot with this and i see a lot of opportunities here for crime
see dcc seminal paper
at
**broken link removed**