Skip to content

Instantly share code, notes, and snippets.

@debedb debedb/c2m.py
Created Aug 25, 2015

Embed
What would you like to do?
mod_uid cookie to hex, python
import base64
import struct
import sys
def main():
"""
http://www.lexa.ru/programs/mod-uid-eng.html
Sample input: 'CtQF91SMxKx6nR1XWfrKAg=='
yields sample output: 'F705D40AACC48C54571D9D7A02CAFA59'
"""
x = sys.argv[1]
cdec = base64.b64decode(x)
s = struct.unpack("<IIII",cdec)
uid = "%08X%08X%08X%08X" % s
print uid
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.