想要查看 png 和 jpg 格式的文件头。但是试了试,现代的 IDE 都太智能了,打开图片格式显示的不是二进制数据而是直接解码的图片。。。试了试 sublime 和 vscode 都是这样,有什么办法直接看到二进制数据吗?
如果要写两行代码来读感觉也太 low 了。。
1
AoEiuV020 2021-10-12 16:10:17 +08:00
我记得 ultraedit 这方面比较专业,
|
2
cairnechen 2021-10-12 16:10:48 +08:00
听上去是需要一个 hex editor,我没去找,但是你说的这几个编辑器应该有插件支持吧?
|
3
unixeno 2021-10-12 16:13:21 +08:00 via Android 1
vs code 装一个 hex 插件就可以了吧
|
4
ipwx 2021-10-12 16:40:09 +08:00
如果是 Linux:
$ hd 0.jpeg | head -n 20 00000000 ff d8 ff e1 13 4a 45 78 69 66 00 00 4d 4d 00 2a |.....JExif..MM.*| 00000010 00 00 00 08 00 07 01 12 00 03 00 00 00 01 00 01 |................| 00000020 00 00 01 1a 00 05 00 00 00 01 00 00 00 62 01 1b |.............b..| 00000030 00 05 00 00 00 01 00 00 00 6a 01 28 00 03 00 00 |.........j.(....| 00000040 00 01 00 02 00 00 01 31 00 02 00 00 00 1d 00 00 |.......1........| 00000050 00 72 01 32 00 02 00 00 00 14 00 00 00 8f 87 69 |.r.2...........i| 00000060 00 04 00 00 00 01 00 00 00 a4 00 00 00 d0 00 2d |...............-| 00000070 c6 c0 00 00 27 10 00 2d c6 c0 00 00 27 10 41 64 |....'..-....'.Ad| 00000080 6f 62 65 20 50 68 6f 74 6f 73 68 6f 70 20 43 43 |obe Photoshop CC| 00000090 20 28 57 69 6e 64 6f 77 73 29 00 32 30 31 39 3a | (Windows).2019:| 000000a0 30 34 3a 32 33 20 31 30 3a 33 30 3a 30 32 00 00 |04:23 10:30:02..| 000000b0 00 03 a0 01 00 03 00 00 00 01 ff ff 00 00 a0 02 |................| 000000c0 00 04 00 00 00 01 00 00 09 18 a0 03 00 04 00 00 |................| 000000d0 00 01 00 00 03 e8 00 00 00 00 00 00 00 06 01 03 |................| 000000e0 00 03 00 00 00 01 00 06 00 00 01 1a 00 05 00 00 |................| 000000f0 00 01 00 00 01 1e 01 1b 00 05 00 00 00 01 00 00 |................| 00000100 01 26 01 28 00 03 00 00 00 01 00 02 00 00 02 01 |.&.(............| 00000110 00 04 00 00 00 01 00 00 01 2e 02 02 00 04 00 00 |................| 00000120 00 01 00 00 12 14 00 00 00 00 00 00 00 48 00 00 |.............H..| 00000130 00 01 00 00 00 48 00 00 00 01 ff d8 ff ed 00 0c |.....H..........| |
5
polaa 2021-10-12 16:45:40 +08:00
vim
xxd |
6
LeeReamond OP @unixeno 已经解决,vscode 的插件很好用
|
7
butanediol2d 2021-10-12 18:46:35 +08:00
Sublime Text 可以装一个 HexViewer,然后按 ⇧⌘P 选择 HexViewer: Toggle Hex View 。
![截屏 2021-10-12 下午 6.43.18.png]( https://i.loli.net/2021/10/12/1VhnyutGlWpbT6f.png) |
8
des 2021-10-12 18:58:05 +08:00 via iPhone
@butanediol2d 这个插件性能太差了…
|
9
XD2333 2021-10-12 18:59:24 +08:00
hxd
|
10
EridanusSora 2021-10-12 20:43:13 +08:00
|
11
luny 2021-10-12 21:02:44 +08:00
WinHex
|
12
ysc3839 2021-10-13 03:30:41 +08:00 via Android
wxMedit 开源且跨平台,支持十六进制模式,不过似乎不更新了,性能也不是非常好。
|
13
msg7086 2021-10-13 14:51:57 +08:00
我用 frhed,感觉还行。轻度十六进制用户。
|
14
crisrock 2021-10-14 20:32:10 +08:00 via iPhone
tc f3
|