If i hook Wow Crash menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    If i hook Wow Crash

    Hello i found this code here at the Forum... I had changed the Pointer but if i start the programm and it trys to inject wow crashes with this error:

    Error:
    Code:
    This application has encountered a critical error:
    
    ERROR #132 (0x85100084) Fatal Exception
    Program:	C:\Programme\World of Warcraft\WoW.exe
    Exception:	0xC0000005 (ACCESS_VIOLATION) at 001B:009C744F
    
    The instruction at "0x009C744F" referenced memory at "0x009C74B4".
    The memory could not be "written".
    The code :
    Code:
    #include <Asm.au3>
    #include <Misc.au3>
    #include <Array.au3>
    #include <Memory.au3>
    #include <_Distorm.au3>
    #include <NomadMemory.au3>
    
    ; dont remove that noob or we cant write to wow process memory
    #requireadmin
    
    ;
    ; WOW 3.2.2 MEMORY OFFSET CONSTANTS
    ;
    Global Const $PLAYER_BASE  = 0x00CF8C50
    Global Const $PLAYER_BPTR1 = 0x34
    Global Const $PLAYER_BPTR2 = 0x24
    
    Global Const $Lua_Dostring = 0x007F25C0
    Global Const $GetLocalizedText = 0x9C744F
    
    ; Setting privilege
    SetPrivilege( "SeDebugPrivilege", 1 )
    
    ; Open wow process to hook endscene
    while not WinActive("World of Warcraft","")
    	Sleep(100)
    WEnd
    $wow = _MemoryOpen(WinGetProcess("World of Warcraft"))
    
    ; Makes sure WoW is open
    If @error == 1 then
      MsgBox( 0x1010, "Error", "World of Warcraft Process not found!")
      Exit
    EndIf
    
    ; Gets player base address
    $base = _MemoryRead("0x" & hex($PLAYER_BASE), $wow, "dword")
    $base_2 = _MemoryRead("0x" & hex($base + $PLAYER_BPTR1), $wow, "dword")
    $base_3 = _MemoryRead("0x" & hex($base_2 + $PLAYER_BPTR2), $wow, "dword")
    
    if $base_3 = 0 Then
      MsgBox( 0x1010, "Error", "Login to your World of Warcraft account first!")
      Exit
    endif
    
    ; get address of EndScene
    $pDevice = _MemoryRead("0x" & hex(0x00C776B8), $wow, "dword")
    $pEnd = _MemoryRead("0x" & hex($pDevice + 0x397C), $wow, "dword")
    $pScene = _MemoryRead("0x" & hex($pEnd), $wow, "dword")
    $pEndScene = _MemoryRead("0x" & hex($pScene + 0xA8), $wow, "dword")
    MsgBox("","",$pEndScene)
    ; injected code
    Global $injected_code
    
    ; check if already hooked
    $orig = _MemoryRead( "0x" & hex($pEndScene), $wow, "byte[64]" )
    
    ; autoit is garbage
    $orig_ptr = DllStructCreate("byte[64]")
    DllStructSetData( $orig_ptr, 1, $orig )
    
    ; check for push xxxxxxxx/ret/nop
    ; 0x68, 0xC3, 0x90
    if DllStructGetData( $orig_ptr, 1, 1 ) == 104 and _
       DllStructGetData( $orig_ptr, 1, 6 ) == -61 and DllStructGetData( $orig_ptr, 1, 7 ) == -112 Then
    
      $injected_code = _MemoryRead( "0x" & hex($pEndScene + 1), $wow, "dword" )
    else
      ; allocate memory to store injected code
      $injected_code = _MemVirtualAllocEx( $wow[1], 0, 2048, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE )
    
      ; Generate the STUB to be injected
      $Asm = AsmInit()
      AsmReset($Asm)
      ; save regs
      AsmAdd($Asm, "pushad")
      AsmAdd($Asm, "pushfd")
      ; check if theres something to be run
      AsmAdd($Asm, "mov esi, " & hex( $injected_code + 256 ) & "h")
      AsmAdd($Asm, "cmp dword [esi], 0" )
      AsmAdd($Asm, "jz $+73" ) ; label exit:
      ; UpdateCurMgr
      AsmAdd($Asm, "mov edx, [" & hex(0x00C93410) & "h]")
      AsmAdd($Asm, "mov edx, [ edx + " & hex( 0x2E04 ) & "h]")
      AsmAdd($Asm, "mov eax, fs:[2Ch]")
      AsmAdd($Asm, "mov eax, [eax]")
      AsmAdd($Asm, "add eax, 0x8")
      AsmAdd($Asm, "mov [eax], edx")
      ; DoString
      AsmAdd($Asm, "mov esi, " & hex( $injected_code + 1024 ) & "h")
      AsmAdd($Asm, "push 0" )
      AsmAdd($Asm, "push esi" )
      AsmAdd($Asm, "push esi" )
      AsmAdd($Asm, "mov eax, " & hex( $Lua_Dostring ) & "h" )
      AsmAdd($Asm, "call eax" )
      AsmAdd($Asm, "add esp, 0Ch" )
      ; check if theres something to be returned on
      AsmAdd($Asm, "mov esi, " & hex( $injected_code + 512 ) & "h")
      AsmAdd($Asm, "cmp dword [esi], 0" )
      AsmAdd($Asm, "jz $+2D" ) ; label exit:
      ; GetLocalizedText
      AsmAdd($Asm, "mov ecx, " & hex( $base_3 ) & "h") ; must be made dynamic
      AsmAdd($Asm, "push -1")
      AsmAdd($Asm, "push esi")
      AsmAdd($Asm, "mov eax, " & hex( $GetLocalizedText ) & "h" )
      AsmAdd($Asm, "call eax")
      AsmAdd($Asm, "cmp eax, 0" )
      AsmAdd($Asm, "jz $+11" ) ; label exit:
      ; copy return string
      AsmAdd($Asm, "mov esi, eax")
      AsmAdd($Asm, "mov edi, " & hex( $injected_code + 768 ) & "h")
      AsmAdd($Asm, "copy:")
      AsmAdd($Asm, "lodsb")
      AsmAdd($Asm, "stosb")
      AsmAdd($Asm, "cmp al, 0")
      AsmAdd($Asm, "jnz @copy")
      ; clean state busy flag
      AsmAdd($Asm, "exit:")
      AsmAdd($Asm, "xor eax, eax")
      AsmAdd($Asm, "mov edi, " & hex( $injected_code + 256 ) & "h")
      AsmAdd($Asm, "stosd")
      AsmAdd($Asm, "mov edi, " & hex( $injected_code + 512 ) & "h")
      AsmAdd($Asm, "stosd")
      ; restore regs
      AsmAdd($Asm, "popfd")
      AsmAdd($Asm, "popad")
    
      ; copy injected code
      _MemoryWrite( "0x" & hex( $injected_code ), $wow, AsmGetBinary($Asm), "byte[" & $Asm[2] & "]" )
    
      ; create hook jump
      $jmpto = AsmInit()
      AsmReset( $jmpto )
      AsmAdd( $jmpto, "push " & hex( $injected_code ) & "h" )
      AsmAdd( $jmpto, "ret")
      AsmAdd( $jmpto, "nop")
    
      ; save original instructions
      _MemoryWrite( "0x" & hex($injected_code + $Asm[2]), $wow, $orig, "byte[64]" )
    
      ; disasm original bytes
      $DecodeArray = DllStructCreate("byte[" & $sizeofDecodedInst * 64 & "]")
      $ret = distorm_decode(0,  DllStructGetPtr($orig_ptr), 64, $Decode32Bits, DllStructGetPtr($DecodeArray), 64)
    
      ; parse until we can jump back
      $sumsize = 0
      If $ret[0] == $DECRES_SUCCESS Then
        For $i = 0 To $ret[1] ; number of decoded instructions
          ; get size of 1 instruction
          $instr = DllStructCreate($tagDecodedInst, DllStructGetPtr($DecodeArray) + ($i * $sizeofDecodedInst))
          $sumsize += DllStructGetData($instr, "size")
    
          ; check if we copied enough instructions
          if $sumsize >= $jmpto[2] Then
    
            ; create jump back stub
            $jmpback = AsmInit()
            AsmReset( $jmpback )
            AsmAdd( $jmpback, "push " & hex($pEndScene + $sumsize) & "h" )
            AsmAdd( $jmpback, "ret")
            AsmAdd( $jmpback, "nop")
    
            ; write jump back
            _MemoryWrite( "0x" & hex($injected_code + $Asm[2] + $sumsize), $wow, AsmGetBinary($jmpback), "byte[" & $jmpback[2] & "]" )
            ExitLoop
          Endif
        Next
      Endif
    
      ; write jump hook
      _MemoryWrite( "0x" & hex($pEndScene), $wow, AsmGetBinary($jmpto), "byte[" & $jmpto[2] & "]" )
    EndIf
    
    ;
    ; Samples
    ;
    
    ; simple DoString()
    WowLuaDoString( $wow, "", "DEFAULT_CHAT_FRAME:AddMessage(""DoString() from AutoIt !!!"", 1, 0, 0);" );
    
    ; doString() and GetLocalizedText()
    $s_text = WowLuaDoString( $wow, "s_text", "s_text = GetMinimapZoneText();" );
    
    ; show
    MsgBox( 0, $s_text, $s_text )
    
    ; doString() and GetLocalizedText()
    $i_int = WowLuaDoString( $wow, "i_int", "i_int = GetContainerNumSlots(0);" );
    
    ; show
    MsgBox( 0, $i_int, $i_int )
    
    ; close wow memory
    _MemoryClose( $wow )
    
    Exit
    
    ;
    ; Execute Lua code in WOW main thread
    ;
    Func WowLuaDoString( $wow, $desc, $cmd )
    
      ; write ret var
      _MemoryWrite( "0x" & hex($injected_code + 512), $wow, $desc, "char[" & StringLen( $desc )+1 & "]" )
    
      ; write lua command
      _MemoryWrite( "0x" & hex($injected_code + 1024), $wow, $cmd, "char[" & StringLen( $cmd )+1 & "]" )
    
      ; change status
      $stat = 1
      _MemoryWrite( "0x" & hex($injected_code + 256), $wow, $stat, "dword" )
    
      ; wait execution
      do
        $stat = _MemoryRead( "0x" & hex($injected_code + 256), $wow, "dword" )
      Until $stat = 0
    
      ; read answer
      $ret = _MemoryRead( "0x" & hex($injected_code + 768), $wow, "char[256]" )
    
      Return $ret
    
    EndFunc

    If i hook Wow Crash
  2. #2
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    The problem is that you are running code you do not understand. You will not find many people here willing to spoon feed you.

  3. #3
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if ure gonna continue do stuff like this i suggest you drop AutoIt

Similar Threads

  1. Replies: 11
    Last Post: 12-23-2010, 09:30 PM
  2. Why Does Wow Crash whenever I Open WOW with Model MPQ..
    By Phunter72 in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 01-22-2008, 07:21 PM
  3. Please help (Wow Crashing Problem)
    By friendofdar in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 11-22-2007, 09:18 PM
  4. My WoW Crashes
    By shim in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-16-2007, 01:43 PM
  5. wow crash model change
    By 1993wow in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 09-01-2007, 07:51 AM
All times are GMT -5. The time now is 04:58 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