Skip to content

Commit 0633b11

Browse files
committed
Comment module exit trap
1 parent 484c641 commit 0633b11

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

qiling/loader/pe_uefi.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,19 @@ def set_exit_hook(self, address: int):
370370
"""
371371

372372
def __module_exit_trap(ql: Qiling):
373+
# this trap will be called when the current module entry point function
374+
# returns. this is done do regain control, run necessary tear down code
375+
# and proceed to the execution of the next module. if no more modules
376+
# left, terminate gracefully.
377+
#
378+
# the tear down code may include queued protocol notifications and module
379+
# unload callbacks. in such case the trap returns without calling 'os.stop'
380+
# and the execution resumes with the current cpu state.
381+
#
382+
# note that the trap may be called multiple times for a single module,
383+
# every time a tear down code needs to be executed, or for any other
384+
# reason defined by the user.
385+
373386
if ql.os.notify_after_module_execution(len(self.modules)):
374387
return
375388

0 commit comments

Comments
 (0)