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

Fix sample_ctl.py #1830

Merged
merged 3 commits into from
May 11, 2023
Merged

Fix sample_ctl.py #1830

merged 3 commits into from
May 11, 2023

Conversation

nneonneo
Copy link

@nneonneo nneonneo commented May 6, 2023

sample_ctl.py was not running correctly. It was crashing with various errors: TypeError: Uc.ctl_remove_cache() missing 1 required positional argument: 'end', KeyError: 64. This patch fixes the relevant errors in the bindings and scripts.

@wtdcode
Copy link
Member

wtdcode commented May 6, 2023

Hi, thanks for your interest! Note the patch should go to dev branch.

@nneonneo nneonneo changed the base branch from master to dev May 7, 2023 15:51
@nneonneo
Copy link
Author

nneonneo commented May 7, 2023

@wtdcode fixed now.

Commit 640251e added a size parameter to uc_hook_tcg_op_2, but this was not
reflected in the Python bindings.

Commit fbf4078 added a len parameter to ctl_remove_cache, but this was not
reflected in sample_ctl.py.
- Match the types of UC_HOOK_CODE_CB and UC_HOOK_INSN_SYS_CB to C
- Avoid building a new namedtuple class in every call to _hook_insn_sys_cb
@@ -424,6 +424,9 @@ class uc_arm64_cp_reg(ctypes.Structure):
("val", ctypes.c_uint64)
]

def __repr__(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you would like to add __repr__ for uc_arm64_cp_reg, could you do the same for uc_arm_cp_reg?

@nneonneo
Copy link
Author

@wtdcode ok, I just added __repr__ to all of the Structure subclasses, hope that's useful.

@wtdcode
Copy link
Member

wtdcode commented May 11, 2023

LGTM, thanks!

@wtdcode wtdcode merged commit f65f8f8 into unicorn-engine:dev May 11, 2023
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants