• 大小: 47KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-20
  • 语言: C/C++
  • 标签: PE  

资源简介

C++ PE格式解析源码

资源截图

代码片段和文件信息

// DlgDataDirectory.cpp : implementation file
//

#include “stdafx.h“
#include “ReadPE.h“
#include “DlgDataDirectory.h“
#include “ShowBmp.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgDataDirectory dialog

extern PBYTE pMaping;
extern PIMAGE_NT_HEADERS pNTHeader;
extern PIMAGE_FILE_HEADER pFileHeader; 
extern PIMAGE_OPTIONAL_HEADER pOptionalHeader;
extern PIMAGE_SECTION_HEADER pSectionTable;
extern PIMAGE_DATA_DIRECTORY pDataDirectory;
 
extern DWORD ReadSectionTableVA(DWORD RVA);

CDlgDataDirectory::CDlgDataDirectory(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDataDirectory::IDD pParent)
{
//{{AFX_DATA_INIT(CDlgDataDirectory)
m_static_data = _T(““);
m_static_dataDirectory = _T(““);
//}}AFX_DATA_INIT

   pImportDes=0;//指向导入表首项 
   pResource=0;//指向资源目录节点
   pResourceChile=0;//指向节点下的孩子



}


void CDlgDataDirectory::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDataDirectory)
DDX_Control(pDX IDC_TREE_resource m_tree_resource);
DDX_Control(pDX IDC_LIST_Data m_list_Data);
DDX_Control(pDX IDC_LIST_DataDirectory m_list_DataDirectory);
DDX_Control(pDX IDC_LIST1 m_list);
DDX_Text(pDX IDC_STATIC_Data m_static_data);
DDX_Text(pDX IDC_STATIC_DataDirectory m_static_dataDirectory);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgDataDirectory CDialog)
//{{AFX_MSG_MAP(CDlgDataDirectory)
ON_NOTIFY(NM_CLICK IDC_LIST1 onclickList1)
ON_LBN_SELCHANGE(IDC_LIST_DataDirectory OnSelchangeLISTDataDirectory)
ON_NOTIFY(NM_DBLCLK IDC_TREE_resource OnDblclkTREEresource)
ON_NOTIFY(NM_CLICK IDC_TREE_resource onclickTREEresource)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgDataDirectory message handlers

BOOL CDlgDataDirectory::OnInitDialog() 
{
CDialog::OnInitDialog();

    DWORD Liststyle;
Liststyle=::GetWindowLong(m_list.m_hWndGWL_style);
Liststyle|=LVS_REPORT | LVS_SHOWSELALWAYS | LVS_EDITLABELS;
::SetWindowLong(m_list.m_hWndGWL_styleListstyle);
::SetWindowLong(m_list.m_hWndGWL_styleListstyle);
::SetWindowLong(m_list.m_hWndGWL_styleListstyle);
Liststyle=m_list.GetExtendedstyle();
Liststyle|=LVS_EX_FULLROWSELECT;
m_list.SetExtendedstyle(Liststyle);

CRect RectList;
m_list.GetWindowRect(&RectList);
m_list.InsertColumn(0“编号“LVCFMT_CENTERRectList.Width()/5);
m_list.InsertColumn(1“RVA“LVCFMT_CENTER2*RectList.Width()/5-10);
m_list.InsertColumn(2“Size“LVCFMT_CENTER2*RectList.Width()/5-10);

CString s=_T(““);
for(DWORD i=0;iNumberOfRvaAndSizes;i++)
{
s.Format(“%X“i);
m_list.InsertItem(is);
s.Format(“%08XH“pDataDirectory[i].VirtualAddress);
m_list.SetItemText(i1s);
s.Format(“%08XH“pDataDirectory[i].Size);
m_list.SetItemText(i2s);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2086  2008-10-07 10:13  ReadPE\DlgDataDirectory.h

     文件       1732  2008-11-09 10:26  ReadPE\DlgShowSectionDate.cpp

     文件       1423  2008-11-09 10:22  ReadPE\DlgShowSectionDate.h

     文件       6112  2008-10-10 11:28  ReadPE\MyShiTu.cpp

     文件       1685  2008-10-10 10:38  ReadPE\MyShiTu.h

     文件       1502  2008-11-09 15:40  ReadPE\MyShowXiangxi.h

     文件       3579  2008-09-07 17:06  ReadPE\ReadMe.txt

     文件      27808  2009-02-08 20:49  ReadPE\ReadPE.aps

     文件       4316  2009-02-12 14:03  ReadPE\ReadPE.clw

     文件       2063  2008-10-06 16:42  ReadPE\ReadPE.cpp

     文件       4916  2008-11-09 12:04  ReadPE\ReadPE.dsp

     文件        520  2008-11-09 09:17  ReadPE\ReadPE.dsw

     文件       1327  2008-10-06 16:42  ReadPE\ReadPE.h

     文件       1240  2009-02-11 14:30  ReadPE\ReadPE.plg

     文件      10354  2008-11-09 10:33  ReadPE\ReadPE.rc

     文件       1730  2008-10-31 16:49  ReadPE\ReadPEDlg.h

     文件      22810  2008-10-02 14:30  ReadPE\res\bitmap1.bmp

     文件        766  2008-09-21 19:16  ReadPE\res\icon1.ico

     文件       1078  2008-09-21 19:19  ReadPE\res\icon2.ico

     文件       1078  2008-09-07 17:06  ReadPE\res\ReadPE.ico

     文件        398  2008-09-07 17:06  ReadPE\res\ReadPE.rc2

     文件       2471  2008-11-09 10:30  ReadPE\resource.h

     文件      11452  2008-11-09 16:02  ReadPE\ShowBmp.cpp

     文件       1781  2008-10-31 14:46  ReadPE\ShowBmp.h

     文件        208  2008-09-07 17:06  ReadPE\StdAfx.cpp

     文件       1054  2008-09-07 17:06  ReadPE\StdAfx.h

     文件      11945  2009-02-09 17:22  ReadPE\MyShowXiangxi.cpp

     文件       9615  2009-02-10 21:51  ReadPE\ReadPEDlg.cpp

     文件         56  2009-02-11 14:21  ReadPE\不明白的地方.txt

     文件      11600  2009-02-11 17:17  ReadPE\DlgDataDirectory.cpp

............此处省略6个文件信息

评论

共有 条评论