From a553f2674865fa544d04ca7b8194e30c008644ae Mon Sep 17 00:00:00 2001 From: "izsh@fail0verflow.com" Date: Sun, 21 Feb 2010 00:47:22 +0000 Subject: [PATCH] Add License/Copyright headers/notices. Please add your own copyright notice if you have made any nontrivial changes or additions to the code. There are several files without any attribution, currently. --- client/Makefile | 5 + client/cli.c | 8 + client/cmddata.c | 10 + client/cmddata.h | 10 + client/cmdhf.c | 10 + client/cmdhf.h | 11 +- client/cmdhf14a.c | 10 + client/cmdhf14a.h | 10 + client/cmdhf14b.c | 10 + client/cmdhf14b.h | 10 + client/cmdhf15.c | 10 + client/cmdhf15.h | 10 + client/cmdhflegic.c | 10 + client/cmdhflegic.h | 10 + client/cmdhw.c | 10 + client/cmdhw.h | 10 + client/cmdlf.c | 10 + client/cmdlf.h | 10 + client/cmdlfem4x.c | 10 + client/cmdlfem4x.h | 10 + client/cmdlfhid.c | 10 + client/cmdlfhid.h | 10 + client/cmdlfti.c | 10 + client/cmdlfti.h | 10 + client/cmdmain.c | 10 + client/cmdmain.h | 10 + client/cmdparser.c | 10 + client/cmdparser.h | 10 + client/data.c | 10 + client/data.h | 10 + client/elf.h | 8 + client/flash.c | 8 + client/flash.h | 8 + client/flasher.c | 8 + client/graph.c | 10 + client/graph.h | 10 + client/guidummy.c | 8 + client/proxgui.cpp | 8 + client/proxgui.h | 8 + client/proxguiqt.cpp | 8 + client/proxguiqt.h | 8 + client/proxmark3.c | 10 + client/proxmark3.h | 10 + client/proxusb.c | 10 + client/proxusb.h | 10 + client/sleep.h | 10 + client/snooper.c | 8 + client/ui.c | 10 + client/ui.h | 10 + client/wingui.c | 536 ------------------------------------------- 50 files changed, 463 insertions(+), 537 deletions(-) delete mode 100644 client/wingui.c diff --git a/client/Makefile b/client/Makefile index 87d529d5..c4696464 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1,3 +1,8 @@ +#----------------------------------------------------------------------------- +# This code is licensed to you under the terms of the GNU GPL, version 2 or, +# at your option, any later version. See the LICENSE.txt file for the text of +# the license. +#----------------------------------------------------------------------------- CC=gcc CXX=g++ #COMMON_FLAGS = -m32 diff --git a/client/cli.c b/client/cli.c index 1fcdd0c3..c5c2acf4 100644 --- a/client/cli.c +++ b/client/cli.c @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Command line binary +//----------------------------------------------------------------------------- + #include #include "sleep.h" #include "ui.h" diff --git a/client/cmddata.c b/client/cmddata.c index 561132bf..92e587ab 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Data and Graph commands +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmddata.h b/client/cmddata.h index 73b5e565..06ea18cc 100644 --- a/client/cmddata.h +++ b/client/cmddata.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Data and Graph commands +//----------------------------------------------------------------------------- + #ifndef CMDDATA_H__ #define CMDDATA_H__ diff --git a/client/cmdhf.c b/client/cmdhf.c index a96d1178..176d99cc 100644 --- a/client/cmdhf.c +++ b/client/cmdhf.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency commands +//----------------------------------------------------------------------------- + #include #include "proxusb.h" #include "graph.h" diff --git a/client/cmdhf.h b/client/cmdhf.h index 317ab4a7..ff20a950 100644 --- a/client/cmdhf.h +++ b/client/cmdhf.h @@ -1,8 +1,17 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency commands +//----------------------------------------------------------------------------- + #ifndef CMDHF_H__ #define CMDHF_H__ int CmdHF(const char *Cmd); - int CmdHFTune(const char *Cmd); #endif diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 61d337d4..a6fa5a85 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency ISO14443A commands +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmdhf14a.h b/client/cmdhf14a.h index 2451954e..eaab18cb 100644 --- a/client/cmdhf14a.h +++ b/client/cmdhf14a.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency ISO14443A commands +//----------------------------------------------------------------------------- + #ifndef CMDHF14A_H__ #define CMDHF14A_H__ diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index ea5b5584..79c1b8ed 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency ISO14443B commands +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmdhf14b.h b/client/cmdhf14b.h index 523f079f..50d64762 100644 --- a/client/cmdhf14b.h +++ b/client/cmdhf14b.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency ISO14443B commands +//----------------------------------------------------------------------------- + #ifndef CMDHF14B_H__ #define CMDHF14B_H__ diff --git a/client/cmdhf15.c b/client/cmdhf15.c index ca3c6d93..9c613b86 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency ISO15693 commands +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmdhf15.h b/client/cmdhf15.h index e7ca32ef..4b9822b7 100644 --- a/client/cmdhf15.h +++ b/client/cmdhf15.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency ISO15693 commands +//----------------------------------------------------------------------------- + #ifndef CMDHF15_H__ #define CMDHF15_H__ diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index e9333ef9..381ad6b2 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency Legic commands +//----------------------------------------------------------------------------- + #include #include #include "proxusb.h" diff --git a/client/cmdhflegic.h b/client/cmdhflegic.h index 7da1be61..48197116 100644 --- a/client/cmdhflegic.h +++ b/client/cmdhflegic.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// High frequency Legic commands +//----------------------------------------------------------------------------- + #ifndef CMDHFLEGIC_H__ #define CMDHFLEGIC_H__ diff --git a/client/cmdhw.c b/client/cmdhw.c index c2b58c9f..4dd5823d 100644 --- a/client/cmdhw.c +++ b/client/cmdhw.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Hardware commands +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmdhw.h b/client/cmdhw.h index 3a85bc73..b8e10f74 100644 --- a/client/cmdhw.h +++ b/client/cmdhw.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Hardware commands +//----------------------------------------------------------------------------- + #ifndef CMDHW_H__ #define CMDHW_H__ diff --git a/client/cmdlf.c b/client/cmdlf.c index ceb84e3e..7b87c70f 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency commands +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmdlf.h b/client/cmdlf.h index 4055cf91..e1f15d2c 100644 --- a/client/cmdlf.h +++ b/client/cmdlf.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency commands +//----------------------------------------------------------------------------- + #ifndef CMDLF_H__ #define CMDLF_H__ diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index 9b40d7c0..fea4bd29 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency EM4x commands +//----------------------------------------------------------------------------- + #include #include "proxusb.h" #include "ui.h" diff --git a/client/cmdlfem4x.h b/client/cmdlfem4x.h index 53f3fe81..dda9d00c 100644 --- a/client/cmdlfem4x.h +++ b/client/cmdlfem4x.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency EM4x commands +//----------------------------------------------------------------------------- + #ifndef CMDLFEM4X_H__ #define CMDLFEM4X_H__ diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index 744138c0..344662e1 100644 --- a/client/cmdlfhid.c +++ b/client/cmdlfhid.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency HID commands +//----------------------------------------------------------------------------- + #include #include "proxusb.h" #include "ui.h" diff --git a/client/cmdlfhid.h b/client/cmdlfhid.h index 7747fd28..328f3b13 100644 --- a/client/cmdlfhid.h +++ b/client/cmdlfhid.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency HID commands +//----------------------------------------------------------------------------- + #ifndef CMDLFHID_H__ #define CMDLFHID_H__ diff --git a/client/cmdlfti.c b/client/cmdlfti.c index dcb30746..59f83f08 100644 --- a/client/cmdlfti.c +++ b/client/cmdlfti.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency TI commands +//----------------------------------------------------------------------------- + #include #include #include "crc16.h" diff --git a/client/cmdlfti.h b/client/cmdlfti.h index 9554bb1a..e4bbc3a0 100644 --- a/client/cmdlfti.h +++ b/client/cmdlfti.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency TI commands +//----------------------------------------------------------------------------- + #ifndef CMDLFTI_H__ #define CMDLFTI_H__ diff --git a/client/cmdmain.c b/client/cmdmain.c index 5334384f..203a250c 100644 --- a/client/cmdmain.c +++ b/client/cmdmain.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Main command parser entry point +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/cmdmain.h b/client/cmdmain.h index 5a34d178..edd0205f 100644 --- a/client/cmdmain.h +++ b/client/cmdmain.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Main command parser entry point +//----------------------------------------------------------------------------- + #ifndef CMDMAIN_H__ #define CMDMAIN_H__ diff --git a/client/cmdparser.c b/client/cmdparser.c index 6bb04164..0f97d7fe 100644 --- a/client/cmdparser.c +++ b/client/cmdparser.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Command parser +//----------------------------------------------------------------------------- + #include #include #include "ui.h" diff --git a/client/cmdparser.h b/client/cmdparser.h index 7d878890..28c2e66e 100644 --- a/client/cmdparser.h +++ b/client/cmdparser.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Command parser +//----------------------------------------------------------------------------- + #ifndef CMDPARSER_H__ #define CMDPARSER_H__ diff --git a/client/data.c b/client/data.c index 1fc7408f..80374c60 100644 --- a/client/data.c +++ b/client/data.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Data utilities +//----------------------------------------------------------------------------- + #include #include #include "data.h" diff --git a/client/data.h b/client/data.h index e001482d..b60ec74d 100644 --- a/client/data.h +++ b/client/data.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Data utilities +//----------------------------------------------------------------------------- + #ifndef DATA_H__ #define DATA_H__ diff --git a/client/elf.h b/client/elf.h index c489a137..906e0cf4 100644 --- a/client/elf.h +++ b/client/elf.h @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// ELF header +//----------------------------------------------------------------------------- + #ifndef __ELF_H__ #define __ELF_H__ diff --git a/client/flash.c b/client/flash.c index 68d3b097..45fa6306 100644 --- a/client/flash.c +++ b/client/flash.c @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Flashing utility functions +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/flash.h b/client/flash.h index 20090db7..f468de35 100644 --- a/client/flash.h +++ b/client/flash.h @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Flashing utility functions +//----------------------------------------------------------------------------- + #ifndef __FLASH_H__ #define __FLASH_H__ diff --git a/client/flasher.c b/client/flasher.c index 418718dd..0b8a3368 100644 --- a/client/flasher.c +++ b/client/flasher.c @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Flashing binary +//----------------------------------------------------------------------------- + #include #include #include "sleep.h" diff --git a/client/graph.c b/client/graph.c index 4a966676..541e68f3 100644 --- a/client/graph.c +++ b/client/graph.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Graph utilities +//----------------------------------------------------------------------------- + #include #include #include "ui.h" diff --git a/client/graph.h b/client/graph.h index 67041430..cbe81161 100644 --- a/client/graph.h +++ b/client/graph.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Graph utilities +//----------------------------------------------------------------------------- + #ifndef GRAPH_H__ #define GRAPH_H__ diff --git a/client/guidummy.c b/client/guidummy.c index 39bcc756..2c813002 100644 --- a/client/guidummy.c +++ b/client/guidummy.c @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// GUI dummy file +//----------------------------------------------------------------------------- + #include void ShowGraphWindow(void) diff --git a/client/proxgui.cpp b/client/proxgui.cpp index 2858157c..fabbd204 100644 --- a/client/proxgui.cpp +++ b/client/proxgui.cpp @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// GUI functions +//----------------------------------------------------------------------------- + #include "proxgui.h" #include "proxguiqt.h" diff --git a/client/proxgui.h b/client/proxgui.h index 6989f541..32121e58 100644 --- a/client/proxgui.h +++ b/client/proxgui.h @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// GUI functions +//----------------------------------------------------------------------------- + #ifdef __cplusplus extern "C" { #endif diff --git a/client/proxguiqt.cpp b/client/proxguiqt.cpp index 70c64fbd..f687bdf4 100644 --- a/client/proxguiqt.cpp +++ b/client/proxguiqt.cpp @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// GUI (QT) +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/proxguiqt.h b/client/proxguiqt.h index 58ff8326..b76a5ea7 100644 --- a/client/proxguiqt.h +++ b/client/proxguiqt.h @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// GUI (QT) +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/proxmark3.c b/client/proxmark3.c index 9873f26a..b98afd9a 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Main binary +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/proxmark3.h b/client/proxmark3.h index 323480ea..d70170dd 100644 --- a/client/proxmark3.h +++ b/client/proxmark3.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Main binary +//----------------------------------------------------------------------------- + #ifndef PROXMARK3_H__ #define PROXMARK3_H__ diff --git a/client/proxusb.c b/client/proxusb.c index b71cffc1..0a50b991 100644 --- a/client/proxusb.c +++ b/client/proxusb.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// USB utilities +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/proxusb.h b/client/proxusb.h index 3842d39f..42e6c75d 100644 --- a/client/proxusb.h +++ b/client/proxusb.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// USB utilities +//----------------------------------------------------------------------------- + #ifndef PROXUSB_H__ #define PROXUSB_H__ diff --git a/client/sleep.h b/client/sleep.h index 1ff4e677..81f4e060 100644 --- a/client/sleep.h +++ b/client/sleep.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// platform-independant sleep macros +//----------------------------------------------------------------------------- + #ifndef SLEEP_H__ #define SLEEP_H__ diff --git a/client/snooper.c b/client/snooper.c index 7723a470..ccff8333 100644 --- a/client/snooper.c +++ b/client/snooper.c @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Snooper binary +//----------------------------------------------------------------------------- + #include "sleep.h" #include "ui.h" #include "proxusb.h" diff --git a/client/ui.c b/client/ui.c index f0fa8e73..0b4183df 100644 --- a/client/ui.c +++ b/client/ui.c @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// UI utilities +//----------------------------------------------------------------------------- + #include #include #include diff --git a/client/ui.h b/client/ui.h index 8d58cf35..383ce83d 100644 --- a/client/ui.h +++ b/client/ui.h @@ -1,3 +1,13 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// UI utilities +//----------------------------------------------------------------------------- + #ifndef UI_H__ #define UI_H__ diff --git a/client/wingui.c b/client/wingui.c deleted file mode 100644 index 9fcf5ea6..00000000 --- a/client/wingui.c +++ /dev/null @@ -1,536 +0,0 @@ -//----------------------------------------------------------------------------- -// Routines for the user interface when doing interactive things with prox -// cards; this is basically a command line thing, in one window, and then -// another window to do the graphs. -// Jonathan Westhues, Sept 2005 -//----------------------------------------------------------------------------- -#include -#include -#include -#include -#include -#include - -#include "proxusb.h" -#include "graph.h" -#include "ui.h" -#include "cmdmain.h" - -#define oops() do { \ - char line[100]; \ - sprintf(line, "Internal error at line %d file '%s'", __LINE__, \ - __FILE__); \ - MessageBox(NULL, line, "Error", MB_ICONERROR); \ - exit(-1); \ -} while(0) - -void dbp(char *str, ...) -{ - va_list f; - char buf[1024]; - va_start(f, str); - vsprintf(buf, str, f); - OutputDebugString(buf); - OutputDebugString("\n"); -} - -int GraphBuffer[MAX_GRAPH_TRACE_LEN]; -int GraphTraceLen; -int PlotGridX, PlotGridY; - -HPEN GreyPenLite, GreyPen, GreenPen, WhitePen, YellowPen; -HBRUSH GreenBrush, YellowBrush; - -static int GraphStart = 0; -static double GraphPixelsPerPoint = 1; - -static int CursorAPos; -static int CursorBPos; -double CursorScaleFactor = 1.0; -static HPEN CursorAPen; -static HPEN CursorBPen; - -static HWND CommandWindow; -static HWND GraphWindow; -static HWND ScrollbackEdit; -static HWND CommandEdit; - -#define COMMAND_HISTORY_MAX 16 -static char CommandHistory[COMMAND_HISTORY_MAX][256]; -static int CommandHistoryPos = -1; -static int CommandHistoryNext; - -static HFONT MyFixedFont; -#define FixedFont(x) SendMessage((x), WM_SETFONT, (WPARAM)MyFixedFont, TRUE) - -void ExecCmd(char *cmd) -{ -} - -int CommandFinished; -int offset = 64; - -static void ResizeCommandWindow(void) -{ - int w, h; - RECT r; - GetClientRect(CommandWindow, &r); - w = r.right - r.left; - h = r.bottom - r.top; - MoveWindow(ScrollbackEdit, 10, 10, w - 20, h - 50, TRUE); - MoveWindow(CommandEdit, 10, h - 29, w - 20, 22, TRUE); -} - -void RepaintGraphWindow(void) -{ - InvalidateRect(GraphWindow, NULL, TRUE); -} - -static LRESULT CALLBACK - CommandWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_DESTROY: - case WM_QUIT: - exit(0); - return 0; - - case WM_SIZE: - ResizeCommandWindow(); - return 0; - - case WM_SETFOCUS: - SetFocus(CommandEdit); - break; - - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - - return 1; -} - -static void PaintGraph(HDC hdc) -{ - RECT r; - HBRUSH brush; - HPEN pen; - char str[250]; - int yMin = INT_MAX; - int yMax = INT_MIN; - int yMean = 0; - int startMax = 0; - int absYMax = 1; - int n = 0, i = 0; - - brush = GreenBrush; - pen = GreenPen; - - GetClientRect(GraphWindow, &r); - int zeroHeight = (r.top + r.bottom) >> 1; - - // plot X and Y grid lines - if ((PlotGridX > 0) && ((PlotGridX * GraphPixelsPerPoint) > 1)) { - for(i = offset; i < r.right; i += (int)(PlotGridX * GraphPixelsPerPoint)) { - SelectObject(hdc, GreyPenLite); - MoveToEx(hdc, r.left + i, r.top, NULL); - LineTo(hdc, r.left + i, r.bottom); - } - } - - if ((PlotGridY > 0) && ((PlotGridY * GraphPixelsPerPoint) > 1)){ - for(i = 0; i < ((r.top + r.bottom)>>1); i += (int)(PlotGridY * GraphPixelsPerPoint)) { - SelectObject(hdc, GreyPenLite); - MoveToEx(hdc, r.left, zeroHeight + i, NULL); - LineTo(hdc, r.right, zeroHeight + i); - MoveToEx(hdc, r.left, zeroHeight - i, NULL); - LineTo(hdc, r.right, zeroHeight - i); - } - } - - // print vertical separator white line on the left of the window - SelectObject(hdc, WhitePen); - MoveToEx(hdc, r.left + offset, r.top, NULL); - LineTo(hdc, r.left + offset, r.bottom); - - // print horizontal grey zero axis line - SelectObject(hdc, GreyPen); - MoveToEx(hdc, r.left, zeroHeight, NULL); - LineTo(hdc, r.right, zeroHeight); - - startMax = (GraphTraceLen - (int)((r.right - r.left - offset) / GraphPixelsPerPoint)); - // check boundaries - if(startMax < 0) startMax = 0; - if(GraphStart > startMax) GraphStart = startMax; - if(GraphStart < 0) GraphStart = 0; - - - SelectObject(hdc, pen); - - // go over the portion of the graph to be displayed and find the largest - // absolute value which will be used to auto scale the graph when displayed - for(i = GraphStart; ; i++) { - if(i >= GraphTraceLen) { - break; - } - if(fabs((double)GraphBuffer[i]) > absYMax) { - absYMax = (int)fabs((double)GraphBuffer[i]); - } - int x = offset + (int)((i - GraphStart)*GraphPixelsPerPoint); - if(x > r.right) { - break; - } - } - - absYMax = (int)(absYMax*1.2 + 1); - SelectObject(hdc, MyFixedFont); - SetTextColor(hdc, RGB(255, 255, 255)); - SetBkColor(hdc, RGB(0, 0, 0)); - - // number of points that will be plotted - double span = (int)((r.right - r.left) / GraphPixelsPerPoint); - - // one label every offset pixels, let us say - int labels = (r.right - r.left - offset) / offset; - if(labels <= 0) labels = 1; - // round to nearest power of 2 - int pointsPerLabel = (int)(log(span / labels)/log(2.0)); - if(pointsPerLabel <= 0) pointsPerLabel = 1; - pointsPerLabel = (int)pow(2.0,pointsPerLabel); - - // go over the graph and plot samples and labels - for(i = GraphStart; ; i++) { - if(i >= GraphTraceLen) { - break; - } - int x = offset + (int)((i - GraphStart)*GraphPixelsPerPoint); - if(x > r.right + GraphPixelsPerPoint) { - break; - } - - int y = GraphBuffer[i]; - if(y < yMin) yMin = y; - if(y > yMax) yMax = y; - yMean += y; - n++; - - y = (y * (r.top - r.bottom) / (2*absYMax)) + zeroHeight; - if(i == GraphStart) { - MoveToEx(hdc, x, y, NULL); - } else { - LineTo(hdc, x, y); - } - - if(GraphPixelsPerPoint > 10) { - RECT f; - f.left = x - 3; - f.top = y - 3; - f.right = x + 3; - f.bottom = y + 3; - FillRect(hdc, &f, brush); - } - - // plot labels - if(((i - GraphStart) % pointsPerLabel == 0) && i != GraphStart) { - SelectObject(hdc, WhitePen); - MoveToEx(hdc, x, zeroHeight - 8, NULL); - LineTo(hdc, x, zeroHeight + 8); - - sprintf(str, "+%d", i); - SIZE size; - GetTextExtentPoint32(hdc, str, strlen(str), &size); - TextOut(hdc, x - size.cx, zeroHeight + 8, str, strlen(str)); - - SelectObject(hdc, pen); - MoveToEx(hdc, x, y, NULL); - } - - // plot measurement cursors - if(i == CursorAPos || i == CursorBPos) { - if(i == CursorAPos) { - SelectObject(hdc, CursorAPen); - } else { - SelectObject(hdc, CursorBPen); - } - MoveToEx(hdc, x, r.top, NULL); - LineTo(hdc, x, r.bottom); - - SelectObject(hdc, pen); - MoveToEx(hdc, x, y, NULL); - } - } - - if(n != 0) { - yMean /= n; - } - - // print misc information at bottom of graph window - sprintf(str, "@%d max=%d min=%d mean=%d n=%d/%d dt=%d [%.3f] zoom=%.3f CursorA=%d [%d] CursorB=%d [%d]", - GraphStart, yMax, yMin, yMean, n, GraphTraceLen, - CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor, GraphPixelsPerPoint, - CursorAPos, GraphBuffer[CursorAPos], CursorBPos, GraphBuffer[CursorBPos]); - TextOut(hdc, 50, r.bottom - 20, str, strlen(str)); -} - -static LRESULT CALLBACK - GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_DESTROY: - case WM_QUIT: - GraphWindow = NULL; - return DefWindowProc(hwnd, msg, wParam, lParam); - - case WM_SIZE: - RepaintGraphWindow(); - return 0; - - case WM_PAINT: { - PAINTSTRUCT ps; - HDC hdc = BeginPaint(hwnd, &ps); - if(GraphStart < 0) { - GraphStart = 0; - } - // This draws the trace. - PaintGraph(hdc); - EndPaint(hwnd, &ps); - break; - } - case WM_KEYDOWN: - switch(wParam) { - case VK_DOWN: - if(GraphPixelsPerPoint <= 8) { - GraphPixelsPerPoint *= 2; - } - break; - - case VK_UP: - if(GraphPixelsPerPoint >= 0.01) { - GraphPixelsPerPoint /= 2; - } - break; - - case VK_RIGHT: - if(GraphPixelsPerPoint < 16) { - GraphStart += (int)(16 / GraphPixelsPerPoint); - } else { - GraphStart++; - } - break; - - case VK_LEFT: - if(GraphPixelsPerPoint < 16) { - GraphStart -= (int)(16 / GraphPixelsPerPoint); - } else { - GraphStart--; - } - break; - - default: - goto nopaint; - } - RepaintGraphWindow(); -nopaint: - break; - - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: { - int x = LOWORD(lParam); - x -= offset; - x = (int)(x / GraphPixelsPerPoint); - x += GraphStart; - - if(msg == WM_LBUTTONDOWN) { - CursorAPos = x; - } else { - CursorBPos = x; - } - RepaintGraphWindow(); - break; - } - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - - return 1; -} - -void PrintAndLog(char *fmt, ...) -{ - va_list f; - char str[1024]; - strcpy(str, "\r\n"); - va_start(f, fmt); - vsprintf(str+2, fmt, f); - - static char TextBuf[1024*32]; - SendMessage(ScrollbackEdit, WM_GETTEXT, (WPARAM)sizeof(TextBuf), - (LPARAM)TextBuf); - - if(strlen(TextBuf) + strlen(str) + 1 <= sizeof(TextBuf)) { - strcat(TextBuf, str); - } else { - lstrcpyn(TextBuf, str, sizeof(TextBuf)); - } - - SendMessage(ScrollbackEdit, WM_SETTEXT, 0, (LPARAM)TextBuf); - SendMessage(ScrollbackEdit, EM_LINESCROLL, 0, (LPARAM)INT_MAX); -} - -void ShowGraphWindow(void) -{ - if(GraphWindow) return; - - GraphWindow = CreateWindowEx(0, "Graph", "graphed", - WS_OVERLAPPED | WS_BORDER | WS_MINIMIZEBOX | WS_SYSMENU | - WS_SIZEBOX | WS_VISIBLE, 200, 150, 600, 500, NULL, NULL, NULL, - NULL); - if(!GraphWindow) oops(); -} - -void HideGraphWindow(void) -{ - if(GraphWindow) { - DestroyWindow(GraphWindow); - GraphWindow = NULL; - } -} - -static void SetCommandEditTo(char *str) -{ - SendMessage(CommandEdit, WM_SETTEXT, 0, (LPARAM)str); - SendMessage(CommandEdit, EM_SETSEL, strlen(str), strlen(str)); -} - -void ShowGui() -{ - WNDCLASSEX wc; - memset(&wc, 0, sizeof(wc)); - wc.cbSize = sizeof(wc); - - wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC; - wc.lpfnWndProc = (WNDPROC)CommandWindowProc; - wc.hInstance = NULL; - wc.hbrBackground = (HBRUSH)(COLOR_BTNSHADOW); - wc.lpszClassName = "Command"; - wc.lpszMenuName = NULL; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - - if(!RegisterClassEx(&wc)) oops(); - - wc.lpszClassName = "Graph"; - wc.lpfnWndProc = (WNDPROC)GraphWindowProc; - wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); - - if(!RegisterClassEx(&wc)) oops(); - - CommandWindow = CreateWindowEx(0, "Command", "prox", - WS_OVERLAPPED | WS_BORDER | WS_MINIMIZEBOX | WS_SYSMENU | - WS_SIZEBOX | WS_VISIBLE, 20, 20, 500, 400, NULL, NULL, NULL, - NULL); - if(!CommandWindow) oops(); - - ScrollbackEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "", - WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | ES_MULTILINE | - ES_AUTOVSCROLL | WS_VSCROLL, 0, 0, 0, 0, CommandWindow, NULL, - NULL, NULL); - - CommandEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "", - WS_CHILD | WS_CLIPSIBLINGS | WS_TABSTOP | WS_VISIBLE | - ES_AUTOHSCROLL, 0, 0, 0, 0, CommandWindow, NULL, NULL, NULL); - - MyFixedFont = CreateFont(14, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, - ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, - FF_DONTCARE, "Lucida Console"); - if(!MyFixedFont) - MyFixedFont = (HFONT)GetStockObject(SYSTEM_FONT); - - FixedFont(ScrollbackEdit); - FixedFont(CommandEdit); - - ResizeCommandWindow(); - SetFocus(CommandEdit); - - PrintAndLog(">> Started prox, built " __DATE__ " " __TIME__); - PrintAndLog(">> Connected to device"); - - GreyPenLite = CreatePen(PS_SOLID, 1, RGB(50, 50, 50)); - GreyPen = CreatePen(PS_SOLID, 1, RGB(100, 100, 100)); - GreenPen = CreatePen(PS_SOLID, 1, RGB(100, 255, 100)); - YellowPen = CreatePen(PS_SOLID, 1, RGB(255, 255, 0)); - GreenBrush = CreateSolidBrush(RGB(100, 255, 100)); - YellowBrush = CreateSolidBrush(RGB(255, 255, 0)); - WhitePen = CreatePen(PS_SOLID, 1, RGB(255, 255, 255)); - - CursorAPen = CreatePen(PS_DASH, 1, RGB(255, 255, 0)); - CursorBPen = CreatePen(PS_DASH, 1, RGB(255, 0, 255)); - - MSG msg; - for(;;) { - if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - if(msg.message == WM_KEYDOWN && msg.wParam == VK_RETURN) { - char got[1024]; - SendMessage(CommandEdit, WM_GETTEXT, (WPARAM)sizeof(got), - (LPARAM)got); - - if(strcmp(got, "cls")==0) { - SendMessage(ScrollbackEdit, WM_SETTEXT, 0, (LPARAM)""); - } else { - CommandReceived(got); - } - SendMessage(CommandEdit, WM_SETTEXT, 0, (LPARAM)""); - - // Insert it into the command history, unless it is - // identical to the previous command in the history. - int prev = CommandHistoryNext - 1; - if(prev < 0) prev += COMMAND_HISTORY_MAX; - if(strcmp(CommandHistory[prev], got) != 0) { - strcpy(CommandHistory[CommandHistoryNext], got); - CommandHistoryNext++; - if(CommandHistoryNext == COMMAND_HISTORY_MAX) { - CommandHistoryNext = 0; - } - } - CommandHistoryPos = -1; - } else if(msg.message == WM_KEYDOWN && msg.wParam == VK_UP && - msg.hwnd == CommandEdit) - { - if(CommandHistoryPos == -1) { - CommandHistoryPos = CommandHistoryNext; - } - CommandHistoryPos--; - if(CommandHistoryPos < 0) { - CommandHistoryPos = COMMAND_HISTORY_MAX-1; - } - SetCommandEditTo(CommandHistory[CommandHistoryPos]); - } else if(msg.message == WM_KEYDOWN && msg.wParam == VK_DOWN && - msg.hwnd == CommandEdit) - { - CommandHistoryPos++; - if(CommandHistoryPos >= COMMAND_HISTORY_MAX) { - CommandHistoryPos = 0; - } - SetCommandEditTo(CommandHistory[CommandHistoryPos]); - } else if(msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE && - msg.hwnd == CommandEdit) - { - SendMessage(CommandEdit, WM_SETTEXT, 0, (LPARAM)""); - } else { - if(msg.message == WM_KEYDOWN) { - CommandHistoryPos = -1; - } - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - if (!offline) - { - UsbCommand c; - if(ReceiveCommandPoll(&c)) - UsbCommandReceived(&c); - } - - Sleep(10); - } -} -- 2.39.5