Trouble with EndScene hook menu

User Tag List

Results 1 to 2 of 2
  1. #1
    LdGn29's Avatar Member
    Reputation
    1
    Join Date
    Oct 2018
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with EndScene hook

    I'm trying to install hook, but always game crashes with some weird exceptions

    All what I do is:
    1)Allocate memory
    2)Write some instructions + first 5 bytes of EndScene + jmp back
    3)Write jmp to allocated memory

    Instructions:
    Code:
    string[] asm = new string[]
    {
    "pushfd",
    "pushad",
    "popad",
    "popfd
    }
    (It is because earlier here was some logic that doesn't work)

    Next I read first 5 bytes of EndScene and inject them after ASM bytecode:
    Code:
    Memory.Write(detourAddress + (uint)asmLength, Memory.Read(pEndScene, 5));
    And then I write jump to (pEndScene + 5)

    I write jump to my detour in pEndScene and game crashes with ACCESS_VIOLATION exception and gives me address of instruction at (pEndScene + 0xB)
    I tried to fix that, swapped first 5 bytes of EndScene with my ASM bytecode, took 6 bytes and wrote jmp + nop, but it also gives exceptions
    Last was also ACCESS_VIOLATION but now at (detourAddress + 0x76), although my code only 24-25 bytes length including jump back

    Also in crash report I found that WoW uses D3D9 adapter.

    What I did wrong?
    Last edited by LdGn29; 01-23-2019 at 12:29 PM.

    Trouble with EndScene hook
  2. #2
    charles420's Avatar Contributor
    Reputation
    315
    Join Date
    Jun 2009
    Posts
    329
    Thanks G/R
    25/119
    Trade Feedback
    0 (0%)
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    suspend WoW main thread
    -allocate memory for your codecave and copy all your code there
    -alter EndScene memory page properties to be able to write at
    -write jmp opcode at the beginning
    -resume thread and probably set all changed properties back

Similar Threads

  1. [Sample Code] EndScene Hook with ASM and blackmagic
    By RivaLfr in forum WoW Memory Editing
    Replies: 89
    Last Post: 05-13-2021, 03:26 PM
  2. Trouble with custom item for my antrix server.
    By phc_chaos in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 10-14-2007, 02:31 PM
  3. Trouble with Human Male -> Orc male
    By warningfromspace in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 07-11-2007, 05:38 PM
  4. [Question] Trouble with Helm Fix
    By PhyrreFly in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 06-13-2007, 10:35 AM
  5. Trouble with MyWarcraftStudio, help greatly appreciated
    By kekburtbhkeke in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 04-28-2007, 05:22 PM
All times are GMT -5. The time now is 03:48 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