Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 16:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Read From My Own Address Space

Discussion on Read From My Own Address Space within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
majidemo's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 347
Received Thanks: 1,286
Read From My Own Address Space

I'm trying to read some data from a pointer on my own address space. I got the pointer from CE.

My code is currently:

PHP Code:
HANDLE ExeBaseAddress GetModuleHandleA(0);

DWORD value = *(DWORD*)(*(DWORD*)ExeBaseAddress 0x7198BC 0x70E);

printf("%d\n\n"value); 
But it always returns "0". Why? On CE it gives the right value.

majidemo is offline  
Old 03/15/2016, 01:32   #2



 
Shawak's Avatar
 
elite*gold: 0
The Black Market: 259/0/0
Join Date: Apr 2010
Posts: 10,289
Received Thanks: 3,613
don't know c++ or either internal hacks that good but you may try this:

Code:
DWORD value= ((*(DWORD*)(ExeBaseAddress +0x7198BC)) + 0x70E);
Shawak is offline  
Old 03/15/2016, 07:10   #3

 
elite*gold: 150
Join Date: Apr 2007
Posts: 2,394
Received Thanks: 6,644
why add modulebase ?
try this:

DWORD value = *(DWORD*)(*(DWORD*)0x7198BC + 0x70E);

printf("%d\n\n", value);
wurstbrot123 is offline  
Old 03/15/2016, 08:28   #4


 
Jeoni's Avatar
 
elite*gold: 966
Join Date: Apr 2010
Posts: 1,105
Received Thanks: 681
I would like to quote myself here:
Quote:
Originally Posted by Jeoni View Post
This won't work if you're working in a x64 application.
Why is every *** **** newbie (excuse that word, but it was my experience so far) so obsessed with using DWORD as pointer type? Even the winapi does have something like UINT_PTR. In my opinion it's just bad coding style and shows that the programmer didn't make his own basic thoughts and / or has no idea what he is doing and / or is just C&Ping.
And has anyone seen that the target type is a 2 byte integer? Reading 4 byte may destroy the result by reading 2 byte from another unrelated value. Taking that and the fact that using DWORD as a pointer type is just bad style into account, I would do something like this:
Code:
short value = *(short*)(*(UINT_PTR*)0x7198BC + 0x70E);
Or with native types only:
Code:
short value = *(short*)(*(char**)0x7198BC + 0x70E);
Of course, you can use C++-Casts, if you want to and if you're using "C++".

With best regards
Jeon
Jeoni is offline  
Old 03/16/2016, 14:18   #5



 
+Yazzn's Avatar
 
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
Go C++ or go home.

Code:
#include <cstdint>

std::uintptr_t ptr = *reinterpret_cast<std::uintptr_t *>(0x7198BC);
if (ptr) {
    std::uint16_t value = *reinterpret_cast<std::uint16_t *>(ptr + 0x70E); // or std::int16_t
}
+Yazzn is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
Read one address
09/02/2012 - Kal Online - 10 Replies
hay could some1 give me a hint how to get that work w/o crash? i want to read text value address, when i use this code i am able to take first char of table, but when i change %c to %s my client crash, any hint?
Address Read Inside
06/11/2012 - 12Sky2 - 3 Replies
Anyone Know the new address of this?? if ur willing to share then i press thanks mwahps You will need to update the addresses 36="01261854" ; < = Drop Item ID the ID of the item that is dropped play with it figure this out in CE 37="012618b0" ; < = Item X Coordinate this address will change the coordinate of the item 65=0x0118bfc3 ; < = Characters X Coordinate 66=0x0118bfcb ; < = Characters Y Coordinate
Fehler its not working now error coming saying failed to find the ip address of space
12/22/2011 - DarkOrbit - 0 Replies
was soll ich tuhen alle daten sind richtig eingegeben doch er bricht nach der meldung ab??? its not working now error coming saying failed to find the ip address of space map...
i want read hp address
06/27/2010 - CO2 Programming - 17 Replies
i want read hp address from memory cause i am gone make auto HP can any one help. i tried it but i don't get the address there is no address for the hp :( please help
Writing procedure to read mem address
02/08/2007 - Conquer Online 2 - 1 Replies
Basically iv been interested in writing a bot that has a few functions. But all of them resolve around reading conquers memory address. Problem is im not sure how to write the procedure to read it, when wrote them for other games i got the procedure from open source bots and well i dont see any here. So if someone could help me with writing the procedure.



All times are GMT +1. The time now is 16:03.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.