Kernel Support for miscellaneous Binary Formats
Posted on Thu 20 October 2016 in note • Tagged with linux, kernel, binfmt
Linux Kernel 文件 binfmt_misc.txt 提到的功能。主要就是告訴 kernel 如果把特定的檔案當成執行檔來呼叫。判斷的方式分成 extension 及 magic。
第一步掛載 binfmt_misc
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
向 binfmt 註冊你的格式
註冊字串組成
:name:type:offset:magic:mask:interpreter:flags
- name 是識別用的字串,註冊後會出現在
/proc/sys/fs/binfmt_misc
- type 有
M
與E
。M
就是 magic number …
Continue reading