X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFET.py;h=0a3bf1ad633bf6087763acaafbfc56b8de5b14ed;hp=10f2e6f01f499b17e25a0117b7d9cc67159fded0;hb=803a81c7aa96d7ca0333c7dfa5e662036758dfd1;hpb=052771a83e020314b718e82d0b1b2a645a7c3d4f diff --git a/client/GoodFET.py b/client/GoodFET.py index 10f2e6f..0a3bf1a 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -13,7 +13,8 @@ fmt = ("B", ">8)&0xff, @@ -365,11 +369,28 @@ 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 poke16(self,address,value): + """Set a word of memory by the monitor.""" + self.pokebyte(address,value&0xFF); + self.pokebyte(address,(value>>8)&0xFF); + return value; + 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