-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Introduce sanitize_va() & has_prefix() for VA formatting #61
Conversation
Introduced sanitize_va() Introduced has_prefix() which now ensures "0x" prefix only when needed. Reduced unnecessary code repetition. Improved readability & efficiency.
@yourpwnguy please try this out; if this works for you I'll get this merged. Cheers |
@0vercl0k It seems fine and works correctly! You can merge it after checking my comment on the Cheers! |
Where is this comment @yourpwnguy I can't seem to find it 😅 |
@0vercl0k Oh, I actually meant for you to check the text under review, my bad! 😅 I'll make sure to be clearer next time. |
I don't seem to see anything on my side; unless I'm missing something 🤔 |
Do you mind pasting it here so that I can have a look before merging please? |
I see, maybe it's on my side. I will just comment the text here. I noticed that when using *it = '\0';, calling va.size() just after it still returns the original size, which might be misleading for debugging or if va was used elsewhere. Using va.erase(it, va.end()); correctly updates the size. That said, since va is only used within this function and passed directly to strtoull(), it doesn’t actually matter in this case, just mentioning it in case it’s relevant. |
Summary
This PR introduces two new utility functions,
sanitize_va()
andhas_prefix()
, to handle and properly format virtual addresses (VA), particularly when copied from WinDbg.Changes
Added
has_prefix()
"0x"
or"0X"
.Added
sanitize_va()
00007ff7`89da0000
)"0x"
prefix is added if missing.Optimised
get_file_size()