Module: wine Branch: master Commit: 173c720e59db999852f74011444c1fdb13ca0459 URL: https://source.winehq.org/git/wine.git/?a=commit;h=173c720e59db999852f740114... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 24 08:35:33 2019 +0300 dbgeng: Set module timestamp field. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbgeng/dbgeng.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/dbgeng/dbgeng.c b/dlls/dbgeng/dbgeng.c index 569b824..95a95b6 100644 --- a/dlls/dbgeng/dbgeng.c +++ b/dlls/dbgeng/dbgeng.c @@ -108,13 +108,28 @@ static WORD debug_target_get_module_machine(struct target_process *target, HMODU ReadProcessMemory(target->handle, module, &dos, sizeof(dos), NULL); if (dos.e_magic == IMAGE_DOS_SIGNATURE) { - ReadProcessMemory(target->handle, (const char *)module + dos.e_lfanew + 4 /* signature */, &machine, + ReadProcessMemory(target->handle, (const char *)module + dos.e_lfanew + 4 /* PE signature */, &machine, sizeof(machine), NULL); } return machine; } +static DWORD debug_target_get_module_timestamp(struct target_process *target, HMODULE module) +{ + IMAGE_DOS_HEADER dos = { 0 }; + DWORD timestamp = 0; + + ReadProcessMemory(target->handle, module, &dos, sizeof(dos), NULL); + if (dos.e_magic == IMAGE_DOS_SIGNATURE) + { + ReadProcessMemory(target->handle, (const char *)module + dos.e_lfanew + 4 /* PE signature */ + + FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp), ×tamp, sizeof(timestamp), NULL); + } + + return timestamp; +} + static HRESULT debug_target_init_modules_info(struct target_process *target) { unsigned int i, count; @@ -156,6 +171,7 @@ static HRESULT debug_target_init_modules_info(struct target_process *target) target->modules.info[i].params.Base = (ULONG_PTR)info.lpBaseOfDll; target->modules.info[i].params.Size = info.SizeOfImage; + target->modules.info[i].params.TimeDateStamp = debug_target_get_module_timestamp(target, modules[i]); GetModuleFileNameExA(target->handle, modules[i], target->modules.info[i].image_name, ARRAY_SIZE(target->modules.info[i].image_name));