So. I am sorry for asking for source but after trying to make this for awhile I am lost for ideas and am asking for how in the world you can eject a dll from an external process in c#. So any help would be much appreciated. Some of the methods I have tried are remote threads, noping the entire address. By the way here is my inject code if that helps.
public static void Eject(string moduleName)
{
Process[] ProcessList = System.Diagnostics.Process.GetProcessesByName(gamename);
if (ProcessList.Length > 0)
{
Process MYPROCESS = ProcessList[0];
IntPtr BaseAddress = IntPtr.Zero;
foreach (System.Diagnostics.ProcessModule Module in MYPROCESS.Modules)
{
if (Module.ModuleName.Contains(moduleName))
BaseAddress = Module.BaseAddress;
}
if (BaseAddress != IntPtr.Zero)
{
IntPtr libaddy = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
CreateRemoteThread(procHandle, IntPtr.Zero, 0, libaddy, BaseAddress, 0, IntPtr.Zero);
}
}
}