/
/
得到第一个区段
PIMAGE_SECTION_HEADER pSectionHeader
=
IMAGE_FIRST_SECTION(pNTHeader32);
CString TmpCstr
=
_T("");
DWORD PeBase
=
0
;
for
(
int
i
=
0
; i < pNTHeader32
-
>FileHeader.NumberOfSections; i
+
+
) {
TCHAR tmpWchar[
9
]
=
{
0
};
CHAR_TO_WCHAR((CHAR
*
)&(pSectionHeader[i].Name), tmpWchar);
TmpCstr.
Format
(_T(
"%s"
), tmpWchar);
m_PeShowEditValue
+
=
TmpCstr;
m_PeShowEditValue
+
=
_T(
"\r\n"
);
if
(TmpCstr
=
=
".text"
)
{
TmpCstr.
Format
(_T(
"区段数据的文件偏移:%x H"
), pSectionHeader[i].PointerToRawData);
m_PeShowEditValue
+
=
TmpCstr;
m_PeShowEditValue
+
=
_T(
"\r\n"
);
TmpCstr.
Format
(_T(
"区段数据的RVA:%x H"
), pSectionHeader[i].VirtualAddress);
m_PeShowEditValue
+
=
TmpCstr;
m_PeShowEditValue
+
=
_T(
"\r\n"
);
MessageBoxA(NULL, NULL, NULL, NULL);
PeBase
=
1
;
PeBase
=
(pSectionHeader[i].PointerToRawData
+
pSectionHeader[i].SizeOfRawData);
TmpCstr.
Format
(_T(
"区段数据的大小:%x H"
), pSectionHeader[i].SizeOfRawData);
m_PeShowEditValue
+
=
TmpCstr;
m_PeShowEditValue
+
=
_T(
"\r\n"
);
m_PeShowEditValue
+
=
_T(
"\r\n"
);
m_PeShowEditValue
+
=
_T(
"\r\n"
);
break
;
}
}