Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include "windows.h"
- #pragma comment (lib, "user32.lib")
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- HWND MShwnd = FindWindowA("blabla", nullptr);
- if (MShwnd == 0)
- {
- cout << " Error couldn't find BLABLA" << endl;
- DWORD proc_id;
- GetWindowThreadProcessId(MShwnd, &proc_id);
- HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
- if (!hProc){
- cout << " Error Couldn't open process" << endl;
- }
- else{
- cout << " The process Opend succsesful" << endl;
- void* address = reinterpret_cast<void*>(0x6C8F05);
- unsigned char nops[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
- unsigned char orig[] = { 0x74, 0x0D, 0x8B, 0xCF, 0xE8, 0x52, 0xEA, 0xD4, 0xFF, 0x88, 0x86, 0x14, 0x01, 0x00, 0x00 };
- if (orig){
- WriteProcessMemory(hProc, address, nops, sizeof(nops), nullptr);
- }
- else {
- WriteProcessMemory(hProc, address, orig, sizeof(orig), nullptr);
- }
- }
- }
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement