我试图反汇编一个 ELF 文件,它是在 armv7a (Android) 上执行的共享对象文件。我看到了一个奇怪的方块。看来PC
,程序计数器寄存器被设置为0
。我是否错过了什么或做错了什么?
该过程进入0x1708
ARM 模式。下面是我从 ELF 文件中反汇编的奇怪的汇编代码块。
; section: .plt
; function: function_1708 at 0x1708 -- 0x1718
0x1708: 04 e0 2d e5 str lr, [sp, #-4]!
0x170c: 04 e0 9f e5 ldr lr, [pc, #4]
0x1710: 0e e0 8f e0 add lr, pc, lr
0x1714: 08 f0 be e5 ldr pc, [lr, #8]!
; data inside code section at 0x1718 -- 0x171c
0x1718: b4 77 00 00 |.w.. |
执行 line 后0x170c
,LR
应将寄存器设置为地址处的值0x1718
。值为0x77b4
(此文件以小端存储)。继续。
0x1710: lr += 0x1710 + 8 // lr = 0x8ecc
0x1714: pc = *(lr + 8) // pc = *(0x8ed4)
lr += 8
并且 0x8ed4 在.got
节中。
; section: .got
0x8eac: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0x8ebc: 00 00 00 00 58 70 00 00 e0 6e 00 00 00 00 00 00 |....Xp...n......|
0x8ecc: 00 00 00 00 00 00 00 00 00 00 00 00 08 17 00 00 |................|
0x8edc: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
0x8eec: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
0x8efc: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
0x8f0c: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
0x8f1c: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
0x8f2c: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
0x8f3c: 08 17 00 00 08 17 00 00 08 17 00 00 08 17 00 00 |................|
似乎 的值0x8ed4
为零。我从 追踪到这个奇怪的块JNI_OnLoad()
,所以在执行这个块之前不应该修改任何数据。
我做错了什么,还是这是 ARM 架构的特定行为?