def map_and_load(self, path: str, exec_now: bool=False):
    "Map and load a module into memory.\n\n        The specified module would be mapped and loaded into the address set\n        in the `next_image_base` member. It is the caller's responsibility to\n        make sure that the memory is available.\n\n        On success, `next_image_base` will be updated accordingly.\n\n        Args:\n            path     : path of the module binary to load\n            exec_now : execute module right away; will be enququed if not\n\n        Raises:\n            QlMemoryMappedError : when `next_image_base` is not available\n        "
    ql = self.ql
    pe = PE(path, fast_load=True)
    image_base = (pe.OPTIONAL_HEADER.ImageBase or self.next_image_base)
    image_size = ql.mem.align(pe.OPTIONAL_HEADER.SizeOfImage, 4096)
    assert ((image_base % 4096) == 0), 'image base is expected to be page-aligned'
    if (image_base != pe.OPTIONAL_HEADER.ImageBase):
        pe.relocate_image(image_base)
    pe.parse_data_directories()
    data = bytes(pe.get_memory_mapped_image())
    ql.mem.map(image_base, image_size, info='[module]')
    ql.mem.write(image_base, data)
    ql.log.info(f'Module {path} loaded to {image_base:#x}')
    entry_point = (image_base + pe.OPTIONAL_HEADER.AddressOfEntryPoint)
    ql.log.info(f'Module entry point at {entry_point:#x}')
    if (self.entry_point == 0):
        self.entry_point = entry_point
    self.install_loaded_image_protocol(image_base, image_size)
    self.images.append(self.coverage_image(image_base, (image_base + image_size), path))
    self.next_image_base = (image_base + image_size)
    module_info = (path, image_base, entry_point)
    if exec_now:
        self.execute_module(*module_info, eoe_trap=None)
    else:
        self.modules.append(module_info)
Map and load a module into memory.

The specified module would be mapped and loaded into the address set
in the `next_image_base` member. It is the caller's responsibility to
make sure that the memory is available.

On success, `next_image_base` will be updated accordingly.

Args:
    path     : path of the module binary to load
    exec_now : execute module right away; will be enququed if not

Raises:
    QlMemoryMappedError : when `next_image_base` is not available
def map_and_load(self, path: str, exec_now: bool=False):
    "Map and load a module into memory.\n\n        The specified module would be mapped and loaded into the address set\n        in the `next_image_base` member. It is the caller's responsibility to\n        make sure that the memory is available.\n\n        On success, `next_image_base` will be updated accordingly.\n\n        Args:\n            path     : path of the module binary to load\n            exec_now : execute module right away; will be enququed if not\n\n        Raises:\n            QlMemoryMappedError : when `next_image_base` is not available\n        "
    ql = self.ql
    pe = PE(path, fast_load=True)
    image_base = (pe.OPTIONAL_HEADER.ImageBase or self.next_image_base)
    image_size = ql.mem.align(pe.OPTIONAL_HEADER.SizeOfImage, 4096)
    assert ((image_base % 4096) == 0), 'image base is expected to be page-aligned'
    if (image_base != pe.OPTIONAL_HEADER.ImageBase):
        pe.relocate_image(image_base)
    pe.parse_data_directories()
    data = bytes(pe.get_memory_mapped_image())
    ql.mem.map(image_base, image_size, info='[module]')
    ql.mem.write(image_base, data)
    ql.log.info(f'Module {path} loaded to {image_base:#x}')
    entry_point = (image_base + pe.OPTIONAL_HEADER.AddressOfEntryPoint)
    ql.log.info(f'Module entry point at {entry_point:#x}')
    if (self.entry_point == 0):
        self.entry_point = entry_point
    self.install_loaded_image_protocol(image_base, image_size)
    self.images.append(self.coverage_image(image_base, (image_base + image_size), path))
    self.next_image_base = (image_base + image_size)
    module_info = (path, image_base, entry_point)
    if exec_now:
        self.execute_module(*module_info, eoe_trap=None)
    else:
        self.modules.append(module_info)