Skip to content

Commit f63646c

Browse files
author
linesight
committed
first commit
0 parents  commit f63646c

26 files changed

+3061
-0
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
.vs/
35+
Generated\ Files/

COMMON.H

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//==================================
2+
// PEDUMP - Matt Pietrek 1997
3+
// FILE: COMMON.H
4+
//==================================
5+
6+
// MakePtr is a macro that allows you to easily add to values (including
7+
// pointers) together without dealing with C's pointer arithmetic. It
8+
// essentially treats the last two parameters as DWORDs. The first
9+
// parameter is used to typecast the result to the appropriate pointer type.
10+
#define MakePtr( cast, ptr, addValue ) (cast)( (DWORD)(ptr) + (DWORD)(addValue))
11+
12+
void DumpHeader(PIMAGE_FILE_HEADER pImageFileHeader);
13+
void DumpOptionalHeader(PIMAGE_OPTIONAL_HEADER pImageOptionalHeader);
14+
void DumpSectionTable(PIMAGE_SECTION_HEADER section,
15+
unsigned cSections,
16+
BOOL IsEXE);
17+
LPVOID GetSectionPtr(PSTR name, PIMAGE_NT_HEADERS pNTHeader, DWORD imageBase);
18+
LPVOID GetPtrFromRVA( DWORD rva, PIMAGE_NT_HEADERS pNTHeader, DWORD imageBase );
19+
PIMAGE_SECTION_HEADER GetSectionHeader(PSTR name, PIMAGE_NT_HEADERS pNTHeader);
20+
PIMAGE_SECTION_HEADER GetEnclosingSectionHeader(DWORD rva,
21+
PIMAGE_NT_HEADERS pNTHeader);
22+
void DumpRawSectionData(PIMAGE_SECTION_HEADER section,
23+
PVOID base,
24+
unsigned cSections);
25+
void DumpDebugDirectory(PIMAGE_DEBUG_DIRECTORY debugDir, DWORD size, DWORD base);
26+
void DumpCOFFHeader(PIMAGE_COFF_SYMBOLS_HEADER pDbgInfo);
27+
void HexDump(PBYTE ptr, DWORD length);
28+
29+
PSTR GetMachineTypeName( WORD wMachineType );
30+
31+
#define GetImgDirEntryRVA( pNTHdr, IDE ) \
32+
(pNTHdr->OptionalHeader.DataDirectory[IDE].VirtualAddress)
33+
34+
#define GetImgDirEntrySize( pNTHdr, IDE ) \
35+
(pNTHdr->OptionalHeader.DataDirectory[IDE].Size)
36+

0 commit comments

Comments
 (0)