c++ - How can I call a function from another .dll which is injected to the same program? -


My question is really above, I will give more information on this below:

I have The program that first takes "false" d3d9.dll, this DLL is then loaded into the game, I am reverse engineering. Some time and more. After loading Dll, with all other game dependencies, I want to inject my DLL which will do all the dirty work of reverse engineering.

I think I can load this DLL in the program using LoadLibrary, although when I'm using the Injection DLL I to run the main reverse engineer code, I'm such a function Which can I use to call some d3d9.dll?

The reason for this is that I still need access to the D9 9 library to provide such things which I would like to add on the screen with my injection .DL. I just do not want to use d3d9.dll as this will cause problems with loading times, and at which point the memory will change.

I do not even plan to use DllMain in DLL, it means that I want to start a safe process in D3d9. DL will need to call a remote function from the injection DLL.

Sorry if this is a stupid question, but thanks for any answers.

In the olden days we use CreateRemoteThread to create and use LoadLibraryA as the address of lpStartAddress (This address should be identical in all the processes) This trick was to allocate the DLL name which you are injected using VirtualAllocEx and it is in the form of the lpParameter Can be used. Effectively, calling your Load to LoadLibraryA with the DLL name is what you want to inject. When Dll loads are called Dllmain and you can run code in Dllmain during that time dll is being added (DLL_PROCESS_ATTACH).

This is just some very good information on it, though this technique is dependent on a Dllmain function. If you can use Dllmain then this mechanism can work. A summary overview of the steps in that article:

Now, we can summarize this technique in the following steps:

  Remote process (Open Paris). Allocate memory in place of the address of the remote procedure for the injection data (virtual hallux) in the allocated allocated memory of the initial INJDATA structure. Allocated memory in place of the address of the remote procedure for the injection code. Write a copy of ThreadFunc in the allocated memory. Start the remote copy of ThreadFunc by CreateRemoteThread. Wait for remote threads to finish (WaitForSingleObject). Retrieve results from the remote process (Keep ReadprocessMemory or GetExitCodeThread) Keep the allocated memory in step # 2 and # 4 (VirtualFreex) free of charge Close the retrieved handle in step # 6 and # 1 (close handle).   

I have not seen your comment about too much information that I understand a lot. Although Dellmine has some restrictions like most Win32 API calls can not be used. There are some exceptions and one is CreateThread Do you consider spinning a thread to work? If you use CreateThread in Dllmain, it is effectively blocked until Dllmain exits. So once Dllmain will execute the thread back.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -