Skip to content

Commit

Permalink
added logs for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Apr 10, 2024
1 parent 8ce59c3 commit a09ed45
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/win/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,32 @@ LM_EnumSymbols(const lm_module_t *module,
DWORD i;
lm_symbol_t symbol;

printf("ENUM SYMBOLS CALLED\n");

if (!module || !callback)
return result;

printf("ARGUMENTS CHECKED\n");

if (!utf8towcs(module->path, wpath, LM_PATH_MAX))
return result;

printf("UTF8 CONVERTED TO WCS\n");

/* Attempt to get the module handle without loading the library */
hmod = GetModuleHandleW(wpath);
printf("ATTEMPTED TO GET HMODULE: %p\n", (void *)hmod);
if (!hmod) {
printf("HMODULE NOT FOUND, ATTEMPING TO LOAD LIBRARY\n");
/* Load library purely for getting resources, and not executing */
hmod = LoadLibraryExW(wpath, NULL, LOAD_LIBRARY_AS_IMAGE_RESOURCE);

printf("LIBRARY LOADED: %p\n", (void *)hmod);
if (!hmod)
return result;

is_loaded = TRUE;
}
printf("STARTED SYMBOL ENUMERATION\n");

/*
* From: https://learn.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-moduleinfo
Expand Down

0 comments on commit a09ed45

Please sign in to comment.