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

SemaSCDG.py crashes when enabling plugin_hook #43

Merged
merged 6 commits into from
Mar 10, 2025

Conversation

Thib-fkr
Copy link
Contributor

(this fix includes part of the Pull request#42 for being able to enable the plugin-hook)

When enabling plugin_hooks, the parameter self.content passed to PluginHook.py is of type str, where it is expected to be bytes.

  File ".../sema_scdg/application/SemaSCDG.py", line 475, in setup_hooks
    self.plugins.enable_plugin_hooks(self.content, state, proj, self.call_sim)
  File ".../sema_scdg/application/plugin/PluginManager.py", line 53, in enable_plugin_hooks
    self.hooks.initialization(content, is_64bits=proj.arch.name == "AMD64")
  File ".../sema_scdg/application/plugin/PluginHooks.py", line 59, in initialization
    pe_header = int.from_bytes(cont[0x3c:0x40],"little")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot convert 'str' object to bytes

The proposed fix initializes SemaSCDG's self.content property as a byte string.

@serenalucca serenalucca merged commit a294df6 into csvl:production Mar 10, 2025
1 of 4 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.

2 participants