SolvedTry to make own injector .

Posts 1–6 of 6 · Page 1 of 1
Try to make own injector .
Hey,i am trying to make my own injector, and i am complete my injector but when i test inject it wont. i don't know injector inject or not so i try to ask did anyone know how to put massage when it done inject?

i will post the code please help me check.

using System.Diagnostics;
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;



[DllImport("kernel32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int ReadProcessMemory(int hProcess, int lpBaseAddress, string lpBuffer, int nSize, ref int lpNumberOfBytesWritten);

[DllImport("kernel32", EntryPoint = "LoadLibraryA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int LoadLibrary(string lpLibFileName);

[DllImport("kernel32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int WriteProcessMemory(System.IntPtr hProcess, int lpBaseAddress, string lpBuffer, int nSize, int lpNumberOfBytesWritten);

[DllImport("kernel32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int VirtualAllocEx(System.IntPtr hProcess, int lpAddress, int dwSize, int flAllocationType, int flProtect);

[DllImport("kernel32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int GetProcAddress(int hModule, string lpProcName);

[DllImport("kernel32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int CreateRemoteThread(System.IntPtr hProcess, int lpThreadAttributes, int dwStackSize, int lpStartAddress, int lpParameter, int dwCreationFlags, int lpThreadId);

[DllImport("Kernel32", EntryPoint = "GetModuleHandleA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int GetModuleHandle(string lpModuleName);

[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

[DllImport("kernel32", EntryPoint = "CloseHandle")]
private static extern int CloseHandle(System.IntPtr hObject);

[DllImport("user32", EntryPoint = "FindWindowA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int FindWindow(string lpClassName, string lpWindowName);

void Inject()
{
System.IntPtr TargetProcessHandle;
int TargetBufferSize;
String pszLibFileRemote;
int pfnStartAddr;
Process[] TargetProcess = Process.GetProcessesByName("BlackShot");
TargetProcessHandle = OpenProcess(0x1F0FFF, false, TargetProcess[0].Id);
pszLibFileRemote = Application.StartupPath + ("\\SILK.dll");
pfnStartAddr = GetProcAddress(GetModuleHandle("Kernel32.dll"), "LoadLibraryA");
TargetBufferSize = 1 + pszLibFileRemote.Length;
int Rtn;
int LoadLibParamAdr;
LoadLibParamAdr = VirtualAllocEx(TargetProcessHandle, 0, TargetBufferSize, 4096, 4);
Rtn = WriteProcessMemory(TargetProcessHandle, LoadLibParamAdr, pszLibFileRemote, TargetBufferSize, 0);
CreateRemoteThread(TargetProcessHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, 0);
CloseHandle(TargetProcessHandle);
}

private void timer1_Tick(object sender, EventArgs e)
{
Process[] TargetProcess = Process.GetProcessesByName("BlackShot");
if (TargetProcess.Length == 0)
{ }
else
{
Inject();
timer1.Stop();
this.Close();
}
}

this code was search on >> http://www.mpgh.net/forum/showthread.php?t=1151586

- - - Updated - - -

sorry for my bad english
Inject any DLL with MsgBox. If MsgBox pop out after Injection means your Injector is complete.
Quote Originally Posted by RuShi View Post
Inject any DLL with MsgBox. If MsgBox pop out after Injection means your Injector is complete.
I test the injector now i know what problem on my injector! i think my injector wasn't target BS.i open like 10 time still not inject do you know how to fix it?
pszLibFileRemote = Application.StartupPath + ("\\SILK.dll");
The DLL must be name SILK.dll - Because the injector only inject SILK.dll -
And I Think this injector only work for Windows 8 and 10
Run as Administrator and Try again
Quote Originally Posted by MafiaBoy BlackShit View Post
The DLL must be name SILK.dll - Because the injector only inject SILK.dll -
And I Think this injector only work for Windows 8 and 10
Run as Administrator and Try again
oh ok thanks you! i will try
The problem has been solved by MafiaBoy BlackShit.

/Closed.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?