Skip to content

Commit 7ae14c3

Browse files
committed
Merge branch 'dev' of github.com:qilingframework/qiling into dev
2 parents 7ee62d5 + 5104b85 commit 7ae14c3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

qiling/core.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,10 @@ def restore(self, saved_states=None, snapshot=None):
868868
if "loader" in saved_states:
869869
self.loader.restore(saved_states["loader"])
870870

871-
# replace linux or windows syscall/api with custom api/syscall
872-
# if replace function name is needed, first syscall must be available
871+
# Either hook or replace syscall/api with custom api/syscall
872+
# - if intercept is None, replace syscall with custom function
873+
# - if intercept is ENTER/EXIT, hook syscall at enter/exit with custom function
874+
# If replace function name is needed, first syscall must be available
873875
# - ql.set_syscall(0x04, my_syscall_write)
874876
# - ql.set_syscall("write", my_syscall_write)
875877
# TODO: Add correspoinding API in ql.os!
@@ -901,7 +903,9 @@ def set_syscall(self, target_syscall, intercept_function, intercept = None):
901903
self.set_api(target_syscall, intercept_function)
902904

903905

904-
# replace default API with customed function
906+
# Either replace or hook API
907+
# - if intercept is None, replace API with custom function
908+
# - if intercept is ENTER/EXIT, hook API at enter/exit with custom function
905909
def set_api(self, api_name, intercept_function, intercept = None):
906910
if self.ostype == QL_OS.UEFI:
907911
api_name = "hook_" + str(api_name)

0 commit comments

Comments
 (0)