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 pointer & c++
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
thearing
Newbie cheater
Reputation: 0

Joined: 23 Nov 2009
Posts: 11

PostPosted: Wed Dec 02, 2009 3:56 pm    Post subject: Help pointer & c++ Reply with quote

Hello! I am from Argentina... I have a pointer of Paintall Winows... To edit the score... Look:



So i put in my code c++:


But not work with this address, but if i put the dinamic address, it work.

Can somebody help me? Thanks!

EDIT: I read in the forum that i need a offset... but look:

Have i a offset?

EDIT2: Mod or admin can you edit the images? Add http in the links
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Dec 02, 2009 4:22 pm    Post subject: Reply with quote

well doesn't appear like your pointer has an offset there so it's not necessary. however it is necessary to dereference 'direccion' by giving it a type DWORD* and then dereferencing that. eg.

Code:
DWORD* dynamicAddress = *(DWORD*)0x0x00C1AE9A;
Back to top
View user's profile Send private message
thearing
Newbie cheater
Reputation: 0

Joined: 23 Nov 2009
Posts: 11

PostPosted: Wed Dec 02, 2009 4:33 pm    Post subject: Reply with quote

Thanks for reply!

I put:

DWORD* direccion = *(DWORD*)0x00C1AE9A;
const long nuevaPuntuacion=999999;

But:
In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':

And

invalid conversion from `long unsigned int' to `DWORD*'
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Dec 02, 2009 4:39 pm    Post subject: Reply with quote

delete the initial declaration of direccion
Back to top
View user's profile Send private message
Cpt.Slow
Cheater
Reputation: 0

Joined: 02 Dec 2009
Posts: 28

PostPosted: Wed Dec 02, 2009 4:43 pm    Post subject: Reply with quote

You'll be changing the data in your own process if you do it like that. Unless this is a DLL.
_________________
Now let's cause some fucking havoc.
Back to top
View user's profile Send private message
thearing
Newbie cheater
Reputation: 0

Joined: 23 Nov 2009
Posts: 11

PostPosted: Wed Dec 02, 2009 4:48 pm    Post subject: Reply with quote

No, look...

Code:
#include<windows.h>
#include<stdio.h>


int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)

{
DWORD* direccion = *(DWORD*)0x00C1AE9A;
const long nuevaPuntuacion=999999;

long viejaPuntuacion;
char mensaje[256];


HWND hwnd;
DWORD pid;
HANDLE phandle;


hwnd = FindWindow(NULL, "3D Pinball Windows: cadete espacial");
if(!hwnd)
{
MessageBox(NULL, "No se esta ejecutando Pinball", "Error", MB_OK | MB_ICONERROR);
return -1;
}
GetWindowThreadProcessId(hwnd, &pid);
phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
if(!phandle)
{
MessageBox(NULL, "Error al obtener el handle del proceso", "Error", MB_OK | MB_ICONERROR);
return -2;
}

ReadProcessMemory(phandle,(LPVOID)direccion,(LPVOID)&viejaPuntuacion,sizeof(viejaPuntuacion),0);
WriteProcessMemory(phandle, (LPVOID)direccion, (LPVOID) &nuevaPuntuacion, sizeof(nuevaPuntuacion), 0);

sprintf(mensaje, "Tu puntuacion ha cambiado de %ld a %ld", viejaPuntuacion, nuevaPuntuacion);

MessageBox(NULL, mensaje, "Listo", MB_OK);

return 0;
}


but the error is: invalid conversion from `long unsigned int' to `DWORD*'


Thanks for reply!
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 Dec 02, 2009 5:05 pm    Post subject: Reply with quote

Code:
DWORD* direccion = *(DWORD*)0x00C1AE9A;


is probably going to blow up in your face if it even somehow compiled.
even if you had it correct, you'd just be reading garbage.

delete this.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Dec 02, 2009 5:07 pm    Post subject: Reply with quote

oh lol my bad thought you were in a dll. okay read the 4 bytes at that address with RPM. that will be a pointer to your dynamic address
Back to top
View user's profile Send private message
thearing
Newbie cheater
Reputation: 0

Joined: 23 Nov 2009
Posts: 11

PostPosted: Wed Dec 02, 2009 5:18 pm    Post subject: Reply with quote

I canīt understand.. i am from argentina...There is no problem, already I will find the return.
Back to top
View user's profile Send private message
Cpt.Slow
Cheater
Reputation: 0

Joined: 02 Dec 2009
Posts: 28

PostPosted: Wed Dec 02, 2009 5:29 pm    Post subject: Reply with quote

Read the value in that address with ReadProcessMemory. Add whatever offset you have to that value and then you have the address to use Read/WriteProcessMemory on.
_________________
Now let's cause some fucking havoc.
Back to top
View user's profile Send private message
thearing
Newbie cheater
Reputation: 0

Joined: 23 Nov 2009
Posts: 11

PostPosted: Wed Dec 02, 2009 7:20 pm    Post subject: Reply with quote

I did!
The error was:
Code:
DWORD* direccion = *(DWORD*)0x00C1AE9A;


And now work:
Code:
DWORD* direccion = (DWORD*)0x00C1AEBA;



Now i have another problem... The dinamic address of a game... Is a IP, this ip connect with the server game. I want edit this ip with writeprocessmemory but i canīt see the pointer becouse the dinamic address (the IP), isenīt change (the value of IP)

Can somebody help me? Thanks!

Sorry for my english i am from argentina.
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Thu Dec 03, 2009 1:11 pm    Post subject: Reply with quote

Slugsnack wrote:
well doesn't appear like your pointer has an offset there so it's not necessary. however it is necessary to dereference 'direccion' by giving it a type DWORD* and then dereferencing that. eg.

Code:
DWORD* dynamicAddress = *(DWORD*)0x0x00C1AE9A;


it could have an offset, it could be hiden.

u could try or the pointer works without an offset by restarting the prgram, if it still has the value u want, its good, otherwise there is an offset which is harder to find,

and u could google for, Readprocessmemory and wirteprocessmemory
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Dec 03, 2009 6:46 pm    Post subject: Reply with quote

NoMercy wrote:
Slugsnack wrote:
well doesn't appear like your pointer has an offset there so it's not necessary. however it is necessary to dereference 'direccion' by giving it a type DWORD* and then dereferencing that. eg.

Code:
DWORD* dynamicAddress = *(DWORD*)0x0x00C1AE9A;


it could have an offset, it could be hiden.

u could try or the pointer works without an offset by restarting the prgram, if it still has the value u want, its good, otherwise there is an offset which is harder to find,

and u could google for, Readprocessmemory and wirteprocessmemory

There is no offset. You can tell from his cheat table
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sat Dec 05, 2009 4:05 am    Post subject: Reply with quote

Slugsnack wrote:
NoMercy wrote:
Slugsnack wrote:
well doesn't appear like your pointer has an offset there so it's not necessary. however it is necessary to dereference 'direccion' by giving it a type DWORD* and then dereferencing that. eg.

Code:
DWORD* dynamicAddress = *(DWORD*)0x0x00C1AE9A;


it could have an offset, it could be hiden.

u could try or the pointer works without an offset by restarting the prgram, if it still has the value u want, its good, otherwise there is an offset which is harder to find,

and u could google for, Readprocessmemory and wirteprocessmemory

There is no offset. You can tell from his cheat table


in this case, yes
exuse me
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Sun Dec 06, 2009 12:49 pm    Post subject: Reply with quote

mov [eax],ecx can be rewritten as
mov [eax+0000000000000000000000000000000000000000],ecx

I'd say the offset is 0000000000000000000000000000000000000000

so, read the 4 byte value at the given address
apply the offset (0000000000000000000000000000000000000000)
read the address this new value represents
and you have the final address

also,because 0x00C1AE9A isn't shown as green, I doubt it's a static address. But with some luck it'll stay the same.( It's low enough to get the same address each time)

_________________
Tools give you results. Knowledge gives you control.

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 -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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