Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #21  
Old 03-13-2005, 05:10
[NtSC]
 
Posts: n/a
Basically a very old asm-snippet of the stuff you need to sort...

get_modules:
cmp [modbuffer],0
jz nofreemod
Call GlobalFree, [modbuffer]
nofreemod:
mov [modsize],04000h
Call GlobalAlloc, 0040h, [modsize]
mov [modbuffer],eax
mov [modpointer],eax

mov ecx,[P_Info+8]
mov [ProcEth32ProcessID],ecx

push ProcEth32ProcessID ;th32ProcessID
push TH32CS_SNAPMODULE ;dwFlags
call CreateToolhelp32Snapshot
mov [hSnapshot],eax

lea edi,ModuleEntry
push edi ;lpme
mov dword ptr [edi],SIZEOFMODULEENTRY
push eax ;hSnapshot
call Module32First
call copy_modinfo
next_mod:
push edi ;lpme
push hSnapshot ;hSnapshot
call Module32Next
or eax,eax
jz mod_done
call copy_modinfo
jmp next_mod
mod_done:
push hSnapshot
call CloseHandle
xor eax,eax
ret
copy_modinfo:
pushad
mov edi,[modpointer]
mov ecx,edi
push ecx
mov eax,[ModEmodBaseAddr] ; get imagebase
mov [edi+30h],eax
mov eax,[ModEmodBaseSize] ; get sizeofimage
mov [edi+34h],eax
lea eax,ModEszModule ; get name of module
call copy0
pop ecx
mov eax,ecx
call lowercase_buffer
add ecx,040h
mov [modpointer],ecx
popad
ret

Just look what apifunctions are used and port it to ur c-code.
that should be enough.. basically you workout all the loaded modules from within a given processinfo!

so..using such a snippet will obtain a list of the loaded modules..
u can increase the search for ur "special" dll by skiping "known" dll modules.
doin this , you can create a table with system librarys and just ignore them.
non standard dlls u examine by obtaining the export table.
you can get the addresses of the exported functions and do a search for whatever in that memory-area.

hope it helps, cheers
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loader and Patch Dll file in C# mcr4ck Source Code 0 06-19-2022 23:59
Creating a Loader for DotNet Apps? bball0002 General Discussion 2 09-24-2009 22:06


All times are GMT +8. The time now is 07:45.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )