Hi, suche jemand der sich halbwegs mit c++ in verbindung mit cheat engin auskennt, wird hier nicht so leicht zu erklären sein, darum wärs nett wenn ihr mich kurz bei skype adden könntet :hirisis
//HackMe.cpp
#include <iostream>
int main(void){
int Holz=100;
for(;;){
std::cout<<"Sie haben momentan"<<Holz<<"Holz\n";
//Damit wir nicht mühsam suchen müssen
std::cout<<"Die Adresse,die den Betrag an Holz haelt:"<<&Holz<<"\n";
getchar();
}
}
//1.
#include <windows.h>
//2.
#define Holz_Adress 0x18fbdc
//3.
void RewriteValues(){
int *HolzPtr;
//Adresse übergeben
HolzPtr=(int *)Holz_Adress;
//Dereferenzieren
*HolzPtr=2000;
}
//4.
BOOL WINAPI DllMain(HINSTANCE hinstDll,DWORD Reason,LPVOID Reserved){
switch(Reason){
//5.
case DLL_PROCESS_ATTACH:
RewriteValues();
break;
//6.
case DLL_PROCESS_DETACH:
MessageBox(NULL,"DLL Hack detached","Heyho",0);
break;
}
return TRUE;
}
kannst du mir da ein beispiel geben? sry bin noch anfänger^^Quote:
openprocess() writeprocessmemory() createremotethread() fertig.
Process::CurrentProcess.GrantDebugPrivileges();
//Dll laden:
auto dllPath = "C:\\Foo\\bar.dll";
auto process = Process::findFirstProcess("Foo.exe");
auto pathAddr = process.allocate(dllPath.Length);
process.write(pathAddr, dllPath);
auto thread = process.createThread(LoadLibray, pathAddr);
thread.waitForSingleObject();
//Exportierte Funktion laden (weil man die Finger von DllMain zu lassen hat):
auto findModule = [&]() -> Module
{
foreach(auto module in process.modules)
if(module.getPath() == dllPath)
return module;
throw Exception("Can not find module, injection failed!");
};
auto module = findModule();
auto myMain = module.getProcAddress("MyMain");
//Exportierte Funktion aufrufen:
thread = process.createThread(myMain);
thread.waitForSingleObject();
#include <Windows.h>
extern "C" void __declspec(dllexport) MyMain()
{
MessageBox(nullptr, "Im inside your app!", nullptr, MB_OK);
}
#include <iostream>
#include <Windows.h>
using namespace std;
int main ()
{
while (1==1)
{
int newValue = 20000;
char carray[80];
cin.getline ( carray, sizeof(carray) );
cout << carray;
HWND hWnd = FindWindow(0, carray);
if (hWnd == 0) {
cerr << "Cannot find window." << endl;
} else {
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
if (!hProc) {
cerr << "Cannot open process." << endl;
}else{
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x0037A674, &newValue, (DWORD)sizeof(newValue), NULL);
if (isSuccessful > 0) {
clog << "Process memory written." << endl;
}
else{
cerr <<"Cannot write process memory." << endl;
}
CloseHandle(hProc);
}
}
}
return 0;
}
#include <iostream>
#include <string>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
using namespace std;
int main( void )
{
HWND l_hwnd;
string l_target;
getline(cin, l_target);
l_hwnd = FindWindow(NULL, l_target.c_str());
if (!l_hwnd)
{
std::cout << "could not find window\n";
getchar();
return 1;
}
std::cout << "found window\n";
CloseWindow(l_hwnd); // zur kontrolle
getchar();
return 0;
}