Reply to Re: Decompilers needed
If you don't have an account, just leave the password field blank.
Because I am a geek, hur, I just checked this. (Why not get the facts on the table?
These are the two files I used to test:
===== wh.c =====
void loop(void) {
int i = 0;
while(1)
i++;
}
===== fl.c =====
void loop(void) {
int i = 0;
for( ;; )
i++;
}
I "compiled" both to assembler using the command "gcc -O0 -S <file>.c", which gave me these two files: (I've removed unnecessary, unrelated crud)
===== wh.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
===== fl.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
If you see any difference between the two outputs, then congratulations. You see something I don't. So, to all of you discussing this, it's settled. They both result in the exact same code, case closed, it's entirely up to personal preference.
These are the two files I used to test:
===== wh.c =====
void loop(void) {
int i = 0;
while(1)
i++;
}
===== fl.c =====
void loop(void) {
int i = 0;
for( ;; )
i++;
}
I "compiled" both to assembler using the command "gcc -O0 -S <file>.c", which gave me these two files: (I've removed unnecessary, unrelated crud)
===== wh.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
===== fl.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
If you see any difference between the two outputs, then congratulations. You see something I don't. So, to all of you discussing this, it's settled. They both result in the exact same code, case closed, it's entirely up to personal preference.