|
发表于 2018-10-1 21:28:42
|
显示全部楼层
大致应该是这样的,可以用IDA或是直接arm-none-eabi-objdump来进行,我是2个结合起来,这样看起来比较方便。
1. arm-none-eabi-objdump -D STemWin532_CM3_GCC.a > 1.txt
.................................................................
Disassembly of section .text.GUI_Init:
00000000 <GUI_Init>:
0: b590 push {r4, r7, lr}
2: b083 sub sp, #12
4: af00 add r7, sp, #0
6: 4b20 ldr r3, [pc, #128] ; (88 <GUI_Init+0x88>)
8: 4a1f ldr r2, [pc, #124] ; (88 <GUI_Init+0x88>)
a: 6812 ldr r2, [r2, #0]
c: f022 0201 bic.w r2, r2, #1
10: 601a str r2, [r3, #0]
12: 4b1e ldr r3, [pc, #120] ; (8c <GUI_Init+0x8c>)
14: 2201 movs r2, #1
16: 601a str r2, [r3, #0]
18: 4b1d ldr r3, [pc, #116] ; (90 <GUI_Init+0x90>)
1a: 4a1e ldr r2, [pc, #120] ; (94 <GUI_Init+0x94>)
1c: 601a str r2, [r3, #0]
1e: 4b1c ldr r3, [pc, #112] ; (90 <GUI_Init+0x90>)
20: 681a ldr r2, [r3, #0]
22: 4b1d ldr r3, [pc, #116] ; (98 <GUI_Init+0x98>)
24: 429a cmp r2, r3
26: d000 beq.n 2a <GUI_Init+0x2a>
28: e7fe b.n 28 <GUI_Init+0x28>
2a: f7ff fffe bl 0 <GUI_Init>
2e: 4b1b ldr r3, [pc, #108] ; (9c <GUI_Init+0x9c>)
30: 222e movs r2, #46 ; 0x2e
32: 701a strb r2, [r3, #0]
34: f7ff fffe bl 0 <GUI_X_Init>
38: 4819 ldr r0, [pc, #100] ; (68 <GUI
=======================
2. IDA的反编译
############################
一些STM32硬CRC的寄存器器
/* CRC calculation unit */
#define CRC ( (volatile uint32_t*)0x40023000)
#define CRC_DR (*(volatile uint32_t*)0x40023000)
#define CRC_IDR (*(volatile uint32_t*)0x40023004)
#define CRC_CR (*(volatile uint32_t*)0x40023008)
总结修改方法:
429a cmp r2, r3 =====>修改成 429b cmp r3, r3
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|