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 


More C++ troubles...

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
kkid28
Expert Cheater
Reputation: 0

Joined: 30 Sep 2006
Posts: 110
Location: The only flat part of the planet.

PostPosted: Sun Jan 07, 2007 2:37 pm    Post subject: More C++ troubles... Reply with quote

Ok, I've gotten the program to work using the address I get in CE but when I try to use the pointer it fucks up. Someone please help!

Code:
WriteMemBalls("3D Pinball for Windows - Space Cadet",(unsigned long*)0x01025040+0x146,x);


The function mentioned there sends it to this:
Code:
void WriteMemBalls(char* window, LPCVOID address, int value)
{
       HWND hWnd = FindWindow(0, window);
       DWORD proc_id;
       GetWindowThreadProcessId(hWnd, &proc_id);
       HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
       BYTE newdata[]={value};
       DWORD newdatasize = sizeof(newdata);
       WriteProcessMemory(hProcess, (void*)address, &newdata, newdatasize, 0);
       CloseHandle(hProcess);
}


The line I'm referring to is the 3rd one from the bottom, WriteProcessMemory(etc...)

_________________
Favourites

Click
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25787
Location: The netherlands

PostPosted: Sun Jan 07, 2007 4:22 pm    Post subject: Reply with quote

0x01025040+0x146=0x1025186 , so you'll be writing to address 0x1025186

I think you actually want 0x01025040 as base pointer and the offset to be 0x146, so...

change
Code:

WriteMemBalls("3D Pinball for Windows - Space Cadet",(unsigned long*)0x01025040+0x146,x);

into
Code:

WriteMemBalls("3D Pinball for Windows - Space Cadet",(unsigned long*)0x01025040,0x146,x);


change
Code:

void WriteMemBalls(char* window, LPCVOID address, int value)

into
Code:

void WriteMemBalls(char* window, LPCVOID address, int level0offset, int value)


then change the code of the function to read the address provided by 'address' , increase that value with level0offset, and then writeprocessmemory to the resulting address

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source 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