Nofalldmg Detour causes wow to crash menu

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 15 of 43
  1. #1
    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)

    Nofalldmg Detour causes wow to crash

    Code:
    #include <windows.h>
    #include <cstring>
    DWORD DetourAddress = 0x760D90;
    DWORD dwOrig = DetourAddress+6;
    typedef struct callsturct
    {
           BYTE opCode;
           DWORD adress;
           }Tcallstruct;
           
    void __declspec(naked) NoFallDamage_Detour()
    {
    	__asm
    	{
    		TEST DWORD PTR [ESI + 0x10], 0x1000
    		JNE RESET
    		MOV ECX, DWORD PTR [EDI + 0x7C]
    		CMP ECX, 0x38D
    		JGE RETURN
    		MOV DWORD PTR [ESI + 0x3C], ECX
    	RETURN:
    		PUSH dwOrig
    		RET
    	RESET:
    		MOV ECX, DWORD PTR [EDI + 0x7C]
    		MOV DWORD PTR [ESI + 0x3C], ECX
    		JMP RETURN
    	}
    }
    void nofalldmg(void)
    {
    	Tcallstruct call={0xE8, PtrToUlong(NoFallDamage_Detour)};
    	DWORD oldprotect;
    	VirtualProtectEx(GetCurrentProcess(),(LPVOID) DetourAddress, sizeof(call),PAGE_EXECUTE_READWRITE, &oldprotect);
        memcpy((PVOID)DetourAddress, &call, sizeof(call));
    	VirtualProtectEx(GetCurrentProcess(),(LPVOID) DetourAddress, sizeof(call), oldprotect, &oldprotect);
         
     }
    
    
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
        switch (reason)
        {
          case DLL_PROCESS_ATTACH:
               nofalldmg();
            break;
    
          case DLL_PROCESS_DETACH:
            break;
    
          case DLL_THREAD_ATTACH:
            break;
    
          case DLL_THREAD_DETACH:
            break;
        }
    
        /* Returns TRUE on success, FALSE on failure */
        return TRUE;
    }
    When I move after I injected this dll into wow, wow crashes with a memory error, the instruction at the offset XXXXXXXX referenced memory at XXXXXXXXX, the memory could not be read.
    Edit:
    I tried injecting the dll while ollydbg was attached to wow, olly told me that my dll is outside of the code segment of the PE or something like that, I'm quite sure my that's causing the crash, yet I've no Idea how to fix that issue :/.
    Last edited by Xarg0; 06-19-2008 at 02:47 PM.
    I hacked 127.0.0.1

    Nofalldmg Detour causes wow to crash
  2. #2
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Recheck your math and asm, it sounds like your detour is going out of wow's memory or that your detour is not set up right.


  3. #3
    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)
    I double checked every thing, yet I can't find a mistake in my code, maybe I'm doing something wrong when injecting my dll.
    I use a createremotethread injection with a LoadLibaryA call, I tried my dll injection on both Linux and Windows, with Linux the detour doesn't work at all, it doesn't write the function call to wows memory, with Windows I'll get an error because the function I want to call is outside of wows code segment :/
    wtf am I doing wrong >.<
    I hacked 127.0.0.1

  4. #4
    Cursed's Avatar Contributor
    Reputation
    270
    Join Date
    Jun 2007
    Posts
    1,380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are using it on Retail Servers: I think Warden checks for CreateRemoteThread (Could be wrong... Just what I remember) :P

  5. #5
    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)
    Knyox WoWObjectdumper worked with my loader ^^
    I hacked 127.0.0.1

  6. #6
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Inside your nofalldmg function, put in some code that helps you check the size of call. Make sure call is only 5 bytes long, not 9. If that's not the problem, I have no idea.

  7. #7
    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)
    Shynd, you're right, the call struct is bigger than 5 bytes, I tried to fix that problem by writing the call instruction without the call struct like this
    Code:
    BYTE opcode=0xE8;
    DWORD nofall=PtrToUlong(NoFallDamage_Detour);
    VirtualProtectEx(GetCurrentProcess(),(LPVOID) DetourAddress, 5,PAGE_EXECUTE_READWRITE, &oldprotect);
    
    memcpy((PVOID)DetourAddress, &opcode, 1);
    memcpy((PVOID)(DetourAddress+0x1), &nofall, 4);
    VirtualProtectEx(GetCurrentProcess(),(LPVOID) DetourAddress, 5, oldprotect, &oldprotect);
    this will give me a memory write error instead of a memory read error, I think the problem is the size of DWORD, it should be 4byte but it isn't, maybe I need to convert the DWORD into a BYTE Array, yet I've no Idea how to do this.
    I hacked 127.0.0.1

  8. #8
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about changing it to look like so:
    Code:
    BYTE opcode = 0xE8;
    DWORD nofall = (DWORD)NoFallDamage_Detour;
    
    VirtualProtect((LPVOID)DetourAddress, 5, PAGE_EXECUTE_READWRITE, &oldprotect);
    memcpy((PVOID)DetourAddress, opcode, 1);
    memcpy((PVOID)(DetourAddress+1), nofall, 4);
    VirtualProtect((LPVOID)DetourAddress, 5, oldprotect, &oldprotect);
    I don't know, I just typed that out without testing, but it seems to me that your PtrToULong function returns an 8-byte LONG-type variable, or something. I'm not sure.

  9. #9
    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)
    DWORD = unsigned long
    and it should be only 4bytes long, yet your code causes another memory error, the memory referenced at 0x0000001 could not be read or something like that.
    Maybe I'll just change the Nofalldmgdetour a bit and write the call instruction to another place
    I hacked 127.0.0.1

  10. #10
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why don't you do what I did for CS:S, write it byte by byte, do what you have to then rewrite it back?

    might work.


  11. #11
    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)
    You didn't write that code, I'm not saying you said you did, but still, credit where credit's due.

    [WoW] No Falling Damage - Game Deception - Forums

  12. #12
    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)
    Yeah sry forgot the credits
    btw I think I've done a big mistake in my code, the call offset is just wrong, I need to dynamical calculate it...
    I'll try if it works later and maybe upload a dll with a working nofalldmg hook ^^
    I hacked 127.0.0.1

  13. #13
    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)
    Code:
    #include <windows.h>
    #include <cstring>
    DWORD DetourAddress = 0x760D90;
    DWORD dwOrig = DetourAddress+6;
    typedef struct callsturct
    {
           BYTE opCode;
           unsigned long adress;
    	   }Tcallstruct;
           
    inline void __declspec(naked) NoFallDamage_Detour()
    {
    	__asm
    	{
    		TEST DWORD PTR [ESI + 0x10], 0x1000
    		JNE RESET
    		MOV ECX, DWORD PTR [EDI + 0x7C]
    		CMP ECX, 0x38D
    		JGE RETURN
    		MOV DWORD PTR [ESI + 0x3C], ECX
    	RETURN:
    		PUSH dwOrig
    		RET
    	RESET:
    		MOV ECX, DWORD PTR [EDI + 0x7C]
    		MOV DWORD PTR [ESI + 0x3C], ECX
    		JMP RETURN
    	}
    }
    void nofalldmg(void)
    {
    	
    	DWORD oldprotect;
    	BYTE opcode=0xE8;
    	DWORD nofall=PtrToUlong(NoFallDamage_Detour)-DetourAddress;
    	VirtualProtectEx(GetCurrentProcess(),(LPVOID) DetourAddress, 5,PAGE_EXECUTE_READWRITE, &oldprotect);
        memcpy((PVOID)DetourAddress, &opcode,1);
    	memcpy((PVOID)(DetourAddress+1), &nofall,4);
    	VirtualProtectEx(GetCurrentProcess(),(LPVOID) DetourAddress, 5, oldprotect, &oldprotect);
    	return;
         
     }
    
    
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
        switch (reason)
        {
          case DLL_PROCESS_ATTACH:
               nofalldmg();
            break;
    
          case DLL_PROCESS_DETACH:
            break;
    
          case DLL_THREAD_ATTACH:
            break;
    
          case DLL_THREAD_DETACH:
            break;
        }
    
        /* Returns TRUE on success, FALSE on failure */
        return TRUE;
    }
    still doesn't work for me
    Here's the a link to the compiled dll
    RapidShare: Easy Filehosting
    I hacked 127.0.0.1

  14. #14
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be uh... DetourAddress-(NoFallDamage_Detour+5) or something, I think. Something like that.

  15. #15
    beagle's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is probably a REALLY noob question, but is it possible to get the address for fall damage using a memory editor for say, Age of Conan? Sorry for asking here but theres nothing really about fall damage on the Conan forums. The reason I ask here is because i thought maybe it might be similar to this game, plus you are all very knowledgable on these kinds of things, so i thought i might as well ask .

Page 1 of 3 123 LastLast

Similar Threads

  1. [Question] Mounting causes WoW crashing
    By Nerfretplz in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 12-27-2008, 11:54 PM
  2. [Question] WoW keep crashing in new zones or discovery?
    By Frombehind in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 04-04-2008, 05:27 PM
  3. WoW keeps crashing
    By zeratul774 in forum World of Warcraft General
    Replies: 3
    Last Post: 07-14-2007, 12:15 PM
  4. WoW keeps crashing...
    By zeratul774 in forum Community Chat
    Replies: 2
    Last Post: 07-13-2007, 11:28 PM
  5. Making WoW Clients crash
    By Siker in forum World of Warcraft Exploits
    Replies: 103
    Last Post: 12-31-2006, 09:42 AM
All times are GMT -5. The time now is 08:50 PM. 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