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

print environment details upon stack trace #101

Merged
merged 5 commits into from
May 8, 2024

Conversation

s-ff
Copy link
Contributor

@s-ff s-ff commented Apr 12, 2024

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?

data/python/jepeval.py Outdated Show resolved Hide resolved
@mike-hunhoff
Copy link
Collaborator

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:

data/python/utils.py Outdated Show resolved Hide resolved
@s-ff s-ff requested a review from mike-hunhoff April 18, 2024 20:22
Copy link
Collaborator

@mike-hunhoff mike-hunhoff left a comment

Choose a reason for hiding this comment

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

Great work @s-ff ! I've left comments for your review.

data/python/utils.py Outdated Show resolved Hide resolved
src/main/java/ghidrathon/GhidrathonPlugin.java Outdated Show resolved Hide resolved
data/python/utils.py Outdated Show resolved Hide resolved
data/python/utils.py Outdated Show resolved Hide resolved
data/python/utils.py Outdated Show resolved Hide resolved
This commit:
- renames utils.py to jeputils.py avoid confusion.
- reformats environment details string as a format string
- enables getVersion method to be called statically
@s-ff
Copy link
Contributor Author

s-ff commented Apr 28, 2024

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:

grafik

@s-ff s-ff marked this pull request as ready for review April 28, 2024 15:00
@s-ff s-ff requested a review from mike-hunhoff April 28, 2024 15:23
Copy link
Collaborator

@mike-hunhoff mike-hunhoff left a comment

Choose a reason for hiding this comment

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

Nice work @s-ff , I've left additional comments for your review.

data/python/jepeval.py Outdated Show resolved Hide resolved
data/python/jeprunscript.py Outdated Show resolved Hide resolved
data/python/jeputils.py Outdated Show resolved Hide resolved
data/python/jeputils.py Outdated Show resolved Hide resolved
@mike-hunhoff
Copy link
Collaborator

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
Copy link
Collaborator

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

@s-ff s-ff requested a review from mike-hunhoff May 8, 2024 17:28
Copy link
Collaborator

@mike-hunhoff mike-hunhoff left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@mike-hunhoff mike-hunhoff merged commit 56866ad into mandiant:main May 8, 2024
14 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.

automatically print environment details upon stack trace
2 participants