Calling stack vanish after using asemly code
Quote:
> Platform :PC - WindowsNT, Microsoft Visual C++ ver 5.0, and 6.0
> I tried to implement calling to C function from assembly code.
> I can see the calling stack before and after calling the C function, but
> not inside the function.
> The following is the assembly code:
> 1. push EBP ;store previous stack
> 2. mov EBP, ESP
> 3. push param1 ;two parameter to function
> 4. push param2
> 5. call Cfunc ; call function by calculate offset from next
> statement
> 6. add ESP, 8 ; remove two parameters given to function
> 7. mov ESP, EBP ;restore stack
> 8. pop EBP
> 9. ret 4 ; remove 1 input parameter
> In this program I can see the stack but when line 5 is being performed and I
> step into function the stack disappeared
What kind of assembler are you useing. Look at what address the Cfunc is
showing, most probably there is just an address showing to the right position of
the function you want to call.
then just change the code to:
call [_Cfunc]
this should work, it work with nasm and turbo assembler from borland.
try to be more specific in how you generated the Cfunc, in which language, with
what kind of calling and so.
Pulzar