Question[Help] Reading Pointer

Posts 1–2 of 2 · Page 1 of 1
[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++
Just cast the address to a char*. You're not remotely reading memory, it already exists. Just declare a pointer of a given type and cast the address to that type.

Code:
char *someString = (char*)0xDEADBEEF;
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us