Force type to selection size when using highlight-bytes set type
What is the feature you'd like to have? When using the highlight bytes -> type workflow to set a type for a specific range of bytes the type will greedily add more than just the highlighted bytes to the type.
This is specifically an issue for UTF-16 strings that are not null terminated. When attempting to set the type for these strings additional non-string bytes are added to the string. There may be other use-cases for this but non-null-terminated UTF-16 strings are common culprits.
Is your feature request related to a problem? No, there is a perfectly acceptable work around of editing the type after creating it but this is very annoying for more than a few strings.
Are any alternative solutions acceptable? Yes but it is annoying. Currently the alternative solution is...
- Highlight string bytes, shift-A
- Type gobbles up extra bytes 🤦♂️
- Y - Change type, adjust size to correct type
Additional Information: Current version: 4.0.4858-dev
Another alternate solution is to highlight the bytes, and use * to create an array with element type wchar16
another work around. Hit make your selection. Then hit 2 to create 2 byte elements then hit *.
The current behavior is very important as it allows you to select a large range of null terminated strings and convert them all at once. I think the provided workaround is sufficient.