@@ -0,0 +1,1740 @@
+#! /usr/bin/env python%0A%0A%22%22%22%0A    stress_apdu.py: send an apdu in loop%0A    Copyright (C) 2010  Ludovic Rousseau%0A%22%22%22%0A%0A#   this program is free software; you can redistribute it and/or modify%0A#   it under the terms of the gnu general public license as published by%0A#   the free software foundation; either version 2 of the license, or%0A#   (at your option) any later version.%0A#%0A#   this program is distributed in the hope that it will be useful,%0A#   but without any warranty; without even the implied warranty of%0A#   merchantability or fitness for a particular purpose.  see the%0A#   gnu general public license for more details.%0A#%0A#   you should have received a copy of the gnu general public license along%0A#   with this program; if not, write to the free software foundation, inc.,%0A#   51 franklin street, fifth floor, boston, ma 02110-1301 usa.%0A%0Afrom smartcard.System import readers%0A%0A%0Adef stress(reader):%0A    # define the APDUs used in this script%0A    SELECT = %5B0x00, 0xA4, 0x04, 0x00, 0x0A, 0xA0, 0x00, 0x00, 0x00, 0x62,%0A        0x03, 0x01, 0x0C, 0x06, 0x01%5D%0A    COMMAND = %5B0x00, 0x00, 0x00, 0x00%5D%0A%0A    connection = reader.createConnection()%0A    connection.connect()%0A%0A    data, sw1, sw2 = connection.transmit(SELECT)%0A    print data%0A    print %22Select Applet: %2502X %2502X%22 %25 (sw1, sw2)%0A%0A    i = 0%0A    while True:%0A        data, sw1, sw2 = connection.transmit(COMMAND)%0A        print data%0A        print %22%25d Command: %2502X %2502X%22 %25 (i, sw1, sw2)%0A        i += 1%0A%0Aif __name__ == %22__main__%22:%0A    import sys%0A%0A    # get all the available readers%0A    readers = readers()%0A    print %22Available readers:%22, readers%0A%0A    try:%0A        i = int(sys.argv%5B1%5D)%0A    except IndexError:%0A        i = 0%0A%0A    reader = readers%5Bi%5D%0A    print %22Using:%22, reader%0A%0A    stress(reader)%0A

send an apdu in loop