Questions tagged [dll-injection]

DLL injection is a technique used to run code within the address space of another process by forcing it to load a dynamic-link library(DLL).

DLL injection is often used by external programs to influence the behaviour of another program in a way its authors did not anticipate or intend. For example, the injected code could hook system function calls, or read the contents of password text-boxes, which cannot be done the usual way. A program used to inject arbitrary code into arbitrary processes is called a DLL injector.

468 questions
35
votes
3 answers

Hooking DirectX EndScene from an injected DLL

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…
Etan
  • 17,014
  • 17
  • 89
  • 148
25
votes
4 answers

DLL Injection with CreateRemoteThread

If you take a look at the following working code of a simple DLL injection: //Open the target process with read , write and execute priviledges Process =…
James King
  • 1,574
  • 4
  • 19
  • 28
20
votes
5 answers

Dll Injection - What is possible with it?

I was browsing the internet lately, when I stumbled upon Dll Injection. I think its an interesting subject but, I have no clue what the purpose of it is? I have read that it can be used for cracking/hacking games and software but is it also possible…
Emerion
  • 820
  • 6
  • 13
14
votes
1 answer

C# DLL Injection

Is it possible to inject a DLL file into a process such as explorer or svchost using C#? I know this is possible in C++ but is it in C#? If so would it matter how the DLL was written, e.g. would it differ betweeen a C++ DLL or a Visual Studio C#…
Bali C
  • 30,582
  • 35
  • 123
  • 152
14
votes
5 answers

Getting a handle to the process's main thread

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…
Etan
  • 17,014
  • 17
  • 89
  • 148
10
votes
4 answers

The truth behind DLL injection with metro applications, Nektra vs Komodia

Komodia says: DLL injection is not possible with Modern UI on Windows 8,It is possible to inject DLLs into Metro apps, BUT, you will not be able to redirect Winsock traffic to localhost. In other words windows metro application working into…
Marwen Trabelsi
  • 4,167
  • 8
  • 39
  • 80
8
votes
2 answers

Ejecting after injecting DLL from running process

I wrote this function to inject DLL into running process: DLL_Results CDLL_Loader::InjectDll() { DWORD ThreadTeminationStatus; LPVOID VirtualMem; HANDLE hProcess, hRemoteThread; HMODULE hModule; if (!isInit()) return…
D_R
  • 4,894
  • 4
  • 45
  • 62
7
votes
4 answers

Win32 Hooks DLL injection into Applications Built against "Any CPU"

I am working on a project which captures all User Interactions. MSDN tells (this) SetWindowsHookEx can be used to inject a DLL into another process. A 32-bit DLL cannot be injected into a 64-bit process, and a 64-bit DLL cannot be injected…
sri
  • 1,005
  • 1
  • 12
  • 26
7
votes
1 answer

How to load dll's during debug in VS2013

I have some code var aa = a(); b(aa); While debugging, I set a breakpoint on the b() call. Then going to the immediate window, I'd like to be able to execute code from a DLL that is in my project but is not yet loaded. Say I want a new Boo and…
Carlo V. Dango
  • 13,322
  • 16
  • 71
  • 114
7
votes
1 answer

How to Modify Import Address Table for Run time Loaded DLL

I want to hook functions that are called from a loaded DLL on Run time, i used the class CAPIHook from the book "Windows Via C/C++" (the DLL Injecting done by Install System Wide hook and The hooking by Modify IAT) but this code work only if the DLL…
Wajdy Essam
  • 4,280
  • 3
  • 28
  • 33
6
votes
5 answers

Why Control.FromHandle(IntPtr) returns null in one hooked process and returns valid object of "Form"? in another hooked process?

I am facing a problem related to get out all the controls from some hooked process. My SpyDll launched into hooked process sucessfully, But when I check the statement Control control = Control.FromHandle(MainWindowHandle), it returns null into…
Usman
  • 2,742
  • 4
  • 44
  • 82
6
votes
5 answers

How can I inject a file into an EXE at runtime and reference the file during program operation?

I'd like a user to download an exe from my website, where (synchronously upon download) an XML file is injected into this application. This XML file contains a public key, and a signature. How do I inject the file prior to downloading and…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
6
votes
1 answer

Dll Injection in C# not working

I have got the following code. using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using ClassLibrary1; namespace Injection { class Program { static void Main(string[] args) …
XWorm
  • 195
  • 2
  • 8
6
votes
4 answers

CreateRemoteThread on LoadLibrary and get the HMODULE back

I am doing the DLL injection job recently, so I have did some research into it on google. Now I know use CreateRemoteThread is a good way. The ASLR(Address space layout randomization, since Windows Vista) makes the address of kernel32.dll is random,…
amanjiang
  • 1,213
  • 14
  • 33
6
votes
2 answers

How to call specific function in dll injection?

Following code will inject dll and DllMain will be called. How I call specific function from DLL, not just DllMain? DWORD pid; HANDLE hd; LPVOID gp, rs, proc; gp = (LPVOID)GetProcAddress(GetModuleHandle(L"Kernel32.dll"),…
Pranit Kothari
  • 9,721
  • 10
  • 61
  • 137
1
2 3
31 32