Cant access any wow function from injected dll menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cant access any wow function from injected dll

    Hi,

    My problem is, that i cant call any function from wow out of my dll.
    Here is my code of my c++ dll. I call this dll from a c# dll, which is injected in wow thought endscene.

    What am i doing wrong?

    PHP Code:
    #define ChatFrame_AddMessage 0x005989F0 
    typedef DWORD(__cdecl *pFunc_t)(char *szTextDWORD dwUnkDWORD dwUnk2) ;


    void AddChatMessage(chartext)
    {   
         
    pFunc_t pFunc = (pFunc_t)((DWORD)GetModuleHandle(NULL) + ChatFrame_AddMessage) ;   
         
    pFunc(text00) ;  
    }

    extern "C" __declspec(dllexportvoid __stdcall addChatMessage(char *text)
    {   
           
    AddChatMessage(text);

    if the call is no cdecl, where do i get the class-pointer from?

    Can anyone give me a working example of any wow function called from an injected library?

    Thanks

    dermoeter
    Last edited by Kwapuzzi; 11-01-2012 at 01:56 AM.

    Cant access any wow function from injected dll
  2. #2
    daCoder's Avatar Sergeant
    Reputation
    22
    Join Date
    Sep 2012
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi dermoeter,

    you have to use __thiscall instead of __cdecl and the "this" parameter will be the first parameter.
    This example is written in C++;
    Code:
    // Definition
    void (__thiscall* pFunc)(unsigned int This) = nullptr;
    
    // Initialization
    pFunc= reinterpret_cast<decltype(pFunc)>(youraddress);
    -daCoder
    My Youtube Vidoes: https://www.youtube.com/user/daCoderVids
    OpenHack: https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/384086-open-souce-project-wow-1-12-1-a.html

  3. #3
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot and rep, cause the function itself runs.

    Now i have the Problem, that i cant pass a correct parameter.

    PHP Code:
    // Lua_DoString Adress
    #define Lua_DoStringAddress 0x75350

    // Definition
    void (__thiscallpFunc)(charThis) = nullptr;

    void LuaDoString(charpcText)
    {
           
    pFunc reinterpret_cast<decltype(pFunc)>((DWORD)GetModuleHandle(NULL) + Lua_DoStringAddress);
           
    char *= (char*)malloc(strlen(pcText));
           
    memcpy(cpcTextstrlen(pcText));   
           
    pFunc(c) ;
      } 
    This was my last try, after normal passing of char* was not working.
    The function lua_doString works fine, but the paramaters are broken, so nothing usefull gets executed.

    Whats wrong with my parameter?

    Thanks a lot for your help
    Last edited by Kwapuzzi; 11-01-2012 at 05:16 AM.

  4. #4
    daCoder's Avatar Sergeant
    Reputation
    22
    Join Date
    Sep 2012
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DoString is no __thiscall, change it to __cdecl and it should run fine.
    My Youtube Vidoes: https://www.youtube.com/user/daCoderVids
    OpenHack: https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/384086-open-souce-project-wow-1-12-1-a.html

  5. #5
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
           char *= (char*)malloc(strlen(pcText));
           
    memcpy(cpcTextstrlen(pcText)); 
    Very suspicious code. Do not allocate memory using strlen (bad manner cause of encoding problems). Also if you do, then allocate (strlen+1) since it doesn't count null byte. Then same error when memcpy (copying only part of string), be careful.
    Last edited by Empted; 11-01-2012 at 07:58 AM.

  6. #6
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cant access any wow function from injected dll-lua-fehler-jpg

    This is what i get, wenn i call the folowing code:

    Cant access any wow function from injected dll-lua-fehler_code-jpg

    I dont get it.
    Attached Thumbnails Attached Thumbnails Cant access any wow function from injected dll-lua-fehler-jpg  

  7. #7
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No need in / symbol. Just call some script functions, like CastSpellByID or CastSpellByName. Full list can be found at http://www.wowwiki.com/API
    P.S. what you write to ingame chat via "/" is like you do in command line. That string is then parsed to internal lua function calls.
    P.P.S. did you fix the function the way I posted?
    Last edited by Empted; 11-01-2012 at 08:46 AM.

  8. #8
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks a lot. Thats it.

    Now i ran into an error, that CastSpellByName is restricted. What can i do to run this function?
    Or is it better to leave this function to the blizzard?

  9. #9
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Code:
    DWORD FrameScript__Execute = (DWORD)GetModuleHandle(NULL)+0x43C230;
    bool DoString(char *command)
    {
    	__asm
    	{
                mov eax, command;
                push 0;
                push eax;
                    
                push eax;
                mov eax, FrameScript__Execute; // Lua_DoString  FrameScript__Execute = 0x43C230,
                    
                call eax;
                add esp, 0xC;
    	};
    
    	return true;
    }
    push 0 not 1, sounds like you are pushing 1...

    This code is old... I think this is the new address..

    FrameScript_Execute = 0x477080


    Also to test it just call something like

    char *DoStringArg="JumpOrAscendStart();";

    This should be a protected command...


    Also, you will need to call it from the main thread... Found an old example I coded for Terror...

    http://fbe.am/atu

    You will need to update it, the code it crap but it should get you started
    Last edited by DarkLinux; 11-01-2012 at 02:12 PM.

  10. Thanks psychoduke (1 members gave Thanks to DarkLinux for this useful post)

Similar Threads

  1. [Bot] Injection code into wow. Do you have to call functions from the main thread?
    By Miivers in forum World of Warcraft Bots and Programs
    Replies: 2
    Last Post: 01-13-2014, 02:56 PM
  2. Replies: 8
    Last Post: 07-22-2013, 01:24 AM
  3. Replies: 1
    Last Post: 08-26-2008, 10:49 PM
All times are GMT -5. The time now is 02:44 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