Well, won't do much.
Basically the same as for cookies dll.
(PS: Would be nice with a comment. Ask if you want snippets.)
(Work Progress: ETC = Easy Tool Creator. An easy DLL file that contains useful functions. 70% Done)
Source: (No, I did NOT write this. I just changed some values.)
Code:
public class Hack
{
[Flags]
private enum ProcessAccessType
{
PROCESS_TERMINATE = (0x0001),
PROCESS_CREATE_THREAD = (0x0002),
PROCESS_SET_SESSIONID = (0x0004),
PROCESS_VM_OPERATION = (0x0008),
PROCESS_VM_READ = (0x0010),
PROCESS_VM_WRITE = (0x0020),
PROCESS_DUP_HANDLE = (0x0040),
PROCESS_CREATE_PROCESS = (0x0080),
PROCESS_SET_QUOTA = (0x0100),
PROCESS_SET_INFORMATION = (0x0200),
PROCESS_QUERY_INFORMATION = (0x0400)
}
[DllImport("kernel32.dll")]
private static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Int32 bInheritHandle, UInt32 dwProcessId);
[DllImport("kernel32.dll")]
private static extern Int32 CloseHandle(IntPtr hObject);
[DllImport("kernel32.dll")]
private static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead);
[DllImport("kernel32.dll")]
private static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesWritten);
public Hack(string Application)
{
Process[] pArray = Process.GetProcessesByName(Application);
if (pArray.Length == 0){ return;}
ReadProcess = pArray[0];
Open();
}
public void Set(int Address, int Value)
{
int byteswritten;
Write((IntPtr)Address, BitConverter.GetBytes(Value), out byteswritten);
}
private Process ReadProcess
{
get
{
return m_ReadProcess;
}
set
{
m_ReadProcess = value;
}
}
private Process m_ReadProcess = null;
private IntPtr m_hProcess = IntPtr.Zero;
private void Open()
{
ProcessAccessType access;
access = ProcessAccessType.PROCESS_VM_READ
| ProcessAccessType.PROCESS_VM_WRITE
| ProcessAccessType.PROCESS_VM_OPERATION;
m_hProcess = OpenProcess((uint)access, 1, (uint)m_ReadProces*****);
}
private void CloseHandle()
{
int iRetValue;
iRetValue = CloseHandle(m_hProcess);
if (iRetValue == 0)
throw new Exception("CloseHandle failed");
}
private void Write(IntPtr MemoryAddress, byte[] bytesToWrite, out int bytesWritten)
{
IntPtr ptrBytesWritten;
WriteProcessMemory(m_hProcess, MemoryAddress, bytesToWrite, (uint)bytesToWrite.Length, out ptrBytesWritten);
bytesWritten = ptrBytesWritten.ToInt32();
}
}
Do it in a DLL project. OR, change it for your purpose. (Need some removing and editing.)
(If you have used Cookies DLL, then you understand how to use this in a WinForm Project.)
Good Luck guys, just ask if anything needed.
Code Lang = C#