All pastes #464974 Raw Edit

Cody Brocious

public python v1 · immutable
#464974 ·published 2007-04-29 20:41 UTC
rendered paste body
    def mapAddr(self, input, header, addr):        old, off = header, header        for sec in input:            old = off            off += len(sec.data)            if addr < sec.mem_addr:                break            elif addr >= (sec.mem_addr + len(sec.data)):                break            return old + (addr - sec.mem_addr)        return -1