Is it possible to convert assembly to C?

Is it possible to convert assembly to C?

You can’t deterministically convert assembly code to C. Interrupts, self modifying code, and other low level things have no representation other than inline assembly in C. There is only some extent to which an assembly to C process can work.

Is it possible to convert function from ASM to C?

Assembler is generally quite simple to learn, as it is so low level. It is difficult to convert a function from asm to C but doable by hand. Converting an entire program with a decompiler will give you code that can be impossible to understand since to much of the structure was lost during compilation.

Do you need to call assembly functions from c?

But, often the assembly routines you get from a vendor are packaged as functions that can be called from C – so as long as the routines do what you want (on the processor you want to use), you might just need to assemble them and more or less forget about them – they’re just library functions you call from C.

How does asm2c work on assembly source code?

For that purpose, it needs to get its address. It does that by making two calls. Calls will make new stack frames, at which point it can just pop the saved stack frame. There’s also asm2c that works on assembly source code instead of executables or objects files.

What does it mean to convert ASM to C?

And guess what that means, you write a disassembler, and instead of disassembling to an instruction in the native assembler syntax like add r0,r1 you have your disassembler print out r0=r0+r1; By the time you finish this disassembler though you will know the pic assembly language so well that you wont need the asm to C translator.

Is it possible to reverse engineer assembler to C?

Yes, it’s very possible to reverse-engineer assembler code to good quality C. I work for a MicroAPL, a company which produces a tool called Relogix to convert assembler code to C. It was mentioned in one of the other posts. It isn’t impossible, just very hard.

Is there asm2c that works on assembly source code?

There’s also asm2c that works on assembly source code instead of executables or objects files. Thanks for contributing an answer to Reverse Engineering Stack Exchange! Please be sure to answer the question. Provide details and share your research! But avoid … Asking for help, clarification, or responding to other answers.