Skip to content

Instantly share code, notes, and snippets.

@nikkej
nikkej / rich.py
Last active August 15, 2020 02:34 — forked from skochinsky/rich.py
MSVC PE Rich header parser with compiler version display
#!/usr/bin/env python3
#
# based on code from http://trendystephen.blogspot.be/2008/01/rich-header.html
# and from https://gist.github.com/skochinsky/07c8e95e33d9429d81a75622b5d24c8b
import sys
import struct
# I'm trying not to bury the magic number...
CHECKSUM_MASK = 0x536e6144 # DanS (actuall SnaD)
RICH_TEXT = b'Rich'