-
Notifications
You must be signed in to change notification settings - Fork 53
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
database.get.string() incorrectly includes null terminator in string #20
Comments
Okay. You caught me. I was being lazy and didn't want to implement the decoding of all the available The reason why An example of this utf8-encoding on a utf-16le string (IDA 7.1.180227):
But then with
I just didn't want to implement all of the ASCSTR types, but I guess I will. Since you're only using C-style strings, you can put something like the following in your
|
… available string types properly (issue #20)
… available string types properly (issue #20)
@x0rloser, PR #21 should fix this. I submitted the PR for review, then I reviewed my own code and realized that I'm just so awesome and so I merged it upstream because I'm always right and of course it fixes the issue...so, yeah... Anyways, you should just need to do a Thanks for your contribution, sir |
can confirm is fixed (for C strings at least). awesomeness ftw ;) |
If a C style string "abc" exists in the idb at address 0, then database.get.string(0) will return the string "abc\0" instead of "abc". It will therefore have a length of 4 instead of 3.
Attempting to use the returned string in python formatting such as:
print("foo %s bar" % database.get.string(0))
will printfoo abc
instead of the expectedfoo abc bar
I am using the latest ida-minsc code from github with IDA32 v7.1 64bit for windows.
The text was updated successfully, but these errors were encountered: