27.03.2018, 16:33
|
#2
|
Регистрация: 26.11.2015
Адрес: Абакан
Сообщений: 322
Отблагодарили 79 раз(а)
|
Re: c# dll замена байт
Свернуть ↑
[CODE]
const int PROCESS_VM_WRITE = 0x0020;
const int PROCESS_VM_OPERATION = 0x0008;
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress,
byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesWritten);Code: C# 2.
Код:
Process process = new Process();
string Login = "Tester";
string Password = "1234";
string Patch = "D:/Games/PointBlank/";
int Addr = 0x787475; // Адрес функции
process.StartInfo = new ProcessStartInfo
{
FileName = Patch + "PointBlank.exe",
Arguments = Login + " " + Password,
};
process.StartInfo.WorkingDirectory = Patch;
process.Start();
IntPtr processHandle = OpenProcess(0x1F0FFF, false, process.Id);
int bytesWritten = 0;
WriteProcessMemory((int)processHandle, Addr, new byte[] { 0x90, 0x90, 0x90, 0x90 }, 4, ref bytesWritten); //Nop (90)Code: C#
Свернуть ↑Развернуть ↓
При запуске занопится.
__________________
Разработка Emu: PiercingBlow 90%, APB Reloaded 100%.
Самый действенный инструмент для самообучения - грабли.
|
|
|