X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=client%2FGoodFETGlitch.py;h=0d49ac3e1cda7293d49239a1cdde7e5fc1a10d60;hb=3ad65af0d988ff3ae71ef71e4e6ba1e889f1e65e;hp=50abc2c592ebbf6d07d5af5524adbc698deabb9d;hpb=cac3f7817e7022215ab8fdb91daa70bfeddae089;p=goodfet diff --git a/client/GoodFETGlitch.py b/client/GoodFETGlitch.py index 50abc2c..0d49ac3 100644 --- a/client/GoodFETGlitch.py +++ b/client/GoodFETGlitch.py @@ -152,6 +152,12 @@ class GoodFETGlitch(GoodFET): print "time vcc gnd glitchcount count"; for r in c: print "%i %i %i %i %i" % r; + def npoints(self): + c=self.db.cursor(); + c.execute("select time,vcc,gnd,glitchcount,count from glitches where lock=0 and count=0;"); + print "time vcc gnd glitchcount count"; + for r in c: + print "%i %i %i %i %i" % r; #GnuPlot sucks for large sets. Switch to viewpoints soon. # sqlite3 glitch.db "select time,vcc,count from glitches where count=0" | vp -l -d "|" -I @@ -203,14 +209,13 @@ class GoodFETGlitch(GoodFET): self.secret=0x69; - while(client.eeprompeek(0)!=self.secret): + while(client.getsecret()!=self.secret): print "-- Setting secret"; client.start(); #Flash the secret to the first two bytes of CODE memory. client.erase(); - client.eeprompoke(0,self.secret); - client.eeprompoke(1,self.secret); + client.setsecret(self.secret); sys.stdout.flush() #Lock chip to unlock it later. @@ -259,7 +264,7 @@ class GoodFETGlitch(GoodFET): client.glitchstart(); #Try to read *0, which is secret if read works. - a=client.eeprompeek(0x0); + a=client.getsecret(); if lock>0: #locked if(a!=0 and a!=0xFF and a!=self.secret): gcount+=1;