Release v4.13441 - midsummer
[RRG-proxmark3.git] / client / pyscripts / pm3_eml2mfd.py
blob90803cf5ee5be4b50f5b17ff907880f76c0ca182
1 #!/usr/bin/env python3
3 '''
4 # Andrei Costin <zveriu@gmail.com>, 2011
5 # pm3_eml2mfd.py
6 # Converts PM3 Mifare Classic emulator EML text file to MFD binary dump file
7 '''
9 import sys
10 import binascii
12 def main(argv):
13 argc = len(argv)
14 if argc < 3:
15 print('Usage:', argv[0], 'input.eml output.mfd')
16 return 1
18 with open(argv[1], "r") as file_inp, open(argv[2], "wb") as file_out:
19 for line in file_inp:
20 line = line.rstrip('\n').rstrip('\r')
21 print(line)
22 data = binascii.unhexlify(line)
23 file_out.write(data)
25 if __name__ == '__main__':
26 main(sys.argv)