19#define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
27#define MAX_SYMBOL_NAME 1024
29#define CV_CALL_NEAR_C 0x00
30#define CV_CALL_FAR_C 0x01
31#define CV_CALL_NEAR_PASCAL 0x02
32#define CV_CALL_FAR_PASCAL 0x03
33#define CV_CALL_NEAR_FAST 0x04
34#define CV_CALL_FAR_FAST 0x05
35#define CV_CALL_SKIPPED 0x06
36#define CV_CALL_NEAR_STD 0x07
37#define CV_CALL_FAR_STD 0x08
38#define CV_CALL_NEAR_SYS 0x09
39#define CV_CALL_FAR_SYS 0x0a
40#define CV_CALL_THISCALL 0x0b
41#define CV_CALL_MIPSCALL 0x0c
42#define CV_CALL_GENERIC 0x0d
43#define CV_CALL_ALPHACALL 0x0e
44#define CV_CALL_PPCCALL 0x0f
45#define CV_CALL_SHCALL 0x10
46#define CV_CALL_ARMCALL 0x11
47#define CV_CALL_AM33CALL 0x12
48#define CV_CALL_TRICALL 0x13
49#define CV_CALL_SH5CALL 0x14
50#define CV_CALL_M32RCALL 0x15
132 "SymTagCompilandDetails",
133 "SymTagCompilandEnv",
139 "SymTagPublicSymbol",
142 "SymTagFunctionType",
149 "SymTagFunctionArgType",
150 "SymTagFuncDebugStart",
151 "SymTagFuncDebugEnd",
152 "SymTagUsingNamespace",
167 for (
i = 0;
i < ind;
i++)
174 IndentPrint(indent); printf
180 printf(
"dumpsym <file> [-sp=<symbolpath>] [-p] [<symname>]\n\n");
181 printf(
"<file> The PE file you want to dump the symbols of\n");
182 printf(
"-sp=<symbolpath> Path to your symbol files.\n");
183 printf(
" Default is MS symbol server.\n");
184 printf(
"-p Enable struct positions.\n");
185 printf(
"<symname> A name of a Symbol, you want to dump\n");
186 printf(
" Default is all symbols.\n");
525 WCHAR *pszName, *pszNameX;
560 for (
i = 0;
i < tfpex.tfp.Count;
i++)
586 WCHAR *pszName, *pszNameX;
614 printfi(
"struct %ls", pszName);
622 printfi(
"UTDKind%ld %ls", dwUDTKind, pszName);
639 for (
i = 0;
i < tfpex.tfp.Count;
i++)
664 DWORD dwCurrentBitPos;
668 if (
i < tfpex.tfp.Count - 1)
677 if (dwNextBitPos == 0 && dwCurrentBitPos != 0)
679 dwNextBitPos = ulLength * 8;
682 if (dwNextBitPos != dwCurrentBitPos)
684 printf(
":%ld", dwNextBitPos - dwCurrentBitPos);
802 (*(
INT*)UserContext)++;
879#if defined(__GNUC__) && \
880 (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400)
881 printf(
"Symbol: %s, TypeIndex=%ld, Flags=%lx, Value=0x%llx\n",
883 printf(
"Symbol: %s, TypeIndex=%ld, Flags=%lx, Value=0x%I64x\n",
902 LPSTR pszSymbolPath, pszSymbolName;
906 printf(
"PE symbol dumper\n");
907 printf(
"Copyright (c) Timo Kreuzer 2008\n\n");
919 pszSymbolName =
NULL;
922 pszSymbolPath =
"srv**symbols*http://msdl.microsoft.com/download/symbols";
931 pszSymbolPath =
argv[
i] + 4;
946 pszSymbolName =
argv[
i];
952 printf(
"Trying to get symbols from: %s\n", pszSymbolPath);
956 printf(
"SymInitialize() failed\n");
960 printf(
"Loading symbols for %s, please wait...\n", szFullFileName);
962 if (dwModuleBase == 0)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
static const WCHAR indent[]
BOOL WINAPI SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess)
#define GetCurrentProcess()
@ TI_GET_CALLING_CONVENTION
#define SYMOPT_DEFERRED_LOADS
DWORD WINAPI SymSetOptions(DWORD opts)
BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame, PIMAGEHLP_CONTEXT Context)
BOOL WINAPI SymSetSearchPath(HANDLE hProcess, PCSTR searchPath)
DWORD WINAPI SymGetOptions(void)
DWORD64 WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD64 BaseOfDll, DWORD SizeOfDll)
BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD64 ModBase, ULONG TypeId, IMAGEHLP_SYMBOL_TYPE_INFO GetType, PVOID pInfo)
BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
static void cleanup(void)
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_In_ BOOL _In_ HANDLE hProcess
_In_ DWORD _In_ DWORD dwOffset
ULONG64 InstructionOffset
BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask, PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
#define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS
VOID PrintVariant(VARIANT *v)
#define CV_CALL_ALPHACALL
#define CV_CALL_NEAR_PASCAL
#define CV_CALL_FAR_PASCAL
VOID DumpType(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers)
VOID DumpPointer(DWORD dwTypeIndex, PENUMINFO pei, INT indent)
VOID DumpFunction(PSYMBOL_INFO pSymInfo, PENUMINFO pei)
BOOL InitDbgHelp(HANDLE hProcess, LPSTR pszSymbolPath)
struct ENUMINFO * PENUMINFO
#define CV_CALL_NEAR_FAST
BOOL CALLBACK EnumSymbolsProc(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)
VOID DumpBaseType(DWORD dwTypeIndex, PENUMINFO pei, INT indent)
void IndentPrint(INT ind)
VOID DumpEnum(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers)
VOID DumpCV(DWORD dwTypeIndex, PENUMINFO pei)
VOID DumpUDT(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers)
VOID DumpParams(PSYMBOL_INFO pSymInfo, PENUMINFO pei)
BOOL IsUnnamed(WCHAR *pszName)
VOID DumpArray(DWORD dwTypeIndex, PENUMINFO pei, INT indent)
BOOL CALLBACK EnumParamsProc(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)
DWORD WINAPI GetLastError(void)