Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 16:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Code Cave dll problem

Discussion on Code Cave dll problem within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Question Code Cave dll problem

Hi all i made a crack me with c++ which loads a message from a dll , my aim is to reverse the messagebox with another dll which patch the exe code, everything is ok but a i have a problem the patched msg is shown twice -.-" all of this is just for learning the basic of code injection.

Why with a dll when i could patch it easily in ollydbg? because ollydbg is detected by a lot of programs but a simple dll can patch code inside the program without being noticed...


Here is my code:

Some Images For Full Understanding:








If someone want to reverse by yourself could try here is the src

VT: WTF 8/46

I'm very noob in this stuff so sorry if i made a stupid comment
Attached Files
File Type: rar code cave src.rar (222.3 KB, 11 views)
elmarcia is offline  
Old 04/11/2013, 15:57   #2




 
Omdi's Avatar
 
elite*gold: 1
Join Date: Apr 2010
Posts: 13,772
Received Thanks: 15,036
Code:
__declspec(naked) void ReverseMesage(void)
{

__asm
{

call Function

Function:
push MB_OK //the patched messagebox
push offset title
push offset body
push 0 
call dword ptr MessageBoxA
ret 
}


}
You are calling "Function", which executes this code

Code:
Function:
push MB_OK //the patched messagebox
push offset title
push offset body
push 0 
call dword ptr MessageBoxA
ret
So after the ret, the code is returning to the return address which is here :

Code:
call Function
[COLOR=Red][B]<--------------------- RETURN ADDRESS[/B][/COLOR]
Function:
push MB_OK //the patched messagebox
push offset title
push offset body
push 0 
call dword ptr MessageBoxA
ret 
}
And then it will execute the same code again - MessageBox is shown twice.

This code should work fine

Code:
__declspec(naked) void ReverseMesage(void)
{

__asm
{
push MB_OK //the patched messagebox
push offset title
push offset body
push 0 
call dword ptr MessageBoxA
ret 
}


}
Omdi is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
i need cave of darkness time code
11/04/2011 - 12Sky2 - 3 Replies
i successed to make vengeful bigger and vicious smaller so i need cave's inf. time address now pls help me
Help me code-cave speed hack.
09/15/2007 - Dekaron - 7 Replies
My computer is buggy, so I can't do this; but it isn't too hard. Well, first, you need to to get the addresses for attack range and attack speed: http://www.elitepvpers.com/forum/2moons/94161-rele ase-hack-attk-range-attk-speed-all-class-excpt-bag i.html Right click the the attack speed address and choose: Find out what accesses this address.



All times are GMT +1. The time now is 16:43.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.