Вниз
Скачать: 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.025 c
1-1103531319
Guitar
2004-12-20 11:28
2005.01.02
Какой параметр передавать в теле процедуры?


1-1103138876
Xupypr
2004-12-15 22:27
2005.01.02
ListView


1-1102684936
JohnKorsh
2004-12-10 16:22
2005.01.02
Как распечатать Help?


14-1102824170
ms
2004-12-12 07:02
2005.01.02
Помогите пожалуйста по QBasic у


3-1102089690
MaxDDinc
2004-12-03 19:01
2005.01.02
Фиксирование изменений в БД MS SQL Server 2000




   Наверх