#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "winerror.h"
#include "wine/debug.h"
#include "imagehlp.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (imagehlp) |
|
static WORD | CalcCheckSum (DWORD StartValue, LPVOID BaseAddress, DWORD WordCount) |
|
BOOL WINAPI | BindImage (PCSTR ImageName, PCSTR DllPath, PCSTR SymbolPath) |
|
BOOL WINAPI | BindImageEx (DWORD Flags, PCSTR ImageName, PCSTR DllPath, PCSTR SymbolPath, PIMAGEHLP_STATUS_ROUTINE StatusRoutine) |
|
PIMAGE_NT_HEADERS WINAPI | CheckSumMappedFile (LPVOID BaseAddress, DWORD FileLength, LPDWORD HeaderSum, LPDWORD CheckSum) |
|
DWORD WINAPI | MapFileAndCheckSumA (PCSTR Filename, PDWORD HeaderSum, PDWORD CheckSum) |
|
DWORD WINAPI | MapFileAndCheckSumW (PCWSTR Filename, PDWORD HeaderSum, PDWORD CheckSum) |
|
BOOL WINAPI | ReBaseImage (PCSTR CurrentImageName, PCSTR SymbolPath, BOOL fReBase, BOOL fRebaseSysfileOk, BOOL fGoingDown, ULONG CheckImageSize, ULONG *OldImageSize, ULONG_PTR *OldImageBase, ULONG *NewImageSize, ULONG_PTR *NewImageBase, ULONG TimeStamp) |
|
BOOL WINAPI | RemovePrivateCvSymbolic (PCHAR DebugData, PCHAR *NewDebugData, ULONG *NewDebugSize) |
|
VOID WINAPI | RemoveRelocations (PCHAR ImageName) |
|
BOOL WINAPI | SplitSymbols (PSTR ImageName, PCSTR SymbolsPath, PSTR SymbolFilePath, ULONG Flags) |
|
BOOL WINAPI | UpdateDebugInfoFile (PCSTR ImageFileName, PCSTR SymbolPath, PSTR DebugFilePath, PIMAGE_NT_HEADERS32 NtHeaders) |
|
BOOL WINAPI | UpdateDebugInfoFileEx (PCSTR ImageFileName, PCSTR SymbolPath, PSTR DebugFilePath, PIMAGE_NT_HEADERS32 NtHeaders, DWORD OldChecksum) |
|
◆ BindImage()
Definition at line 40 of file modify.c.
42{
44}
BOOL WINAPI BindImageEx(DWORD Flags, PCSTR ImageName, PCSTR DllPath, PCSTR SymbolPath, PIMAGEHLP_STATUS_ROUTINE StatusRoutine)
static const char const char * DllPath
static const char * ImageName
static const char const char const char * SymbolPath
Referenced by bind_image().
◆ BindImageEx()
Definition at line 67 of file modify.c.
70{
74
75 FIXME(
"(%d, %s, %s, %s, %p): semi-stub\n",
78 );
79
81
84 {
87 }
88
89
90#ifdef _WIN64
92#else
94#endif
95 {
96 FIXME(
"Wrong architecture in PE header, unable to enumerate imports\n");
99 }
100
101 for (; import_desc->
Name && import_desc->
FirstThunk; ++import_desc)
102 {
105 const char *dll_name;
106
108 import_desc->
Name, 0)))
109 {
113 }
114
117
119 {
123 }
124
128 {
129 ERR(
"Can't grab thunk data of %s, going to next imported DLL\n", dll_name);
130 continue;
131 }
132
134 {
135
137 {
139
141 thunk->u1.AddressOfData, 0)))
142 {
143 ERR(
"Can't grab import by name info, skipping to next ordinal\n");
144 continue;
145 }
146
149 }
150 }
151 }
152
155}
PVOID WINAPI ImageRvaToVa(_In_ PIMAGE_NT_HEADERS, _In_ PVOID, _In_ ULONG, _In_opt_ PIMAGE_SECTION_HEADER *)
#define RtlImageDirectoryEntryToData
BOOL WINAPI MapAndLoad(PCSTR pszImageName, PCSTR pszDllPath, PLOADED_IMAGE pLoadedImage, BOOL bDotDll, BOOL bReadOnly)
BOOL WINAPI UnMapAndLoad(PLOADED_IMAGE pLoadedImage)
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
#define ERROR_FILE_NOT_FOUND
static const char const char const char PIMAGEHLP_STATUS_ROUTINE StatusRoutine
#define IMAGE_SNAP_BY_ORDINAL(Ordinal)
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define IMAGE_DIRECTORY_ENTRY_IMPORT
PIMAGE_NT_HEADERS32 FileHeader
#define ERROR_INVALID_ACCESS
_Must_inspect_result_ _In_ ULONG Flags
Referenced by BindImage().
◆ CalcCheckSum()
Definition at line 161 of file modify.c.
163{
167
168 Sum = StartValue;
170 for (
i = 0;
i < WordCount;
i++)
171 {
174 {
176 }
178 }
179
181}
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
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
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Referenced by CheckSumMappedFile().
◆ CheckSumMappedFile()
Definition at line 187 of file modify.c.
190{
194
196
199
202
203 *HeaderSum = HdrSum =
header->OptionalHeader.CheckSum;
204
205
206
208 {
209 CalcSum -=
LOWORD(HdrSum);
210 }
211 else
212 {
213 CalcSum = ((
LOWORD(CalcSum) -
LOWORD(HdrSum)) & 0xFFFF) - 1;
214 }
215
216
218 {
219 CalcSum -=
HIWORD(HdrSum);
220 }
221 else
222 {
223 CalcSum = ((
LOWORD(CalcSum) -
HIWORD(HdrSum)) & 0xFFFF) - 1;
224 }
225
226
228
229 *CheckSum = CalcSum;
230
232}
static WORD CalcCheckSum(DWORD StartValue, LPVOID BaseAddress, DWORD WordCount)
_Out_ PNDIS_HANDLE _Out_ PUINT FileLength
Referenced by IMAGEHLP_RecalculateChecksum(), MapFileAndCheckSumA(), and MapFileAndCheckSumW().
◆ MapFileAndCheckSumA()
Definition at line 237 of file modify.c.
239{
244
245 TRACE(
"(%s, %p, %p): stub\n",
247 );
248
255 0);
257 {
259 }
260
264 0,
265 0,
267 if (hMapping == 0)
268 {
271 }
272
275 0,
276 0,
277 0);
279 {
283 }
284
287
290 HeaderSum,
291 CheckSum);
292
296
297 return 0;
298}
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(LPVOID BaseAddress, DWORD FileLength, LPDWORD HeaderSum, LPDWORD CheckSum)
#define CHECKSUM_MAPVIEW_FAILURE
#define CHECKSUM_OPEN_FAILURE
#define CHECKSUM_MAP_FAILURE
◆ MapFileAndCheckSumW()
Definition at line 303 of file modify.c.
305{
310
311 TRACE(
"(%s, %p, %p): stub\n",
313 );
314
321 0);
323 {
325 }
326
330 0,
331 0,
333 if (hMapping == 0)
334 {
337 }
338
341 0,
342 0,
343 0);
345 {
349 }
350
353
356 HeaderSum,
357 CheckSum);
358
362
363 return 0;
364}
◆ ReBaseImage()
BOOL WINAPI ReBaseImage |
( |
PCSTR |
CurrentImageName, |
|
|
PCSTR |
SymbolPath, |
|
|
BOOL |
fReBase, |
|
|
BOOL |
fRebaseSysfileOk, |
|
|
BOOL |
fGoingDown, |
|
|
ULONG |
CheckImageSize, |
|
|
ULONG * |
OldImageSize, |
|
|
ULONG_PTR * |
OldImageBase, |
|
|
ULONG * |
NewImageSize, |
|
|
ULONG_PTR * |
NewImageBase, |
|
|
ULONG |
TimeStamp |
|
) |
| |
Definition at line 369 of file modify.c.
374{
376 "(%s, %s, %d, %d, %d, %d, %p, %p, %p, %p, %d): stub\n",
378 fRebaseSysfileOk, fGoingDown, CheckImageSize, OldImageSize,
379 OldImageBase, NewImageSize, NewImageBase,
TimeStamp
380 );
383}
#define ERROR_CALL_NOT_IMPLEMENTED
◆ RemovePrivateCvSymbolic()
Definition at line 388 of file modify.c.
390{
391 FIXME(
"(%p, %p, %p): stub\n",
392 DebugData, NewDebugData, NewDebugSize
393 );
396}
◆ RemoveRelocations()
◆ SplitSymbols()
Definition at line 410 of file modify.c.
413{
414 FIXME(
"(%s, %s, %s, %d): stub\n",
417 );
420}
◆ UpdateDebugInfoFile()
Definition at line 425 of file modify.c.
428{
429 FIXME(
"(%s, %s, %s, %p): stub\n",
432 );
435}
◆ UpdateDebugInfoFileEx()
Definition at line 440 of file modify.c.
443{
444 FIXME(
"(%s, %s, %s, %p, %d): stub\n",
446 debugstr_a(DebugFilePath), NtHeaders, OldChecksum
447 );
450}
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
imagehlp |
| ) |
|