1. Список говнокодов пользователя stas

    Всего: 1

  2. C++ / Говнокод #4537

    +151

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 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);
    
    ...

    писал на третьем курсе загрузку заголовка PE-файлов в GUI

    stas, 05 Ноября 2010

    Комментарии (6)