Register for your free account! | Forgot your password?

You last visited: Today at 10:04

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

Advertisement



[Guide]Codecave

Discussion on [Guide]Codecave within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1


 
MeGaMaX's Avatar
 
elite*gold: 48
Join Date: Sep 2006
Posts: 1,087
Received Thanks: 2,584
Post [Guide]Codecave

Hello !

long time didn't post topic or something into conquer sections but i hope this time its useful.

What is code cave:

A code-whoah ? Unless you have spent some time working in the area of reverse engineering, chances are you have not heard of the term codecave before.
A codecave can best be defined as a redirection of program execution to another location and then returning back to the area where program execution had previously left." In a sense, a codecave is no different in concept than a function call, except for a few minor differences. If a codecave and a function call are so similar, why do we need codecaves at all then ? The reason we need codecaves is because source code is rarely available to modify any given program. As a result, we have to physically (or virtually) modify the executable at an assembly level to make changes.





What you want is:

1: Assembly programming knowledge.
2: Ollydebug.
3: Logic.
4: Brain.

Lets start:

I will choose msgserver.exe for example but you can do that with any program that you want to modify.

I will target the BFK function into the msgserver for example



I will see if the selected block is used by any other functions or no



Seems its not used so that's ok and if it use by others address you will have to change the original address to your new memory address



I will take copy of the selected block by binary copy



Now i will go at the end of the msgserver.exe and i will choose some free memory address and past the copied binary there



Its will looks like that



If you found the call address changed like that at the pictures you have to re back them to the original address

call 005990E0 > call 004BB4C0

But for example i don't want the BFK to be the same static memory address

mov eax, 0x4EDF2C , i will go to 0x4EDF2C

Now i found that

Code:
004EDF2C    44              inc     esp
004EDF2D    52              push    edx
004EDF2E    36:35 34647433  xor     eax, 0x33746434
004EDF34    34 74           xor     al, 0x74
004EDF36    72 67           jb      short 004EDF9F
004EDF38    34 55           xor     al, 0x55
004EDF3A    49              dec     ecx
004EDF3B    36:0000         add     byte ptr ss:[eax], al
That's equal



Now i will go to my new memory address and write any 16 letter or numbers,
I will let some memory address and select some address then right click > binary > edit and write my 16 number or letters and at the end i will put 00 in hex then press ok.



Now i will edit call 004BB4C0 to JMP into my new memory address like



To

JMP 00581814

It will be like that and i fill the other 2 address with 00 because i don't need them anymore



And this is my new memory address



Now with at my new address i will edit

0058181C B8 2CDF4E00 mov eax, 004EDF2C

004EDF2C to my new BFK address the highlighted one



Now at the end of my code i will JMP back to the next address after the address that i filled with 00 i will jump here the highlighted address



So now my codecave looks like



Now i will search if there is any other address use the old BFK and i found one



If you want to codecave that one too make the above steps if you just want to use the new BFK address then edit it to the new BFK address so it will be like mov eax, 00581828

Now i will go back to the BFK old address and fill it with 00 and the address is 0x4EDF2C

It will looks like.



Now i just codecave new BFK address and i fill the old with 00 because no use for them.

Notice: You can do that with for example new weapon type for conquer character and the client doesn't support the type of it so you will look at the function at the new conquer.exe and make jump from the function that responsible about reading weapons type and then jump back to the rest of the code so its will looks like you made the client read the code you add and make it continue execution for sure you will do that at the old conquer client

Thanks for reading hope i helped.

Because nTL3fTy mad : Draw graphic goes to Pushedx

Greetings: Andrew.
MeGaMaX is offline  
Thanks
7 Users
Old 02/04/2013, 13:24   #2
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Credit:
nTL3fTy is offline  
Thanks
3 Users
Old 02/04/2013, 13:35   #3


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Should have been posted in Programming and not PServer Guides also.
Korvacs is offline  
Old 02/04/2013, 13:38   #4
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
#moved
Lateralus is offline  
Old 02/04/2013, 15:30   #5
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Interesting...
Super Aids is offline  
Old 02/04/2013, 20:25   #6


 
MeGaMaX's Avatar
 
elite*gold: 48
Join Date: Sep 2006
Posts: 1,087
Received Thanks: 2,584
Quote:
Originally Posted by nTL3fTy View Post
you mean only the start description and the guide totally different
MeGaMaX is offline  
Old 02/04/2013, 21:58   #7
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by androw3349 View Post
you mean only the start description and the guide totally different
Someone else made those graphics and should be given credit.
nTL3fTy is offline  
Old 02/04/2013, 22:27   #8


 
MeGaMaX's Avatar
 
elite*gold: 48
Join Date: Sep 2006
Posts: 1,087
Received Thanks: 2,584
Quote:
Originally Posted by nTL3fTy View Post
Someone else made those graphics and should be given credit.
You came here to give him credits xD, He is my friend u mad .

lets end this spam

Draw graphic goes to Pushedx
MeGaMaX is offline  
Reply


Similar Threads Similar Threads
best codecave video tsearch tutorial
07/29/2013 - Coding Tutorials - 14 Replies
just upping it here because the old website where I've got it is down.
[GUIDE] Item Filter Guide | Cabal Crafting & Dungeon Guide by Dewa Gempak.
06/15/2008 - Cabal Guides & Templates - 5 Replies
Since its his work, just SHARING it here, i just gonna link his URL from his work. because i dont like copy and pasting other ppl's guides: http://119.110.98.150:90/ipb/index.php?showtopic= 1145 Q#1: Does it work with CabalRider (PH)? A#1: Yes, it works, i tried it personally myself. Q#2: I'm too dumb to understand it, how to make it work. A#2: Try reading it again and again, if u still don't know how, don't use it then sleep.gif



All times are GMT +1. The time now is 10:04.


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.