1 Star 0 Fork 0

PPL/PEView

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
uFrmMain.pas 2.85 KB
一键复制 编辑 原始数据 按行查看 历史
PPL 提交于 2017-10-11 21:09 . no commit message
unit uFrmMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, uPublicFunc, Menus, ComCtrls;
type
TFrmMain = class(TForm)
Button1: TButton;
dlgOpen: TOpenDialog;
Memo1: TMemo;
Button2: TButton;
Button3: TButton;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
MainMenu1: TMainMenu;
mniFile: TMenuItem;
mniOpenFile: TMenuItem;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure mniOpenFileClick(Sender: TObject);
private
FLGYPEInfo: TLGYPEInfo;
property LGYPEInfo: TLGYPEInfo read FLGYPEInfo write FLGYPEInfo;
{ Private declarations }
public
{ Public declarations }
end;
var
FrmMain: TFrmMain;
implementation
{$R *.dfm}
procedure TFrmMain.Button2Click(Sender: TObject);
var
i: Integer;
sLine: string;
begin
self.Memo1.Lines.Clear;
for i := 0 to FLGYPEInfo.NumberOfSections - 1 do
begin
sLine := 'Name:' + StrPas(Pchar(@FLGYPEInfo.ImageSectionHeaders[i].Name));
self.Memo1.Lines.Add(sLine);
sLine := 'VirtualSize:' + IntToHex(FLGYPEInfo.ImageSectionHeaders[i].Misc.VirtualSize, 8);
self.Memo1.Lines.Add(sLine);
sLine := 'Virtualoffset:' + IntToHex(FLGYPEInfo.ImageSectionHeaders[i].VirtualAddress, 8);
self.Memo1.Lines.Add(sLine);
sLine := 'RawOffsetSize:' + IntToHex(FLGYPEInfo.ImageSectionHeaders[i].SizeOfRawData, 8);
self.Memo1.Lines.Add(sLine);
sLine := 'RawOffset:' + IntToHex(FLGYPEInfo.ImageSectionHeaders[i].PointerToRawData, 8);
self.Memo1.Lines.Add(sLine);
self.Memo1.Lines.Add('');
end;
end;
procedure TFrmMain.Button3Click(Sender: TObject);
var
i, j, iCount, jCount: Integer;
sLine: string;
begin
self.Memo1.Lines.Clear;
iCount := FLGYPEInfo.DllList.Count - 1;
for i := 0 to iCount do
begin
sLine := 'DllName:' + TDllInfo(FLGYPEInfo.DllList[i]).dllName;
self.Memo1.Lines.Add(sLine);
jCount := TDllInfo(FLGYPEInfo.DllList[i]).FuncList.Count - 1;
for j := 0 to jCount do
begin
sLine := ' ' + TDllFuncInfo(TDllInfo(FLGYPEInfo.DllList[i]).FuncList[j]).FuncName;
self.Memo1.Lines.Add(sLine);
end;
end;
end;
procedure TFrmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if Assigned(FLGYPEInfo) then
begin
FreeAndNil(FLGYPEInfo);
end;
end;
procedure TFrmMain.mniOpenFileClick(Sender: TObject);
begin
if Assigned(FLGYPEInfo) then
begin
FreeAndNil(FLGYPEInfo);
end;
if self.dlgOpen.Execute then
begin
FLGYPEInfo := TLGYPEInfo.Create(self.dlgOpen.FileName);
self.Memo1.Lines.Add(FLGYPEInfo.ImageDosHeaderStr);
end;
end;
end.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Delphi
1
https://gitee.com/newboard/PEView.git
git@gitee.com:newboard/PEView.git
newboard
PEView
PEView
master

搜索帮助