EMO Style ForumPro - Hos Geldiniz
[Tut(C++)] Hooking Functions Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
[Tut(C++)] Hooking Functions Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

pointer  loot  kutu  

Kimler hatta?
Toplam 5 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 5 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
[Tut(C++)] Hooking Functions I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
[Tut(C++)] Hooking Functions I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
[Tut(C++)] Hooking Functions I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
[Tut(C++)] Hooking Functions I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
[Tut(C++)] Hooking Functions I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
[Tut(C++)] Hooking Functions I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
[Tut(C++)] Hooking Functions I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
[Tut(C++)] Hooking Functions I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
[Tut(C++)] Hooking Functions I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

[Tut(C++)] Hooking Functions

Aşağa gitmek

[Tut(C++)] Hooking Functions Empty [Tut(C++)] Hooking Functions

Mesaj tarafından EMO C.tesi Haz. 25, 2011 4:40 am

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
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
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

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz