예제 #1
0
파일: hibernate.py 프로젝트: revers3r/PyMal
    def read_xpress(self, baddr, BlockSize):
        try:
            return self.PageCache.get(baddr)
        except KeyError:
            data_read = self.base.read(baddr, BlockSize)
            if BlockSize == 0x10000:
                data_uz = data_read
            else:
                data_uz = xpress.xpress_decode(data_read)

                self.PageCache.put(baddr, data_uz)

            return data_uz
예제 #2
0
    def read_xpress(self, baddr, BlockSize):
        try:
            return self.PageCache.get(baddr)
        except KeyError:
            data_read = self.base.read(baddr, BlockSize)
            if BlockSize == 0x10000:
                data_uz = data_read
            else:
                data_uz = xpress.xpress_decode(data_read)

                self.PageCache.put(baddr, data_uz)

            return data_uz
예제 #3
0
파일: hibernate.py 프로젝트: revers3r/PyMal
 def convert_to_raw(self, ofile):
     page_count = 0
     for _i, xb in enumerate(self.PageDict.keys()):
         size = self.PageDict[xb][0][1]
         data_z = self.base.read(xb + 0x20, size)
         if size == 0x10000:
             data_uz = data_z
         else:
             data_uz = xpress.xpress_decode(data_z)
         for page, size, offset in self.PageDict[xb]:
             ofile.seek(page * 0x1000)
             ofile.write(data_uz[offset * 0x1000:offset * 0x1000 + 0x1000])
             page_count += 1
         del data_z, data_uz
         yield page_count
예제 #4
0
 def convert_to_raw(self, ofile):
     page_count = 0
     for _i, xb in enumerate(list(self.PageDict.keys())):
         size = self.PageDict[xb][0][1]
         data_z = self.base.read(xb + 0x20, size)
         if size == 0x10000:
             data_uz = data_z
         else:
             data_uz = xpress.xpress_decode(data_z)
         for page, size, offset in self.PageDict[xb]:
             ofile.seek(page * 0x1000)
             ofile.write(data_uz[offset * 0x1000:offset * 0x1000 + 0x1000])
             page_count += 1
         del data_z, data_uz
         yield page_count