补充上源码:
[Delphi] 纯文本查看 复制代码 unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,Winapi.ImageHlp, Vcl.StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TAccressArray = array of DWORD;
TOrdinalArray = array of WORD;
var
Form2: TForm2;
DllImage:PLoadedImage;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
size:DWORD;
ExportDate:^IMAGE_EXPORT_DIRECTORY;
ExportName:Pointer;
ExportOrdinals:^TOrdinalArray;
str:PAnsiChar;
POrdinal:Pointer;
Ordinal:Word;
i: Integer;
begin
DllImage := ImageLoad('x32dbg.dll','X:\x64dbg自修改比较牛逼版★★★★★\x32\');
ExportDate := ImageDirectoryEntryToData(dllimage.MappedAddress{.FileHeader.OptionalHeader.ImageBase},False,IMAGE_DIRECTORY_ENTRY_EXPORT,size);
ExportName := ImageRvaToVa(Dllimage.FileHeader,dllimage.MappedAddress,ExportDate.AddressOfNames,dllimage.LastRvaSection);
POrdinal := ImageRvaToVa(Dllimage.FileHeader,dllimage.MappedAddress,ExportDate.AddressOfNameOrdinals,dllimage.LastRvaSection);
Memo1.Lines.Clear;
for i := 0 to ExportDate.NumberOfNames - 1 do
begin
str := ImageRvaToVa(Dllimage.FileHeader,dllimage.MappedAddress,TAccressArray(ExportName)[i],dllimage.LastRvaSection);
Memo1.Lines.Add(Format('Ordinal:%s Name:%s',[
TOrdinalArray(POrdinal)[i].ToHexString,
string(AnsiString(str))]));
end;
UnMapAndLoad(DllImage);
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
Memo1.Lines.SaveToFile(InputBox('Input save Path:','save','D:\X32.txt'));
Application.MessageBox('OK!', 'Message...', MB_OK + MB_ICONINFORMATION);
end;
end.
|