Skip to content

Commit

Permalink
flush stdout on windows logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Apr 10, 2024
1 parent a09ed45 commit cc4b68c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/win/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,38 @@ LM_EnumSymbols(const lm_module_t *module,
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, LOAD_LIBRARY_AS_IMAGE_RESOURCE);
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
Expand Down

0 comments on commit cc4b68c

Please sign in to comment.