Currently I'm working on trying to find out if an function (Foo()) in my executable has been called from an injected dll.
My first idea was to call GetModule(NULL)
and then check the result with the address given by GetModule("InjectedDllName")
, all this is done inside Foo().
Apperantly GetModule(NULL)
will return the address of the executable and not the address of the current calling module. Is there maybe any other solution for my problem?
Another idea I have is locating the thread start address when foo() is called and check if this is inside the injected dll address space, dunno if this is possible.