Author Topic: C++ Auto-Change memory  (Read 2718 times)

0 Members and 1 Guest are viewing this topic.

bfwlegend

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
C++ Auto-Change memory
« on: June 26, 2012, 09:02:06 pm »
So I'm trying to get my mod-app to automatically change the memory so when I press ESCx2 my mod-apps will load, I can do it with CheatEngine but I like it to be automatic, I've made something and was trying to get it to work but I can't see to get my memory to come out as a string (I need to read/write as string not byte) and I was wondering if anyone could help me out, thanks :)
(It's lacking some of the features I also didn't add WriteProcessMemory yet to it)
Code: [Select]
// Arma 2 Hecks.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <string>
#include <tlhelp32.h>

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

using namespace std;

DWORD FindProcessId(const std::wstring& processName);

int _tmain(int argc, _TCHAR* argv[])
{
std::cout << "Welcome to Das Arma mod-apps for Arma 2 OA" << endl;
std::wstring processName;

std::wcout << "Enter ArmA2OA's process name, usally ""ArmA2OA.exe"": ";
std::getline(std::wcin, processName);
std::cout << "Look for the Arma2OA window now..." << endl;
DWORD ProcessId = FindProcessId(processName);

if (ProcessId == 0){
cout << "ERROR: Could not find "<< processName.c_str() << endl;
}
else{
cout << "Arma 2 OA window found ID: "<< ProcessId << endl;
cout << "Executing functions on "<< processName.c_str() << endl;
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessId);
if (!hProc){
cout << "FAILED! on: Opening process" << endl;
}else{
cout << "Opened process" << endl;

DWORD Pointer = 0xFC7EBED5;
DWORD Pointed;
DWORD Pointstring;
DWORD CurrentInjection;
WORD Offset = 0x0025;
//ReadProcessMemory(hProc,(LPCVOID)(Pointer), &Pointed,59,NULL);
ReadProcessMemory(hProc,(LPCVOID)(Pointer), &CurrentInjection,4,NULL);

cout << "Done!: " << CurrentInjection << endl;
}

}



system("PAUSE");
return 0;
}

DWORD FindProcessId(const std::wstring& processName)
{
PROCESSENTRY32 processInfo;
processInfo.dwSize = sizeof(processInfo);

HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if ( processesSnapshot == INVALID_HANDLE_VALUE )
return 0;

Process32First(processesSnapshot, &processInfo);
if ( !processName.compare(processInfo.szExeFile) )
{
CloseHandle(processesSnapshot);
return processInfo.th32ProcessID;
}

while ( Process32Next(processesSnapshot, &processInfo) )
{
if ( !processName.compare(processInfo.szExeFile) )
{
CloseHandle(processesSnapshot);
return processInfo.th32ProcessID;
}
}

CloseHandle(processesSnapshot);
return 0;
}


[TKC]Symantic

  • The Indifferent Character
  • The Central Committee
  • Heckler
  • *
  • Posts: 1647
  • I can has personal text?
    • View Profile
Re: C++ Auto-Change memory
« Reply #1 on: June 26, 2012, 09:21:02 pm »
system("PAUSE") is a bad habit, use something like "wait for character input" for a pause, its much cleaner and less memory intensive.

define my_cheat as a boolean statement and set it to false

if(GetAsyncKeyState(VK_F10)&1)
  { my_cheat  = !my_cheat }



if(my_cheat)
{
all_my_sexy_functions()
}

This is a hotkey set to f10, not sure what esc key is.

dont copy/paste this exactly, im sure its fked up. you probably need to get a window handle or something
« Last Edit: June 26, 2012, 09:30:19 pm by [TKC]Symantic »
Enjoy your creative game-play, whatever that may include.

bfwlegend

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
Re: C++ Auto-Change memory
« Reply #2 on: June 26, 2012, 09:26:34 pm »
I just need help on changing the strings in the memory

Instead of like 4 byte I need to change it via string and right now I'm not sure on how to do it or if it's possible.


Is DLL injecting better to activate your scripts? If so what code would I use to execVM my own scripts?

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: C++ Auto-Change memory
« Reply #3 on: June 26, 2012, 10:22:39 pm »
Code: [Select]
void stopEnd();

void stopEnd()
{
cin.clear();
cin.ignore(255, '\n');
cin.get();
}

What I always used. Call the function, pause's until it get's an input. Requires IOstream.
"Now we are going to watch my boys do it" - Joopig

s0beit

  • Relentless Teamkiller
  • **
  • Posts: 94
    • View Profile
Re: C++ Auto-Change memory
« Reply #4 on: June 26, 2012, 10:59:07 pm »
Is DLL injecting better to activate your scripts? If so what code would I use to execVM my own scripts?

It doesn't matter if you're using cheat engine or your own hack if you're modifying the scripts in memory. They're the same thing in effect.

bfwlegend

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
Re: C++ Auto-Change memory
« Reply #5 on: June 26, 2012, 11:38:51 pm »
Is DLL injecting better to activate your scripts? If so what code would I use to execVM my own scripts?

It doesn't matter if you're using cheat engine or your own mod-app if you're modifying the scripts in memory. They're the same thing in effect.
Well I'm also thinking about trying to make a bypass which should be fun considering I have no clue where to start, So I'm probably going to aim towards DLL injection right now

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: C++ Auto-Change memory
« Reply #6 on: June 27, 2012, 02:44:29 am »
GetAsyncKeyState << bad idea as it uses a buffer with delayed strokes  , there are better ways

i think i use an alternative to it in one of those trainer source codes i posted a while back ( lol at a while i bet it was 2 or 3 years ago how time fly's :smile ) , if its still here after the forum upgrade grab it , some nice stuff in there curtasy of ya freindly neighbour hood mrmedic.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

bfwlegend

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
Re: C++ Auto-Change memory
« Reply #7 on: June 27, 2012, 02:50:07 am »
GetAsyncKeyState << bad idea as it uses a buffer with delayed strokes  , there are better ways

i think i use an alternative to it in one of those trainer source codes i posted a while back ( lol at a while i bet it was 2 or 3 years ago how time fly's :smile ) , if its still here after the forum upgrade grab it , some nice stuff in there curtasy of ya freindly neighbour hood spidermedic.

Thanks for this, I never really wanted to get into C++ I know PHP, VB.net, C#, and some other languages and never really wanted to get into C++ but this forum and mostly you made me learn a lot about C++ and gave me something to make, thanks :)

Also I bought your hack and it works great and I was wondering if you could PM me your skype or something because I don't know if you'd be willing to but I'd like to learn more about bypassing BE, I understand if you can't though!

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: C++ Auto-Change memory
« Reply #8 on: June 27, 2012, 02:52:10 am »
GetAsyncKeyState << bad idea as it uses a buffer with delayed strokes  , there are better ways

i think i use an alternative to it in one of those trainer source codes i posted a while back ( lol at a while i bet it was 2 or 3 years ago how time fly's :smile ) , if its still here after the forum upgrade grab it , some nice stuff in there curtasy of ya freindly neighbour hood spidermedic.

Thanks for this, I never really wanted to get into C++ I know PHP, VB.net, C#, and some other languages and never really wanted to get into C++ but this forum and mostly you made me learn a lot about C++ and gave me something to make, thanks :)

Also I bought your mod-app and it works great and I was wondering if you could PM me your skype or something because I don't know if you'd be willing to but I'd like to learn more about bypassing BE, I understand if you can't though!

simple to bypass battleye , delete the battleye dll , bypassed.  ( thats a cheaters joke you anticheaters wont understand it )   :smile  :icon_thumbsup
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

ZOldDude

  • The Unknown Rank!
  • Administrator
  • MasstKer
  • *
  • Posts: 20874
  • Old School TKC
    • View Profile
    • Admin
Re: C++ Auto-Change memory
« Reply #9 on: June 27, 2012, 07:44:36 am »
Quote
simple to bypass battleye , delete the battleye dll , bypassed.  ( thats a cheaters joke you anticheaters wont understand it )

I leave everything as it was meant to be and just tell it "Everything is OK,now piss off".

*While we crash and burn, small, low tech, agrarian societies such as the Hmong in the mountains of Laos will continue on without so much as blinking an eye.*

SYLDude

  • Cheater Apprentice
  • *
  • Posts: 12
    • View Profile
Re: C++ Auto-Change memory
« Reply #10 on: June 28, 2012, 07:15:03 pm »

simple to bypass battleye , delete the battleye dll , bypassed.  ( thats a cheaters joke you anticheaters wont understand it )   :smile  :icon_thumbsup



i actually wondered if this would work :( i figured it didnt, but it'd sure be fucking awesome if it did!

c5

  • Online Villain
  • ***
  • Posts: 174
    • View Profile
Re: C++ Auto-Change memory
« Reply #11 on: June 28, 2012, 07:38:57 pm »

simple to bypass battleye , delete the battleye dll , bypassed.  ( thats a cheaters joke you anticheaters wont understand it )   :smile  :icon_thumbsup



i actually wondered if this would work :( i figured it didnt, but it'd sure be fucking awesome if it did!

"Normally, an application that was linked against a DLL?s import library will fail to start if the DLL cannot be found, because Windows will not run the application unless it can find all of the DLLs that the application may need. However an application may be linked against an import library to allow delayed loading of the dynamic library." - Wikipedia  :icon_shifty

Sorry for going offtopic... Someone answer his question, how to apply a string to a memory using writeprocessmemory  :smile
« Last Edit: June 28, 2012, 08:10:59 pm by c5 »
How do I makes hax?!

bouncer123

  • Klass Klown
  • ***
  • Posts: 349
    • View Profile
Re: C++ Auto-Change memory
« Reply #12 on: June 28, 2012, 08:47:44 pm »

simple to bypass battleye , delete the battleye dll , bypassed.  ( thats a cheaters joke you anticheaters wont understand it )   :smile  :icon_thumbsup



i actually wondered if this would work :( i figured it didnt, but it'd sure be fucking awesome if it did!

did you know that this actually worked for punkbuster back in the day? in the early days of battlefield you could actually block the pb dll from loading and the server didnt kick you.  :icon_laugh i kid you not.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: C++ Auto-Change memory
« Reply #13 on: June 28, 2012, 09:22:35 pm »

simple to bypass battleye , delete the battleye dll , bypassed.  ( thats a cheaters joke you anticheaters wont understand it )   :smile  :icon_thumbsup



i actually wondered if this would work :( i figured it didnt, but it'd sure be fucking awesome if it did!

did you know that this actually worked for punkbuster back in the day? in the early days of battlefield you could actually block the pb dll from loading and the server didnt kick you.  :icon_laugh i kid you not.

lol just shows you how shit anti cheats allways are.

i remember you could do that with some others renaming the dll worked as well.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

MrCamo

  • Village Idiot of TKC
  • Quarantine
  • Heckler Apprentice
  • ****
  • Posts: 1456
  • Banned from TKC forever
    • View Profile
Re: C++ Auto-Change memory
« Reply #14 on: June 29, 2016, 11:57:25 pm »
using namespace std;
...
std::wcout << "Enter ArmA2OA's process name, usally ""ArmA2OA.exe"": ";
std::getline(std::wcin, processName);
std::cout << "Look for the Arma2OA window now..." << endl; ...


Where is the logic?
I remain moderatedBanned from TKC forever as I keep posting porn 2 piss off the Staff.
https://www.youtube.com/watch?v=BRzlha-tZS4