From e598aec89026aa3efa32174c0ea5eed4a51440e4 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 31 Jul 2017 15:12:38 +0200 Subject: [PATCH] lf t55xx commands works again. Need to find a better sprinf_bin_break function --- client/cmdlft55xx.c | 9 ++++----- client/proxmark3.c | 20 ++++++++++---------- client/util.c | 4 ++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 510c85518..e2b1e1ca3 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -1210,7 +1210,7 @@ int CmdT55xxInfo(const char *Cmd){ if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H') return usage_t55xx_info(); if (strlen(Cmd)==0){ - // sanity check. + // sanity check. if (!SanityOfflineCheck(false)) return 1; if ( !AquireData( T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, pwdmode, password ) ) @@ -1223,10 +1223,10 @@ int CmdT55xxInfo(const char *Cmd){ if ( DemodBufferLen < 32) return 1; // - PrintAndLog("Offset+32 ==%d\n DemodLen == %d", config.offset + 32,DemodBufferLen ); + //PrintAndLog("Offset+32 ==%d\n DemodLen == %d", config.offset + 32, DemodBufferLen); uint8_t si = config.offset; - uint32_t bl0 = PackBits(si, 32, DemodBuffer); + uint32_t block0 = PackBits(si, 32, DemodBuffer); uint32_t safer = PackBits(si, 4, DemodBuffer); si += 4; uint32_t resv = PackBits(si, 7, DemodBuffer); si += 7; uint32_t dbr = PackBits(si, 3, DemodBuffer); si += 3; @@ -1262,9 +1262,8 @@ int CmdT55xxInfo(const char *Cmd){ PrintAndLog(" POR-Delay : %s", (por) ? "Yes":"No"); PrintAndLog("-------------------------------------------------------------"); PrintAndLog(" Raw Data - Page 0"); - PrintAndLog(" Block 0 : 0x%08X %s", bl0, sprint_bin(DemodBuffer+config.offset,32) ); + PrintAndLog(" Block 0 : 0x%08X %s", block0, sprint_bin(DemodBuffer + config.offset, 32) ); PrintAndLog("-------------------------------------------------------------"); - return 0; } diff --git a/client/proxmark3.c b/client/proxmark3.c index caa20a272..96df5bd19 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -62,15 +62,15 @@ struct receiver_arg { byte_t rx[sizeof(UsbCommand)]; byte_t* prx = rx; -// static void showBanner(void){ - // printf("██████╗ ███╗ ███╗ ████╗ ...Iceman fork\n"); - // printf("██╔══██╗████╗ ████║ ══█║\n"); - // printf("██████╔╝██╔████╔██║ ████╔╝\n"); - // printf("██╔═══╝ ██║╚██╔╝██║ ══█║ iceman@icesql.net\n"); - // printf("██║ ██║ ╚═╝ ██║ ████╔╝ https://github.com/iceman1001/proxmark3\n"); - // printf("╚═╝ ╚═╝ ╚═╝ ╚═══╝v3.0.2n"); -// } - +static void showBanner(void){ + printf("██████╗ ███╗ ███╗ ████╗ ...Iceman fork\n"); + printf("██╔══██╗████╗ ████║ ══█║\n"); + printf("██████╔╝██╔████╔██║ ████╔╝\n"); + printf("██╔═══╝ ██║╚██╔╝██║ ══█║ iceman@icesql.net\n"); + printf("██║ ██║ ╚═╝ ██║ ████╔╝ https://github.com/iceman1001/proxmark3\n"); + printf("╚═╝ ╚═╝ ╚═╝ ╚═══╝v3.0.0\n"); + printf("\n\n"); +} static void *uart_receiver(void *targ) { struct receiver_arg *arg = (struct receiver_arg*)targ; @@ -124,7 +124,7 @@ void main_loop(char *script_cmds_file, bool usb_present) { } read_history(".history"); - + while(1) { // If there is a script file diff --git a/client/util.c b/client/util.c index 07742a3e7..e66170fc9 100644 --- a/client/util.c +++ b/client/util.c @@ -160,10 +160,10 @@ char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t brea int rowlen = (len > MAX_BIN_BREAK_LENGTH ) ? MAX_BIN_BREAK_LENGTH : len; - if ( len % breaks != 0) + if ( breaks > 0 && len % breaks != 0) rowlen = ( len+(len/breaks) > MAX_BIN_BREAK_LENGTH ) ? MAX_BIN_BREAK_LENGTH : len+(len/breaks); -// printf("(sprint_bin_break) rowlen %d\n", rowlen); + //printf("(sprint_bin_break) rowlen %d\n", rowlen); static char buf[MAX_BIN_BREAK_LENGTH]; // 3072 + end of line characters if broken at 8 bits //clear memory