Update default options of builtin hex editor to match external hex editor#416
Open
A2uria wants to merge 1 commit intodnSpyEx:masterfrom
Open
Update default options of builtin hex editor to match external hex editor#416A2uria wants to merge 1 commit intodnSpyEx:masterfrom
A2uria wants to merge 1 commit intodnSpyEx:masterfrom
Conversation
12 tasks
There was a problem hiding this comment.
Pull request overview
Updates the built-in hex editor’s default view settings so they align with common external hex editors, improving consistency when comparing/editing byte-level data.
Changes:
- Set the default offset display bit size to 32
- Set the default bytes-per-line to 16
| options.BasePosition = HexPosition.Zero; | ||
| options.UseRelativePositions = false; | ||
| options.OffsetBitSize = 0; | ||
| options.OffsetBitSize = 32; |
There was a problem hiding this comment.
Setting OffsetBitSize to 32 will truncate/wrap displayed offsets for buffers whose logical position exceeds 0xFFFFFFFF. HexOffsetFormatter formats offsets by shifting based on bit size, so a 32-bit setting will repeat offsets every 4GiB and can show incorrect addresses on large files/mappings. Consider keeping OffsetBitSize as 0 (auto) or choosing 32 only when the buffer span fits within 32 bits, falling back to auto/64-bit when it doesn’t.
Suggested change
| options.OffsetBitSize = 32; | |
| options.OffsetBitSize = 0; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change offset bit size to 32 and bytes per line to 16, so it will match the behaviour of common hex editor / viewer such as 010Editor and xxd, which makes it easier to do things like one byte CIL patch.