Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help, WriteProcessMemory c++ 6.

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Wed Oct 01, 2008 1:37 pm    Post subject: Help, WriteProcessMemory c++ 6. Reply with quote

I'm trying to use this code, but i get an error,

WriteProcessMemory(hProcess, (LPVOID)0x01002FF5, &HaloD;ToBeWritten, Newdatasize, 0);


HaloD=Dword

Code:

C:\Halo Trial Trainer\Halo Trial TrainerDlg.cpp(196) : error C2143: syntax error : missing ')' before ';'
C:\Halo Trial Trainer\Halo Trial TrainerDlg.cpp(196) : error C2660: 'WriteProcessMemory' : function does not take 3 parameters
C:\Halo Trial Trainer\Halo Trial TrainerDlg.cpp(196) : error C2059: syntax error : ')'


help?
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Wed Oct 01, 2008 1:41 pm    Post subject: Reply with quote

Code:
&HaloD;

change to
Code:
&HaloD,

_________________
Gone
Back to top
View user's profile Send private message
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Wed Oct 01, 2008 1:48 pm    Post subject: Reply with quote

C:\Halo Trial Trainer\Halo Trial TrainerDlg.cpp(196) : error C2660: 'WriteProcessMemory' : function does not take 6 parameters


heres the whole code i use

Code:

void OpenMem()
{
unsigned long PID; // We need this now to store the PID.
    HWND hWindow=FindWindow(NULL, "MineSweeper");
    CreateRemoteThread(hWindow, NULL, 0, 0, 0, NULL, NULL);
   GetWindowThreadProcessId(hWindow, &amp);PID;
    hProcess=OpenProcess(PROCESS_ALL_ACCESS, TRUE, PID);
}




void CHaloTrialTrainerDlg::OnAllSnipers()
{
OpenMem();
    DWORD ToBeWritten[]={0x90};
    DWORD Newdatasize=sizeof(ToBeWritten);
    WriteProcessMemory(hProcess, (LPVOID)0x01002FF5, &amp,ToBeWritten, Newdatasize, 0);

}

Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Oct 01, 2008 1:57 pm    Post subject: Reply with quote

How about you actually read the errors?

http://msdn.microsoft.com/en-us/library/ms681674(VS.85).aspx

BOOL WINAPI WriteProcessMemory(
__in HANDLE hProcess,
__in LPVOID lpBaseAddress,
__in LPCVOID lpBuffer,
__in SIZE_T nSize,
__out SIZE_T *lpNumberOfBytesWritten
);
Back to top
View user's profile Send private message
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Wed Oct 01, 2008 2:00 pm    Post subject: Reply with quote

I did, but im not that good in c++, So i thought the code would work by itself, but im going to vc++.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Oct 01, 2008 2:11 pm    Post subject: Reply with quote

The code won't change even if you go to VC++ Rolling Eyes
Your attitude sucks, Your Code doesn't even make sense Rolling Eyes

Go learn the basics before you try something obviously way out of your reach.

_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Oct 01, 2008 2:15 pm    Post subject: Reply with quote

You shouldn't copy and paste from wordpress or w/e. You get funky characters. I really need to edit my blog =[.

Last edited by Noz3001 on Wed Oct 01, 2008 2:24 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Wed Oct 01, 2008 2:23 pm    Post subject: Reply with quote

lurc wrote:
The code won't change even if you go to VC++ :roll:
Your attitude sucks, Your Code doesn't even make sense :roll:

Go learn the basics before you try something obviously way out of your reach.

You took the words right out of my mouth.

_________________
Gone
Back to top
View user's profile Send private message
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Wed Oct 01, 2008 2:51 pm    Post subject: Reply with quote

I never quit on c++ 6. right now, i just have a tut on how to do it in vC++, so i'm going to try that o.o
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Thu Oct 02, 2008 4:25 am    Post subject: Reply with quote

Code:

BOOL WriteMemory(HANDLE Handle, DWORD Address, BTYE bBuffer, DWORD dwSize)
{
   DWORD TempValue;
   return WriteProcessMemory(Handle, (VOID*)Address, LPVOID(&bBuffer), dwSize, &TempValue);
}

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Oct 02, 2008 9:14 am    Post subject: Reply with quote

x0r wrote:
Just quit, this guy won't learn. slovach, lock this thread.


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites