Endscene Injection Crash! menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    hamburger1's Avatar Member
    Reputation
    10
    Join Date
    Apr 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Endscene Injection Crash!

    Hello everyone. Got a prob :S.

    My source is crashing Wow but it should work fine o.O. Would you have a look on it and say me if i'am mistakin in any step?

    Code:
     void Inject(HANDLE phandle,DWORD Addr,string Var)
    {
    	unsigned char* Sarray = NULL;
    	int size;
    	string_to_bytearray(Var,Sarray,size);
    	cout<<"Size: "<<size<<endl;
    	WriteProcessMemory(phandle,(LPVOID *)Addr,(LPVOID)Sarray,size,NULL);
    	delete [] Sarray;
    }
    
    int main()
    {
    	//cout<<intToOpcode(1801309710-5)<<endl;
    	
    	SetDebuggPrivilege();
    	HWND WowHwnd = WinGetProcess("World of Warcraft");
    	DWORD WowPid = GetProcessId(WowHwnd);
    	HANDLE WowHandle = MemoryOpenByPid(WowPid);
    	DWORD WowBase = GetModuleBaseAddress(WowPid,"Wow.exe");
    
    	cout<<"WowHwnd: "<<WowHwnd<<" WowPid: "<<WowPid<<" WowHandle "<<WowHandle<<" WowBase: "<<WowBase<<endl;
    
    	DWORD Direct3D9__Device = 0xA7E20C;
            DWORD Direct3D9__Device__OffsetA = 0x27E8;
            DWORD Direct3D9__Device__OffsetB = 0xA8;
    
    
    	DWORD EndScene = ReadDword(WowHandle,ReadDword(WowHandle,ReadDword(WowHandle,ReadDword(WowHandle,WowBase +Direct3D9__Device)+Direct3D9__Device__OffsetA))+Direct3D9__Device__OffsetB);
    	cout<<hex<<EndScene<<endl;
    
    	void * CodeCave = VirtualAllocEx(WowHandle, 0, 2048, MEM_COMMIT,PAGE_EXECUTE_READWRITE);
    	void * injectionAddress = VirtualAllocEx(WowHandle, 0, 0x4, MEM_COMMIT,PAGE_EXECUTE_READWRITE);
    	
    	WriteInt(WowHandle,(DWORD)injectionAddress,0);
    
    	void * returnAddress = VirtualAllocEx(WowHandle, 0, 0x4, MEM_COMMIT,PAGE_EXECUTE_READWRITE);
    	WriteInt(WowHandle,(DWORD)returnAddress,0);
    
    	string EndSceneHook = "89FF5589E59C60A1"+intToOpcode((DWORD)injectionAddress)+"85C07418A1"+intToOpcode((DWORD)injectionAddress)+"FFD0A3"+intToOpcode((DWORD)returnAddress)+"BA"+intToOpcode((DWORD)injectionAddress)+"B900000000890A";
    
    	Inject(WowHandle,(DWORD)CodeCave,EndSceneHook);
    
    	int sizeJumpBack = 5;
    	cout<<"Endscene: "<<hex<<EndScene+sizeJumpBack<<endl;
    	string JumpBackStub = "E9"+intToOpcode(EndScene);
    	Inject(WowHandle,(DWORD)CodeCave + 40,JumpBackStub);
    	
    	string HookJump = "E9"+intToOpcode((DWORD)CodeCave-5);// CRASHES HERE!
    	Inject(WowHandle,EndScene,HookJump); 
    	
    	DWORD FrameScript__Execute = WowBase + 0x425A30;
    	string command = "print(\"Hello World!\")";
    
    	int nSize = command.length() + 0x100;
            void * LuaCode = VirtualAllocEx(WowHandle, 0, nSize, MEM_COMMIT | MEM_RESERVE,PAGE_EXECUTE_READWRITE);
    
    	WriteString(WowHandle,(DWORD)LuaCode, command.c_str());
    
    	string LuaDoString = "B8"+intToOpcode((DWORD)LuaCode)+"6A005050B8"+intToOpcode(FrameScript__Execute)+"FFD083C40CC3";
    	cout<<LuaDoString<<endl;
    
    	void * injectionAsm_Codecave = VirtualAllocEx(WowHandle, 0, LuaDoString.length(), MEM_COMMIT | MEM_RESERVE,PAGE_EXECUTE_READWRITE);
    	Inject(WowHandle,(DWORD)injectionAsm_Codecave,LuaDoString.c_str());
    
    	WriteDword(WowHandle,(DWORD)injectionAddress, (int)injectionAsm_Codecave);
    
    	Sleep(5000);
    
    	string DisposeHook = "89FF5589E5";
    	Inject(WowHandle,EndScene,DisposeHook.c_str());
    	
    	cout<<"DONE!"<<endl;
    	system("pause");
    }
    Is my Inject Funktion Ok?

    I tested the Binary Output - its ok
    I tested the Size - its ok
    I tested intToOpcode func - its ok

    thank you for your help!

    Endscene Injection Crash!
  2. #2
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    "89FF5589E59C60A1"+intToOpcode((DWORD)injectionAddress)+"85C07418A1"+intToOpcode((DWORD)injectionAddress)+"FFD0A3"+intToOpcode((DWORD)returnAddress)+"BA"+intToOpcode((DWORD)injectionAddress)+"B900000000890A";
    Machine code anyone?
    The whole code is a mess! Clean up and refactor your code before posting again plz... This is just ridiculous!
    And you write your asm as a string rather than as bytes. You have to prepend \x in front of each byte ("\x89\xff...").
    Get used to to JIT assembler like asmjit - Complete x86/x64 JIT Assembler for C++ Language. - Google Project Hosting. If you don't get it running, read the wiki examples.
    There are unbelievably many other bugs in your code.

  3. #3
    hamburger1's Avatar Member
    Reputation
    10
    Join Date
    Apr 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh do you know how to jump to address?

    like:
    jmp 0x12345

    or like:
    mov eax, 0x12345

    ? thats the only thing i don't get since 11 Hours -.-

    with asmjit*

  4. #4
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't jump to an address by simply putting the address into a register.
    Assembler::jmp has several overloads, choose the one which pleases you the most.
    Pretty obvious, isn't it?
    Code:
    Assembler a;
    a.jmp(0x12345);
    void* localCode = a.make();
    int codeSize = a.codeSize();
    // write localCode content to remote process
    MemoryManager::global()->free(localCode);
    // too lazy to set up unique_ptr for this example

  5. #5
    hamburger1's Avatar Member
    Reputation
    10
    Join Date
    Apr 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Done it with opcode ^^ was preatty simple :S sry that i hadn't used the debugger befor asking


    PLEAS CLOSE!

Similar Threads

  1. [Release] [C# DLL] iHook, EndScene ASM Injection!
    By -Ryuk- in forum WoW Memory Editing
    Replies: 142
    Last Post: 09-19-2022, 09:06 PM
  2. Endscene Injection Crash! ACCESS_VIOLATION
    By hamburger1 in forum WoW Memory Editing
    Replies: 17
    Last Post: 04-05-2011, 04:29 PM
  3. Replies: 11
    Last Post: 12-23-2010, 09:30 PM
  4. [Injection] EndScene: Memory Protection Attribute
    By Bananenbrot in forum WoW Memory Editing
    Replies: 7
    Last Post: 06-18-2010, 10:46 AM
  5. Interact injection crashing wow.exe
    By Hawker in forum WoW Memory Editing
    Replies: 5
    Last Post: 03-19-2009, 09:56 AM
All times are GMT -5. The time now is 05:59 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