Anfidya'nın arka bahçesi..

There is dark web in the deep web..

[Delphi] Dll İçerisindeki Export İsimlerini Görme&Listeleme

2 comments

Merhaba arkadaşlar,
Bu başlık altında daha önce her hangi bir derleyiciyle(dil fark etmez) derlenmiş dll içerisinden, dışarıya export ettiği fonksiyon ve prosedür isimlerini göreceğiz.
Uses kısmı:

uses
  ImageHlp;

Dışarı aktarmayı yapacak babayiğit;

procedure ListDLLExports(const FileName: string; List: TStrings);
type
  TDWordArray = array [0..$FFFFF] of DWORD;
var
  imageinfo: LoadedImage;
  pExportDirectory: PImageExportDirectory;
  dirsize: Cardinal;
  pDummy: PImageSectionHeader;
  i: Cardinal;
  pNameRVAs: ^TDWordArray;
  Name: string;
begin
  List.Clear;
  if MapAndLoad(PChar(FileName), nil, @imageinfo, True, True) then
  begin
    try
      pExportDirectory := ImageDirectoryEntryToData(imageinfo.MappedAddress,
        False, IMAGE_DIRECTORY_ENTRY_EXPORT, dirsize);
      if (pExportDirectory <> nil) then
      begin
        pNameRVAs := ImageRvaToVa(imageinfo.FileHeader, imageinfo.MappedAddress,
          DWORD(pExportDirectory^.AddressOfNames), pDummy);
        for i := 0 to pExportDirectory^.NumberOfNames - 1 do
        begin
          Name := PChar(ImageRvaToVa(imageinfo.FileHeader, imageinfo.MappedAddress,
            pNameRVAs^[i], pDummy));
          List.Add(Name);
        end;
      end;
    finally
      UnMapAndLoad(@imageinfo);
    end;
  end;
end;

Kullanımı:


procedure TForm1.Button1Click(Sender: TObject);
var
  List: TStrings;
  i: Integer;
  s: string;
begin
  List := TStringList.Create;
  try
    ListDLLExports('C:\WINDOWS\SYSTEM32\browseui.dll', List);
    ShowMessage(IntToStr(list.Count) + ' functions in dll');
    s := 'List of functions:';
    for i := 0 to List.Count - 1 do
      s := s + #13#10 + List[i];
    ShowMessage(S);
  finally
    List.Free
  end;
end;

Tepe tepe kullanın (:

Written by anfidya

Kasım 23rd, 2014 at 7:13 pm

2 Responses to '[Delphi] Dll İçerisindeki Export İsimlerini Görme&Listeleme'

Subscribe to comments with RSS or TrackBack to '[Delphi] Dll İçerisindeki Export İsimlerini Görme&Listeleme'.

  1. Hi Francois,I apologize for asinkg a beginner question, but I am creating a translation application and have installed Microsoft Speech Server. I have also installed a Spanish voice. But I have no idea how to change voices, or populate a combobox with all the voices. I plan on using a Jap and Korean voice too. Thanks so much!Waldo

    Donald

    20 Haz 15 at 15:30

  2. Hi mate,
    I found this -> https://msdn.microsoft.com/en-us/library/office/microsoft.speech.audioformat(v=office.14).aspx

    I have never worked on MPS. I am sorry.

    anfidya

    22 Ağu 15 at 00:46

Leave a Reply

*