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'
@nikkej
nikkej / extract-prodids.py
Created April 29, 2020 09:41
MSVC prodid extractor
#!/usr/bin/env python3
#
# Extracts prodid enumeration from a given binary file
# Example usage:
# extract-prodids.py -f msobj140-msvcrt.lib
#
import re, argparse, struct
# Note: care must be taken of a format of RE string as following works only
# with msobj140-msvcrt.lib for certain
@nikkej
nikkej / check-pre-reqs.sh
Last active March 29, 2020 12:47
A simple bash function to test existence of required programs
#!/bin/bash
#
# Simple bash function to test existence of required programs for script
# to work properly. Utilizes bash array
#
function check_pre_reqs {
declare -a procrams=($*)
for item in ${procrams[*]}; do
if test "$(type -p $item)" == ""; then