#include <ntifs.h>
#include <ndk/ntndk.h>
#include <reactos/rossym.h>
#include "rossympriv.h"
#include <ntimage.h>
#include <debug.h>
#include "dwarf.h"
#include "pe.h"
Go to the source code of this file.
|
PeSect * | pesection (Pe *pe, const char *name) |
|
u16int | peget2 (const unsigned char *ptr) |
|
u32int | peget4 (const unsigned char *ptr) |
|
u64int | peget8 (const unsigned char *ptr) |
|
int | readn (void *filectx, char *buffer, ulong size) |
|
int | seek (void *filectx, ulong position, int origin) |
|
static int | readblock (void *fd, DwarfBlock *b, ulong off, ulong len) |
|
int | loaddisksection (Pe *pe, char *name, DwarfBlock *b) |
|
int | loadmemsection (Pe *pe, char *name, DwarfBlock *b) |
|
void * | RosSymAllocMemZero (ulong size, ulong count) |
|
int | GetStrnlen (const char *string, int maxlen) |
|
void | pefree (Pe *pe) |
|
void | xfree (void *v) |
|
ulong | pefindrva (struct _IMAGE_SECTION_HEADER *SectionHeaders, int NumberOfSections, ulong TargetPhysical) |
|
◆ NDEBUG
Definition at line 8 of file pe.c.
◆ GetStrnlen()
Definition at line 103 of file pe.c.
103 {
105 for (
i = 0;
i < maxlen &&
string[
i];
i++);
107}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by RosSymCreateFromFile(), and RosSymCreateFromMem().
◆ loaddisksection()
Definition at line 72 of file pe.c.
73{
76 return -1;
77 return readblock(pe->
fd,
b,
s->PointerToRawData,
s->SizeOfRawData);
78}
GLboolean GLboolean GLboolean b
PeSect * pesection(Pe *pe, const char *name)
static int readblock(void *fd, DwarfBlock *b, ulong off, ulong len)
Referenced by RosSymCreateFromFile().
◆ loadmemsection()
Definition at line 81 of file pe.c.
82{
84
86 return -1;
87 DPRINT(
"Loading section %s (ImageBase %x RVA %x)\n",
name, pe->
fd,
s->VirtualAddress);
89 b->len =
s->SizeOfRawData;
90 PCHAR DataSource = ((
char *)pe->
fd) +
s->VirtualAddress;
91 DPRINT(
"Copying to %x from %x (%x)\n", DataSource,
b->data,
b->len);
93
94 return s->SizeOfRawData;
95}
#define RosSymAllocMem(Size)
#define RtlCopyMemory(Destination, Source, Length)
Referenced by RosSymCreateFromMem().
◆ pefindrva()
Definition at line 126 of file pe.c.
126 {
128 DPRINT(
"Finding RVA for Physical %x\n", TargetPhysical);
129 for (
i = 0;
i < NumberOfSections;
i++) {
130 DPRINT(
"Section %d name %s Raw %x Virt %x\n",
133 SectionHeaders[
i].PointerToRawData,
135 if (TargetPhysical >= SectionHeaders[
i].PointerToRawData &&
136 TargetPhysical < SectionHeaders[
i].PointerToRawData + SectionHeaders[
i].SizeOfRawData) {
137 DPRINT(
"RVA %x\n", TargetPhysical - SectionHeaders[
i].PointerToRawData + SectionHeaders[
i].
VirtualAddress);
139 }
140 }
142}
#define ANSI_NAME_STRING(s)
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
Referenced by RosSymCreateFromMem().
◆ pefree()
Definition at line 109 of file pe.c.
109 {
113 }
116 }
120}
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
struct _IMAGE_SECTION_HEADER * sect
Referenced by dwarfclose().
◆ peget2()
◆ peget4()
◆ peget8()
◆ pesection()
Definition at line 15 of file pe.c.
16{
27 pe->
sect[
i].SizeOfRawData);
29 }
30 }
33}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
Referenced by loaddisksection(), and loadmemsection().
◆ readblock()
Definition at line 57 of file pe.c.
58{
61 return -1;
65 return -1;
66 }
68 return 0;
69}
int seek(void *filectx, ulong position, int origin)
int readn(void *filectx, char *buffer, ulong size)
Referenced by loaddisksection().
◆ readn()
Definition at line 47 of file pe.c.
47 {
49}
#define RosSymReadFile(FileContext, Buffer, Size)
Referenced by readblock().
◆ RosSymAllocMemZero()
Definition at line 97 of file pe.c.
97 {
101}
GLuint GLuint GLsizei count
◆ seek()
Definition at line 51 of file pe.c.
51 {
54}
#define RosSymSeekFile(FileContext, Position)
Referenced by readblock().
◆ xfree()
Definition at line 122 of file pe.c.
122 {
124}
#define RosSymFreeMem(Area)