-
Notifications
You must be signed in to change notification settings - Fork 460
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
Extracting language specific strings from golang #779 #792
Conversation
also, strongly recommend creating some tests as you're developing this code, to assert that the changes you're making help improve the features declared in the tests. |
Co-authored-by: Willi Ballenthin <willi.ballenthin@gmail.com>
Co-authored-by: Willi Ballenthin <willi.ballenthin@gmail.com>
Current results look promising, nice progress! |
By the way, I'd love to hear your thoughts about suggestion Arker123#3 (comment). Let me know what you think. |
and the length is reasonable; however, we don't validate the encoded string data. | ||
""" | ||
if psize == 32: | ||
format = "I" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick curiosity: 'I' format works, 'L' doesn't. Why? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is for an array (not struct) the formats are declared here: https://docs.python.org/3/library/array.html
I is for 2 byte words and L is for 4 bytes (and Q for 8 bytes). Lowercase variants are for signed versus uppercase for unsigned. here we want 4 byte unsigned since it doesn't make sense for addresses/sizes to be negative (signed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and it seems like we want "L" but I used "I" which seems like a mistake. i should have tested this.
when you say it doesn't work, what are you observing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See: 5260cb6 you did use the "L" format initially. However, during my testing and debugging process, I observed that the "L" format was not working as expected. While making some adjustments to the code, I surprisingly discovered that the "I" format magically worked instead. I apologize for not communicating this clearly earlier.
It's still unclear to me why the "I" format ended up working while the "L" format did not.
Doesn't this also print strings twice potentially? I'd suggest to roll back 722e82a and consider using the proposed changes in Arker123#6. |
d2a800b
to
3463353
Compare
Nice work, @Arker123 and @williballenthin! |
This pull request (PR) aims to enhance the codebase by implementing a feature to extract language-specific strings from Go (Golang) binaries.
TODO:-