Results 1 to 3 of 3

Thread: need help please...

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    need help please...

    I just managed to change the Import Address Table so I could hook api function. Basically, I changed the address in the IAT so that when the api function is called, it directs the call to my own function. Unfortunately, after my function is called, it crashes with this error:

    "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."

    I also noticed while looking at the disassembly debug window(in vc++), these two lines are called after my function is called, and then again a second time after the thread goes out of my function. I'm not that familiar with ASM, so i'm wondering if anyone knows a way for me to stop it from crashing?

    00401034 3B F4 cmp esi,esp
    00401036 E8 45 02 00 00 call _RTC_CheckEsp (401280h)

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: need help please...

    Declare your replacement function with WINAPI:
    Code:
    void WINAPI whatever()
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: need help please...

    yes it works. Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width