AntiAfk Problem menu

User Tag List

Results 1 to 9 of 9
  1. #1
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AntiAfk Problem

    Hey!

    I am currently trying to implement some anti afk for my bot as it always went afk.
    After some reversing I stumbled accross CSimpleTop::m_eventTime, which is increased after every hardware event, realtime like I thought.
    Freezing it kept me staying afk/logging out, so it seems to be the right value.

    I wrote this code:
    std::uintptr_t const LAST_HARDWARE_EVENT = 0xD92B90;

    static inline std::uint32_t getLocalTimeMs()
    {
    return (std::clock() / (CLOCKS_PER_SEC / 1000));
    }

    static inline std::uint32_t& getLastHardwareEvent()
    {
    return *reinterpret_cast<std::uint32_t*>(LAST_HARDWARE_EVENT);
    }

    void WoW:ulseAntiAfk()
    {
    static std::uint32_t difference =
    std::abs(getLocalTimeMs() - getLastHardwareEvent());

    std::uint32_t curDifference =
    std::abs(getLocalTimeMs() - getLastHardwareEvent());
    if(curDifference > difference)
    getLastHardwareEvent() += curDifference - difference;
    }
    It keeps the value synchronised to the 'real' time.
    But after some time it stops working.

    I investigated it a bit and found out that the value is increased kinda similar to real time but after a while there's a huge gap.
    Wtf ist WoW doing there? And is it an option to simply set it to 0xFFFFFFFF every frame?

    Thank you.
    Regards,
    Flo
    Hey, it compiles! Ship it!

    AntiAfk Problem
  2. #2
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why dont you just write performance count to LastHardwareAction?
    Code:
            public static void ResetHardwareAction()
            {
                Magic.Write(Offsets.LastHardwareAction, PerformanceCount);
            }

  3. #3
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by miceiken View Post
    Why dont you just write performance count to LastHardwareAction?
    Code:
            public static void ResetHardwareAction()
            {
                Magic.Write(Offsets.LastHardwareAction, PerformanceCount);
            }
    Hi.

    With PerformanceCount you mean the value returned by QueryPerformanceCounter ?
    That value has a much higher resolution, WoW seems to use millisecond resolution.
    So using that value of course works (as it is high enough to be never reached by WoW's millisecond comparisons), but it's so easy to detect if the value of the last hardware action is "from the future".
    Writing UINT_MAX would be the most easy solution, but surely not the best.
    Hey, it compiles! Ship it!

  4. #4
    Thongs's Avatar Member
    Reputation
    10
    Join Date
    Oct 2006
    Posts
    51
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He means by calling WoW's function at 0x4626D0 (rebased). It's generally referred to as PerformanceCount, GetTickCount or OsGetAsyncTimeMs. If I remember correctly, I think there's also a static address for it if you're trying to get the value from it without being injected.

  5. #5
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Thongs View Post
    He means by calling WoW's function at 0x4626D0 (rebased). It's generally referred to as PerformanceCount, GetTickCount or OsGetAsyncTimeMs. If I remember correctly, I think there's also a static address for it if you're trying to get the value from it without being injected.
    Ok, PerformanceCount/TickCount are very odd names, just because OsGetAsyncTimeMs internally uses them.
    I was a bit confused from the disassembly of OsGetAsyncTimeMs, but I use it now, so thanks.

    But I am still interested why those timestamps are so far off from the real time.
    Hey, it compiles! Ship it!

  6. #6
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just reverse OsGetAsyncTimeMs. You will see that it does much more than just get the time in ms.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  7. #7
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IIRC you get logged out if you write a timestamp that's too far off, so I don't think uint maxvalue would solve anything.

  8. #8
    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)
    Originally Posted by MaiN View Post
    Just reverse OsGetAsyncTimeMs. You will see that it does much more than just get the time in ms.
    ​It also reads your email.

  9. #9
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    ​It also reads your email.
    No no, that's this guy:
    &#x202a;O365 MGX Copy wmv&#x202c;&rlm; - YouTube
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Similar Threads

  1. realm list problem
    By robtuner in forum World of Warcraft General
    Replies: 2
    Last Post: 07-21-2006, 09:08 AM
  2. 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
  3. wow emu problem
    By bezike in forum World of Warcraft General
    Replies: 0
    Last Post: 07-09-2006, 04:45 PM
  4. [Program] WoW Jumper AntiAFK Script
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 5
    Last Post: 06-23-2006, 10:38 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 02:26 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