资源简介
PEDUMP 即PE文件解读的源程序, 可以获取所有的PE文件内容
代码片段和文件信息
//==================================
// PEDUMP - Matt Pietrek 1997-2001
// FILE: COMMON.CPP
//==================================
#include
#include
#include
#include “COFFSymbolTable.h“
COFFSymbol::COFFSymbol(
PIMAGE_SYMBOL pSymbolData
PSTR pStringTable
DWORD index )
{
m_pSymbolData = pSymbolData;
m_pStringTable = pStringTable;
m_index = index;
m_pszShortString = 0;
}
COFFSymbol::~COFFSymbol( )
{
CleanUp();
}
void
COFFSymbol::CleanUp( void )
{
if ( m_pszShortString )
free( m_pszShortString );
m_pszShortString = 0;
}
PSTR
COFFSymbol::GetName()
{
if ( !m_pSymbolData )
return 0;
if ( 0 != m_pSymbolData->N.Name.Short )
{
m_pszShortString = (PSTR)malloc( 9 );
memcpy( m_pszShortString m_pSymbolData->N.ShortName 8 );
m_pszShortString[8] = 0;
return m_pszShortString;
}
return m_pStringTable + m_pSymbolData->N.Name.Long;
}
PSTR
COFFSymbol::GetTypeName()
{
if ( !m_pSymbolData )
return 0;
sprintf( m_szTypeName “%04X“ m_pSymbolData->Type );
return m_szTypeName;
}
//
// Dumps the auxillary symbol for a regular symbol. It takes a pointer
// to the regular symbol since the the information in that record defines
// how the “auxillary“ record that follows it is interpreted
//
BOOL
COFFSymbol::GetAuxSymbolAsString( PSTR pszBuffer unsigned cbBuffer )
{
if ( !m_pSymbolData || (0==m_pSymbolData->NumberOfAuxSymbols) )
return FALSE;
//
// Auxillary symbol immediately follows the main symbol. Note the pointer
// arithmetic going on here.
//
PIMAGE_AUX_SYMBOL auxSym = (PIMAGE_AUX_SYMBOL)(m_pSymbolData+1);
if ( m_pSymbolData->StorageClass == IMAGE_SYM_CLASS_FILE )
{
lstrcpyn( pszBuffer (char *)auxSym cbBuffer );
}
else if ( (m_pSymbolData->StorageClass == IMAGE_SYM_CLASS_EXTERNAL) )
{
if ( (m_pSymbolData->Type & 0xF0) == (IMAGE_SYM_DTYPE_FUNCTION << 4))
{
sprintf( pszBuffer
“tag: %04X size: %04X Line #‘s: %08X next fn: %04X“
auxSym->Sym.TagIndex auxSym->Sym.Misc.TotalSize
auxSym->Sym.FcnAry.Function.PointerToLinenumber
auxSym->Sym.FcnAry.Function.PointerToNextFunction);
}
}
else if ( (m_pSymbolData->StorageClass == IMAGE_SYM_CLASS_STATIC) )
{
sprintf( pszBuffer
“Section: %04X Len: %05X Relocs: %04X LineNums: %04X“
auxSym->Section.Number auxSym->Section.Length
auxSym->Section.NumberOfRelocations
auxSym->Section.NumberOfLinenumbers );
}
else if ( m_pSymbolData->StorageClass == IMAGE_SYM_CLASS_FUNCTION )
{
sprintf( pszBuffer
“Line #: %u next fn: %X“
auxSym->Sym.Misc.LnSz.Linenumber
auxSym->Sym.FcnAry.Function.PointerToNextFunction);
}
else if ( m_pSymbolData->StorageClass == IMAGE_SYM_CLASS_CLR_TOKEN )
{
PWORD pCLRToken = (PWORD)aux
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 24133 1995-07-19 20:52 pe\COMMON.C
文件 1577 1995-07-19 20:52 pe\COMMON.H
文件 2703 1995-07-19 20:52 pe\DBGDUMP.C
文件 866 1995-07-19 20:52 pe\DBGDUMP.H
文件 19735 1995-07-19 20:52 pe\EXEDUMP.C
文件 179 1995-07-19 20:52 pe\EXEDUMP.H
文件 508 1995-07-19 20:52 pe\EXTRNVAR.H
文件 6301 1995-07-19 20:52 pe\LIBDUMP.C
文件 167 1995-07-19 20:52 pe\LIBDUMP.H
文件 3999 1995-07-19 20:52 pe\OBJDUMP.C
文件 185 1995-07-19 20:52 pe\OBJDUMP.H
文件 924 1995-07-19 20:52 pe\PEDUMP.BOR
文件 4553 1995-07-19 20:52 pe\PEDUMP.C
文件 36864 1995-07-19 20:52 pe\PEDUMP.EXE
文件 1373 1995-07-19 20:52 pe\PEDUMP.MAK
文件 7649 2001-09-20 11:19 PEDump\coffsymboltable.cpp
文件 1663 1998-01-03 15:01 PEDump\coffsymboltable.h
文件 13853 2001-09-20 11:19 PEDump\COMMON.cpp
文件 4177 2001-09-12 15:06 PEDump\COMMON.H
文件 16549 1998-07-10 21:24 PEDump\cvexefmt.h
文件 102966 1994-09-07 18:38 PEDump\cvinfo.h
文件 714 1998-07-25 12:45 PEDump\CVInfoNew.H
文件 10499 2009-11-04 18:14 PEDump\CVSymbols.CPP
文件 69 1998-07-10 21:50 PEDump\cvsymbols.h
文件 205 1997-02-19 22:29 PEDump\cv_dbg.h
文件 3010 2001-09-20 11:19 PEDump\DBGDUMP.cpp
文件 196 1997-02-24 20:34 PEDump\DBGDUMP.H
文件 15708 2009-11-04 19:08 PEDump\Debug\BuildLog.htm
文件 46091 2009-11-04 18:14 PEDump\Debug\coffsymboltable.obj
文件 52933 2009-11-04 18:14 PEDump\Debug\COMMON.obj
............此处省略49个文件信息
- 上一篇:vs_setup.msi197439
- 下一篇:超详细MIT线性代数公开课笔记
评论
共有 条评论