diff --git a/ModuleLoader.vcxproj b/ModuleLoader.vcxproj index 80ae87c..614e840 100644 --- a/ModuleLoader.vcxproj +++ b/ModuleLoader.vcxproj @@ -37,7 +37,6 @@ ProgramDatabase Level4 true - true Disabled WIN32;_DEBUG;_CONSOLE MultiThreadedDebug @@ -59,7 +58,6 @@ $(XEDK)\include\win32 Level4 true - true Full Speed true diff --git a/src/Modules.c b/src/Modules.c index 3505e34..b1389ac 100644 --- a/src/Modules.c +++ b/src/Modules.c @@ -100,7 +100,20 @@ HRESULT ShowLoadedModuleNames(void) // Go through the loaded modules and print their names while ((hr = DmWalkLoadedModules(&pModuleWalker, &loadedModule)) == XBDM_NOERR) - puts(loadedModule.Name); + { + // Create a date string from the timestamp + char date[50] = { 0 }; + TimestampToDateString(loadedModule.TimeStamp, date, sizeof(date)); + + printf("%s\n", loadedModule.Name); + printf(" BaseAddress: 0x%X\n", loadedModule.BaseAddress); + printf(" Size: 0x%X\n", loadedModule.Size); + printf(" Timestamp: %s\n", date); + printf(" Checksum: 0x%X\n", loadedModule.CheckSum); + printf(" DataAddress: 0x%X\n", loadedModule.PDataAddress); + printf(" DataSize: 0x%X\n", loadedModule.PDataSize); + printf("\n"); + } // Error handling if (hr != XBDM_ENDOFLIST) diff --git a/src/Utils.c b/src/Utils.c index e6295d4..72f08aa 100644 --- a/src/Utils.c +++ b/src/Utils.c @@ -3,6 +3,7 @@ #include #include +#include // XBDM uses bit field types other than int which triggers a warning at warning level 4 // so we just disable it for XBDM @@ -88,3 +89,10 @@ void LogXbdmError(HRESULT hr) LogError(errorMsg); } + +void TimestampToDateString(time_t timestamp, char *date, size_t dateSize) +{ + struct tm dateTime; + localtime_s(&dateTime, ×tamp); + strftime(date, dateSize, "%B %d, %Y (%H:%M:%S)", &dateTime); +} diff --git a/src/Utils.h b/src/Utils.h index 0a5337f..9276ce5 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -10,3 +10,6 @@ HRESULT AddXdkBinDirToPath(void); // Translate the HRESULT hr into an error message and write it to stderr. void LogXbdmError(HRESULT hr); + +// Convert a time_t to a formatted date string. +void TimestampToDateString(time_t timestamp, char *date, size_t dateSize);