Вниз
Скачать: CL | DM;

Узнать имя DLL которую загрузил мой процесс   Найти похожие ветки 

← →
paa   (2004-11-16 08:52) [0]

Пришло событие что процесс загрузил какую то Dllку.
Как узнать имя этой DLLки?


← →
Digitman ©   (2004-11-16 09:18) [1]


> Пришло событие что процесс загрузил какую то Dllку


событие не "приходит" и не "уходит", оно происходит (или наступает)

что за событие ? подробней..


← →
paa   (2004-11-16 09:48) [2]

событие LOAD_DLL_DEBUG_EVENT:


← →
Digitman ©   (2004-11-16 10:11) [3]

typedef struct _LOAD_DLL_DEBUG_INFO { // lddi  
   HANDLE hFile;  
   LPVOID lpBaseOfDll;
   DWORD  dwDebugInfoFileOffset;
   DWORD  nDebugInfoSize;
   LPVOID lpImageName;
   WORD fUnicode;
} LOAD_DLL_DEBUG_INFO;

lpImageName

Points to the filename associated with hFile. This member may be NULL, or it may contain the address of a string pointer in the address space of the process being debugged. That address may, in turn, either be NULL or point to the actual filename. If fUnicode is a nonzero value, the name string is Unicode; otherwise, it is ANSI.

This member is strictly optional. Debuggers must be prepared to handle the case where lpImageName is NULL or *
lpImageName (in the address space of the process being debugged) is NULL. Specifically, this release of Windows NT will never provide an image name for a create process event, and it will not likely pass an image name for the first DLL event. This version of Windows NT will also never provide this information in the case of debugging events that originate from a call to the DebugActiveProcess function.

fUnicode

Indicates whether a filename specified by lpImageName is Unicode or ANSI. A nonzero value for this member indicates Unicode; zero indicates ANSI.


← →
VMcL ©   (2004-11-16 10:13) [4]

LOAD_DLL_DEBUG_INFO.lpImageName


← →
paa   (2004-11-16 10:58) [5]

не получается в строковую переменную получить имя DLL,
что делать с lpImageName?


← →
Digitman ©   (2004-11-16 11:12) [6]


> paa   (16.11.04 10:58) [5]


что значит "не получается" ?


← →
VMcL ©   (2004-11-16 11:32) [7]

>>paa  (16.11.04 10:58) [5]

Если fUnicode = 0, то привести lpImageName к PAnsiChar, иначе привести к PWideChar.


← →
paa   (2004-11-16 11:53) [8]

>Если fUnicode = 0, то привести lpImageName к PAnsiChar, иначе привести к PWideChar.

делаю так:
var NameDll:string
...
...
if Event.LoadDll.fUnicode = 0 then
               NameDll:=PAnsiChar(Event.LoadDll.lpImageName)
else
               NameDll:=PWideChar(Event.LoadDll.lpImageName);

в lpImageName=$7FFDE014, а  переменной NameDll="";


← →
Digitman ©   (2004-11-16 12:16) [9]

var
NameDll:String;

if Event.LoadDll.fUnicode = 0 then
NameDll:=StrPas(PChar(Event.LoadDll.lpImageName))
else
 NameDll:=WideCharToString(PWideChar(Event.LoadDll.lpImageName));


← →
paa   (2004-11-16 12:30) [10]

> Digitman ©   (16.11.04 12:16) [9]

И так не получается, но все равно спасибо!
Как говорится "будем искать"!


← →
Digitman ©   (2004-11-16 12:50) [11]

если lpImageName <> nil, то оно содержит не прямую, а косвенную ссылку на строку, поэтому требуется доп.разыменование :

var
pImageName: Pointer;
NameDll:String;

with Event.LoadDll do
if Assigned(lpImageName) then
 begin
  pImageName := Pointer(lpImageName^);
  if Assigned(pImageName) then
   if fUnicode = 0 then
    NameDll:=StrPas(PChar(pImageName))
   else
    NameDll:=WideCharToString(PWideChar(pImageName));
 end;

цитата из справки :

This member is strictly optional. Debuggers must be prepared to handle the case where lpImageName is NULL or *lpImageName (in the address space of the process being debugged) is NULL



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.47 MB
Время: 0.041 c
14-1103010089
Resiv
2004-12-14 10:41
2005.01.02
Вирус!!!


3-1102068577
lightix
2004-12-03 13:09
2005.01.02
Tquery,кэшированные данные и DBF таблицы


4-1100536437
Ale}{(is)
2004-11-15 19:33
2005.01.02
UPX 1.xx, Aspack 2.xx, Shrink


4-1100592227
MaxxSoft
2004-11-16 11:03
2005.01.02
System Tray


14-1102695821
Style
2004-12-10 19:23
2005.01.02
Ура свершилось! :) У меня будет "собственный" сервер в инете.




   Наверх