Register for your free account! | Forgot your password?

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

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

Advertisement



[Help] Reading Pointer

Discussion on [Help] Reading Pointer within the C/C++ forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2008
Posts: 12
Received Thanks: 0
[Help] Reading Pointer

recently i was learning to make dll for injection and i found this func code:

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
off = 0x10

readpointer(addr, off) -> let say this read value (DWORD) = 1701277249 and char/string value = egnA

DWORD/unsigned long is 4 byte which mean can contain up to 4 char.

i wanna ask how to get value into char/string which have control size that could contain up to 24 char.

ps : im newbie c++
jonyboy is offline  
Old 07/25/2012, 22:21   #2
 
elite*gold: 0
Join Date: Sep 2006
Posts: 774
Received Thanks: 8,580
Code:
std::string my_string((char*)0xdeadbeef, 24);
phize is offline  
Old 07/26/2012, 00:27   #3
 
elite*gold: 0
Join Date: Mar 2008
Posts: 12
Received Thanks: 0
thanks for your help.

but, the problem was the result of ReadPointer is DWORD, then how to make it to value ascii char?

ex. : 979899100101102103 = abcdefg
jonyboy is offline  
Old 07/30/2012, 16:23   #4
 
elite*gold: 0
Join Date: Jun 2012
Posts: 187
Received Thanks: 58
create a new pString or lpStr var and point it to the return value. acessing it should be simple enough. your values seem to be ansi, so make sure you use pAnsiString / lpAnsiString or pChar.
tnd0 is offline  
Old 07/31/2012, 18:26   #5
 
elite*gold: 0
Join Date: Mar 2008
Posts: 12
Received Thanks: 0
moderator can close this now..

here solution i got..

Code:
LPCSTR ReadStringPointer(unsigned long ulBase, int iOffset)
{
__try { return (LPCSTR)(*(unsigned long*)ulBase + iOffset); }
__except (EXCEPTION_EXECUTE_HANDLER) { return "-"; }
}
thx all..
jonyboy is offline  
Closed Thread


Similar Threads Similar Threads
[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
Frage: Wie findet man zB UG Pointer?Speed pointer?
03/30/2010 - Kal Online - 2 Replies
kann mir einer sagen wie man UG/Speed pointer finden kann usw^^´ß#



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


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.