Skip to content

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
@Thib-fkr Thib-fkr deleted the fix_content_type branch May 6, 2025 13:19
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