Skip to content

Instantly share code, notes, and snippets.

Forked from lkraider/
Last active April 18, 2023 14:03
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
def decode(msg):
text = ""
for i in range(0, len(msg), 2):
text += unrot(msg[i: i + 2], i // 2) # add position as extra parameter
return text
def unrot(pair, pos, key=ord('x')):
if pos % 2 == 0: # "even" position => 2nd char is offset
pair = pair[1] + pair[0] # swap letters in pair
offset = (ord('g') - ord(pair[0])) * 16 # treat 1st char as offset
return chr(sum(ord(c) for c in pair) - key - offset) # map to original character
if __name__ == '__main__':
import sys
Copy link

mqu commented Mar 24, 2023

an other way to use this script:

  • feed spamcause header in a file whithout "X-VR-SPAMCAUSE: "
  • then run
python3 ./ $(cat /tmp/temp-file) | sed -e "s/;/\n/g"

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