From af5b4ef187ffa03f9effce4c8a0a8c231fe8611b Mon Sep 17 00:00:00 2001 From: Omegalulz Date: Sat, 20 Jun 2009 07:45:35 -0700 Subject: [PATCH] Added delKey function (untested) --- other.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/other.py b/other.py index a1958d8..2358af3 100644 --- a/other.py +++ b/other.py @@ -104,6 +104,29 @@ class CONF: return out + def delKey(self, key): + try: + del self.keys[key.upper()] + self.keyNames.remove(key.upper()) + self.totalKeys -=1 + + self.conf = '' + + for key in self.keys: + self.conf += key + self.conf += '=' + self.conf += self.keys[key] + self.conf += '\r\n' + + self.fp.seek(0) + self.fp.write(self.xorConf(self.conf)) + self.fp.write('\x00' * (0x100 - len(self.conf))) + + self.lastKeyOffset = self.conf.rfind('\r\n') + 2 + + except KeyError: + return 'Key not found' + class iplsave: """This class performs all iplsave.bin related things. It includes functions to add a title to the list, remove a title based upon position or title, and move a title from one position to another.""" class IPLSAVE_Entry(Struct):