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 8 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 8 Misafir :: 1 Arama motorları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
API Hooking by IAT Patching
1 sayfadaki 1 sayfası
API Hooking by IAT Patching
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!
Similar topics
» D3d hooking
» Hooking address (GCC)
» [Tut(C++)] Hooking Functions
» [C/C++] Hooking Tutorial
» Patching A Processes Memory Without Injecting
» Hooking address (GCC)
» [Tut(C++)] Hooking Functions
» [C/C++] Hooking Tutorial
» Patching A Processes Memory Without Injecting
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