Re: [Release] Adding New Option C++ Source Code + Full Tutorial [Updated & Fixed]
P.S. i'm italian, sorry for bad english!
link for pictures :
To view the content, you need to sign in or register
Tools Needed:
OllyDbg (Olly Debugger)
LordPE (Portable Executable Editor)
This is the fastest way to hook your dll into an exe file.
(yes without check etc etc.. i don't have time now)
Let's GO:
Open your exe in ollydbg (in this sample i show u my gs_cs)
When olly have finished to analyze the code u are on the OPE of your file.
In my case is : 005B63C1 (take note of it)
Now its time to search codecave point to inject our code.
scroll down and find some "DB 00" like in the picture 01.
Ok select some of this lines like in the picture 02
click with your dx mouse button and select "Binary->Edit"
or press "CTRL+E"
Write your dll name (for me is "VcorpCS.dll") then press "OK".
Now its time to reanalyze your code press "CTRL+A" and wait.
Now do the same for your Procedure name . (i have called it InitDLL)
in the source sample in this thread the name is: OptionAndBugFix
Ok it's time to write our code to load and initialize our dll.
Select the line where u want start ( i'm start writing from 005EFD1A )
P.S. Keep in your mind the line from u start write your code.
Ok pres SPACE or double click to Assemble the code necessary like in the picture 06:
PUSH 005EFCF6
CALL LoadLibraryA
TEST EAX,EAX
MOV DWORD PTR DS:[5EFCF2],EAX
PUSH 005EFD07
PUSH EAX
CALL GetProcAddress
TEST EAX,EAX
CALL EAX
JMP 005B63C1
Code:
============THIS IS WHAT U GET AFTER REANALIZYNG YOUR CODE (CTRL+A)================================
005EFD1A > . 68 F6FC5E00 PUSH 005EFCF6 ; /FileName = "VcorpCS.dll" New OEP
005EFD1F . E8 5320217C CALL LoadLibraryA ; \LoadLibraryA
005EFD24 . 85C0 TEST EAX,EAX
005EFD26 . A3 F2FC5E00 MOV DWORD PTR DS:[5EFCF2],EAX
005EFD2B . 68 07FD5E00 PUSH 005EFD07 ; /ProcNameOrOrdinal = "InitDLL"
005EFD30 . 50 PUSH EAX ; |hModule
005EFD31 . E8 6AB0217C CALL GetProcAddress ; \GetProcAddress
005EFD36 . 85C0 TEST EAX,EAX
005EFD38 . FFD0 CALL EAX
005EFD3A .^E9 8266FCFF JMP 005B63C1 ; JMP to Original OEP ^^
if everything is done it's time to save your mod:
click with your dx mouse button and select "Copy to executable->All modification"
then in the windows click on "copy all"
and then in the new window click with your dx mouse button in the gray area and select "save file"
give it a new name and u are done!!!
Now open your new saved file with LordPE:
Open LordPE, click on the button "PE Editor" and select your file
on the EntryPoint Label write down your new OEP (is the code where u have write your new function with olly).
For me is: 001EFD1A.
Then press Save.
Enjoy!