[2.4.3] [C++] Autologin menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Jansi's Avatar Member
    Reputation
    2
    Join Date
    Mar 2015
    Posts
    3
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [2.4.3] [C++] Autologin

    I was inspired by Tutrakan's guide ([1.12.1] Trouble calling DefaultServerLogin) to making the client log in automatically using Lua GLUE function DefaultServerLogin(), but I couldn't find the offset for it in 2.4.3 (I thought it to be 0x00899398, but that crashed immediately), so I used AttemptLogin2() instead (see this article which describes the login proces indepth: Under the Hood: World of Warcraft – Logging In – Recelate Blog)

    I found the following offsets for 2.4.3 using IDA Pro and Cheat Engine:
    PHP Code:
    #define GAMESTATE    0x00C07CD0 // string
    #define LOGIN        0x0046E560 // function
    #define ENTERWORLD    0x00471940 // function

    typedef void(__cdecl *AttemptLogin2)(char *namechar *password);
    typedef void(__cdecl *EnterWorld)();

    BOOL APIENTRY DllMain(HMODULE hModuleDWORD ul_reason_for_callLPVOID /* reserved */)
    {
        if (
    ul_reason_for_call == DLL_PROCESS_ATTACH) {
            
    // disables thread notifications (DLL_THREAD_ATTACH, DLL_THREAD_DETACH)
            
    DisableThreadLibraryCalls(hModule);

            
    CreateThread(NULL0, (LPTHREAD_START_ROUTINE)&MainThreadControlNULL0NULL);
        }
        return 
    TRUE;
    }

    DWORD MainThreadControl(LPVOID lpParm)
    {
        while (
    1) {
            
    char *gamestate = (char*)GAMESTATE;

            if (
    strcmp(gamestate"login") == 0) {
                
    char user[]{ "MyAccount" };
                
    char pass[]{ "MyPassword" };
                
    AttemptLogin2 login = (AttemptLogin2)LOGIN;
                
    login(userpass);
            } else if (
    strcmp(gamestate"charselect") == 0) {
                
    EnterWorld enterworld = (EnterWorld)ENTERWORLD;
                
    enterworld();

                break;
            }

            
    Sleep(500); // std::this_thread::sleep_for(std::chrono::milliseconds(500));
        
    }
            return 
    0;

    This is how I got to AttemptLogin2() using IDA Pro: [ASM (NASM)] WoW 2.4.3 DefaultServerLogin() - Pastebin.com

    Now, the problém is that this successfully logs me into the game only 1 out of 5 times. 4 out of 5 it crashes with different errors such as:

    >> The instruction at "0x663C8E75" referenced memory at "0X00000078". The memory could not be "written". <<
    or
    >> The instruction at "0x6639CC33" referenced memory at "0x00000010". The memory could not be "read". <<
    or
    >> AsyncFileReadWait(): s_waiting != FALSE <<

    I would appreciate any advice. My guess is that I am skipping some vital functions which initialize some variables which the game relies on.

    [2.4.3] [C++] Autologin
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Login functions are not thread safe. They were designed to be called from the main thread only. It's probably a race condition, hence the arbitrary crash locations.

  3. #3
    tutrakan's Avatar Contributor
    Reputation
    134
    Join Date
    Feb 2013
    Posts
    175
    Thanks G/R
    124/52
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The login function seems to work well from the MainThreadControl(), but the client crashes when EnterWorld() function called. As Jadd stated, the last one need to be called from the client main thread:
    Code:
    const char user[]{ "user" };
    const char pass[]{ "pass" };
    //this one works fine
    ((void(__cdecl*)(const char*, const char*))0x0046E560)(user, pass);	//CGlueMgr::DefaultServerLogin
    
    Sleep(5000);
    
    //will crash here because this function need to be called from the main thread a.k.a. end scene
    ((void(__stdcall*)())0x0046F460)();		//CGlueMgr::EnterWorld()

  4. #4
    Jansi's Avatar Member
    Reputation
    2
    Join Date
    Mar 2015
    Posts
    3
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So after 10 hours of furious googling and compiling source code from Github, I have finally done it. I couldn't figure out how to use the latest Microsoft Detours 3.0, but I found an example project for ancient Detours version 1.5 and it still works. I am even able to draw text on the screen, which is something I've always wanted to know how it's done.

    There is one weird thing though. When I press ESC while in game a pop up appears saying: "Blizzard_TimeManager has been blocked from an action only available to the Blizzard UI. You can disable this addon and reload the UI". Any idea what is happening? This obviously doesn't happen when I don't inject my DLL library.
    Last edited by Jansi; 08-21-2017 at 02:07 PM. Reason: figured out how to attach the debugger

  5. #5
    culino2's Avatar Elite User
    Reputation
    336
    Join Date
    Feb 2013
    Posts
    181
    Thanks G/R
    139/72
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jansi View Post
    So after 10 hours of furious googling and compiling source code from Github, I have finally done it. I couldn't figure out how to use the latest Microsoft Detours 3.0, but I found an example project for ancient Detours version 1.5 and it still works. I am even able to draw text on the screen, which is something I've always wanted to know how it's done.

    There is one weird thing though. When I press ESC while in game a pop up appears saying: "Blizzard_TimeManager has been blocked from an action only available to the Blizzard UI. You can disable this addon and reload the UI". Any idea what is happening? This obviously doesn't happen when I don't inject my DLL library.
    Then you're still damaging the lua stack somehow, a piece of code may help. Also you don't need to hook anything just to run the login in the main-thread (yes for drawing you need to), copy pasting code is never a good idea, especially if you only understand half of it.
    Last edited by culino2; 08-21-2017 at 05:22 PM.

Similar Threads

  1. [Help] Lua AutoLogin
    By maclof in forum WoW Memory Editing
    Replies: 2
    Last Post: 03-01-2010, 03:02 AM
  2. [MAC] Create your own AutoLogin
    By Jiat in forum World of Warcraft Bots and Programs
    Replies: 25
    Last Post: 07-27-2009, 08:54 AM
  3. Autologin Prog + Keylogger = Account + Password
    By Wilkey in forum WoW Scam Prevention
    Replies: 3
    Last Post: 11-09-2008, 06:45 AM
  4. [Program]*UPDATE* "Advanced" Autologin by Thidan (Source included)
    By Thidan in forum World of Warcraft Bots and Programs
    Replies: 16
    Last Post: 05-23-2008, 12:19 PM
  5. AutoLogin or EasyBgAFK
    By Kwapuzzi in forum World of Warcraft Bots and Programs
    Replies: 6
    Last Post: 03-30-2008, 04:03 AM
All times are GMT -5. The time now is 03:23 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search