MCPcopy Create free account
hub / github.com/qilingframework/qiling / execute_module

Method execute_module

qiling/loader/pe_uefi.py:227–255  ·  view source on GitHub ↗

Start the execution of a UEFI module. Args: image_base : module base address entry_point : module entry point address context : module execution context (either dxe or smm) eoe_trap : end-of-execution trap address; may be None

(self, path: str, image_base: int, entry_point: int, context: UefiContext, eoe_trap: Optional[int])

Source from the content-addressed store, hash-verified

225 return False
226
227 def execute_module(self, path: str, image_base: int, entry_point: int, context: UefiContext, eoe_trap: Optional[int]):
228 """Start the execution of a UEFI module.
229
230 Args:
231 image_base : module base address
232 entry_point : module entry point address
233 context : module execution context (either dxe or smm)
234 eoe_trap : end-of-execution trap address; may be None
235 """
236
237 # use familiar UEFI names
238 ImageHandle = image_base
239 SystemTable = self.gST
240
241 # set effectively active heap
242 self.ql.os.heap = context.heap
243
244 # set stack and frame pointers
245 self.ql.arch.regs.rsp = context.top_of_stack
246 self.ql.arch.regs.rbp = context.top_of_stack
247
248 self.ql.os.fcall.call_native(entry_point, (
249 (POINTER, ImageHandle),
250 (POINTER, SystemTable)
251 ), eoe_trap)
252
253 self.ql.os.running_module = path
254 self.ql.os.entry_point = entry_point
255 self.ql.log.info(f'Running from {entry_point:#010x} of {path}')
256
257 def execute_next_module(self):
258 if not self.modules:

Callers 2

map_and_loadMethod · 0.95
execute_next_moduleMethod · 0.95

Calls 1

call_nativeMethod · 0.80

Tested by

no test coverage detected