PHP Code:
public void ApplyGameServerFixes(string ProcName)
{
Process GameProcess = null;
bool flag = false;
try
{
GameProcess = Process.GetProcessesByName(ProcName)[0];
flag = true;
}
catch { }
if (!flag)
{
Console.WriteLine("Could not find [{0}] process", ProcName);
return;
}
//--------------------------------------------------------------------
int AddrExHandler_1 = 0x00521765;
int AddrExHandler_2 = 0x00521768;
//--------------------------------------------------------------------
byte[] Patch_ExHandler_1 = new byte[] { 0x90, 0x90 };
byte[] Patch_ExHandler_2 = new byte[] { 0xEB };
//--------------------------------------------------------------------
Target: ApplyGameServerFixes
[SR_GameServer.exe]
Open in
ollydbg, press CTRL+G and put Offset.
PHP Code:
//--------------------------------------------------------------------
int AddrExHandler_1 = 0x00521765;
int AddrExHandler_2 = 0x00521768;
//--------------------------------------------------------------------
byte[] Patch_ExHandler_1 = new byte[] { 0x90, 0x90 };
byte[] Patch_ExHandler_2 = new byte[] { 0xEB };
//--------------------------------------------------------------------
The AddrExHandler_1 located the Offset
0x00521765 and writes the bytes
{ 0x90, 0x90 }; --- NOP
The AddrExHandler_2 located the Offset
0x00521768 and writes the bytes
{ 0xEB }; -- JMP
If you want to implement it in one .DLL you can do it in C++
Examples: Fix.cpp
PHP Code:
#include "Fix.h"
#include "Asm.h"
void Fixs()
{
SetByte(0x00521765,0xEB); -- JMP
SetNop(0x00521768,2); -- NOP
}
Fix.h
Asm.cpp
PHP Code:
#include "Asm.h"
void SetNop(DWORD dwOffset, int Size){
for(int n=0; n < Size; n++){
*(BYTE*)(dwOffset+n) = 0x90;
}
}
void SetByte(DWORD dwOffset, BYTE btValue){
*(BYTE*)(dwOffset) = btValue;
}
Asm.h
PHP Code:
void SetNop(DWORD dwOffset, int Size);
void SetByte(DWORD dwOffset, BYTE btValue);
Have enough :)
So is that you could use what public Chernobyl.
Good Luck!
