 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sat Jul 04, 2009 4:03 pm Post subject: [C++] Window not recieving? |
|
|
I'll keep this short.
When you type "hidden test" in Pinball, you can move the ball with your mouse.
I'm making a trainer to get a feel for basic memory editing and wanted to add this as an extra feature.
How can I simulate typing hidden test in pinball with c++?
I have already tried:
| Code: | char* SendText = "hidden test";
for( int i = 0; i <= strlen( SendText ); i++ )
PostMessage( HWND, WM_CHAR, SendText[i], 0 ); |
| Code: | PostMessage(hWnd, WM_KEYDOWN, 0, 0x48); //h down
PostMessage(hWnd, WM_KEYUP, 0, 0x48); //h up
//used this to type out all the other letters too
|
| Code: | SendMessage(hWnd, WMCHAR, 0 , (long)"hidden test");
//might have typed this wrong..forgot the exact parameter order but you get the idea |
| Code: | SendString(hWnd, TEXT("hidden test"), 50);
//(This is Irwin's function)
VOID SendString(__in HWND hWnd, __in_z LPCTSTR lpcszMessage, __in_opt UINT uSleep = 0)
{
for (int i = 0; i < lstrlen(lpcszMessage); i++, Sleep(uSleep))
SendMessage(hWnd, WM_CHAR, lpcszMessage[i], 0);
} |
Running out of idea here. Can I get some input?
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Jul 04, 2009 4:27 pm Post subject: |
|
|
| Or you can just do it the easy way and find the address in about 4 seconds.
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sat Jul 04, 2009 5:07 pm Post subject: |
|
|
O mighty slovach, how might I do that?
I can find addresses that have logic behind them...like ammo, hp, etc.
But how would I find it?
You can't turn it off without closing the game, so I don't know how to narrow down the addresses in this case.
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Jul 04, 2009 5:16 pm Post subject: |
|
|
I'm pretty sure you can disable it if I remember right?
This is also why you have the other search functions in CE. Search unknown, search changed, etc, etc.
Anyway, it's probably just a simple disabled, enabled deal (0 and 1 respectively).
|
|
| Back to top |
|
 |
Cheat Engine User Something epic
Reputation: 60
Joined: 22 Jun 2007 Posts: 2071
|
Posted: Sat Jul 04, 2009 5:48 pm Post subject: |
|
|
| slovach wrote: | I'm pretty sure you can disable it if I remember right?
This is also why you have the other search functions in CE. Search unknown, search changed, etc, etc.
Anyway, it's probably just a simple disabled, enabled deal (0 and 1 respectively). | You can also restart the application and find it again.. Anyway, I was bored and got meself the address: 01024FF8
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sun Jul 05, 2009 4:02 pm Post subject: |
|
|
Thanks Holly, that's the right address.
New problem. I believe I have gotten correct privileges to write to pinball's memory but it doesn't seem to be working.
| Code: | void __fastcall TForm1::CheckBox2Click(TObject *Sender)
{
if( SetDebugPrivileges() != 0 )
return;
else {
HWND hWnd = FindWindow(0, "3D Pinball for Windows - Space Cadet");
HANDLE hProcess = 0;
DWORD PID = 0;
GetWindowThreadProcessId( hWnd, &PID );
hProcess = OpenProcess( PROCESS_ALL_ACCESS, false, PID );
VirtualProtectEx( hProcess, (LPVOID)(DWORD)0x01000000, 0x5, PAGE_EXECUTE_READWRITE, NULL );
BYTE haxOn[2] = { 0x01, 0x00 };
if(CheckBox3->Checked == true)
WriteProcessMemory( hProcess, (LPVOID)(DWORD)0x01024FF8, &haxOn, 2, NULL );
} //closes the else
} //closes the whole functon |
Yes, this is Borland C++ Builder. I am starting to think the code is right but the code proprietary to Borland is wrong ( the CheckBox3->Checked == true; part). Can anyone confirm this?
Edit: Ok wtf is it just me or is this code full of random "}"'s and stuff.
I dont know why I cant paste my code without it turning into symbols and stuff...so heres the code at pastebin if anyone has the time. http://pastebin.com/m2dcb416a
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Jul 05, 2009 5:16 pm Post subject: |
|
|
1. Step through it in the debugger
2. Throw some GetLastError() after your calls.
|
|
| Back to top |
|
 |
|
|
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
|
|