GameCapture 1.24b

This is a discussion on GameCapture 1.24b within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; Originally Posted by Zephyrix TBH I was just going to edit the new offsets in, but then I noticed some ...

Page 7 of 7 FirstFirst ... 567
Results 61 to 68 of 68
  1. #61
    Darimus's Avatar
    Darimus is offline Hacker
    Array
    Join Date
    Jul 2008
    Posts
    185
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    11
    Reputation
    300
    Quote Originally Posted by Zephyrix View Post
    TBH I was just going to edit the new offsets in, but then I noticed some calls to SendMessage. Upon further inspection I found that it was quite easy to interact with the application as it was just a simple injector and a nice msgloop

    One thing I noticed is that the application would inject the DLL before creating its class/window, so I had to make the DLL create a thread and sleep until it saw the gamecapture class before sending any messages.
    This way I could print any debug messages straight in the GameCapture window.

    Some code:
    Code:
    void __stdcall SendText(const char* text)
    {
        HWND hGameCapture = NULL;
        HWND hEdit = NULL;
    
        int iPosition = 0;
        bool bFilterColourTags = false;
    
        hGameCapture = FindWindowA("GameCapture Class", 0);
        hEdit = FindWindowExA(hGameCapture, 0, "Edit", 0);
        
        if(!hEdit)
            return;
    
        iPosition = (int)SendMessageA(hEdit, WM_GETPOSITION, 0, 0);
        bFilterColourTags = SendMessageA(hGameCapture, WM_FILTERCOLOUR, 0, 0) ? true : false;
    
        string szBuffer = string(text);
    
        if(bFilterColourTags)
            StripColourCodes(szBuffer);
    
        szBuffer += "\r\n";
    
        SendMessageA(hEdit, WM_SETPOSITION, iPosition, iPosition);
        SendMessageA(hEdit, WM_ADDTEXT, 0, (LPARAM)szBuffer.c_str());
    
        return;
    }
    At first I was hoping that the GameCapture window would do the stripping of the colour codes, but it didn't, so I tried doing a complete rewrite of the stripcolourcodes function to be more faithful to wc3's handling, which behaves like this:

    Remove all instances of "|r"
    Remove all instaces of "|cAABBCCDD", where AABBCCDD are valid hex digits; it doesn't remove it if any of the letters aren't in hex.

    So even strings like "|c|rAABBCCDD" would be rejected, because the |r would be removed, and then "|cAABBCCDD" is removed.

    Unfortunately, my StripColourCodes implementation is a little buggy as you can see...

    Code:
    inline void StripColourCodes(string &szBuffer)
    {
        size_t pos = szBuffer.find("|r");
    
        while(pos != string::npos)
        {
            szBuffer.erase(pos, 2);
            pos = szBuffer.find("|r");
        }
    
        if(szBuffer.length() < 10)
            return;
    
        pos = szBuffer.find("|c");
    
        while(pos != string::npos)
        {
            const string szValidChars = "0123456789abcdefABCDEF";
    
            if(szBuffer.length() - pos + 8 < 10 || pos + 9 >= szBuffer.length())
                break;
    
            int i;
            for(i = 0; i < 8; ++i)
            {
                if(szValidChars.find(szBuffer.at(pos+2+i)) == string::npos)
                    break;
            }
    
            if(i == 8 && szValidChars.find(szBuffer.at(pos+i)) != string::npos)
            {
                szBuffer.erase(pos, 10);
                pos = szBuffer.find("|c", pos);
            }
            else
                pos = szBuffer.find("|c", pos+2);
        }
    }
    Currently, the DLL itself also supports being unloaded, and will remove its hooks when asked to unload, but there is no way to actually unload it :p
    That looks pretty similar to what I originally had in my DLL.



    Code:
    void parseGame(char* game_msg) {
        HWND hEdit = FindWindowEx(FindWindow("GameCapture Class", 0), 0, "Edit", 0);
        int len = SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0);
        int s = SendMessage(FindWindow("GameCapture Class", 0), WM_GETOPTION_STRIP, 0, 0);
        char* buf = new char[strlen(game_msg)+1];
        for (unsigned int i=0; i<strlen(game_msg)+1; ++i) {
            buf[i] = game_msg[i];
        }
        if (s != 0) {
            unsigned int sl = strlen(buf);
            for (unsigned int i=0; i<(sl-1); ++i) {
                if (buf[i] == '|' && buf[i+1] == 'c') {
                    for (unsigned int t=i+10; t<sl; ++t) {
                        buf[t-10] = buf[t];
                        buf[t-9] = 0;
                    }
                    --i;
                }
                if (buf[i] == '|' && buf[i+1] == 'r') {
                    for (unsigned int t=i+2; t<sl; ++t) {
                        buf[t-2] = buf[t];
                        buf[t-1] = 0;
                    }
                    --i;
                }
            }
        }
        SendMessage(hEdit, EM_SETSEL, len, len);
        SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)buf);
        SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)"\r\n");
        delete[] buf;
    }
    
    void onGameMessage() {
        asm(
        "leave;"
        "pusha;"
        "pushl %edx;"
        "call _parseGame;"
        "popl %edx;"
        "popa;"
        "movl %eax, _temp;"
        "movl $0x006EBC86, %eax;" //0x006EBBE6
        "addl _gameBase, %eax;"
        "call *%eax;"
        "movl $0x002F752C, %eax;"
        "addl _gameBase, %eax;"
        "movl %eax, _addr;"
        "movl _temp, %eax;"
        "jmp *(_addr);"
        );
    }
    Last edited by Darimus; 12-30-2009 at 03:11 PM.

  2. #62
    Zephyrix is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    5
    Quote Originally Posted by goofus View Post
    new version still changes c into 0 sometimes.
    Thanks for the update Zephyrix!
    I've tested a lot and can't reproduce this. You're going to need to give me more info. Turn off strip colour codes and post what the text is supposed to be or something?

    Quote Originally Posted by Darimus View Post
    That looks pretty similar to what I originally had in my DLL.

    Code:
    void parseGame(char* game_msg) {
        HWND hEdit = FindWindowEx(FindWindow("GameCapture Class", 0), 0, "Edit", 0);
        int len = SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0);
        int s = SendMessage(FindWindow("GameCapture Class", 0), WM_GETOPTION_STRIP, 0, 0);
        char* buf = new char[strlen(game_msg)+1];
        for (unsigned int i=0; i<strlen(game_msg)+1; ++i) {
            buf[i] = game_msg[i];
        }
        if (s != 0) {
            unsigned int sl = strlen(buf);
            for (unsigned int i=0; i<(sl-1); ++i) {
                if (buf[i] == '|' && buf[i+1] == 'c') {
                    for (unsigned int t=i+10; t<sl; ++t) {
                        buf[t-10] = buf[t];
                        buf[t-9] = 0;
                    }
                    --i;
                }
                if (buf[i] == '|' && buf[i+1] == 'r') {
                    for (unsigned int t=i+2; t<sl; ++t) {
                        buf[t-2] = buf[t];
                        buf[t-1] = 0;
                    }
                    --i;
                }
            }
        }
        SendMessage(hEdit, EM_SETSEL, len, len);
        SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)buf);
        SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)"\r\n");
        delete[] buf;
    }
    
    void onGameMessage() {
        asm(
        "leave;"
        "pusha;"
        "pushl %edx;"
        "call _parseGame;"
        "popl %edx;"
        "popa;"
        "movl %eax, _temp;"
        "movl $0x006EBC86, %eax;" //0x006EBBE6
        "addl _gameBase, %eax;"
        "call *%eax;"
        "movl $0x002F752C, %eax;"
        "addl _gameBase, %eax;"
        "movl %eax, _addr;"
        "movl _temp, %eax;"
        "jmp *(_addr);"
        );
    }
    Very cool to see two different approaches at the same thing.

  3. #63
    goofus is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    I wrote a bug in someone else. so i dont know.
    but I have been using without problems

  4. #64
    Zephyrix is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    5
    Darimus, I'd just like to point out a bug in both our StripColourCodes functions. "|C" and "|c" are identical to WC3, but in our code only the lowercase condition is considered. Same with "|r" and "|R".
    So even with strip colour codes enabled, a string like "|CFF00FF00Test|R" won't be filtered correctly.
    Last edited by Zephyrix; 12-31-2009 at 06:13 PM.

  5. #65
    JakeCake is offline Newbie
    Array
    Join Date
    Mar 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    I would love to use this as a part of my tool where I post data directly from the game to a third party program and then to my DataBase online

    What I need is to get the message-log, could someone explain me how this works, I can't even get the damn .dll opened in my editor! probably me who **Ø*ed it up at some point..

  6. #66
    sumguy is offline Newbie
    Array
    Join Date
    Mar 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    how do u use this D: its just a blank program... i dont get it...

  7. #67
    McPeon's Avatar
    McPeon is offline Da flying one

    Array
    Join Date
    May 2010
    Posts
    976
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    437
    Hey it's an outdated tool/hack. It's for the old 1.24b version of Warcraft3. The current is 1.26. Also, please watch at the dates when posted. This thread is pretty old so please stop bumping

    R.I.P. NYAN!

  8. #68
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    Derp.
    Providing you with foolish stuff since 2007.

Page 7 of 7 FirstFirst ... 567

Similar Threads

  1. GameCapture 1.24
    By Darimus in forum Warcraft 3 Hacks, bots and tools
    Replies: 12
    Last Post: 04-02-2017, 06:14 PM
  2. GameCapture
    By Darimus in forum Warcraft 3 Hacks, bots and tools
    Replies: 16
    Last Post: 03-28-2011, 11:25 PM
  3. TFTLaunch 1.24b
    By Darimus in forum Warcraft 3 Hacks, bots and tools
    Replies: 18
    Last Post: 10-09-2009, 03:16 PM
  4. GameCapture 1.23
    By Darimus in forum Warcraft 3 Hacks, bots and tools
    Replies: 17
    Last Post: 09-15-2009, 02:18 PM

Posting Permissions

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