[Out of Process] Calling functions in the VTable. menu

User Tag List

Results 1 to 13 of 13
  1. #1
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Out of Process] Calling functions in the VTable.

    So I am trying to call GetObjectName(), VMT #47, but it keeps crashing wow.

    So here is the code I got so far but I am stumped to why its crashing WoW.

    Code:
    void __declspec(naked) __start_GetObjName()
    {
    	__asm
    	{
    		MOV EDX, [0x011CA310]
    		MOV EDX, [EDX+0x28A4]
    		MOV EAX, FS:[0x2C]
    		MOV EAX, [EAX]
    		ADD EAX, 8
    		MOV [EAX], EDX
    		
    		MOV ECX, [0xDEADBEEF] // WoW uses ECX to store class pointer?
    		MOV EDX, [0xDEADBEEF] 
    		MOV EAX, [EDX + 4 * 47] // Get the address of GetObjectName()
    		CALL EAX
    		RETN
    	}
    }
    void __end_GetObjName() { }
    Here is the injecting code.

    Code:
    // Create our injector
    gpWoW->GetSyringe()->CreateInjector( (unsigned long)__start_GetObjName, dwFuncLen, "GetObjectName" );
    
    // Inject our code into a code cave.
    gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->Inject();
    		
    // Set the 0xDEADBEEF offsets to the correct class pointer.
    gpWoW->GetSyringe()->GetMemory()->SetMem( ((unsigned long)gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->GetAllocAddr() + 0x19), m_dwObject  );
    gpWoW->GetSyringe()->GetMemory()->SetMem( ((unsigned long)gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->GetAllocAddr() + 0x1E), m_dwObject  );		
    
    // Execute returns the DWORD exit code of GetExitCodeThread();
    dwLvl02 = gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->Execute();
    Everything injects find and the memory gets changed correctly but when every it gets to the Execute() line. Wow just crashes. There is no crash dump or anything it just closes.

    [Out of Process] Calling functions in the VTable.
  2. #2
    shomoiog's Avatar Member
    Reputation
    20
    Join Date
    Dec 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You try to call functions out of process. 'Nuff said.

  3. #3
    Sillyboy72's Avatar Member
    Reputation
    13
    Join Date
    Jan 2009
    Posts
    66
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, this isn't "out of process" that is just a poor choice of words. Injecting and calling a function should mostly work fine.

    But really, you are gonna have to hook a debugger and figure out wtf is going on. could be a stack cleanup issue? could be all kinds of things.

    The idea is that the DWORD returned (via eax/threadexitcode) will be the address to read in wow to grab the name? sounds possible enough

    gotta say... injecting a dll and just staying in process is like 926x easier.

  4. #4
    bigtimt's Avatar Active Member
    Reputation
    41
    Join Date
    Mar 2008
    Posts
    100
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the get object name function has one parameter
    Code:
    GetObjectName(DWORD ObjectBaseAddress)
    from what i think i remember, so you have to push ObjectBaseAddress onto the stack

    and if it is a stack cleanup issue i believe you would add

    Code:
    add esp, (4 * Number of Parameters)
    after call eax

  5. #5
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not positive, but I think that GetObjName() has a static address, and all of the CG_XXX inherit it. You have to move ObjBase to ecx and then find the address. It should work.

  6. #6
    shomoiog's Avatar Member
    Reputation
    20
    Join Date
    Dec 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is not "bad choice of words" is ignorance, he has no damn clue what is he doing. If it crashes and you want help, provide the stack/registers snapshots. This is not voodoo, reproduce what you consider a sequence of magic words and symbols to find out why you get turned into to a chicken. The fact that wow "just crashes" and the OP is mesmerized about how this could be happening when he's tempering with it's execution flow says a lot.

    This forum is in incredible resource, hat's off to those that actually added the useful stuff, but there is also a lot of "omgz I wanna haxxor wow, I don't know what "injecting" means or that a plane has two dimensions, but cat I has some sources to has imba haxxx?!!?? I learned at school to press F5 to compile/run, I am am so coool!"

    I've been reading this forum for a few days now, and I found absolutely everything I could ever need to find out in order to get me started on this matter. I am an uber newb to wow reversing, I haven't seen mnemonics in years, and I am still annoyed by more than 70% of the posts. I have no idea how the "big" guys put up with it.

    Thanks Cypher, Kynox and everyone else that made this a fun journey.

  7. #7
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope. GetObjectName is a virtual method.

    // Virtual function 47.
    virtual const char* GetObjectName();

  8. #8
    shomoiog's Avatar Member
    Reputation
    20
    Join Date
    Dec 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    I'm not positive, but I think that GetObjName() has a static address, and all of the CG_XXX inherit it. You have to move ObjBase to ecx and then find the address. It should work.
    Wouldn't that negate the whole polymorphism idea? Not to mention that adding "virtual","static" and "inheritance" in the same sentence makes little baby Jesus cry...

  9. #9
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I said I'm not positive, no need to flame bro.

    EDIT: I guess I was thinking about UpdateModel() or something.
    Last edited by lanman92; 01-31-2009 at 02:06 AM.

  10. #10
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by shomoiog View Post
    Is not "bad choice of words" is ignorance, he has no damn clue what is he doing. If it crashes and you want help, provide the stack/registers snapshots. This is not voodoo, reproduce what you consider a sequence of magic words and symbols to find out why you get turned into to a chicken. The fact that wow "just crashes" and the OP is mesmerized about how this could be happening when he's tempering with it's execution flow says a lot.

    This forum is in incredible resource, hat's off to those that actually added the useful stuff, but there is also a lot of "omgz I wanna haxxor wow, I don't know what "injecting" means or that a plane has two dimensions, but cat I has some sources to has imba haxxx?!!?? I learned at school to press F5 to compile/run, I am am so coool!"

    I've been reading this forum for a few days now, and I found absolutely everything I could ever need to find out in order to get me started on this matter. I am an uber newb to wow reversing, I haven't seen mnemonics in years, and I am still annoyed by more than 70% of the posts. I have no idea how the "big" guys put up with it.

    Thanks Cypher, Kynox and everyone else that made this a fun journey.

    Are you done dude? All I am hearing from you is :cry2: :cry2: :cry2: :cry2:

    Just STFU and GTFO! Your post is nothing but a waste of time. When I say out of process I am talking about the program that injects the code into WoW is a stand alone app. **** people hear one word and start crying like a little bitch!

    You talk so much shit but then you go and say this.

    Originally Posted by shomoiog View Post
    You try to call functions out of process. 'Nuff said.
    Your such a TARD!!!!!!


    Originally Posted by Sillyboy72 View Post
    Well, this isn't "out of process" that is just a poor choice of words. Injecting and calling a function should mostly work fine.

    But really, you are gonna have to hook a debugger and figure out wtf is going on. could be a stack cleanup issue? could be all kinds of things.

    The idea is that the DWORD returned (via eax/threadexitcode) will be the address to read in wow to grab the name? sounds possible enough

    gotta say... injecting a dll and just staying in process is like 926x easier.
    Ya I agree the DLL injection much easier. I have a dll I wrote, with all the help i got from Cypher, Kynox, and Bobbysing, that does what I need it to.

    I am doing this out of process thing just for fun and not really taking it to serious. Something to work on when I am tired of working on the normal projects.

    I posted this right before going to work hoping maybe someone had the same problem. Ill run through it with a debugger now that I am home. Thanks for the tip and I am assuming that the GetThreadExitCode returns the address :X I haven't looked into it yet to see if thats how it works because I am on the ASM crashing wow. Think of it as a place holder.
    Last edited by cenron; 01-31-2009 at 02:21 AM.

  11. #11
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cenron, try to pause wow's mainthread before you execute your code cave and resume it afterwards.
    SuspendThread is your friend
    It's very likely to be a threading issue, WoW's Mainthread accesses the CurMgr Object and you do so too, this results in a crash.
    If your code still doesn't work after implementing this, you messed up somewhere else and you'll need to debug your code, OllyDBG is your friend as well
    I hacked 127.0.0.1

  12. #12
    kynox's Avatar Account not activated by Email
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guys, think for a second. Why would GetObjectName even need to enumerate the linked object list? You pass it the fkn object.

  13. #13
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THANKS FOR ALL THE HELPS GUYS! But with some time spent with Olly I figure out what the problem was. Anyway here is revised code that works currently.

    Code:
    // GetObjectName() VTable Function stub.
    void __declspec(naked) __start_GetObjName()
    {
    	__asm
    	{
    		MOV EDX, [0x011CA310]
    		MOV EDX, [EDX+0x28A4]
    		MOV EAX, FS:[0x2C]
    		MOV EAX, [EAX]
    		ADD EAX, 8
    		MOV [EAX], EDX
    		MOV ECX, 0xDEADBEEF
    		MOV EDX, [ECX]
    		MOV EAX, [EDX + 4 * 47]
    		CALL EAX
    		RETN
    	}
    }
    void __end_GetObjName() { }
    unsigned long dwGetObjNameLen = ((unsigned long)__end_GetObjName - (unsigned long)__start_GetObjName);
    // End of GetObjectName()
    Injection code.

    Code:
    gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->Inject();
    gpWoW->GetSyringe()->GetMemory()->SetMem( ((unsigned long)gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->GetAllocAddr() + 0x19), m_dwObject  );
    	
    dwLvl02 = gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->Execute();
    gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->CleanUp();
    Sillyboy72: So I did confirm that GetThreadExitCode() does return the address of EAX, which is where the name is stored.


    Hope this helps someone out.

Similar Threads

  1. [Question] C# EasyHook calling the original function crashes the program
    By chronicxo in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 12-20-2016, 09:05 AM
  2. [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
  3. [Help] Accessing a function Out of Process
    By cenron in forum WoW Memory Editing
    Replies: 18
    Last Post: 10-14-2008, 05:49 AM
  4. I Got Called on by the Wow Police
    By Cradin in forum WoW Scam Prevention
    Replies: 55
    Last Post: 10-07-2008, 06:44 PM
  5. Can you read player names out of process?
    By sweeper18 in forum WoW Memory Editing
    Replies: 10
    Last Post: 07-06-2008, 08:54 PM
All times are GMT -5. The time now is 05:06 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