Is there an easy to convert assembly (ARM) to C code?
Asked
Active
Viewed 3,159 times
1 Answers
1
void func(char *r0, int r1, int r2) {
char *r12, r3;
int r4, r5;
if (r1>=r2)
goto l1;
l2:
r12=r0+r2<<2;
r3=r0+r1<<2;
r4=*(int *)r12;
r5=*(int *)r3;
r1++;
r2--;
*((int *)(&(r12[-4])))=r5;
*((int *)(&(r3[-4])))=r4;
if (r1<r2)
goto l2;
l1:
}
Another example why reverse engineering is not about converting assembler to C, but about understanding what's going on. (This function seems to reverse the elements of an array).

Guntram Blohm
- 12,950
- 2
- 22
- 32
-
So what does the function do? – Jon Apr 26 '16 at 16:25
-
@guntram-blohm: "Don't feed the bears" - http://reverseengineering.stackexchange.com/questions/12534/translate-the-assembly-code-to-c-code – Jason Geffner Apr 26 '16 at 16:37
-
1@JasonGeffner: I had been hoping he was going to take this "solution" to his teacher/TA/professor/whatever and get a lecture about not having people on the internet do your homework for you. – Guntram Blohm Apr 26 '16 at 17:23