Results 1 to 1 of 1
  1. #1
    jonyboy
    jonyboy is offline
    Guest
    Join Date
    2012 Jul
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    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++

    ---------- Post added 2012-07-31 at 04:23 PM ---------- Previous post was 2012-07-25 at 06:57 PM ----------

    moderator can close this now..

    here some solution i got..

    Code:
    LPCSTR ReadStringPointer(unsigned long ulBase, int iOffset)
    {
    __try { return (LPCSTR)(*(unsigned long*)ulBase + iOffset); }
    __except (EXCEPTION_EXECUTE_HANDLER) { return "-"; }
    }
    and this..

    Code:
    std::string my_string((char*)0xdeadbeef, 24);

Similar Threads

  1. [Help] reading text value with readprocessmemory
    By elshabory in forum Delphi
    Replies: 5
    Last Post: 2013-01-07, 04:34 PM
  2. Pointer collection
    By Dwar in forum Last Chaos
    Replies: 9
    Last Post: 2011-11-18, 04:52 AM
  3. looking to hire someone to teach me memory reading
    By valdemir in forum General Game Research
    Replies: 2
    Last Post: 2011-05-29, 09:08 AM
  4. [C++] Need Help Multi Patching Pointer
    By gosicks in forum C/C++
    Replies: 0
    Last Post: 2011-02-11, 09:40 PM
  5. Replies: 0
    Last Post: 2010-11-29, 04:04 PM
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •