]> cvs.zerfleddert.de Git - proxmark3-svn/blame - client/pm3_mfd2eml.py
Merge pull request #969 from pwpiwi/gcc10_fixes
[proxmark3-svn] / client / pm3_mfd2eml.py
CommitLineData
1f947c4b 1#!/usr/bin/python
2
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
70049c47 9from __future__ import with_statement
1f947c4b 10import sys
11import binascii
12
70049c47 13READ_BLOCKSIZE = 16
14
1f947c4b 15def main(argv):
16 argc = len(argv)
17 if argc < 3:
18 print 'Usage:', argv[0], 'input.mfd output.eml'
19 sys.exit(1)
20
70049c47 21 with file(argv[1], "rb") as file_inp, file(argv[2], "w") as file_out:
22 while True:
23 byte_s = file_inp.read(READ_BLOCKSIZE)
1f947c4b 24 if not byte_s:
25 break
26 hex_char_repr = binascii.hexlify(byte_s)
27 file_out.write(hex_char_repr)
28 file_out.write("\n")
1f947c4b 29
11d23264 30if __name__ == '__main__':
31 main(sys.argv)
Impressum, Datenschutz