Last active
March 28, 2016 17:26
-
-
Save vdudouyt/8430113 to your computer and use it in GitHub Desktop.
A GetCString() procedure for IDA Pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import string, itertools, operator | |
| def GetCString(ea, max_length = 32): | |
| bytes = map(Byte, xrange(ea, ea + max_length + 1)) | |
| if 0x00 not in bytes: raise ValueError("String terminator wasn't found") | |
| chars = map(chr, itertools.takewhile(operator.truth, bytes)) | |
| return string.join(chars, '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment