Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multihreading ql.restore operation after ql.save(call qiling.os.linux.thread._prepare_lib_patch only once) #1484

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion qiling/os/linux/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,13 @@ def _clear_queued_msg(self):
pass

def _prepare_lib_patch(self):
if self.ql.loader.elf_entry != self.ql.loader.entry_point:
# If current control flow comes from a second call of ql.run method, which means
# we have complished the preparation of library patch, then ql.entry_point would
# be the next instruction needed to execute, so we do not need do library patch twice now.
if self.ql.entry_point is not None:
self.ql.loader.elf_entry = self.ql.entry_point
return None
elif self.ql.loader.elf_entry != self.ql.loader.entry_point:
entry_address = self.ql.loader.elf_entry

if self.ql.arch.type == QL_ARCH.ARM:
Expand Down