21{
25 unsigned SectionIndex;
26 unsigned SymbolTable, NumSymbols;
27
28
30 {
31 werrstr(
"Could not rewind file\n");
33 }
35 {
38 }
40 {
41 werrstr(
"Image doesn't have a valid DOS header\n");
43 }
44
45
47 {
48 werrstr(
"Failed seeking to NT headers\n");
50 }
52 {
53 werrstr(
"Failed to read NT headers\n");
55 }
57 {
58 werrstr(
"Image doesn't have a valid PE header\n");
60 }
61
64
65 if (!NumSymbols)
66 {
67 werrstr(
"Image doesn't have debug symbols\n");
69 }
70
71 DPRINT(
"SymbolTable %x NumSymbols %x\n", SymbolTable, NumSymbols);
72
73
75 (
char *) &NtHeaders + DosHeader.
e_lfanew))
76 {
77 werrstr(
"Failed seeking to section headers\n");
79 }
80 DPRINT(
"Alloc section headers\n");
83 if (
NULL == SectionHeaders)
84 {
85 werrstr(
"Failed to allocate memory for %u section headers\n",
88 }
92 {
94 werrstr(
"Failed to read section headers\n");
96 }
97
98
100 SectionIndex++)
101 {
103 if (SectionHeaders[SectionIndex].
Name[0] !=
'/') {
104 DPRINT(
"Short name string %d, %s\n", SectionIndex, SectionHeaders[SectionIndex].
Name);
109 } else {
113
115 goto freeall;
120 goto freeall;
123 goto freeall;
126 DPRINT(
"Long name %d, %s\n", SectionIndex, astr.
Buffer);
127 }
129 }
130
131 DPRINT(
"Done with sections\n");
138 pe->
sect = SectionHeaders;
145
147
148freeall:
150 SectionIndex++)
153
155}
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _Inout_ PFILE_ENUM_CONTEXT FileContext
#define NT_SUCCESS(StatCode)
#define memcpy(s1, s2, n)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define IMAGE_FIRST_SECTION(NtHeader)
#define IMAGE_SIZEOF_SHORT_NAME
u32int peget4(const unsigned char *ptr)
u64int peget8(const unsigned char *ptr)
u16int peget2(const unsigned char *ptr)
int GetStrnlen(const char *string, int maxlen)
int loaddisksection(Pe *pe, char *name, DwarfBlock *b)
#define ANSI_NAME_STRING(s)
#define RosSymSeekFile(FileContext, Position)
#define RosSymAllocMem(Size)
#define RosSymFreeMem(Area)
#define RosSymReadFile(FileContext, Buffer, Size)
#define ROSSYM_IS_VALID_NT_HEADERS(NtHeaders)
#define ROSSYM_IS_VALID_DOS_HEADER(DosHeader)
#define MAXIMUM_DWARF_NAME_SIZE
Dwarf * dwarfopen(struct _Pe *elf)
struct _IMAGE_SECTION_HEADER * sect
u16int(* e2)(const unsigned char *data)
int(* loadsection)(struct _Pe *pe, char *name, struct DwarfBlock *b)
u64int(* e8)(const unsigned char *data)
u32int(* e4)(const unsigned char *data)