[docs]classPatchedStream:""" An object that wraps a readable stream, performing passthroughs on seek and read operations, except to make it seem like the data has actually been patched by the given patches. """
[docs]def__init__(self,stream,patches):""" :param stream: The stream to patch :param patches: A list of tuples of (addr, patch data) """iftype(stream)isPatchedStream:patches=stream.patches+patchesstream=stream.streamself.stream=streamself.patches=patchesself._pos=stream.tell()