corna / me_cleaner

Tool for partial deblobbing of Intel ME/TXE firmware images
GNU General Public License v3.0
4.42k stars 275 forks source link

A bug ? #414

Open Sererim opened 2 weeks ago

Sererim commented 2 weeks ago

I was reading the me_cleaner.py and i think i found a bug In RegionFile class

 def read(self, n):
        if f.tell() + n <= self.region_end:
            return self.f.read(n)
        else:
            raise OutOfRegionException()

    def readinto(self, b):
        if f.tell() + len(b) <= self.region_end:
            return self.f.readinto(b)
        else:
            raise OutOfRegionException()

Why these methods work if f is undefined ?

I looked into it removed the argparser part and initilized the class and tried to use method read and pyton threw an error.