Skip to content
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

Address prefix optional offset and variable width support #10

Merged
merged 3 commits into from
Jul 23, 2023

Conversation

matcap
Copy link
Contributor

@matcap matcap commented Jul 16, 2023

Using the library I found the need to print address prefixes starting from a pre-determined offset instead of 0,
so I added display_offset field to HexConfig (defaults to 0).

Before:

0000:   00 c3 50 01  ce ed 66 66   ..P...ff
0008:   cc 0d 00 0b  03 73 00 83   .....s..

With display_offset set to 0x0100:

0100:   00 c3 50 01  ce ed 66 66   ..P...ff
0108:   cc 0d 00 0b  03 73 00 83   .....s..

As a consequence, since now addresses can be greater than 0xff, I added support for automatically displaying addresses with larger width.

With display_offset set to 0x010000:

010000:   00 c3 50 01  ce ed 66 66   ..P...ff
010008:   cc 0d 00 0b  03 73 00 83   .....s..

With display_offset set to 0x10000000:

10000000:   00 c3 50 01  ce ed 66 66   ..P...ff
10000008:   cc 0d 00 0b  03 73 00 83   .....s..

@wolandr
Copy link
Owner

wolandr commented Jul 23, 2023

Looks good, thank you

@wolandr wolandr merged commit 4a889b6 into wolandr:master Jul 23, 2023
@Sharpiro
Copy link

this looks great, any idea when a new release will be cut?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants