Ghidrathon icon indicating copy to clipboard operation
Ghidrathon copied to clipboard

print environment details upon stack trace

Open fariss opened this issue 10 months ago • 3 comments

This PR closes #66.

My main concern here is that the exception handler log_env_details will get executed for every Exception. Do you suggest we whitelist some exceptions?

fariss avatar Apr 12 '24 01:04 fariss

This PR closes #66.

My main concern here is that the exception handler log_env_details will get executed for every Exception. Do you suggest we whitelist some exceptions?

Yes, this has a potential to pollute the interactive output, we should already handle SyntaxError and friends exceptions but let's double check. Other suggestions:

  • Print the information to stderr instead of stdout
  • Include this handling in https://github.com/mandiant/Ghidrathon/blob/main/data/python/jeprunscript.py while avoiding code duplication, if possible

mike-hunhoff avatar Apr 15 '24 16:04 mike-hunhoff

Hi @mike-hunhoff,

I addressed these comments in 46f45fdffff6c8df64e5d9f87f41d0c1a91ef523.


On a side note, while I initially started working on this, I noticed that user custom hooks set via sys.excepthook = <custom exception handler> are not executed in Ghidrathon. Though, this functionally works as intended in the builtin interpreter.

Here is an example:

grafik

fariss avatar Apr 28 '24 15:04 fariss

Hi @mike-hunhoff,

I addressed these comments in 46f45fd.

On a side note, while I initially started working on this, I noticed that user custom hooks set via sys.excepthook = <custom exception handler> are not executed in Ghidrathon. Though, this functionally works as intended in the builtin interpreter.

Here is an example:

Nice find @s-ff , please open a new issue that links to your comment so this can be investigated further in the future.

mike-hunhoff avatar Apr 29 '24 14:04 mike-hunhoff

@s-ff please re-request my review when you're ready and we'll get this approved + merged 🥳

mike-hunhoff avatar May 06 '24 18:05 mike-hunhoff