uses
Winapi.ImageHlp, Winapi.Windows;
function GetDLLExports(const AFileName: AnsiString; AList: TStrings): Boolean;
var
Image: LoadedImage;
pExport: PImageExportDirectory;
pNames: PDWORD;
Dummy: DWORD;
I: DWORD;
begin
Result := MapAndLoad(PAnsiChar(AFileName), nil, @Image, True, True);
if Result then begin
try
pExport := ImageDirectoryEntryToData(Image.MappedAddress, False, IMAGE_DIRECTORY_ENTRY_EXPORT, ULONG(Dummy));
if pExport <> nil then begin
pNames := ImageRvaToVa(Image.FileHeader, Image.MappedAddress, pExport^.AddressOfNames, Pointer(Dummy));
for I := 0 to Pred(pExport^.NumberOfNames) do begin
AList.Add(String(PAnsiChar(ImageRvaToVa(Image.FileHeader, Image.MappedAddress, pNames^, Pointer(Dummy)))));
Inc(pNames);
end;
end else begin
Result := False;
end;
finally
UnMapAndLoad(@Image);
end;
end;
end;
'Windows > RAD Studio' 카테고리의 다른 글
[CB] 긴 문자열 줄이기. (AnsiString, Canvas, TextWidth, Width) (0) | 2015.09.25 |
---|---|
[CB] Ole - InternetExplorer 띄우기 (0) | 2015.09.17 |
프로세스 종료 (0) | 2015.09.08 |
DLL 기본 주석 문구 해석 (0) | 2015.05.13 |
[Del] TListBox HorizontalScrollBar 표시 (0) | 2015.05.06 |