Calling stack vanish after using asemly code 
Author Message
 Calling stack vanish after using asemly code

Hi!
    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

        Thanks
               Ady



Thu, 24 May 2001 03:00:00 GMT  
 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


Thu, 24 May 2001 03:00:00 GMT  
 Calling stack vanish after using asemly code


Quote:
>    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.

Do the call in c code and have the compiler spit out an asm listing to
see how the call setup.


Fri, 25 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Calling stack vanish after using asemly code

2. Showing Call Stack and Determine which object is not valid LARGE CHUNK OF CODE

3. Call stack never shows our own code

4. destructor is called before copy-constructor on temporary class (allocated on stack during function call)

5. Multithreading using the so called MIX ansi-c compliant source code

6. Call Stack not showing up?

7. function pointers, casting, call stack overwriting

8. HELP:self loading parameters on stack before function call

9. help with loading call stack

10. Call Stack

11. How to get calling method stack trace

12. Recursive call and Stack

 

 
Powered by phpBB® Forum Software