1 2 3 4 5 6 7 8 9 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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| VOID InitDirectoryView(HWND hwndDlg) { ReadPEFile(szFileName, &pFileBuffer); pDosHeader = (PIMAGE_DOS_HEADER) pFileBuffer; pNTHeader = (PIMAGE_NT_HEADERS) ((DWORD) pFileBuffer + pDosHeader->e_lfanew); pFileHeader = (PIMAGE_FILE_HEADER) (((DWORD) pNTHeader) + 4); pOptionHeader = (PIMAGE_OPTIONAL_HEADER32) ((DWORD) pFileHeader + IMAGE_SIZEOF_FILE_HEADER); PIMAGE_DATA_DIRECTORY dirHeader = pOptionHeader->DataDirectory;
TCHAR strBuffer[0x20];
sprintf(strBuffer, _T("0x%08X"), dirHeader[0].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_EXPORT_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[1].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_IMPORT_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[2].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_RESOURCE_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[3].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_EXCEPTION_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[4].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_SEC_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[5].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_RELOC_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[6].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_DEBUG_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[7].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_COPYRIGHT_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[8].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_GPOINTER_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[9].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_TLS_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[10].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_IMPORTCONF_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[11].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_BINDIMPORT_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[12].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_IAT_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[13].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_POSTIMPORT_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[14].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_COM_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%08X"), dirHeader[15].VirtualAddress); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_RESERVE_RVA, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR)); sprintf(strBuffer, _T("0x%X"), dirHeader[0].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_EXPORT_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[1].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_IMPORT_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[2].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_RESOURCE_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[3].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_EXCEPTION_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[4].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_SEC_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[5].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_RELOC_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[6].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_DEBUG_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[7].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_COPYRIGHT_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[8].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_GPOINTER_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[9].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_TLS_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[10].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_IMPORTCONF_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[11].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_BINDIMPORT_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[12].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_IAT_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[13].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_POSTIMPORT_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[14].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_COM_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR));
sprintf(strBuffer, _T("0x%X"), dirHeader[15].Size); SetDlgItemText(hwndDlg,IDC_EDIT_DIR_RESERVE_SIZE, strBuffer); memset(strBuffer,0x20 ,sizeof(TCHAR)); }
|