dll-injection

Getting a handle to the process's main thread

旧时模样 提交于 2019-11-27 23:28:59
问题 I have created an additional thread in some small testing app and want to suspend the main thread from this additional thread. The additional thread is created via CreateRemoteThread from an external process. Since SuspendThread needs a HANDLE to the thread which should be suspended, I want to know how to get this HANDLE from code running in my additional thread. 回答1: I don't think there is anything that differentiates the main thread from other threads once the process has started. However,

Error_Invalid_Parameter Error 57 when calling CreateRemoteThread with Python 3.2 CTypes

安稳与你 提交于 2019-11-27 23:22:26
I'm trying to perform DLL injection using Python's Ctypes. I attach Olly to the process that I'm trying to inject and the thread that I'm trying to creates gives the error, "ERROR_INVALID_PARAMETER 00000057". I've been doing some research and I've found that as the error says one of my parameters is bad when I call CreateRemoteThread. I can't seem to figure out what parameter is bad as all the values that I send in seem valid. I set an Olly conditional break point on the call to LoadLibrary and the dll name and (full) path are correct. I also don't see my custom dll loaded in the memory space

Calling function in injected DLL

北战南征 提交于 2019-11-27 18:55:27
问题 I want to call a function in a remote process of an injected DLL that I've made. I have successfully injected my DLL with: CreateRemoteThread(pHandle, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle("kernel32"), "LoadLibraryA"), pLibRemote, 0, NULL); The DllMain is executed and the DLL is running in a stand-by mode. What I would like to do is somehow call the remotely loaded DLL in order to do some work. I have tried exporting the function like this: extern "C" __declspec

Hooking DirectX EndScene from an injected DLL

允我心安 提交于 2019-11-27 06:07:50
I want to detour EndScene from an arbitrary DirectX 9 application to create a small overlay. As an example, you could take the frame counter overlay of FRAPS, which is shown in games when activated. I know the following methods to do this: Creating a new d3d9.dll , which is then copied to the games path. Since the current folder is searched first, before going to system32 etc., my modified DLL gets loaded, executing my additional code. Downside: You have to put it there before you start the game. Same as the first method, but replacing the DLL in system32 directly. Downside: You cannot add

Function ReadProcessMemory keeps returning ERROR_PARTIAL_COPY

*爱你&永不变心* 提交于 2019-11-27 04:58:10
问题 I know that there are other people that have asked this question but it seems as though none of them reached a satisfying or understandable conclusion. I can't use what isn't answered. I am not quite sure what the problem is and I have tried various different solutions with no success so here is my code: #include <windows.h> #include <iostream> using namespace std; int main() { HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_QUERY_INFORMATION, FALSE, (DWORD)7312); if(hProc == NULL) {

How to hide C# application from taskmanager processtab? [duplicate]

左心房为你撑大大i 提交于 2019-11-26 23:26:29
问题 This question already has answers here : How do I hide a process in Task Manager in C#? (16 answers) Closed 3 years ago . I need to hide my C# application from process tab of Taskmanager using this.ShowInTaskbar = false; I have hide it from application tab. Now I need to hide it from process tab. Is this possible?. 回答1: You could inject a DLL into the svchost process, that would camouflage it from Task Manager but not from ProcessExplorer. Here's how: How To Inject a Managed .NET Assembly

Error_Invalid_Parameter Error 57 when calling CreateRemoteThread with Python 3.2 CTypes

…衆ロ難τιáo~ 提交于 2019-11-26 23:19:40
问题 I'm trying to perform DLL injection using Python's Ctypes. I attach Olly to the process that I'm trying to inject and the thread that I'm trying to creates gives the error, "ERROR_INVALID_PARAMETER 00000057". I've been doing some research and I've found that as the error says one of my parameters is bad when I call CreateRemoteThread. I can't seem to figure out what parameter is bad as all the values that I send in seem valid. I set an Olly conditional break point on the call to LoadLibrary

Hooking DirectX EndScene from an injected DLL

给你一囗甜甜゛ 提交于 2019-11-26 11:54:19
问题 I want to detour EndScene from an arbitrary DirectX 9 application to create a small overlay. As an example, you could take the frame counter overlay of FRAPS, which is shown in games when activated. I know the following methods to do this: Creating a new d3d9.dll , which is then copied to the games path. Since the current folder is searched first, before going to system32 etc., my modified DLL gets loaded, executing my additional code. Downside: You have to put it there before you start the