Skip to content

Instantly share code, notes, and snippets.

@vpzomtrrfrt
Last active August 9, 2017 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpzomtrrfrt/771df91c0a8f64626fc40ca7492f0b61 to your computer and use it in GitHub Desktop.
Save vpzomtrrfrt/771df91c0a8f64626fc40ca7492f0b61 to your computer and use it in GitHub Desktop.
#!/bin/bash
data=$(iconv -f UTF16LE $1 | tr -d '\r')
echo "LongTermKey"
echo "$data" | grep LTK | cut -d: -f 2 | tr -d ',' | tr '[:lower:]' '[:upper:]'
echo
echo "Rand"
printf 'ibase=16; %s\n' $(echo "$data" | grep ERand | cut -d: -f 2 | tac -s, | tr -d ',' | tr -d '[:space:]' | tr '[:lower:]' '[:upper:]') | bc
echo
echo "EDiv"
printf 'ibase=16; %s\n' $(echo "$data" | grep EDIV | cut -d: -f 2 | tr '[:lower:]' '[:upper:]') | bc
echo
echo "LocalSignatureKey"
echo "$data" | grep CSRK | cut -d: -f 2 | tr -d ',' | tr '[:lower:]' '[:upper:]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment