12 uintptr_t module_base,
15 if (!resolved || !name || !name[0] || image_size == 0) {
19 const uintptr_t image_end = module_base + image_size;
20 if (image_end < module_base) {
24 return address >= module_base && address < image_end;
28 if (!module || !out_image_size) {
32 const uint8_t *base = (
const uint8_t *)module;
33 const IMAGE_DOS_HEADER *dos = (
const IMAGE_DOS_HEADER *)base;
34 if (dos->e_magic != IMAGE_DOS_SIGNATURE || dos->e_lfanew <= 0) {
38 const IMAGE_NT_HEADERS *nt = (
const IMAGE_NT_HEADERS *)(base + dos->e_lfanew);
39 if (nt->Signature != IMAGE_NT_SIGNATURE) {
43 *out_image_size = nt->OptionalHeader.SizeOfImage;
44 return *out_image_size != 0;
49 IMAGEHLP_MODULE module_info = {.SizeOfStruct =
sizeof(module_info)};
50 if (SymGetModuleInfo(process, base, &module_info)) {
54 char module_path[MAX_PATH] = {0};
55 const char *image_name =
NULL;
56 if (GetModuleFileNameA(module, module_path,
sizeof(module_path)) != 0) {
57 image_name = module_path;
60 const DWORD loaded_base = SymLoadModuleEx(
70 if (loaded_base != 0) {
74 const DWORD error = GetLastError();
75 return error == ERROR_SUCCESS;
80 if (!process || !runtime || !runtime->
game_module) {
94 const uintptr_t module_base = (uintptr_t)module;
95 bool added_any =
false;
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
static bool ensure_pcdogs_dbghelp_module(HANDLE process, HMODULE module, DWORD image_size)
static bool pcdogs_crash_symbol_should_add(bool resolved, uintptr_t address, const char *name, uintptr_t module_base, uint32_t image_size)
void dttr_pcdogs_crash_symbols_clear()
void dttr_pcdogs_crash_symbols_register(const DTTR_Core_Context *runtime)
static bool dttr_pcdogs_crash_symbol_provider(HANDLE process, void *context)
static bool pcdogs_module_image_size(HMODULE module, DWORD *out_image_size)
void DTTR_CrashDump_SetSymbolProvider(DTTR_CrashDump_SymbolProvider provider, void *context)
Registers a synchronous symbol provider used by crash stack formatting.
void DTTR_CrashDump_ClearSymbolProvider()
DTTR_PCDOGS_API const DTTR_PCDOGS_T_Symbol_Function * DTTR_PCDOGS_SymbolFunctionAt(uint32_t index)
DTTR_PCDOGS_API uint32_t DTTR_PCDOGS_SymbolFunctionCount()
DTTR_PCDOGS_API const char * DTTR_PCDOGS_SymbolFunctionNameAt(uint32_t index)