-1

Is there an easy to convert assembly (ARM) to C code?

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).

3
  • So what does the function do? – Jon Apr 26 '16 at 16:25
  • @guntram-blohm: "Don't feed the bears" - reverseengineering.stackexchange.com/questions/12534/… – 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.