Giriş yap
En iyi yollayıcılar
Hello EMO | ||||
EMO | ||||
eMoStyLe | ||||
BesimBICER | ||||
GameKinG | ||||
Crysis | ||||
~>!.DεvιLρяιεsт.!<~ | ||||
MeTaL | ||||
TrueCrime | ||||
djhayal3t |
Istatistikler
Toplam 203 kayıtlı kullanıcımız varSon kaydolan kullanıcımız: crayzboy76
Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Arama
Sosyal yer imi
Sosyal bookmarking sitesinde Emo, Emo nedir, Emo resimleri, Emo Kıyafetleri, Emo Sözleri, Emo Oyunları, EmoTurkey, Emo Nickler, Emo Avatarları, Punk, Punk Resimleri, Punk Avatarları, Rock, Rock Resimleri, Rock Avatarları, Msn Nickleri, Msn Avatarları, Müzik adresi saklayın ve paylaşın
Sosyal bookmarking sitesinde EMO Style ForumPro - Hos Geldiniz adresi saklayın ve paylaşın
Kimler hatta?
Toplam 5 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 5 Misafir Yok
Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
Reklam
[Tut(C++)] Hooking Functions
1 sayfadaki 1 sayfası
[Tut(C++)] Hooking Functions
Hooking Functions
Requested Knowledge :- Quite a bit of C++ Programming knowledge
- Debugging Knowledge
- Know how DLLs work and inject
- Knows what a function is.
- Can locate functions in a debugger
Required Tools :
- C++ Compiler(NOT DEV-C++,does't compile DLLs that work)
- OllyDbg(Or an alternative debugger)
- Detour.h\detour.cpp files (Download in attachments)
- DLL Injector
- TargetApplication.exe(Download In Attachments)
Whats is 'Hooking A Function"?
Hooking a function is simply replacing a function with yours, or having your function called
before\after the targeted function, you could also pass paramters to the targeted function when its called.
Step one, locating the function of our target.
Well, we can run the application and you will see that the text "Hello" pops up, and when you hit return, it adds another line with the text "Hello", eventually creating an array of lines with the text "Hello". Finding this function is quite easy to do, we could step through it and examine the program, or we could just search for the ASCII string "hello" in out hex dump. We will find it at 00401082. And a reference to it at 00401082. There you should see an array of pushes followed by a call.
401080 PUSH ESI
401081 PUSH EDI
401082 PUSH 004120B0
401087 PUSH 00413DF0
40108C CALL 00401AA0
and you can see that 00401080 is the start of our function, thus thats the one we need to hook.
Step Two, Creating the hook.
#include
#include "detours.h"
int (__stdcall* HelloFunction)(void);
void HookHelloFunction(void)
{
MessageBox(0, "You called the function : "Hello"", "Function Called", MB_OK);
return;
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
HelloFunction = (int (__stdcall*)(void))DetourFunction((PBYTE)0x0040108 0, (PBYTE)HookHelloFunction);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
DetourRemove((PBYTE)0x00401080, (PBYTE)HelloFunction); //Remove hook
break;
}
return TRUE;
}
A couple new things, first of all the :
int (__stdcall* HelloFunction)(void);
Thats basically the structure of our targeted function.
Then you see void HookHelloFunction(void), thats basically the function where hooking.
The rest should be quite strait forward.
DetourFunction(FunctionWithinProcess, FunctionToReplaceItWith)
and
DetourRemove(HookedFunction,HelloFunction)
EMO- EMO Team
- Cinsiyet :
Burçlar :
Mesaj Sayısı : 184
Puan : 247443
Rep Puanı : 5
Doğum tarihi : 28/11/89
Kayıt tarihi : 18/05/11
Yaş : 34
Nerden : EMO world
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO
Similar topics
» D3d hooking
» API Hooking by IAT Patching
» Hooking address (GCC)
» [C/C++] Hooking Tutorial
» [Tutorial][SourceCode] SEH/thread hooking
» API Hooking by IAT Patching
» Hooking address (GCC)
» [C/C++] Hooking Tutorial
» [Tutorial][SourceCode] SEH/thread hooking
1 sayfadaki 1 sayfası
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz
Cuma Ağus. 29, 2014 8:33 am tarafından Hello EMO
» goldenchase.net maden yaparak para kazanma
Cuma Ağus. 29, 2014 8:18 am tarafından Hello EMO
» etichal hacker görsel egitim seti
Çarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO
» KO TBL Source C#
Ptsi Ara. 09, 2013 6:36 am tarafından Hello EMO
» x86 Registers
C.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO
» [Tutorial] Pegando Address, Pointers de WYD
Çarş. Tem. 10, 2013 7:25 am tarafından Hello EMO
» [Tutorial] Pegando Address, Pointers de CS Metodo²
Çarş. Tem. 10, 2013 7:23 am tarafından Hello EMO
» [Tutorial] Aprendendo basico deASM OLLYDBG
Çarş. Tem. 10, 2013 7:22 am tarafından Hello EMO
» Basic C# DLL injector
Ptsi Tem. 08, 2013 7:48 am tarafından Hello EMO