第一个字节是异常向量:
CODE:00000000 LDR PC, =0x1000005C
CODE:00000004 ; ---------------------------------------------------------------------------
CODE:00000004 LDR PC, =0x10000044
CODE:00000008 ; ---------------------------------------------------------------------------
CODE:00000008 LDR PC, =0x10000048
CODE:0000000C ; ---------------------------------------------------------------------------
CODE:0000000C LDR PC, =0x1000004C
CODE:00000010 ; ---------------------------------------------------------------------------
CODE:00000010 LDR PC, =0x10000050
CODE:00000010 ; ---------------------------------------------------------------------------
CODE:00000014 ALIGN 8
CODE:00000018 LDR PC, =0x10000054
CODE:0000001C ; ---------------------------------------------------------------------------
CODE:0000001C LDR PC, =0x10000058
CODE:0000001C ; ---------------------------------------------------------------------------
CODE:00000020 off_20 DCD 0x1000005C ; DATA XREF: CODE:00000000↑r
CODE:00000024 off_24 DCD 0x10000044 ; DATA XREF: CODE:00000004↑r
CODE:00000028 off_28 DCD 0x10000048 ; CODE XREF: sub_1D8↓j
CODE:00000028 ; DATA XREF: CODE:00000008↑r ...
CODE:0000002C off_2C DCD 0x1000004C ; DATA XREF: CODE:0000000C↑r
CODE:00000030 off_30 DCD 0x10000050 ; DATA XREF: CODE:00000010↑r
CODE:00000034 off_34 DCD 0x10000054 ; DATA XREF: CODE:00000018↑r
CODE:00000038 off_38 DCD 0x10000058 ; DATA XREF: CODE:0000001C↑r
显然,代码映射在0x10000000
. 变基后,我们可以看到您找到的循环是虚拟处理程序:
CODE:10000000 LDR PC, =Reset_Handler
CODE:10000004 ; ---------------------------------------------------------------------------
CODE:10000004 LDR PC, =Undef_Hander
CODE:10000008 ; ---------------------------------------------------------------------------
CODE:10000008 LDR PC, =SWI_Handler
CODE:1000000C ; ---------------------------------------------------------------------------
CODE:1000000C LDR PC, =PrefAbort_Handler
CODE:10000010 ; ---------------------------------------------------------------------------
CODE:10000010 LDR PC, =DataAbort_Handler
CODE:10000010 ; ---------------------------------------------------------------------------
CODE:10000014 ALIGN 8
CODE:10000018 LDR PC, =IRQ_Handler
CODE:1000001C ; ---------------------------------------------------------------------------
CODE:1000001C LDR PC, =FIQ_Handler
CODE:1000001C ; ---------------------------------------------------------------------------
CODE:10000020 off_10000020 DCD Reset_Handler ; DATA XREF: CODE:10000000↑r
CODE:10000024 off_10000024 DCD Undef_Hander ; DATA XREF: CODE:10000004↑r
CODE:10000028 off_10000028 DCD SWI_Handler ; DATA XREF: CODE:10000008↑r
CODE:1000002C off_1000002C DCD PrefAbort_Handler ; DATA XREF: CODE:1000000C↑r
CODE:10000030 off_10000030 DCD DataAbort_Handler ; DATA XREF: CODE:10000010↑r
CODE:10000034 off_10000034 DCD IRQ_Handler ; DATA XREF: CODE:10000018↑r
CODE:10000038 off_10000038 DCD FIQ_Handler ; DATA XREF: CODE:1000001C↑r
CODE:1000003C aV10 DCB "v1.0"
CODE:10000040 DCD 0x1C200
CODE:10000044
CODE:10000044 ; =============== S U B R O U T I N E =======================================
CODE:10000044
CODE:10000044 ; Attributes: noreturn
CODE:10000044
CODE:10000044 Undef_Hander ; CODE XREF: CODE:10000004↑j
CODE:10000044 ; Undef_Hander↓j
CODE:10000044 ; DATA XREF: ...
CODE:10000044 B Undef_Hander
CODE:10000044 ; End of function Undef_Hander
CODE:10000044
CODE:10000048
CODE:10000048 ; =============== S U B R O U T I N E =======================================
CODE:10000048
CODE:10000048 ; Attributes: noreturn
CODE:10000048
CODE:10000048 SWI_Handler ; CODE XREF: CODE:10000008↑j
CODE:10000048 ; SWI_Handler↓j
CODE:10000048 ; DATA XREF: ...
CODE:10000048 B SWI_Handler
CODE:10000048 ; End of function SWI_Handler
CODE:10000048
CODE:1000004C
CODE:1000004C ; =============== S U B R O U T I N E =======================================
CODE:1000004C
CODE:1000004C ; Attributes: noreturn
CODE:1000004C
CODE:1000004C PrefAbort_Handler ; CODE XREF: CODE:1000000C↑j
CODE:1000004C ; PrefAbort_Handler↓j
CODE:1000004C ; DATA XREF: ...
CODE:1000004C B PrefAbort_Handler
CODE:1000004C ; End of function PrefAbort_Handler
CODE:1000004C
CODE:10000050
CODE:10000050 ; =============== S U B R O U T I N E =======================================
CODE:10000050
CODE:10000050 ; Attributes: noreturn
CODE:10000050
CODE:10000050 DataAbort_Handler ; CODE XREF: CODE:10000010↑j
CODE:10000050 ; DataAbort_Handler↓j
CODE:10000050 ; DATA XREF: ...
CODE:10000050 B DataAbort_Handler
CODE:10000050 ; End of function DataAbort_Handler
CODE:10000050
CODE:10000054
CODE:10000054 ; =============== S U B R O U T I N E =======================================
CODE:10000054
CODE:10000054 ; Attributes: noreturn
CODE:10000054
CODE:10000054 IRQ_Handler ; CODE XREF: CODE:10000018↑j
CODE:10000054 ; IRQ_Handler↓j
CODE:10000054 ; DATA XREF: ...
CODE:10000054 B IRQ_Handler
CODE:10000054 ; End of function IRQ_Handler
CODE:10000054
CODE:10000058
CODE:10000058 ; =============== S U B R O U T I N E =======================================
CODE:10000058
CODE:10000058 ; Attributes: noreturn
CODE:10000058
CODE:10000058 FIQ_Handler ; CODE XREF: CODE:1000001C↑j
CODE:10000058 ; FIQ_Handler↓j
CODE:10000058 ; DATA XREF: ...
CODE:10000058 B FIQ_Handler
CODE:10000058 ; End of function FIQ_Handler
CODE:10000058
CODE:1000005C ; ---------------------------------------------------------------------------
CODE:1000005C
CODE:1000005C Reset_Handler ; CODE XREF: CODE:10000000↑j
CODE:1000005C ; DATA XREF: CODE:10000000↑o ...
CODE:1000005C MOV R1, #0x12
CODE:10000060 ORR R0, R1, #0
CODE:10000064 MCR p15, 0, R0,c9,c1, 1
CODE:10000068 MOV R1, #0x12
CODE:1000006C ORR R0, R1, #0x100000
CODE:10000070 MCR p15, 0, R0,c9,c1, 0
CODE:10000074 MRC p15, 0, R0,c1,c0, 0
CODE:10000078 ORR R0, R0, #0x50000
CODE:1000007C MCR p15, 0, R0,c1,c0, 0
CODE:10000080 LDR R0, =0x5200F010
CODE:10000084 LDR R1, [R0]
CODE:10000088 ORR R1, R1, #0xE
CODE:1000008C STR R1, [R0]
CODE:10000090 LDR R12, =sub_10000140
CODE:10000094 BX R12 ; sub_10000140
中的代码Reset_Handler
执行非常基本的 hw init,然后跳转到准备其余环境的代码(将代码和数据复制到其最终位置,然后跳转到它)。