Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 01:08

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

Advertisement



Reading pointer from injected dll

Discussion on Reading pointer from injected dll within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2009
Posts: 20
Received Thanks: 6
Reading pointer from injected dll

Hey,

So I inject a DLL into a game and i try to read the pointers that i found with CE.

CE address:


Code that i tried to get the values with
Code:
HANDLE handle = GetModuleHandleA(0);
DWORD *baseAddress = (DWORD*)handle;
DWORD value = *(DWORD*)(*(DWORD*)baseAddress + 0xE750F4);
But this returns the wrong value

Any ideas?
Rogier55 is offline  
Old 02/01/2016, 08:40   #2
 
elite*gold: 8
Join Date: Sep 2014
Posts: 625
Received Thanks: 177
Try:
DWORD value = *((DWORD*)handle + 0xE750F4);
qqdev is offline  
Old 02/01/2016, 08:43   #3
 
Biesi's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 182
Received Thanks: 185
^ this and are you sure that this one is static?
Biesi is offline  
Old 02/01/2016, 10:34   #4
 
elite*gold: 354
Join Date: Jun 2015
Posts: 114
Received Thanks: 286
Quote:
Originally Posted by Rogier55 View Post
Code:
DWORD base = (DWORD)GetModuleHandleA(0);
DWORD val = *(DWORD*)(base + 0xE750F4);
^
mac'que is offline  
Old 02/01/2016, 15:09   #5


 
Jeoni's Avatar
 
elite*gold: 966
Join Date: Apr 2010
Posts: 1,104
Received Thanks: 681
Quote:
Originally Posted by qqdev View Post
Try:
DWORD value = *((DWORD*)handle + 0xE750F4);
This won't work due to pointer arithmetics.

Quote:
Originally Posted by mac'que View Post
Code:
DWORD base = (DWORD)GetModuleHandleA(0);
DWORD val = *(DWORD*)(base + 0xE750F4);
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.

With best regards
Jeoni
Jeoni is offline  
Thanks
1 User
Old 02/01/2016, 21:14   #6
 
elite*gold: 0
Join Date: Dec 2014
Posts: 442
Received Thanks: 211
Quote:
Originally Posted by Jeoni View Post
This won't work due to pointer arithmetics.


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.

With best regards
Jeoni
^this
I agree with you and I assume these beginners simply watched some crappy YouTube tutorial and c&p the exact same code without understanding the concept behind it (which I noticed quite a lot, especially in this forum).
He should at least have used some C++ casting instead of c-casts for dereferencing like:
Code:
*reinterpret_cast< std::uintptr_t *>(0xDEADBEAF)
_asm is offline  
Old 02/06/2016, 18:11   #7
 
elite*gold: 8
Join Date: Sep 2014
Posts: 625
Received Thanks: 177
Because it is all over the internet Better tell how to do it right and leave the other part out.
qqdev is offline  
Reply


Similar Threads Similar Threads
C# / CE Memory Pointer Reading + Offset
06/05/2013 - .NET Languages - 6 Replies
Hi, ich hab folgendes Problem: Ich hab mit CE (6.2) einen statischen Pointer ermittelt mit dem ich dann zur gewünschten speicher Adresse komme. Leider bekomme ich beim dem hinzufügen der Offsets immer nur eine null als wert raus. http://s7.directupload.net/images/130603/46cw7nu8 .png (toll img tag geht nicht) http://s7.directupload.net/images/130603/46cw7nu8 .png
[C#]Reading Memory / Pointer with multiple Offsets.
01/12/2013 - .NET Languages - 23 Replies
I am used to coding in AutoIt. I am trying to move my project into C# but I have only about 2-3 weeks of experience. In AutoIt, I have this code here that reads the process memory and returns a value. $map = _MemoryRead(0x00B5CCB8, $handle) // Pointer address 0x00B5CCB8 $map = _MemoryRead($map + 0x02, $handle) // Offset 0x02 $map = _MemoryRead($map + 0xBD, $handle) // Second Offset 0xBD I am trying desperately to convert this to C# language and I need some help. Here is what I have...
[Help] Reading Pointer
07/31/2012 - C/C++ - 4 Replies
recently i was learning to make dll for injection and i found this func code: unsigned long ReadPointer(unsigned long ulBase, int iOffset) { __try { return *(unsigned long*)(*(unsigned long*)ulBase + iOffset); } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } } for example : addr = 0x0012345
[VB.NET] Need help - memory reading from pointer
09/03/2010 - .NET Languages - 2 Replies
Hi, i'm kinda beginner in memory editing, the only experience i got is vb6 and vb.net - and basic CE skills. However i could get the pointer and the offset for a memory address, it works, tested. Next step is the reading of this value with a vb.net application. I have been googleing for 2 days, got some codes, wrote some by myself, but none of them seems to work. Could anyone help me a bit? Thank you, Regards



All times are GMT +2. The time now is 01:08.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.