X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFET.py;h=154bd389d98de4f1f533b3a5b27004230d1e5473;hp=b9c35e3adc4bad1f12b53103f85d30cadc12aba7;hb=704a3e5036b88ba2fc03606d24b0e474b22338e8;hpb=598bfb091e51a8d5b7e463bd834203d677d99977 diff --git a/client/GoodFET.py b/client/GoodFET.py index b9c35e3..154bd38 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -13,7 +13,8 @@ fmt = ("B", ">16)&0xFF]); print "Got %02x%02x buffer size." % (self.data[1],self.data[0]); @@ -195,6 +277,10 @@ class GoodFET: print "# DEBUG %s" % self.serialport.read(self.count) elif self.verb==0xFE: print "# DEBUG 0x%x" % struct.unpack(fmt[self.count-1], self.serialport.read(self.count))[0] + elif self.verb==0xFD: + #Do nothing, just wait so there's no timeout. + print "# NOP."; + sys.stdout.flush(); else: self.data=self.serialport.read(self.count); @@ -280,11 +366,23 @@ class GoodFET: def peek(self,address): """Read a word of memory from the monitor.""" return self.peekbyte(address)+(self.peekbyte(address+1)<<8); + def eeprompeek(self,address): + """Read a word of memory from the monitor.""" + return self.peekbyte(address)+(self.peekbyte(address+1)<<8); + def pokebyte(self,address,value): """Set a byte of memory by the monitor.""" self.data=[address&0xff,address>>8,value]; self.writecmd(0,0x03,3,self.data); return ord(self.data[0]); + def setsecret(self,value): + """Set a secret word for later retreival. Used by glitcher.""" + self.eeprompoke(0,value); + self.eeprompoke(1,value); + def getsecret(self): + """Get a secret word. Used by glitcher.""" + self.eeprompeek(0); + def dumpmem(self,begin,end): i=begin; while i