devilsclaw Code Warrior
Registered: Dec
2002 Location: Posts: 26 |
A Tip for you people
and dlls
When a dll is
loaded into a program force or normal it has an area that is
always called no matter what.
between dllEntry
PROC dllEntry endp
it is always called
so if
you want to find the curent process that calls that dll all
you have to do is.
code: .586
.MODEL FLAT,STDCALL
INCLUDE \masm32\include\Windows.inc
INCLUDE \masm32\include\Kernel32.inc
INCLUDE \masm32\include\User32.inc
INCLUDELIB \masm32\lib\Kernel32.lib
INCLUDELIB \masm32\lib\User32.lib
.DATA
WindowName db "The Names of the window",0
.DATA?
Finished dword ?
BLANK2 dword ?
FoundIT dword ?
.CODE
dllEntry PROC
cmp Finished,01h
je YepFinished
invoke FindWindowA,NULL,offset WindowName
cmp eax,00h
je YepFinished
mov Finished,01
invoke GetWindowThreadProcessId,eax,offset BLANK2
invoke OpenProcess,PROCESS_VM_READ or PROCESS_VM_WRITE or PROCESS_VM_OPERATION,0,BLANK2
mov FoundIT,eax
YepFinished:
ret
dllEntry endp
END dllEntry
FoundIT has what you need.
Im posting this for
people who want to know this because no one would help me with
it. so i figure others did to.
this is help full if you
use a hooked dll and you want to process something once the
dll loaded into the programs memory.
Last edited by
bitRAKE on January 2nd, 2003 at 01:35 PM
Report
this post to a moderator | IP: Logged |