

def scan_file(self, fp):
    current_file_offset = 0
    while True:
        (data, dlen) = fp.read_block()
        if (not data):
            break
        current_block_offset = 0
        block_start = (fp.tell() - dlen)
        self.status.completed = (block_start - fp.offset)
        for r in self.magic.scan(data, dlen):
            if (r.offset < current_block_offset):
                continue
            relative_offset = (r.offset + r.adjust)
            r.offset = (self + relative_offset)
            r.file = fp
            self.result(r=r)
            if (r.valid and (r.jump > 0) and (not self.dumb_scan)):
                absolute_jump_offset = (r.offset + r.jump)
                current_block_offset = (relative_offset + r.jump)
                if (absolute_jump_offset >= fp.tell()):
                    fp.seek((r.offset + r.jump))
                    break

dataset/ETHPy150Open devttys0/binwalk/src/binwalk/modules/signature.py Signature.scan_file/VarMisuse@121/149 `block_start`->`self`