Kernel image 信息

三种文件介绍:

Image: the generic Linux kernel binary image file.

zImage: a compressed version of the Linux kernel image that is self-extracting.

uImage: an image file that has a U-Boot wrapper (installed by the mkimage utility) that includes the OS type and loader information.

 

查看uImage 信息:

#binwalk uImage

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             uImage header, header size: 64 bytes, header CRC: 0x41C2F835, created: 2020-07-06 12:28:58, image size: 2763304 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x6CD7401D, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: "Linux-3.14.17"
16919         0x4217          gzip compressed data, maximum compression, from Unix, NULL date (1970-01-01 00:00:00)

从uImage 获取zImage,一般uImage只是在zImage前面加了64bytes的header,所以跳过前64bytes 即是zImage:

dd if=uImage of=zImage skip=64 bs=1

zImage 是一个自解压的image,里面的kernel是压缩后的,需要把完整的kernel 解压出来,上面可以看到是通过gzip压缩的,gzip压缩的特征码是 1F 8B, 通过搜索这个特征码得到压缩后的kernel:

dd if=zImage bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b' zImage | head -n 1 | cut -d ':' -f 1) of=image.gz 

然后将kernel解压出来即可得到kernel image:

gzip -d image.gz

参考信息:

https://stackoverflow.com/questions/9535227/getting-uname-information-from-a-compressed-kernel-image

https://acassis.wordpress.com/2015/06/04/how-to-recover-and-decompress-a-linux-kernel-dumped-mtd-partition/

https://github.com/torvalds/linux/blob/master/scripts/extract-vmlinux

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值