[C++] PlayerBase problems menu

User Tag List

Results 1 to 13 of 13
  1. #1
    0_00_0's Avatar Member
    Reputation
    1
    Join Date
    Jun 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C++] PlayerBase problems

    So I've just figured out how to get the player base and read values from it. However, whenever I enter a battleground my program cannot read the Player Base and returns 0's for everything . Is there a better way of re-scanning for playerbase? What changes when I enter a battleground? Is it still at the same memory location?

    here's the code I've been using for getting my player base
    Code:
    DWORD lvl1Pointer=0x010B65F4;
    DWORD lvl2PointerOffset = 0x34;
    DWORD playerBaseOffset = 0x24;
    
    //get player base
    DWORD getPlayerBase(HANDLE hProcess){
         DWORD playerBase;
         DWORD buffer = 0;
         if(ReadProcessMemory(hProcess, (LPCVOID)lvl1Pointer, &buffer, sizeof(buffer), NULL)==0)
                                       return 0;
        if(ReadProcessMemory(hProcess, (LPCVOID)(buffer+lvl2PointerOffset), &buffer, sizeof(buffer), NULL)==0)
                                       return 0;
        if(ReadProcessMemory(hProcess, (LPCVOID)(buffer+playerBaseOffset), &playerBase, sizeof(playerBase), NULL)==0)
                                       return 0;
        return playerBase;
    }

    [C++] PlayerBase problems
  2. #2
    wraithZX's Avatar Active Member
    Reputation
    43
    Join Date
    May 2007
    Posts
    122
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    errrr.... Apoc?

  3. #3
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where did all the good C++ bot/hack programmers go?

  4. #4
    korknob's Avatar Active Member
    Reputation
    29
    Join Date
    May 2008
    Posts
    67
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    /dance....
    Last edited by korknob; 05-17-2009 at 07:28 PM.
    Then it comes to be that the soothing light at the end of your tunnel
    Was just a freight train coming your way

  5. #5
    0_00_0's Avatar Member
    Reputation
    1
    Join Date
    Jun 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well.. Those weren't very productive comments. I'm really trying to learn here. I can take abuse, just so long as it comes with suggestions. I've really got past this problem, its not really an issue anymore. However, I am having difficulty finding the object manager in similar fashion that you guys mocked. Please let me know what I'm doing wrong this time. The program has debug and administrator privileges.

    I also need the offsets for the first and next objects. Please be helpful this time I'm trying to learn.

    Code:
    DWORD clientConn    = 0x01132F60;
    DWORD cur_MgrOffset = 0x2C24;
    
    DWORD getObjectManager(HANDLE hProcess){
          DWORD buffer, objMgr;
          if(ReadProcessMemory(hProcess, (LPCVOID)clientConn, &buffer, sizeof(buffer), NULL)==0)
                                       return 0;
          if(ReadProcessMemory(hProcess, (LPCVOID)(buffer+cur_MgrOffset), &objMgr, sizeof(objMgr), NULL)==0)
                                       return 0;
          return objMgr;
    }
    edit: the error is the function always returns 0, meaning the readprocessmemory()'s failed.

  6. #6
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure you have the SeDebugPrivilege. Run as admin. Use GetLastError() to see what's going on.

  7. #7
    0_00_0's Avatar Member
    Reputation
    1
    Join Date
    Jun 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have debug priviliges. It's worked for me many times and my vista's UAC is turned off. GetLastError() reports error 6.

  8. #8
    Opul3nt's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've set those conditionals to return '0' in the event of a variety of unexpected results.

    Set breakpoints and debug your sh**. Then look at the point at which this code fails. If it fails on the first read, you probably don't have a valid handle or debug privileges. In those cases your problem is out of the scope you've provided here.

    Good Luck.

  9. #9
    boomingranny's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    don't worry about everyone here, everyone answers your question with:
    "you are stupid to ask such a basic question (even if you question isn't basic to normal humans) but here is a hint at the answer"

    anyway, when your gameworld reloads (that progress bar/loading screen) the part of memory that you are reading (which the player object is part of) is destroyed then the new "gameworld" is loaded (so its location will move)
    so reload your player base from your static pointers.

    i Currently just do it when my mapID changes, but i am sure there is a much smarter way of doing it...

    Anyway, good luck

  10. #10
    dekz's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or read the stickies

  11. #11
    deCutter's Avatar Member
    Reputation
    5
    Join Date
    Apr 2009
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by 0_00_0 View Post
    GetLastError() reports error 6.
    Well,
    Originally Posted by WinError.h
    //
    // MessageId: ERROR_INVALID_HANDLE
    //
    // MessageText:
    //
    // The handle is invalid.
    //
    #define ERROR_INVALID_HANDLE 6L
    To be sured that this is your problem, in debug mode add "@err,hr" to your watch list, this will show you error from last winapi call. You must be sured that there was no more winapi calls between your error call and GetLastError() call. Also, if u want to manually check GetLastError(), you can call
    Code:
    DWORD WINAPI FormatMessage(
      __in      DWORD dwFlags,
      __in_opt  LPCVOID lpSource,
      __in      DWORD dwMessageId,
      __in      DWORD dwLanguageId,
      __out     LPTSTR lpBuffer,
      __in      DWORD nSize,
      __in_opt  va_list *Arguments
    );
    to get string representation of your error.

  12. #12
    0_00_0's Avatar Member
    Reputation
    1
    Join Date
    Jun 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by deCutter View Post
    Well, To be sured that this is your problem, in debug mode add "@err,hr" to your watch list, this will show you error from last winapi call. You must be sured that there was no more winapi calls between your error call and GetLastError() call. Also, if u want to manually check GetLastError(), you can call
    Code:
    DWORD WINAPI FormatMessage(
      __in      DWORD dwFlags,
      __in_opt  LPCVOID lpSource,
      __in      DWORD dwMessageId,
      __in      DWORD dwLanguageId,
      __out     LPTSTR lpBuffer,
      __in      DWORD nSize,
      __in_opt  va_list *Arguments
    );
    to get string representation of your error.
    This was the problem. It was an invalid handle, i didnt notice but two of my lines had swapped somehow and I added priviliges after i called OpenProcess(). Dumb mistake, there's technically nothing wrong with that code, although it's sloppy.

    Now to start looping through the game objects. I'm already having trouble but I'll spend my day off trying to figure this out!

  13. #13
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looping through objects is cake. Look up "shynd wow modification" on google. It's a great guide, just update the offsets from here(most should be the same though, other than the ObjMgr offsets).

Similar Threads

  1. Problem with CE.
    By Eldretch in forum World of Warcraft General
    Replies: 1
    Last Post: 08-08-2006, 06:49 PM
  2. realm list problem
    By robtuner in forum World of Warcraft General
    Replies: 2
    Last Post: 07-21-2006, 09:08 AM
  3. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
  4. wow emu problem
    By bezike in forum World of Warcraft General
    Replies: 0
    Last Post: 07-09-2006, 04:45 PM
  5. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
All times are GMT -5. The time now is 03:01 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search