Skip to content

Instantly share code, notes, and snippets.

@bodik
bodik / psx.py
Created November 14, 2016 11:50 — forked from anonymous/psx.py
PowerShell decoder by @JohnLaTwC
## hacked together by @JohnLaTwC, Nov 2016, v 0.5
## This script attempts to decode common PowerShell encoded scripts. This version handles:
## * base64 data which encode unicode, gzip, or deflate encoded strings
## * it can operate on a file or stdin
## * it can run recursively in the event of multiple layers
## With apologies to @Lee_Holmes for using Python instead of PowerShell
##
import sys
import zlib
import re
#!/usr/bin/env python
# coding=utf8
# Copyright (C) 2010 <[email protected]>
#
"""
pydmesg: dmesg with human-readable timestamps
"""