情况是这样,我有一部 OnePlus 手机,我想探索他的内核,所以我从 oneplus 网站下载了 zip 固件,从 payload.bin 中提取 img 文件,使用此工具从引导中提取 zImage。图像。
我在这里找到了一篇从 zImage 中提取 gzip的文章,但输出arm-linux-gnueabi-objdump
有点奇怪<UNDEFINED> instruction: 0xf1008b1f
:
arm-linux-gnueabi-objdump -EL -b binary -D -m armv5t boot.img-zImage | grep 8b1f
2f14: f1008b1f ; <UNDEFINED> instruction: 0xf1008b1f
3290: f1008b1f ; <UNDEFINED> instruction: 0xf1008b1f
3384: f1008b1f ; <UNDEFINED> instruction: 0xf1008b1f
8a224: 2a0003f4 bcs 0x8b1fc
8b1f0: f9000518 ; <UNDEFINED> instruction: 0xf9000518
8b1f4: f9000308 ; <UNDEFINED> instruction: 0xf9000308
8b1f8: f9405fe8 ; <UNDEFINED> instruction: 0xf9405fe8
8b1fc: f9000708 ; <UNDEFINED> instruction: 0xf9000708
8fd54: b98b1f28 stmiblt fp, {r3, r5, r8, r9, sl, fp, ip}
cffbc: 9a9f87e9 bls 0xfe8b1f68
d0008: 9a9f87ea bls 0xfe8b1fb8
18a220: aa0003f3 bge 0x18b1f4
18b1f0: f81a83a8 ; <UNDEFINED> instruction: 0xf81a83a8
18b1f4: b40001a2 strlt r0, [r0], #-418 ; 0xfffffe5e
18b1f8: d0010268 andle r0, r1, r8, ror #4
18b1fc: b94e5108 stmdblt lr, {r3, r8, ip, lr}^
^C
我还注意到无法识别文件类型:
user@ubuntu:~/Desktop/bootImg$ file zImage
zImage: data
但无论如何,我将其转换2f14
为十进制并尝试提取 gzip 存档:
dd if=zImage of=piggy.gz bs=1 skip=12052
然后尝试提取:
user@ubuntu:~/Desktop/bootImg$ gunzip piggy.gz
gzip: piggy.gz: unknown method 0 -- not supported
此外,存档似乎已加密:
user@ubuntu:~/Desktop/bootImg$ file piggy.gz
piggy.gz: gzip compressed data, reserved method, ASCII, has comment, encrypted, last modified: Fri Aug 29 04:43:12 2014, from Unix, original size modulo 2^32 0
注意:我知道 oneplus 内核是开源的,但我真的很想练习我的逆向工程技能。