From b56cd37306d4333106060edeb5298a40bba61f8b Mon Sep 17 00:00:00 2001 From: hploetz Date: Sat, 2 Jun 2007 06:58:48 +0000 Subject: [PATCH] Change output of ultralight cat to the customary 4 bytes per line git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@209 f711b948-2313-0410-aaa9-d29f33439f0b --- cards/building_blocks.py | 3 ++- cards/rfid_card.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cards/building_blocks.py b/cards/building_blocks.py index 3895ea4..a6fe5a4 100644 --- a/cards/building_blocks.py +++ b/cards/building_blocks.py @@ -96,6 +96,7 @@ class Card_with_80_aa(Card_with_ls): class Card_with_read_binary: DATA_UNIT_SIZE=1 + HEXDUMP_LINELEN=16 def read_binary_file(self, offset = 0): """Read from the currently selected EF. @@ -127,7 +128,7 @@ class Card_with_read_binary: "Print a hexdump of the currently selected file (e.g. consecutive READ BINARY)" contents = self.read_binary_file() self.last_result = R_APDU(contents + self.last_sw) - print utils.hexdump(contents) + print utils.hexdump(contents,linelen=self.HEXDUMP_LINELEN) COMMANDS = { "cat": cmd_cat, diff --git a/cards/rfid_card.py b/cards/rfid_card.py index 42eba9e..e209c91 100644 --- a/cards/rfid_card.py +++ b/cards/rfid_card.py @@ -75,6 +75,7 @@ class Mifare_Classic_4k_Card(Mifare_Classic_Card): class Mifare_Ultralight_Card(Mifare_Card): DRIVER_NAME = ["Mifare Ultralight"] + HEXDUMP_LINELEN = 4 ATRS = [ # Ultralight