```
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class Program
{
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool CreateProcess(
string lpApplicationName,
string lpCommandLine,
IntPtr lpProcessAttributes,
IntPtr lpThreadAttributes,
bool bInheritHandles,
uint dwCreationFlags,
IntPtr lpEnvironment,
string lpCurrentDirectory,
out StartupInfo lpStartupInfo,
out ProcessInformation lpProcessInformation);
public static void Main()
{
// Buton oluştur
Button button = new Button();
button.Text = "Enjekte Et";
button.Click += Button_Click;
// Form oluştur
Form form = new Form();
form.Controls.Add(button);
// Formu göster
form.ShowDialog();
}
private static void Button_Click(object sender, EventArgs e)
{
// Oyunun yolunu ve DLL'in adını girin
string oyunYolu = @"C:\Program Files\Oyun\Oyun.exe";
string dllAdi = "EnjekteEdilecekDll.dll";
// DLL'i belleğe yükle
IntPtr dllPtr = LoadLibrary(dllAdi);
if (dllPtr == IntPtr.Zero)
{
MessageBox.Show("DLL yüklenemedi!");
return;
}
// Oyunu başlat
StartupInfo startupInfo = new StartupInfo();
ProcessInformation processInformation = new ProcessInformation();
CreateProcess(oyunYolu, null, IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null, out startupInfo, out processInformation);
// DLL'i oyuna enjekte et
InjectDll(processInformation.hProcess, dllPtr);
// İşlemleri kapat
CloseHandle(processInformation.hProcess);
CloseHandle(processInformation.hThread);
FreeLibrary(dllPtr);
MessageBox.Show("Enjeksiyon tamamlandı!");
}
[DllImport("kernel32.dll", SetLastError = true)]
private static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool FreeLibrary(IntPtr hLibModule);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool InjectDll(IntPtr hProcess, IntPtr hDllModule);
[StructLayout(LayoutKind.Sequential)]
private struct StartupInfo
{
public int cb;
public string lpReserved;
public string lpDesktop;
public string lpTitle;
public int dwX;
public int dwY;
public int dwXSize;
public int dwYSize;
public int dwFlags;
public short wShowWindow;
public short cbReserved2;
public IntPtr lpReserved2;
public IntPtr hStdInput;
public IntPtr hStdOutput;
public IntPtr hStdError;
}
[StructLayout(LayoutKind.Sequential)]
private struct ProcessInformation
{
public IntPtr hProcess;
public IntPtr hThread;
public int dwProcessId;
public int dwThreadId;
}
}
```
örnek sağlam olanlarda atabilirsen iyi olurGithub da birçok DLL ınject open source olarak var bakmanızı öneririm.
dll i adamın tahmin edemeyeceği bir yere install ettirirsin sonra inject ettirirsin
bence kendi yazıyoropen sourcemi injectlemeye çalışacaksın yoksa kendinmi yazıyosun
adam kendi yapmak istiyordll injectliyceksen hazır injektör kullanabilirsin
o en zoru işteadam kendi yapmak istiyor
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?