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]Adresses with 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
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Tue Feb 08, 2011 5:31 am    Post subject: [Help]Adresses with C++ Reply with quote

Im doing a bot and Im having some trouble with adresses, the adress that I have to use is in allocated memory so everytime I run the game, I have to search the adress, open my bot and put the adress. How can I do a pointer to direct acess? Its really annoying have to search everytime.
For temporaly Im using this:

Quote:

LPVOID lpAddress2 = reinterpret_cast< LPVOID >( reinterpret_cast< DWORD >( lpAddress ) + 32 );


to alocate the pointer. But I still have to search for adress. Can someone help me with this problem.
Thanks.
Back to top
View user's profile Send private message
zile
Advanced Cheater
Reputation: 0

Joined: 11 Jul 2009
Posts: 75

PostPosted: Tue Feb 08, 2011 7:29 am    Post subject: Reply with quote

find the pointer using ce's poitner scanner first... then once u get one that points to your address everytime u run the game, put that in ur bot

i dont know why you are using that line btw
Back to top
View user's profile Send private message
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Tue Feb 08, 2011 10:27 am    Post subject: Reply with quote

I found the pointer, how can I implement in c++ now?
In my bot the adress was like this

LPCVOID lpAddress = (LPCVOID)0x26EE9DA4;

How can I exchange the adress for the pointer?
Thanks ^^



pointer.jpg
 Description:
CE
 Filesize:  66.26 KB
 Viewed:  11746 Time(s)

pointer.jpg


Back to top
View user's profile Send private message
zirak
Expert Cheater
Reputation: 1

Joined: 15 Jun 2006
Posts: 121
Location: In the sewers

PostPosted: Wed Feb 09, 2011 1:26 am    Post subject: Reply with quote

Code:
      DWORD *level1 = (DWORD*)(*(DWORD*)0xB5CFF8 + 0x10);
      DWORD *level1Chk = (DWORD*)level1;
      if(level1Chk != 0x00000000 && *level1Chk != 0x00000000)
      {
         DWORD *level2 = (DWORD*)(*(DWORD*)level1 + 0x4C);
         *(float*)level2 = set;
      }


That would do something like this in cheatengine:
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Wed Feb 09, 2011 2:12 am    Post subject: Reply with quote

DWORD base = 0x // I don't know...
DWORD Offset1 = 0x48c;
DWORD Offset2 = 0x19;
DWORD Offset3 = 0x10;
DWORD Offset4 = 0x14c4;

then calculate the pointer ouut of it:)
Back to top
View user's profile Send private message
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Wed Feb 09, 2011 8:29 pm    Post subject: Reply with quote

I tried, but something is wrong:

Code:
DWORD Base = 0x006FC0FC;
DWORD Offset1 = 0x44;
DWORD Offset2 = 0x14;
DWORD Offset3 = 0x34;
DWORD Offset4 = 0x8;
DWORD Offset5 = 0x98;
DWORD final = Base  + Offset1 + Offset2 + Offset3 + Offset4 + Offset5;


In CE this point goes to P->006A19F4
When I do a printf in my program:

Code:
printf("Final Adress: %p\n",final);


I got the adress final = 006FC228
What is missing?
Sorry about so many questions, but its kinda hard for me to learn about this pointers and offset.
Thanks to trying teach me Smile
Very Happy Very Happy



pointer2.jpg
 Description:
Pointer Calc
 Filesize:  86.42 KB
 Viewed:  11621 Time(s)

pointer2.jpg


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

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

PostPosted: Wed Feb 09, 2011 8:58 pm    Post subject: Reply with quote

like most people you're forgetting to add the base address of game.dll to the base 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
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Wed Feb 09, 2011 9:27 pm    Post subject: Reply with quote

Sad
I thouht the base adress was only 0x006FC0FC

Im trying to find the dll base adress with this:

Code:
DWORD Address= (DWORD)GetModuleHandle ("DanceGame.dll");
printf("Adress: %p\n",Address);


Why the result is 0 ?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Feb 09, 2011 11:21 pm    Post subject: Reply with quote

First things first since you never mentioned it, are you injecting a dll to do your hacking? Or are you writing an external application to do it?
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Thu Feb 10, 2011 6:19 am    Post subject: Reply with quote

external application in c++
EDIT: I tried View -> Enumerate DLL's and Symbols.
030b0000 is the base adress?



dll.jpg
 Description:
DLL
 Filesize:  219.37 KB
 Viewed:  11551 Time(s)

dll.jpg


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

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Feb 10, 2011 7:52 am    Post subject: Reply with quote

if you're using an external app you are accessing a different view of the memory. each process has its own virtualised memory space. it believes it has a space from 00000000-7fffffff which is mapped to physical memory by the OS.

to access another application's virtual memory space you can either map your code into it (dll injection) or use the functions provided by windows to interface with its memory (readprocessmemory, etc.)
Back to top
View user's profile Send private message
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Thu Feb 10, 2011 8:26 am    Post subject: Reply with quote

Slugsnack wrote:
if you're using an external app you are accessing a different view of the memory. each process has its own virtualised memory space. it believes it has a space from 00000000-7fffffff which is mapped to physical memory by the OS.

to access another application's virtual memory space you can either map your code into it (dll injection) or use the functions provided by windows to interface with its memory (readprocessmemory, etc.)


I know I prefer to use windows interface, the problem Im having is with multi level pointers, I want to use them in the c++ aplication and dunno how.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Feb 10, 2011 9:54 am    Post subject: Reply with quote

toolhelp32snapshot and module32first/module32next to get the base address of a dll

also DWORD final = Base + Offset1 + Offset2 + Offset3 + Offset4 + Offset5; is wrong
you need to dereference each address again

do something like:
DWORD a;
a=Base;
a=*(PDWORD)a;
a=a+offset1;
a=*(PDWORD)a;
a=a+offset2;
a=*(PDWORD)a;
a=a+offset3;
a=*(PDWORD)a;
a=a+offset4;
final=a;

_________________
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
xNef
Cheater
Reputation: 0

Joined: 23 Jan 2011
Posts: 25

PostPosted: Thu Feb 10, 2011 8:09 pm    Post subject: Reply with quote

I tried you code, but the line :

Code:
a=*(PDWORD)a;


crash the program.

I took a printscreen from all thing I do for the pointer, in my program say that base adress is 10000000 and im MHS say different. :S
And my program still dont point to the right adress.



BaseAdress.jpg
 Description:
BaseAdress
 Filesize:  271.55 KB
 Viewed:  11467 Time(s)

BaseAdress.jpg


Back to top
View user's profile Send private message
zirak
Expert Cheater
Reputation: 1

Joined: 15 Jun 2006
Posts: 121
Location: In the sewers

PostPosted: Thu Feb 10, 2011 8:26 pm    Post subject: Reply with quote

Code:
   DWORD *level1 = (DWORD*)(*(DWORD*)baseaddress+ 0x44);
   DWORD *level2 = (DWORD*)(*(DWORD*)level1 + 0x14);
   DWORD *level3 = (DWORD*)(*(DWORD*)level2 + 0x34);
   DWORD *level4 = (DWORD*)(*(DWORD*)level3 + 0x08);
   DWORD *level5 = (DWORD*)(*(DWORD*)level4 + 0x98);
   *(DWORD*)level5 = set;


Just put in your base address and you're ready to set the pointed value
Back to top
View user's profile Send private message
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