- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
void TPEForm::LoadFromFile(AnsiString _FileName)
{
FileName = _FileName;
Caption = FileName + " - " + DOS_HEADER_STRING;
iPEFileHandle = FileOpen(FileName,fmOpenRead);
FileRead(iPEFileHandle,&dos_header,sizeof(IMAGE_DOS_HEADER));
TreeView->Items->AddChild(NULL,DOS_HEADER_STRING);
dos_header_frame = new TDOSHeader(this);
dos_header_frame->Parent = Panel;
dos_header_frame->e_magic->Text = "0x"+IntToHex(dos_header.e_magic,4);
dos_header_frame->e_cblp->Text = "0x"+IntToHex(dos_header.e_cblp,4);
dos_header_frame->e_cp->Text = "0x"+IntToHex(dos_header.e_cp,4);
dos_header_frame->e_crlc->Text = "0x"+IntToHex(dos_header.e_crlc,4);
dos_header_frame->e_cparhdr->Text = "0x"+IntToHex(dos_header.e_cparhdr,4);
...
dos_header_frame->e_ovno->Text = "0x"+IntToHex(dos_header.e_ovno,4);
dos_header_frame->e_oemid->Text = "0x"+IntToHex(dos_header.e_oemid,4);
dos_header_frame->e_oeminfo->Text = "0x"+IntToHex(dos_header.e_oeminfo,4);
dos_header_frame->e_lfanew->Text = "0x"+IntToHex((int)dos_header.e_lfanew,4);
...
TreeView->Items->AddChild(nt_header_node,FILE_HEADER_STRING);
file_header_frame = new TFileHeader(this);
file_header_frame->Parent = Panel;
file_header_frame->Machine->Text = "0x"+IntToHex((int)nt_header.FileHeader.Machine,4);
file_header_frame->NumberOfSections->Text = "0x"+IntToHex((int)nt_header.FileHeader.NumberOfSections,4);
file_header_frame->TimeDateStamp->Text = "0x"+IntToHex((int)nt_header.FileHeader.TimeDateStamp,8);
file_header_frame->PointerToSymbolTable->Text = "0x"+IntToHex((int)nt_header.FileHeader.PointerToSymbolTable,8);
file_header_frame->NumberOfSymbols->Text = "0x"+IntToHex((int)nt_header.FileHeader.NumberOfSymbols,8);
file_header_frame->SizeOfOptionalHeader->Text = "0x"+IntToHex((int)nt_header.FileHeader.SizeOfOptionalHeader,4);
file_header_frame->Characteristics->Text = "0x"+IntToHex((int)nt_header.FileHeader.Characteristics,4);
TTreeNode *optional_header_node = TreeView->Items->AddChild(nt_header_node,OPTIONAL_HEADER_STRING);
optional_header_frame = new TOptionalHeader(this);
optional_header_frame->Parent = Panel;
TreeView->Items->AddChild(optional_header_node,STANDARD_FIELDS_STRING);
standard_fields_frame = new TStandardFieldsFrame(this);
standard_fields_frame->Parent = Panel;
TTreeNode *additional_fields_node = TreeView->Items->AddChild(optional_header_node,ADDITIONAL_FIELDS_STRING);
additional_fields_frame = new TAdditionalFieldsFrame(this);
additional_fields_frame->Parent = Panel;
standard_fields_frame->Magic->Text = "0x"+IntToHex((int)nt_header.OptionalHeader.Magic,4);
standard_fields_frame->MajorLinkerVersion->Text = "0x"+IntToHex((int)nt_header.OptionalHeader.MajorLinkerVersion,2);
...
additional_fields_frame->ImageBase->Text = "0x"+IntToHex((int)nt_header.OptionalHeader.ImageBase,8);
additional_fields_frame->SectionAlignment->Text = "0x"+IntToHex((int)nt_header.OptionalHeader.SectionAlignment,8);
additional_fields_frame->FileAlignment->Text = "0x"+IntToHex((int)nt_header.OptionalHeader.FileAlignment,8);
...
KirAmp 05.11.2010 13:01 # 0
Govnoeb 05.11.2010 15:42 # 0
Govnoeb 05.11.2010 15:40 # 0
заебали уже
stas 05.11.2010 16:18 # 0
andremacareno 06.11.2010 17:35 # +1
По-моему здесь какие-то символы пропущены.
ctm 08.11.2010 10:41 # −1
всякие "0x"+IntToHex() можно было бы и в функцию обернуть, но это не в счет.
ну еще не хватает TreeView->Items->Clear(); в начале.