-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDllInjector.cs
More file actions
57 lines (53 loc) · 1.46 KB
/
DllInjector.cs
File metadata and controls
57 lines (53 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
namespace Com.Xenthrax.DllInjector
{
public partial class DllInjector : IDisposable
{
/*
* DllInjector(string/int/Process Process[, bool FreeOnDispose]);
*
* bool FreeOnDispose { get; }
* Process TargetProcess { get; }
* bool Is64BitProcess { get; }
* int PointerSize { get; }
*
* void AcquireProcessHandle();
* void ReleaseProcessHandle();
*
* IntPtr LoadLibrary(string FileName);
* void FreeLibrary(IntPtr hModule);
* void FreeLoadedLibraries();
*
* IntPtr GetModuleHandle(string ModuleName);
*
* IntPtr GetProcAddress(string/IntPtr Module, string ProcName);
* IntPtr GetProcAddress(string/IntPtr Module, short Ordinal);
*
* FunctionReturn CallFunction(IntPtr Function[, params object[] Paramaters]);
* FunctionReturn CallFunction(IntPtr Function, CallingConvention callingConvention[, params object[] Paramaters]);
* uint CallFunctionThreadProc<T>(IntPtr Function, ref T Paramater) where T : struct;
* uint CallFunctionThreadProc(IntPtr Function[, IntPtr Paramater]);
*
* ReadMemory
*
* WriteMemory
*
* FreeMemory
*
* void Dispose();
*/
public void Dispose()
{
if (this.Disposed)
return;
if (this.FreeOnDispose)
{
this.FreeCommonLanguageRuntime();
this.FreeLoadedLibraries();
}
this.FreeNativeCallFunction();
this.ReleaseProcessHandle();
this.Disposed = true;
}
}
}