From e81521be268f2be037a47f9fb1d1dff4bdc0e752 Mon Sep 17 00:00:00 2001 From: rdbo Date: Thu, 11 Apr 2024 04:58:59 -0300 Subject: [PATCH] removed debug logs from windows --- src/win/symbol.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/win/symbol.c b/src/win/symbol.c index c5dc98e6..1006d71c 100644 --- a/src/win/symbol.c +++ b/src/win/symbol.c @@ -45,76 +45,42 @@ LM_EnumSymbols(const lm_module_t *module, DWORD i; lm_symbol_t symbol; - printf("ENUM SYMBOLS CALLED\n"); - fflush(stdout); - if (!module || !callback) return result; - printf("ARGUMENTS CHECKED\n"); - fflush(stdout); - if (!utf8towcs(module->path, wpath, LM_PATH_MAX)) return result; - printf("UTF8 CONVERTED TO WCS\n"); - fflush(stdout); - /* Attempt to get the module handle without loading the library */ hmod = GetModuleHandleW(wpath); - printf("ATTEMPTED TO GET HMODULE: %p\n", (void *)hmod); - fflush(stdout); if (!hmod) { - printf("HMODULE NOT FOUND, ATTEMPING TO LOAD LIBRARY\n"); - fflush(stdout); /* Load library purely for getting resources, and not executing */ hmod = LoadLibraryExW(wpath, NULL, DONT_RESOLVE_DLL_REFERENCES); - printf("LIBRARY LOADED: %p\n", (void *)hmod); - fflush(stdout); if (!hmod) return result; is_loaded = TRUE; } - printf("STARTED SYMBOL ENUMERATION\n"); - fflush(stdout); /* * From: https://learn.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-moduleinfo * * "The load address of a module is the same as the HMODULE value." */ - modbase = (lm_address_t)hmod; - printf("MODBASE: %p\n", (void *)modbase); - fflush(stdout); + modbase = (lm_address_t)hmod; pdoshdr = (PIMAGE_DOS_HEADER)modbase; pnthdr = (PIMAGE_NT_HEADERS)(modbase + (lm_address_t)pdoshdr->e_lfanew); - printf("NTHDR: %p\n", (void *)pnthdr); - fflush(stdout); pexportdir = (PIMAGE_EXPORT_DIRECTORY)( modbase + pnthdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress ); - printf("EXPORT DIR: %p\n", (void *)pexportdir); - fflush(stdout); - export_names = (DWORD *)(modbase + pexportdir->AddressOfNames); - printf("EXPORT_NAMES: %p\n", (void *)export_names); - fflush(stdout); - export_funcs = (DWORD *)(modbase + pexportdir->AddressOfFunctions); - printf("EXPORT_FUNCS: %p\n", export_funcs); - fflush(stdout); for (i = 0; i < pexportdir->NumberOfNames && i < pexportdir->NumberOfFunctions; ++i) { symbol.name = (lm_string_t)(modbase + export_names[i]); - printf("SYMBOL NAME: %s\n", symbol.name); - fflush(stdout); - symbol.address = (lm_address_t)(module->base + export_funcs[i]); - printf("SYMBOL ADDRESS: %p\n", symbol.address); - fflush(stdout); if (callback(&symbol, arg) == LM_FALSE) break;