Why my approach to create a codecave is not working ? menu

Shout-Out

User Tag List

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

    Why my approach to create a codecave is not working ?

    Well i am trying to create a codecave... this is my first time trying. i have injected the dll successfully in the target but my custom codecave is not getting called

    Code:
    #include <Windows.h>
    
    __declspec(naked) void codecave()
    {
    	__asm
    	{
    		PUSHAD
    		PUSHFD
    	}
    
    	MessageBox(NULL, "ROCK", "THE", MB_ICONINFORMATION);
    
    	__asm
    	{
    		POPFD
    		POPAD
    		ret
    	}
    }
    
    __declspec(naked) void *shortcut(const byte *dst)
    {
    	__asm{
    		jmp dst
    	}
    }
    
    void CreatRoute(byte *src, const byte *dst)
    {
    	DWORD oldProtection;
    	VirtualProtect(src, sizeof(dst), PAGE_EXECUTE_READWRITE, &oldProtection);
    	memcpy((byte*)shortcut(dst), src, sizeof(dst));
    	VirtualProtect(src, sizeof(dst), oldProtection, &oldProtection);
    }
    
    BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
    	switch (dwReason)
    	{
    	case DLL_PROCESS_ATTACH:
    		MessageBox(NULL, "DLL loaded!", "MyDLL", MB_ICONINFORMATION);
    		CreatRoute((BYTE*)0x00E54D20, (BYTE*)codecave);
    		break;
    	case DLL_PROCESS_DETACH:
    		MessageBox(NULL, "DLL unloaded!", "MyDLL", MB_ICONINFORMATION);
    		break;
    	default:
    		break;
    	}
    
    	return TRUE;
    }

    Why my approach to create a codecave is not working ?

Similar Threads

  1. [Help] Dont know why its not working!
    By GRB in forum WoW Memory Editing
    Replies: 34
    Last Post: 05-09-2009, 10:08 AM
  2. [Question] Why the patch not works?
    By Angelopascuzzi in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 08-05-2008, 04:48 AM
  3. Why my model edit is not working
    By metempsicosi in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 06-03-2008, 02:05 PM
  4. Why do my helmfixes not work with Glitchys MES
    By Tiar in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 06-03-2008, 02:04 AM
  5. Why is my shoutbawx not working?
    By Pyr0 in forum Community Chat
    Replies: 1
    Last Post: 01-31-2008, 01:02 PM
All times are GMT -5. The time now is 07:36 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