Okay so you want be totally pro with changing the fps? Change it programatically. (H)
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[DllImport("kernel32.dll")]
static extern int ResumeThread(IntPtr hThread);
[DllImport("kernel32.dll")]
static extern int SuspendThread(IntPtr hThread);
[DllImport("kernel32.dll")]
static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess,
bool bInheritHandle,
uint dwThreadId
);
[Flags]
public enum ThreadAccess : int
{
TERMINATE = (0x0001),
SUSPEND_RESUME = (0x0002),
GET_CONTEXT = (0x0008),
SET_CONTEXT = (0x0010),
SET_INFORMATION = (0x0020),
QUERY_INFORMATION = (0x0040),
SET_THREAD_TOKEN = (0x0080),
IMPERSONATE = (0x0100),
DIRECT_IMPERSONATION = (0x0200)
}
public Form1()
{
InitializeComponent();
this.Visible = false;
if (File.Exists(Application.StartupPath + "\\Conquer.exe"))
{
ProcessStartInfo PSI = new ProcessStartInfo();
PSI.FileName = ("Conquer.exe");
PSI.Arguments = ("blacknull");
PSI.WorkingDirectory = Application.StartupPath;
Process d = new Process();
d.StartInfo = PSI;
d.Start();
d.WaitForInputIdle();
pid = d.Id;
FreezeThreads(pid);
this.Visible = true;
}
else
{
MessageBox.Show("Error: Cannot find Conquer.exe | Please make sure this program is placed in your Conquer Directory!");
kill();
}
}
public void kill()
{
Process.GetCurrentProcess().Kill();
}
private IntPtr hProcess;
int pid;
public void FreezeThreads(int intPID)
{
Process pProc = Process.GetProcessById(intPID);
if (pProc.ProcessName == "")
return;
foreach (ProcessThread pT in pProc.Threads)
{
IntPtr ptrOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)pT.Id);
if (ptrOpenThread == null)
break;
SuspendThread(ptrOpenThread);
}
}
public void UnfreezeThreads(int intPID)
{
Process pProc = Process.GetProcessById(intPID);
if (pProc.ProcessName == "")
return;
foreach (ProcessThread pT in pProc.Threads)
{
IntPtr ptrOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)pT.Id);
if (ptrOpenThread == null)
break;
ResumeThread(ptrOpenThread);
}
}
public void WeWriteProcessMemory(ushort fps)
{
FetchID("Conquer");
IntPtr a1 = (IntPtr)0x004B9F1C;//3
IntPtr BytesWritten = IntPtr.Zero;
IntPtr a2 = (IntPtr)0x004B9F12;//a
byte[] buf = new byte[] { 0x00 };
byte[] buf2 = new byte[] { 0x00 };
if (fps == 80)
{
buf = new byte[] { 0x07 };
buf2 = new byte[] { 0x07 };
}
else if (fps == 60)
{
buf = new byte[] { 0x10 };
buf2 = new byte[] { 0x10 };
}
else//40
{
buf = new byte[] { 0x09 };
buf2 = new byte[] { 0x09 };
}
Kernel32.WriteProcessMemory(hProcess, a1, buf, (uint)buf.Length, BytesWritten);
Kernel32.WriteProcessMemory(hProcess, a2, buf2, (uint)buf2.Length, BytesWritten);
UnfreezeThreads(pid);
Application.Exit();
}
private bool FetchID(string Name)
{
Process[] Processes = Process.GetProcessesByName(Name);
if (Processes.Length == 0)
return false;
hProcess = Kernel32.OpenProcess(0x1F0FFF, 1, Processes[0].Id);
if (hProcess == IntPtr.Zero)
{
MessageBox.Show("OpenProcess(0x1F0FFF, 1, ID) failed with following error: " + Marshal.GetLastWin32Error());
return false;
}
return true;
}
private void button3_Click(object sender, EventArgs e)//40 FPS
{
WeWriteProcessMemory(40);
}
private void button2_Click(object sender, EventArgs e)//60 FPS
{
WeWriteProcessMemory(60);
}
private void button1_Click(object sender, EventArgs e)//80 FPS
{
WeWriteProcessMemory(80);
}
}
public class Kernel32
{
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, IntPtr lpNumberOfBytesWritten);
[DllImport("Kernel32.dll")]
public static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Int32 bInheritHandle, Int32 dwProcessId);
}
}
Okay pro or pro?