EMO Style ForumPro - Hos Geldiniz
API Hooking by IAT Patching Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
API Hooking by IAT Patching 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

loot  pointer  kutu  

Kimler hatta?
Toplam 4 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 4 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
API Hooking by IAT Patching I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
API Hooking by IAT Patching I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
API Hooking by IAT Patching I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
API Hooking by IAT Patching I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
API Hooking by IAT Patching I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
API Hooking by IAT Patching I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
API Hooking by IAT Patching I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
API Hooking by IAT Patching I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
API Hooking by IAT Patching I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

API Hooking by IAT Patching

Aşağa gitmek

API Hooking by IAT Patching Empty API Hooking by IAT Patching

Mesaj tarafından Hello EMO Çarş. Nis. 25, 2012 10:27 pm

Binary_Death demiş ki:Gracias al tutorial de YST & Hacker_Zero entendí el API Hooking, pero por desgracia ese manual quedó a medias y jamás se explicó el método para hookear una API modificando la IAT.

Me puse y salió esto, cualquier error por favor decidmelo:

Kod:
.386
.model flat, stdcall
option casemap:none

assume fs:nothing

include windows.inc
include kernel32.inc
include user32.inc
includelib kernel32.lib
includelib user32.lib


.data
   Process               db 'ejecutable.exe',0
   Kernel               db 'kernel32.dll',0
   GetProc               db 'GetProcAddress',0
.data?
   Function            dd ?
   FunctionLen            dd ?
   pInfo                  PROCESS_INFORMATION <>
   sInfo                  STARTUPINFO <>
function_start PROTO
.code
start:
      invoke CreateProcess,0,addr Process,0,0,0,0,0,0,addr sInfo,addr pInfo
      
      mov eax,offset function_end
      sub eax,offset function_start
      mov [FunctionLen],eax
      
      invoke VirtualAllocEx,[pInfo.hProcess],0,[FunctionLen],MEM_COMMIT+MEM_RESERVE,PAGE_EXECUTE_READWRITE
      mov [Function],eax
      
      invoke GetModuleHandle,offset Kernel
      mov [KernelBase],eax
      push offset GetProcAddressName
      
      invoke GetProcAddress,eax,offset GetProc
      mov [pGetProcAddress],eax
      
      invoke WriteProcessMemory,[pInfo.hProcess],[Function],offset function_start,[FunctionLen],0
      invoke CreateRemoteThread,[pInfo.hProcess],0,0,[Function],0,0,0
      invoke ExitProcess,0

;Injecting Function
function_start PROC
    call delta
      delta:
         pop ebp
         sub ebp, offset delta
         mov ebx, fs:[030h]
         ;Getting host process IAT address and its size
         mov eax,[ebx+08h]
         mov ebx,[eax+03Ch]
         add ebx,eax
         mov edx,[ebx+0D8h]
         add edx,eax
         mov [ebp+pIAT],edx
         mov edx,[ebx+0DCh]
         mov [ebp+IATsize],edx
         
         ;Getting the needed API's
            ;GetModuleHandle
         mov ebx,offset GetModuleHandleName
         add ebx,ebp
         push ebx
         push dword ptr [ebp+KernelBase]
         call [ebp+pGetProcAddress]
         mov [ebp+pGetModuleHandle],eax
            ;VirtualProtect
         mov ebx,offset VirtualProtectName
         add ebx,ebp
         push ebx
         push dword ptr [ebp+KernelBase]
         call [ebp+pGetProcAddress]
         mov [ebp+pVirtualProtect],eax
         ;Getting address of MessageBox
         mov ebx,offset user32name
         add ebx,ebp
         push ebx
         call [ebp+pGetModuleHandle]
         mov ebx,offset MessageBoxName
         add ebx,ebp
         push ebx
         push eax
         call [ebp+pGetProcAddress]
         mov [ebp+pMessageBox],eax
         ;Showing a MessageBox
         push MB_OK + MB_ICONINFORMATION
         push 0
         mov ebx,offset MsgInjected
         add ebx,ebp
         push ebx
         push 0
         call [ebp+pMessageBox]
         ;Finding pointing address
         xor edx,edx
         mov eax,[ebp+IATsize]
         mov ecx,04h
         div ecx
         mov ecx,eax
         mov eax,[ebp+pMessageBox]
         mov edi,[ebp+pIAT]
         repnz scasd
         sub edi,04h
         ;Patching the IAT
         mov ebx,offset OldProtect
         add ebx,ebp
         push ebx
         push PAGE_EXECUTE_READWRITE
         push 04h
         push edi
         call [ebp+pVirtualProtect]
         mov ebx,offset Hook
         add ebx,ebp
         mov [edi],ebx
         ret

pIAT dd ?
IATsize dd ?
BaseImage dd ?
KernelBase dd ?
pGetProcAddress dd ?
GetProcAddressName db "GetProcAddress",0
user32name db "user32.dll",0
MessageBoxName db "MessageBoxA",0
pMessageBox dd ?
GetModuleHandleName db "GetModuleHandleA",0
pGetModuleHandle dd ?
VirtualProtectName db "VirtualProtect",0
pVirtualProtect dd ?
OldProtect dd ?
MsgInjected db "The function has been injected!",0

Hook:
   ;Delta offset
   call deltahook
      deltahook:
         pop ebp
         sub ebp,offset deltahook
         pop ebx                  ;Saving to return after
         mov edi,offset msghook
         add edi,ebp
         mov [esp+04h],edi         ;Changing the stack parameters
         call [ebp+pMessageBox]      ;Calling the original address of MessageBox
         push ebx               ;Setting the returning address
         ret
msghook    db "MessageBox Hooked!", 0
function_start endp
function_end:
end start

El ejecutable que usé lo que hace es lanzar dos MessageBox, uno detrás de otro (podéis programarlo para ver cómo funciona).
No abre un proceso existente, sino que lo crea (arreglarlo es cuestión de un par de API's).
El proceso no lo crea suspendido, así pues al principio lanza el primer MessageBox junto con otro MessageBox que anuncia que la función ha sido inyectada. Después, al cerrar el mensaje de alerta y posteriormente el primer mensaje, lanza otro MessageBox que en teoría debería de ser el segundo del programa, pero como hookea la API hará que a partir de ahí todos los MessageBox muestren "MessageBox Hooked!"


Saludos!
Hello EMO
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 373943
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 34
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

https://emostyle.yetkinforum.com

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