Why does CreateRemoteThread work here?

こ雲淡風輕ζ 提交于 2019-12-21 20:56:54

问题


I'm trying to inject a thread to another process, which let the process load an external dll.

Here's the code I found on the internet, and it works.

    HANDLE hThread  = CreateRemoteThread (hProcess, NULL, 0,
            (LPTHREAD_START_ROUTINE) GetProcAddress(
                GetModuleHandle(L"kernel32"), "LoadLibraryA"), 
                  lpMemory, 0, NULL);
    if (hThread == INVALID_HANDLE_VALUE)
    {
            return false;
    }

But from my understandings, the address returned by GetProcAddress lives in the memory space of the current process, not the targeted one.

So why does it work?

Tested on Windows 7

来源:https://stackoverflow.com/questions/18941843/why-does-createremotethread-work-here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!