help on Writeprocessmemory

09/27/2009 10:39 bogiman789#1
#include <Windows.h>
#include <iostream>

using namespace std;

#define EngineUpgrade_Addr 0x2F7EDDC8
#define EngineUpgrade_Value 1000
const SIZE_T EngineUpgrade_Size = sizeof(EngineUpgrade_Value);
SIZE_T EngineUpgrade_Sent = 0;

bool AIONClient()
{
HWND WindowHandle;
DWORD ProcessId;
HANDLE ProcessHandle;

if(!(WindowHandle = FindWindow(NULL,"AION Client")))
cout<<"AION Client"<<endl;

while(!WindowHandle)
{
Sleep(200);
WindowHandle = FindWindow(NULL,"AION Client");
}
GetWindowThreadProcessId(WindowHandle,&ProcessId);
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS,0,ProcessId);

cout<<"AION.bin"<<endl;

// זה מנסה לקרוא מהכתובת
LPVOID upgradelevel;
SIZE_T bytesgot;
ReadProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,&upgradelevel ,4 ,&bytesgot);
printf("Getting upgrade info... \n");
printf("Healthe Point: %i",upgradelevel);
printf("\nBytes got: %i",bytesgot);

// זה כותב לכתובת

while(1)
{
WriteProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,(LPCVOID)EngineUpgrade_Value ,EngineUpgrade_Size ,&EngineUpgrade_Sent);
Sleep(50);
}
return true;
}


if you can please help me i new on it ,and i try to change the value of 0x2F7EDDC8 to 1000... did i well?? if not what is the outer way???

the error that i get: [Linker error] undefined reference to `WinMain@16'
09/27/2009 11:11 Akorn#2
Do you only Copy & Paste this?
You have no main function and you use the C++ output function cout and the C output function printf in the same project.

PHP Code:
#include <Windows.h>
#include <stdio.h>
#define EngineUpgrade_Addr 0x2F7EDDC8
#define EngineUpgrade_Value 1000
const SIZE_T EngineUpgrade_Size sizeof(EngineUpgrade_Value);
SIZE_T EngineUpgrade_Sent 0;

int main()
{
HWND WindowHandle;
DWORD ProcessId;
HANDLE ProcessHandle;

if(!(
WindowHandle FindWindow(NULL,"AION Client")))
printf("AION Client");

while(!
WindowHandle)
{
Sleep(200);
WindowHandle FindWindow(NULL,"AION Client");
}
GetWindowThreadProcessId(WindowHandle,&ProcessId);
ProcessHandle OpenProcess(PROCESS_ALL_ACCESS,0,ProcessId);

printf("AION.bin");

// זה מנסה לקרוא מהכתובת
LPVOID upgradelevel;
SIZE_T bytesgot;
ReadProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,&upgradelevel ,,&bytesgot);
printf("Getting upgrade info... \n");
printf("Healthe Point: %i",upgradelevel);
printf("\nBytes got: %i",bytesgot);

// זה כותב לכתובת

while(1)
{
WriteProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,(LPCVOID)EngineUpgrade_Value ,EngineUpgrade_Size ,&EngineUpgrade_Sent);
Sleep(50);
}
return 
0;

09/27/2009 11:28 bogiman789#3
i fix it now its....
///////////////////////
#include <Windows.h>
#include <iostream>

using namespace std;
int main;
#define EngineUpgrade_Addr 0x2F7EDDC8
#define EngineUpgrade_Value 1000
const SIZE_T EngineUpgrade_Size = sizeof(EngineUpgrade_Value);
SIZE_T EngineUpgrade_Sent = 0;

bool AIONClient()
{
HWND WindowHandle;
DWORD ProcessId;
HANDLE ProcessHandle;

if(!(WindowHandle = FindWindow(NULL,"AION Client")))
cout<<"AION Client"<<endl;

while(!WindowHandle)
{
Sleep(200);
WindowHandle = FindWindow(NULL,"AION Client");
}
GetWindowThreadProcessId(WindowHandle,&ProcessId);
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS,0,ProcessId);

cout<<"AION Client"<<endl;

// זה מנסה לקרוא מהכתובת
LPVOID upgradelevel;
SIZE_T bytesgot;
ReadProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,&upgradelevel ,4 ,&bytesgot);
printf("Getting upgrade info... \n");
printf("Healthe Point: %i",upgradelevel);
printf("\nBytes got: %i",bytesgot);

// וזה כותב לכתובת
while(1)
{
WriteProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,(LPVOID)EngineUpgrade_Value ,EngineUpgrade_Size ,&EngineUpgrade_Sent);
Sleep(50);
}
return true;
}
///////////////////////////////////////
its compile but when the cmd(black screen) pop up its have a error on it that say i have to close it or check for problems=\ help plzz
09/27/2009 11:35 bogiman789#4
ohh didnt see you post yourself source hmmm ty you very much ... you realy helped me and if u can help more a little so its be fun ... plz contact me
09/27/2009 11:49 MrSm!th#5
Quote:
Originally Posted by bogiman789 View Post
i fix it now its....
///////////////////////
#include <Windows.h>
#include <iostream>

using namespace std;
int main;
#define EngineUpgrade_Addr 0x2F7EDDC8
#define EngineUpgrade_Value 1000
const SIZE_T EngineUpgrade_Size = sizeof(EngineUpgrade_Value);
SIZE_T EngineUpgrade_Sent = 0;

bool AIONClient()
{
HWND WindowHandle;
DWORD ProcessId;
HANDLE ProcessHandle;

if(!(WindowHandle = FindWindow(NULL,"AION Client")))
cout<<"AION Client"<<endl;

while(!WindowHandle)
{
Sleep(200);
WindowHandle = FindWindow(NULL,"AION Client");
}
GetWindowThreadProcessId(WindowHandle,&ProcessId);
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS,0,ProcessId);

cout<<"AION Client"<<endl;

// זה מנסה לקרוא מהכתובת
LPVOID upgradelevel;
SIZE_T bytesgot;
ReadProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,&upgradelevel ,4 ,&bytesgot);
printf("Getting upgrade info... \n");
printf("Healthe Point: %i",upgradelevel);
printf("\nBytes got: %i",bytesgot);

// וזה כותב לכתובת
while(1)
{
WriteProcessMemory(ProcessHandle ,(void*)EngineUpgrade_Addr ,(LPVOID)EngineUpgrade_Value ,EngineUpgrade_Size ,&EngineUpgrade_Sent);
Sleep(50);
}
return true;
}
///////////////////////////////////////
its compile but when the cmd(black screen) pop up its have a error on it that say i have to close it or check for problems=\ help plzz
:rolleyes: that cant work
you wrote int main;
main isnt a variable xD its a fuction
so int main(){
}
09/27/2009 12:03 bogiman789#6
yes i know i fix it ty you very much hmmm can you help me with the readprocessmemory plz?///
i dont get how to do this can you give me a example?
09/27/2009 14:46 schlurmann#7
Quote:
Originally Posted by bogiman789 View Post
yes i know i fix it ty you very much hmmm can you help me with the readprocessmemory plz?///
i dont get how to do this can you give me a example?
Stop copying and pasting and learn the language if you wanna work with it.
10/07/2009 01:37 wurstbrot123#8
Quote:
Originally Posted by bogiman789 View Post
yes i know i fix it ty you very much hmmm can you help me with the readprocessmemory plz?///
i dont get how to do this can you give me a example?
first of all learn the languade. The forum isnt named "Help with Copy / Paste | stealing code".
10/07/2009 09:35 Bl@ze!#9
After your code compiles you WILL get an Error with 0x2F7EDDC8 This address changes after every Client restart ;) U need to : Game.dll + Hitpoints Adress ;)