]> git.zerfleddert.de Git - proxmark3-svn/blame_incremental - client/pm3_mfd2eml.py
clean up unprintable characters in MFU dump output
[proxmark3-svn] / client / pm3_mfd2eml.py
... / ...
CommitLineData
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
9from __future__ import with_statement
10import sys
11import binascii
12
13READ_BLOCKSIZE = 16
14
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
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)
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")
29
30if __name__ == '__main__':
31 main(sys.argv)
Impressum, Datenschutz