added more keys (@equipter)
[RRG-proxmark3.git] / tools / pm3_mfd2eml.py
blob52d858df0679122243c533ec00d836d240d21026
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 '''
10 import sys
12 READ_BLOCKSIZE = 16
14 def main(argv):
15 argc = len(argv)
16 if argc < 3:
17 print('Usage:', argv[0], 'input.mfd output.eml')
18 sys.exit(1)
20 with open(argv[1], "rb") as file_inp, open(argv[2], "w") as file_out:
21 while True:
22 byte_s = file_inp.read(READ_BLOCKSIZE)
23 if not byte_s:
24 break
25 hex_char_repr = byte_s.hex()
26 file_out.write(hex_char_repr)
27 file_out.write("\n")
29 if __name__ == '__main__':
30 main(sys.argv)