[Help Request] Detect in game/disconnected menu

User Tag List

Results 1 to 12 of 12
  1. #1
    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)

    [Help Request] Detect in game/disconnected

    This post started out as a help request,
    but then i thought i could simply cycle the object list, and if its empty then im not in game. (im sure there is a much better way)

    i had found a memory location that is 0 when not in game, but struggled to work out what exactly it was. (assembily that writes this memory address below)

    00928C52 | F3:A5 | REP MOVSD |
    00928C54 | 8B75 0C | MOV ESI, DWORD PTR [EBP+C] |
    00928C57 | 33C0 | XOR EAX, EAX |
    00928C59 | 8943 20 | MOV DWORD PTR [EBX+20], EAX |
    00928C5C | 8B0D 60EC3501 | MOV ECX, DWORD PTR [135EC60] |
    00928C62 | 894B 0C | MOV DWORD PTR [EBX+C], ECX |
    00928C65 | 8943 08 | MOV DWORD PTR [EBX+8], EAX |
    00928C68 | EB 0B | JMP 00928C75 |
    00928C6A | 8B53 20 | MOV EDX, DWORD PTR [EBX+20] |
    00928C6D | 8957 20 | MOV DWORD PTR [EDI+20], EDX |
    00928C70 | 897B 20 | MOV DWORD PTR [EBX+20], EDI |
    00928C73 | 8BDF | MOV EBX, EDI |
    00928C75 | 8B7D 10 | MOV EDI, DWORD PTR [EBP+10] |
    00928C78 | 8B07 | MOV EAX, DWORD PTR [EDI] |
    00928C7A | 8943 10 | MOV DWORD PTR [EBX+10], EAX |
    00928C7D | 8B4F 04 | MOV ECX, DWORD PTR [EDI+4] |
    00928C80 | 894B 14 | MOV DWORD PTR [EBX+14], ECX | <--- this bit here refers to an address that is 0 if not in game
    00928C83 | 8B57 08 | MOV EDX, DWORD PTR [EDI+8] |
    00928C86 | B8 04000000 | MOV EAX, 4 |
    00928C8B | 8953 18 | MOV DWORD PTR [EBX+18], EDX |
    00928C8E | 3947 08 | CMP DWORD PTR [EDI+8], EAX |
    00928C91 | 7C 1A | JL 00928CAD |
    00928C93 | 8B0F | MOV ECX, DWORD PTR [EDI] |
    00928C95 | F641 09 03 | TEST BYTE PTR [ECX+9], 3 |
    00928C99 | 74 12 | JE 00928CAD |
    00928C9B | 8446 09 | TEST BYTE PTR [ESI+9], AL |
    00928C9E | 74 0D | JE 00928CAD |
    00928CA0 | 8B55 08 | MOV EDX, DWORD PTR [EBP+8] |
    00928CA3 | 56 | PUSH ESI |
    00928CA4 | 52 | PUSH EDX |

    the best way would be to be able to detect which screen i am in (login/choose character/game)
    i read a post by Cypher (i think) that said you the console output is different in game/out of game,
    but calling console commands/parsing the console output is out of the scope of my project
    (read - i don't know how to do it, and have other wow related things invest time on)

    Flame Disclaimer: Yes i am shit at Assembily and have next to no clue what the above is doing, Yes i know this, Yes please point it out by replying to this post
    Last edited by boomingranny; 06-17-2009 at 07:20 PM.

    [Help Request] Detect in game/disconnected
  2. #2
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you coding this in? If you're not against asm injection you can use BlackMagic to copy that ECX register and then re-inject the normal code..but i haven't tried this and it's probably harder than I made it sound. Hope that helps ?

    Also..I can't remember, but I'm pretty sure when I looped through the objMgr there is a line like..

    loop allObjects
    'do stuff w/ object info like display to text box
    allObjects.baseAddress = memRead(baseAddress + &H3C) ' next objects's baseaddr

    allObjects.baseAddress should be a pointer to the next object, but..check for 0..I noticed that as soon as I logged out, it threw an exception and said .baseAddress = 0..so maybe you can check for that and eithor ( I assume =0 is an error, exit loop, but you could also assume nextbase=0 means you're not logged in Eithor way..hope that helps a little.

  3. #3
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    public bool IsInGame
    {
    get
    {
     return ClntObjMgrGetActivePlayer() != 0;
    }
    }
    ClntObjMgrGetActivePlayer function address is 0x007BC8D0.

    Pattern: \x64\x8B\x0D\x2C\x00\x00\x00\xA1\xFC\xD9\x35\x01\x8B\x14\x81\x8B\x8A\x10\x00\x00 \x00\x85\xC9\x75\x05
    Mask: xxxxxxxx????xxxxxxxxxxxxx

    Enjoy.

  4. #4
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    got it...

    Ok so I looked at my code..did some debugging and --> atleast for me, sometimes i get an object in the ObjMgr who's nextBasePointer (base+0x3c) is == 0 So, for me..if nbp=0, exit whatever ScanObjMgr loop you're in --> this isn't helpful because it throws a 0 if you're at the login screen..or at the end of the objmgr's list --> So just compare the .BaseAddress w/ the FirstObject's address and if ==, you're at the login screen

    If CurrentScanObject.BaseAddress = FirstObjectAddres AND CurrentScanObject.NextBaseAddress = 0 then
    MessageBox.Show("You are at the login screen...LOGIN NOW or else!")

    End If



    For example, I have a function called "DrawRadar" which loops through all objects in objMgr and if they are npc/player, it draws them



    DrawRadar
    //Error Check: Make sure we are logged in
    Dim CurrentScanObject As WowBasicObject(FirstObjectAddress)
    IF currentScanObject.base = firstobjectbase AND currentscanObject.nextbase = 0 then
    'You are at login screen

    exit sub

    ....code to actually draw stuff once logged in
    ....

    End DrawRadar

    Explain: WowBasicObject's NEW sub initialized all it's values like guid,pos,
    The wowbasicobject class also has a variable to store the 'next base address' which could be done on the fly later(bae+0xc3)...I do it at wowbasicobject.New() SO If you don't keep track of it like that you could always use

    If CurrentScanObject.baseAddress = FirstObjectAddress AND ReadUint32(CurrentScanObject.baseAddress + 0xc3) = 0 Then
    'You are at login screen
    End if

    I hope that helps/works for you? I just finished about 15 minutes ago and tested it for a few minutes and it worked. The only thing that bothers me is the fact that NBP = 0...I thought for the last object it whould = FirstObjectAddress, but that NEVER happens in my loops, so I just leave on nbp =0..which works, I see all (maybe all-1 objects around me. Also, be sure to do this check AFTER initializing the first object and BEFORE the loop (If you put it inside the loop, lowers's performance and..it shouldn't be in the ObjMgrscanning loop) hopefully you know what I mean.


    PS. if that doesn't make sense, pm me ...i could explain more in detail over msn,yahoo etc..

    EDIT: To make that 99.9% shorter, all you have to do is see if the (firstObject).NextObject'sAddress = 0..if so, you're at the login screen
    Last edited by abuckau907; 06-19-2009 at 08:36 PM.

  5. #5
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
            public static void Pulse()
            {
                // Logging.Write("Start of objmgr traversal!");
                ObjList.Clear();
                ulong localGuid = Marshal.ReadIntPtr(ManagerAddress, (int) ObjectManager.localGuid).ToUInt64();
    
                IntPtr curObj = Marshal.ReadIntPtr(ManagerAddress, (int) ObjectManager.firstObj);
                //_me = GetMe();
                while (curObj.ToInt64() != 0 && (curObj.ToInt64() & 1) == 0)
                {
                    var obj = new WoWObject(curObj);
                    switch (obj.Type)
                    {
                        case WoWObjectType.Unit:
                            ObjList.Add(new WoWUnit(obj));
                            break;
                        case WoWObjectType.GameObject:
                            ObjList.Add(new WoWGameObject(obj));
                            break;
                        case WoWObjectType.Player:
                            if (obj.Guid == localGuid)
                            {
                                Me = new WoWActivePlayer(obj);
                                ObjList.Add(Me);
                                break;
                            }
                            ObjList.Add(new WoWPlayer(obj));
                            break;
                        default:
                            ObjList.Add(obj);
                            break;
                    }
                    IntPtr nextObj = Marshal.ReadIntPtr(curObj, (int) ObjectManager.nextObj);
                    if (nextObj == curObj)
                    {
                        //Logging.Write("End of objmgr traversal!");
                        break;
                    }
    
                    curObj = nextObj;
                }
                //Logging.Write("End of objmgr traversal!");
            }
    That should help.

  6. #6
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If Memory.ReadUint32(FirstObjectAddress + &H3c) = 0 then 'First Object has no 2nd object
    YOU ARE AT LOGINSCREEN

    If you don't have FirstObjectAddress ....yikes


    Took me 30 minutes..but you finally got 1 line of code :P almost

  7. #7
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could check if the login frames "IsShown()" in lua and get a return.

    In game frame = WorldFrame

  8. #8
    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)
    thanks for all the help everyone.

    What i am keen to work out is if i am at the character choose screen,
    the login screen, or in game.

    I can tell if im in game or not, but not if i need to tell my script to enter a username/password, or just press enter and login my char.

    i guess i could settle for both just type my username then tab my password then enter. i figure that will get past either screen. (the enter at the end would select the character) otherwise i will just terminate wow.exe and start from scratch if im not in game

  9. #9
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you were sniffing packets, I'd say to look for the realm split or char enum packets.
    Don't believe everything you think.

  10. #10
    Baxterzz's Avatar Member
    Reputation
    4
    Join Date
    Oct 2008
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    1 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    look for the char packets

  11. #11
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a static afress that holds the last visited glue screen. It's pretty easy to find with cheatengine or if you use lua or if you sniff packets

  12. #12
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

Similar Threads

  1. Need help, not working in game
    By C-Death in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 12-31-2007, 06:28 PM
  2. [help/request] I need trainers for 2.3 lol
    By jokerjokes in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-28-2007, 12:39 PM
  3. [Request] Notepad in game?
    By dynamikz in forum WoW UI, Macros and Talent Specs
    Replies: 2
    Last Post: 12-20-2007, 01:32 AM
  4. Getting A Friend Connected (Help Request)
    By Magnusvermis in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 12-07-2007, 11:57 PM
  5. Help Request
    By sirios in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 10-14-2007, 12:47 PM
All times are GMT -5. The time now is 01:27 AM. 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