Skip to content

Conversation

@jhhcs
Copy link

@jhhcs jhhcs commented Nov 24, 2025

I ran into an issue where the TimeDateStamp value computed by minidump was incorrect. When inspecting the code, I noticed that both the Reserved and TimeDateStamp field were being read as consecutive 32-bit integers:

mh.Reserved = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mh.TimeDateStamp = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)

This is incorrect, see also the official Microsoft documentation:

typedef struct _MINIDUMP_HEADER {
  ULONG32 Signature;
  ULONG32 Version;
  ULONG32 NumberOfStreams;
  RVA     StreamDirectoryRva;
  ULONG32 CheckSum;
  union {
    ULONG32 Reserved;
    ULONG32 TimeDateStamp;
  };
  ULONG64 Flags;
} MINIDUMP_HEADER, *PMINIDUMP_HEADER;

The Reserved and TimeDateStamp field are the same value since they are in a union. This PR fixes this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants