LoginSignup
7
7

More than 5 years have passed since last update.

od出力結果のバイトオーダー

Posted at

od出力結果のバイトオーダー

odの出力結果には実行してる実行環境のバイトオーダーが利用される。

x86_64のマシンなどはリトルエンディアンなので、たとえばELFのマジックナンバーである0x7f、0x45、0x4c、0x46は下記のような順序でodでは出力される。

$ od -t x -A x /bin/ls | head -5
000000 464c457f 00010102 00000000 00000000
000010 003e0002 00000001 00404e3c 00000000
000020 00000040 00000000 0001d808 00000000
000030 00000000 00380040 0040000a 00200021
000040 00000006 00000005 00000040 00000000

そのためodコマンドを利用して、実行環境のエンディアン確認することができる。

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7