From 4d946fbe1f007d6d44960ed38784593ae64d603d Mon Sep 17 00:00:00 2001 From: travisutk Date: Sun, 1 Apr 2012 22:05:59 +0000 Subject: [PATCH 1/1] Primitive code for auditing the strings table entries. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1128 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/GoodFETMAXUSB.py | 2 +- client/goodfet.maxusbhost | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/client/GoodFETMAXUSB.py b/client/GoodFETMAXUSB.py index 30fb06e..2559eb9 100644 --- a/client/GoodFETMAXUSB.py +++ b/client/GoodFETMAXUSB.py @@ -408,7 +408,7 @@ class GoodFETMAXUSBHost(GoodFETMAXUSB): time.sleep(0.2); self.vbus_on(); - self.hostrun(); + #self.hostrun(); def hostrun(self): """Run as a minimal host and dump the config tables.""" while 1: diff --git a/client/goodfet.maxusbhost b/client/goodfet.maxusbhost index 92b56c6..4cfaece 100755 --- a/client/goodfet.maxusbhost +++ b/client/goodfet.maxusbhost @@ -6,14 +6,36 @@ import sys; import binascii; import array; +import time; from GoodFETMAXUSB import GoodFETMAXUSBHost; +if(len(sys.argv)==1): + print "Usage: %s verb [objects]\n" % sys.argv[0]; + print "%s info" % sys.argv[0]; + print "%s allstrings" % sys.argv[0]; + sys.exit(); + + #Initialize FET and set baud rate client=GoodFETMAXUSBHost(); client.serInit() client.MAXUSBsetup(); + client.hostinit(); +if(sys.argv[1]=="info"): + client.hostrun(); + +if(sys.argv[1]=="allstrings"): + print "This will try to print all strings from the target device."; + client.detect_device(); + time.sleep(0.2); + client.enumerate_device(); + for foo in range(1,40): + print "Grabbing string at index=%i" % foo; + string=client.getDescriptorString(foo); + print "Strings[%i]=%s" % (foo,string); + sys.stdout.flush(); -- 2.20.1