You are on page 1of 2

#include "stdafx.

h"
#include "iostream";
#include "atlstr.h";
#include <windows.h>
#include <TlHelp32.h>
#include <stdio.h>
#include <psapi.h>
using namespace std;

#pragma comment(lib, "Psapi.lib")

PROCESS_INFORMATION CreateVProcess();
void TryToCrack(PROCESS_INFORMATION processInfo);

//
// 85 c0 0f 84 9e 00 00 00
// 85 c0 0f 85 9e 00 00 00
// First offset 34EC7, do 34EC8
//
// second offset 34F03
// 74 2E
// EB 2E

int main()
{
cout << "Launching Application" << endl;
PROCESS_INFORMATION processInfo = CreateVProcess();
cout << "Trying to crack..." << endl;
TryToCrack(processInfo);
return 0;
}

PROCESS_INFORMATION CreateVProcess()
{
LPCTSTR path = L"NameOfAppHere.exe";

// additional information
STARTUPINFO si;
PROCESS_INFORMATION pi;

// set the size of the structures


ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));

CreateProcess(
path,
NULL, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi // Pointer to PROCESS_INFORMATION structure (removed
extra parentheses)
);
return pi;
}

void TryToCrack(PROCESS_INFORMATION processInfo)


{
Sleep(500);

HANDLE targetProcess = OpenProcess(STANDARD_RIGHTS_WRITE, 0,


processInfo.dwProcessId);
void* hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,
processInfo.dwProcessId);
MODULEENTRY32 mod32;
mod32.dwSize = sizeof(MODULEENTRY32);
Module32Next(hSnap, &mod32);

DWORD modHandle = (DWORD)mod32.modBaseAddr;

unsigned char mem1 = 0x85;


unsigned char mem2 = 0x75;

for (int i = 0; i < 100000; i++)


{
WriteProcessMemory(processInfo.hProcess, (LPVOID)(modHandle +
0x034EC8), &mem1, 1, NULL);
WriteProcessMemory(processInfo.hProcess, (LPVOID)(modHandle +
0x034F02), &mem2, 1, NULL);
}
}

You might also like