DLL Injection in C# Snippet

Code snippet available for copy here

The code snippet is self documenting and will specify what failed or if it succeeded.  Simply use any of the InjectDLL functions.

I recommend using any of these

public InjectRet InjectByProcessName(string strDLLName, string strProcessName)

public InjectRet InjectDLL(string fileName, Process Process)

 

The function

public InjectRet InjectDLL(IntPtr hProcess, string strDLLName)

This was converted to C# by me from C++ from a blog post in 2008 and therefore may or may not be under GPL 3.0.  Since the post has likely been deleted at this point, I have no way of knowing.

Wo1f Injector Lite v2.5

Wo1f Injector Lite v2.5

Wo1f Injector

Features

  • Multi-DLL Injection
  • Reflex Injection
  • Closes after reflex injection
  • Saves settings
  • Manual Injection (Numpad 0)
  • Process List
  • Next/Previous Process for same name
  • Single core friendly
  • Detailed Process Info
  • Copy Process Info
  • Compatible with all operating systems with .Net Framework 2.0

Instructions

  • Click on a Process in the List to select it and view its information
  • Double click on a process or window in the list in order to set that as the target process
  • If you can view the process information you can likely inject.  If you see an error, try the other bit version
  • To add a DLL right click on the DLL list on the left
  • To inject manually press Numpad 0 key

Notes

  • 64 bit is not supported yet
  • If you see Access Denied while looking at a process do not expect to be able to inject into it.  Try though, it may work.
  • Written entirely in C#
  • I wrote the C# Injection function based on a C++ Dll Injection method

Requires

Downloads

Images

Wo1f Injector
Wo1f Injector Successful Injection

 

 

 

 

 

 

injector
You can add and remove DLLs by right clicking on the DLL List

 

error
Error window for Wo1f Injector

See Also