Release v4.13441 - midsummer
[RRG-proxmark3.git] / client / pyscripts / pm3_mfd2eml.py
blobae7a79825042cac4316a38162b847d42e02b3f68
1 #!/usr/bin/env python3
3 '''
4 # Andrei Costin <zveriu@gmail.com>, 2011
5 # pm3_eml2mfd.py
6 # Converts PM3 Mifare Classic MFD binary dump file to emulator EML text file
7 '''
8 import sys
10 READ_BLOCKSIZE = 16
12 def main(argv):
13 argc = len(argv)
14 if argc < 3:
15 print('Usage:', argv[0], 'input.mfd output.eml')
16 return 1
18 with open(argv[1], "rb") as file_inp, open(argv[2], "w") as file_out:
19 while True:
20 byte_s = file_inp.read(READ_BLOCKSIZE)
21 if not byte_s:
22 break
23 hex_char_repr = byte_s.hex()
24 file_out.write(hex_char_repr)
25 file_out.write("\n")
27 if __name__ == '__main__':
28 main(sys.argv)