from binascii import hexlify, unhexlify
from Crypto.Cipher import AES
IV = 16*"\x00"
key = 16*"\x00"
picc = "CACDEC6C5455EE52BB1DA40470963113"
# ergibt c7048d66e22e6780050100a2495ed77a
myaes = AES.new(key,AES.MODE_CBC,IV)
okay = myaes.decrypt(unhexlify(picc))
print hexlify(okay)
print "hallo"
counter= int("0x"+hexlify(okay[9:10])+hexlify(okay[8:9]),16)
print counter
ZnJvbSBiaW5hc2NpaSBpbXBvcnQgaGV4bGlmeSwgdW5oZXhsaWZ5CmZyb20gQ3J5cHRvLkNpcGhlciBpbXBvcnQgQUVTCklWICAgICA9IDE2KiJceDAwIgprZXkgICAgPSAxNioiXHgwMCIKcGljYyAgID0gIkNBQ0RFQzZDNTQ1NUVFNTJCQjFEQTQwNDcwOTYzMTEzIgojIGVyZ2lidCAgYzcwNDhkNjZlMjJlNjc4MDA1MDEwMGEyNDk1ZWQ3N2EKbXlhZXMgID0gQUVTLm5ldyhrZXksQUVTLk1PREVfQ0JDLElWKQpva2F5ICAgPSBteWFlcy5kZWNyeXB0KHVuaGV4bGlmeShwaWNjKSkKcHJpbnQgICAgaGV4bGlmeShva2F5KQpwcmludCAgICAiaGFsbG8iCmNvdW50ZXI9IGludCgiMHgiK2hleGxpZnkob2theVs5OjEwXSkraGV4bGlmeShva2F5Wzg6OV0pLDE2KQpwcmludCAgICBjb3VudGVyCg==