Go to the source code of this file.
|
PVOID NTAPI | RtlpAllocateMemory (ULONG Bytes, ULONG Tag) |
|
VOID NTAPI | RtlpFreeMemory (PVOID Mem, ULONG Tag) |
|
NTSTATUS NTAPI | RtlpSafeCopyMemory (_Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination, _In_reads_bytes_(Length) CONST VOID UNALIGNED *Source, _In_ SIZE_T Length) |
|
NTSTATUS NTAPI | RtlpImageNtHeaderEx (_In_ ULONG Flags, _In_ PVOID Base, _In_ ULONG64 Size, _Out_ PIMAGE_NT_HEADERS *OutHeaders) |
|
NTSTATUS NTAPI | RtlImageNtHeaderEx (_In_ ULONG Flags, _In_ PVOID Base, _In_ ULONG64 Size, _Out_ PIMAGE_NT_HEADERS *OutHeaders) |
|
◆ RtlImageNtHeaderEx()
Definition at line 78 of file libsupp.c.
83{
85}
NTSTATUS NTAPI RtlpImageNtHeaderEx(_In_ ULONG Flags, _In_ PVOID Base, _In_ ULONG64 Size, _Out_ PIMAGE_NT_HEADERS *OutHeaders)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ ULONG Flags
◆ RtlpAllocateMemory()
Definition at line 35 of file libsupp.c.
37{
39}
PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
◆ RtlpFreeMemory()
Definition at line 44 of file libsupp.c.
46{
48}
VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
◆ RtlpImageNtHeaderEx()
Definition at line 140 of file image.c.
145{
149 ULONG NtHeaderOffset;
150
151
152 if (OutHeaders ==
NULL)
153 {
154 DPRINT1(
"OutHeaders is NULL\n");
156 }
157
158
160
161
163 {
166 }
167
168
170 {
173 }
174
175
177 if (WantsRangeCheck)
178 {
179
181 {
184 }
185 }
186
187
190 {
191
192 DPRINT1(
"Invalid image DOS signature!\n");
194 }
195
196
197 NtHeaderOffset = DosHeader->
e_lfanew;
198
199
200
201
202
203 if (NtHeaderOffset >= (256 * 1024 * 1024))
204 {
205
206 DPRINT1(
"NT headers offset is larger than 256MB!\n");
208 }
209
210
211 if (WantsRangeCheck)
212 {
213
214 if ((NtHeaderOffset +
216 {
217
218 DPRINT1(
"NT headers beyond image size!\n");
220 }
221 }
222
223
225
226
228 {
229
231 {
232 DPRINT1(
"Image overflows from user space into kernel space!\n");
234 }
235 }
236
237
239 {
240
241 DPRINT1(
"Invalid image NT signature!\n");
243 }
244
245
246 *OutHeaders = NtHeaders;
248}
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
#define RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
#define STATUS_INVALID_IMAGE_FORMAT
#define IMAGE_NT_SIGNATURE
#define IMAGE_DOS_SIGNATURE
PVOID MmHighestUserAddress
#define STATUS_INVALID_PARAMETER
◆ RtlpSafeCopyMemory()
Definition at line 52 of file libsupp.c.
56{
59}
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define RtlCopyMemory(Destination, Source, Length)
◆ MmHighestUserAddress