Пример #1
0
 def printFreeList(self, uselog = None):
     """ 
     Print the Heap's FreeList
     
     @type  uselog: Log Function
     @param uselog: (Optional, Def: Log Window) Log function that display the information
     """
     log = self.imm.Log
     if uselog:
         log = uselog
     for block in self.blocks:    
         f = block.FreeListInUse
         log("** Block 0x%08x StartSize: %d MaxSize: %d CtrZone: %d **" % ( block.address, block.StartSize, block.MaxSize, block.CtrZone ) )
         log("FreeListInUse: %s %s" % (immutils.decimal2binary(f[0]),\
                         immutils.decimal2binary(f[1]) ) )
         log("               %s %s" % (immutils.decimal2binary(f[2]),\
                         immutils.decimal2binary(f[3]) ) )
         
         for a in range(0, 128):
             entry= block.FreeList[a]
             e=entry[0]
             if e[0]:
                 log("[%03d]   0x%08x -> [ 0x%08x |  0x%08x ] " % (a, e[0], e[1], e[2]), address = e[0])
                 for e in entry[1:]:
                     log("        0x%08x -> [ 0x%08x |  0x%08x ] " % (e[0], e[1], e[2]), address= e[0])
     return 0x0
Пример #2
0
    def printFreeList(self, uselog = None):
        """ 
        Print the Heap's FreeList

        @type  uselog: Log Function
        @param uselog: (Optional, Def: Log Window) Log function that display the information
        """
        log = self.imm.log
        if uselog:
            log = uselog
        for block in self.blocks:    
            f = block.FreeListInUse
	    log("** Block 0x%08x BaseIndex: %d ArraySize: %d ExtraItem: %d **" % ( block.address, block.BaseIndex, block.ArraySize, block.ExtraItem ) )
	    if DEBUG:
	        log("** ListInUse: 0x%08x" % block.ListsInUseUlong)
	    if f:
                log("FreeListInUse: %s %s" % (immutils.decimal2binary(f[0]),\
                                          immutils.decimal2binary(f[1]) ) )
                log("               %s %s" % (immutils.decimal2binary(f[2]),\
                                          immutils.decimal2binary(f[3]) ) )

            for a in range(0, 128):
                entry= block.FreeList[a]
                e=entry[0]
                if e[0]:
                    log("[%03d]   0x%08x -> [ 0x%08x |  0x%08x ] " % (a, e[0], e[1], e[2]), address = e[0])
                    for e in entry[1:]:
                        log("        0x%08x -> [ 0x%08x |  0x%08x ] " % (e[0], e[1], e[2]), address= e[0])
        return 0x0
Пример #3
0
    def printFreeList(self, uselog=None):
        """ 
        Print the Heap's FreeList

        @type  uselog: Log Function
        @param uselog: (Optional, Def: Log Window) Log function that display the information
        """
        log = self.imm.Log
        if uselog:
            log = uselog
        for block in self.blocks:
            f = block.FreeListInUse
            log("** Block 0x%08x StartSize: %d MaxSize: %d CtrZone: %d **" %
                (block.address, block.StartSize, block.MaxSize, block.CtrZone))
            log("FreeListInUse: %s %s" % (immutils.decimal2binary(f[0]),\
                                          immutils.decimal2binary(f[1]) ) )
            log("               %s %s" % (immutils.decimal2binary(f[2]),\
                                          immutils.decimal2binary(f[3]) ) )

            for a in range(0, 128):
                entry = block.FreeList[a]
                e = entry[0]
                if e[0]:
                    log("[%03d]   0x%08x -> [ 0x%08x |  0x%08x ] " %
                        (a, e[0], e[1], e[2]),
                        address=e[0])
                    for e in entry[1:]:
                        log("        0x%08x -> [ 0x%08x |  0x%08x ] " %
                            (e[0], e[1], e[2]),
                            address=e[0])
        return 0x0
Пример #4
0
    def printFreeList(self, uselog=None):
        """ 
        Print the Heap's FreeList

        @type  uselog: Log Function
        @param uselog: (Optional, Def: Log Window) Log function that display the information
        """
        log = self.imm.log
        if uselog:
            log = uselog
        for block in self.blocks:
            f = block.FreeListInUse
            log(
                "** Block 0x%08x BaseIndex: %d ArraySize: %d ExtraItem: %d **"
                % (block.address, block.BaseIndex, block.ArraySize, block.ExtraItem)
            )
            if DEBUG:
                log("** ListInUse: 0x%08x" % block.ListsInUseUlong)
            if f:
                log("FreeListInUse: %s %s" % (immutils.decimal2binary(f[0]), immutils.decimal2binary(f[1])))
                log("               %s %s" % (immutils.decimal2binary(f[2]), immutils.decimal2binary(f[3])))

            for a in range(0, 128):
                entry = block.FreeList[a]
                e = entry[0]
                if e[0]:
                    log("[%03d]   0x%08x -> [ 0x%08x |  0x%08x ] " % (a, e[0], e[1], e[2]), address=e[0])
                    for e in entry[1:]:
                        log("        0x%08x -> [ 0x%08x |  0x%08x ] " % (e[0], e[1], e[2]), address=e[0])
        return 0x0
Пример #5
0
 def printFreeListInUse(self, uselog=None):
     """ 
     Print the Heap's FreeListInUse bitmask
     
     @type  uselog: Log Function
     @param uselog: (Optional, Def: Log Window) Log function that display the information
     """
     tbl= ["FreeListInUse %s %s"%  (immutils.decimal2binary(self.FreeListInUseLong[0]), immutils.decimal2binary(self.FreeListInUseLong[1])),\
             "              %s %s" % (immutils.decimal2binary(self.FreeListInUseLong[2]), immutils.decimal2binary(self.FreeListInUseLong[3]))]
     if uselog:
         for a in tbl:
             uselog(a)
     return tbl
Пример #6
0
    def printFreeListInUse(self, uselog=None):
        """ 
        Print the Heap's FreeListInUse bitmask

        @type  uselog: Log Function
        @param uselog: (Optional, Def: Log Window) Log function that display the information
        """
        tbl= ["FreeListInUse %s %s"%  (immutils.decimal2binary(self.FreeListInUseLong[0]), immutils.decimal2binary(self.FreeListInUseLong[1])),\
              "              %s %s" % (immutils.decimal2binary(self.FreeListInUseLong[2]), immutils.decimal2binary(self.FreeListInUseLong[3]))]
        if uselog:
            for a in tbl:
                uselog(a)
        return tbl