assuming you have a function in ASM (as specified in the first post). The program analyzes it and generates a C-stub that contains the parameters and local variables as well as the function name. It's intended to work like that.
Consider this function:
_reverse:
push ebp
mov ebp, esp
sub esp, 24
mov eax, DWORD PTR [ebp+8]
mov DWORD PTR [esp], eax
call _string_length
mov DWORD PTR [ebp-4], eax
mov eax, DWORD PTR [ebp+8]
mov DWORD PTR [ebp-12], eax
mov eax, DWORD PTR [ebp+8]
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-8], 0
L3:
mov eax, DWORD PTR [ebp-4]
dec eax
cmp eax, DWORD PTR [ebp-8]
jle L4
lea eax, [ebp-16]
inc DWORD PTR [eax]
lea eax, [ebp-8]
inc DWORD PTR [eax]
jmp L3
L4:
mov DWORD PTR [ebp-8], 0
L6:
mov edx, DWORD PTR [ebp-4]
mov eax, edx
sar eax, 31
shr eax, 31
lea eax, [edx+eax]
sar eax
cmp eax, DWORD PTR [ebp-8]
jle L2
mov eax, DWORD PTR [ebp-16]
movzx eax, BYTE PTR [eax]
mov BYTE PTR [ebp-17], al
mov edx, DWORD PTR [ebp-16]
mov eax, DWORD PTR [ebp-12]
movzx eax, BYTE PTR [eax]
mov BYTE PTR [edx], al
mov edx, DWORD PTR [ebp-12]
movzx eax, BYTE PTR [ebp-17]
mov BYTE PTR [edx], al
lea eax, [ebp-12]
inc DWORD PTR [eax]
lea eax, [ebp-16]
dec DWORD PTR [eax]
lea eax, [ebp-8]
inc DWORD PTR [eax]
jmp L6
L2:
leave
ret
The output will be:
reverse(int arg_8){
int var_4;
int var_8;
char * var_12;
char * var_16;
char var_17;
}
Which is an approximation to the original:
void reverse(char *string)
{
int length, c;
char *begin, *end, temp;
length = string_length(string);
begin = string;
end = string;
for ( c = 0 ; c < ( length - 1 ) ; c++ )
end++;
for ( c = 0 ; c < length/2 ; c++ )
{
temp = *end;
*end = *begin;
*begin = temp;
begin++;
end--;
}
}
It tries to get the arguments, local variables and their datatypes, altough it's far from perfect (doesn't recognize some pointers and stuff). The idea is to create a stub which can be used as a starting point while rewriting ASM code in C.
Does this explanation help?