Announcement

Collapse
No announcement yet.

Inject Dll and Call My Function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inject Dll and Call My Function

    I have been playing around with my Error Handler routines and some other code to inject a dll into another process. (In this case a program i wrote to raise an exception).

    I have gotten my dll to inject and it gets called via the "SetUnhandledException" but for the life of me I can not figure out how I would let the "Crash program" call a function in my "Dll Error Handler" when my Dll was injected, not compiled as a part of the "Crash program"

    The other function I am trying to call in my Dll is when an error is not a "Fatal GPF" that we all see when an app has to close.
    and in that case "Non-Fatal" errors are not called via "SetUnhandledException"

    So I am wondering, once I inject my Dll, how does the "Crash Program" know what function(s) to call in my dll and when to do it?????

    Any ideas?
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

  • #2
    Could you make a "stub" dll file with the external calls that you want your program to be able to make?
    Scott Slater
    Summit Computer Networks, Inc.
    www.summitcn.com

    Comment


    • #3
      I am not sure what you mean, I see the word "Stub" all over the net (mostly C code, much too confusing to understand).

      This may be a "Duhhhhh" question, but could you show how a stub would be created and used?

      Thanks
      Engineer's Motto: If it aint broke take it apart and fix it

      "If at 1st you don't succeed... call it version 1.0"

      "Half of Programming is coding"....."The other 90% is DEBUGGING"

      "Document my code????" .... "WHYYY??? do you think they call it CODE? "

      Comment


      • #4
        I am assuming that you are intercepting calls to other dlls or the system api (dlls). In this case you would create a dll with an empty function with the same one that you will intercept later, and then you can intercept the call to this dll. hope that makes sense...
        Scott Slater
        Summit Computer Networks, Inc.
        www.summitcn.com

        Comment

        Working...
        X