char BytePattern[] = "\x89\x00\x00\x8B\x00\x00\xFC\xFF\xFF\x85\x00\x0F";
char ByteMask[] = "x??x??xxxx?x"; //Our Mask
FindPattern("Game.exe", BytePattern, ByteMask);
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include "Functions.h"
using namespace std;
#pragma comment( lib, "psapi.lib" )
//Define all Here, its easier.
char BytesToPatch[] = "\x8b"; //What we are replacing with, for example \x90\ = NOP.
char BytePattern[] = "\x89\x00\x00\x8B\x00\x00\xFC\xFF\xFF\x85\x00\x0F";
char ByteMask[] = "x??x??xxxx?x"; //Our Mask
int Position = 0; //0 means first.
int NoOfBytes = 1;
//Our Main Function
void InitiatePatch()
{
DWORD ammoAddy = FindPattern("Transformice.exe", BytePattern, ByteMask);
MessageBoxA(NULL, BytePattern , "",0 );
MessageBoxA(NULL, ByteMask , "", 0);
MsgBoxAddy(ammoAddy);
WriteToMemory(ammoAddy, BytesToPatch, 1);
}
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpReserved) // reserved
{
// Perform actions based on the reason for calling.
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
MessageBoxA(NULL, "Attached successfuly", "", 0);
InitiatePatch();
break;
}
// Successful DLL_PROCESS_ATTACH.
return TRUE;
}
#pragma comment( lib, "psapi.lib" )
error LNK2001: unresolved external symbol _GetModuleInformation 16