Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Weird Offset Values #2

Open
waseemR02 opened this issue Aug 27, 2023 · 0 comments
Open

Weird Offset Values #2

waseemR02 opened this issue Aug 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@waseemR02
Copy link
Member

waseemR02 commented Aug 27, 2023

Fix this issue

Hex editor prints out weird offset values

When trying to dump hex from a binary. The offset that represents read bytes is not uniform and expected.

Steps to recreate

$ gcc *.c -o hx.out
$ ./hx.out -b2h tests/test_hex2bin.txt

The test_hex2bin.txt file is available here.

Output

0000000000000001  4C 6F 72 65 6D 20 49 70 73 75 6D 20 69 73 20 73 |Lorem Ipsum is s|
0000000000000017  69 6D 70 6C 79 20 64 75 6D 6D 79 20 74 65 78 74 |imply dummy text|
0000000000000033  20 6F 66 20 74 68 65 20 70 72 69 6E 74 69 6E 67 | of the printing|
0000000000000049  20 61 6E 64 20 74 79 70 65 73 65 74 74 69 6E 67 | and typesetting|
0000000000000065  20 69 6E 64 75 73 74 72 79 2E 20 4C 6F 72 65 6D | industry. Lorem|
0000000000000081  20 49 70 73 75 6D 20 68 61 73 20 62 65 65 6E 20 | Ipsum has been |
0000000000000097  74 68 65 20 69 6E 64 75 73 74 72 79 27 73 20 73 |the industry's s|
0000000000000113  74 61 6E 64 61 72 64 20 64 75 6D 6D 79 20 74 65 |tandard dummy te|
0000004294967169  78 74 20 65 76 65 72 20 0A 73 69 6E 63 65 20 74 |xt ever .since t|
0000004294967185  68 65 20 31 35 30 30 73 2C 20 77 68 65 6E 20 61 |he 1500s, when a|
0000004294967201  6E 20 75 6E 6B 6E 6F 77 6E 20 70 72 69 6E 74 65 |n unknown printe|
0000004294967217  72 20 74 6F 6F 6B 20 61 20 67 61 6C 6C 65 79 20 |r took a galley |
0000004294967233  6F 66 20 74 79 70 65 20 61 6E 64 20 73 63 72 61 |of type and scra|
0000004294967249  6D 62 6C 65 64 20 69 74 20 74 6F 20 6D 61 6B 65 |mbled it to make|
0000004294967265  20 61 20 74 79 70 65 20 73 70 65 63 69 6D 65 6E | a type specimen|
0000004294967281  20 62 6F 6F 6B 2E 20 49 74 20 68 61 73 20 73 75 | book. It has su|
.
.
.
.

Expected Output

0000000000000001  4C 6F 72 65 6D 20 49 70 73 75 6D 20 69 73 20 73 |Lorem Ipsum is s|
0000000000000017  69 6D 70 6C 79 20 64 75 6D 6D 79 20 74 65 78 74 |imply dummy text|
0000000000000033  20 6F 66 20 74 68 65 20 70 72 69 6E 74 69 6E 67 | of the printing|
0000000000000049  20 61 6E 64 20 74 79 70 65 73 65 74 74 69 6E 67 | and typesetting|
0000000000000065  20 69 6E 64 75 73 74 72 79 2E 20 4C 6F 72 65 6D | industry. Lorem|
0000000000000081  20 49 70 73 75 6D 20 68 61 73 20 62 65 65 6E 20 | Ipsum has been |
0000000000000097  74 68 65 20 69 6E 64 75 73 74 72 79 27 73 20 73 |the industry's s|
0000000000000113  74 61 6E 64 61 72 64 20 64 75 6D 6D 79 20 74 65 |tandard dummy te|
0000000000000129  78 74 20 65 76 65 72 20 0A 73 69 6E 63 65 20 74 |xt ever .since t|
0000000000000145  68 65 20 31 35 30 30 73 2C 20 77 68 65 6E 20 61 |he 1500s, when a|
0000000000000161  6E 20 75 6E 6B 6E 6F 77 6E 20 70 72 69 6E 74 65 |n unknown printe|
0000000000000177  72 20 74 6F 6F 6B 20 61 20 67 61 6C 6C 65 79 20 |r took a galley |
0000000000000193  6F 66 20 74 79 70 65 20 61 6E 64 20 73 63 72 61 |of type and scra|
0000000000000209  6D 62 6C 65 64 20 69 74 20 74 6F 20 6D 61 6B 65 |mbled it to make|
0000000000000225  20 61 20 74 79 70 65 20 73 70 65 63 69 6D 65 6E | a type specimen|
0000000000000241  20 62 6F 6F 6B 2E 20 49 74 20 68 61 73 20 73 75 | book. It has su|
0000000000000257  72 76 69 76 65 64 20 6E 6F 74 20 6F 6E 6C 79 20 |rvived not only |
.
.
.
.
@waseemR02 waseemR02 added the bug Something isn't working label Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant