|
发表于 2020-9-7 20:43:25
|
显示全部楼层
像这样直接出伪代码的,才算神器
复位函数:
- void UndefinedFunction_0800168c(void)
- {
- int iVar1;
- undefined4 *puVar2;
-
- iVar1 = 0;
- while (puVar2 = DAT_080016c8, (uint)(DAT_080016c0 + iVar1) < DAT_080016c4) {
- *(undefined4 *)(DAT_080016c0 + iVar1) = *(undefined4 *)(PTR_DAT_080016bc + iVar1);
- iVar1 = iVar1 + 4;
- }
- while (puVar2 < DAT_080016cc) {
- *puVar2 = 0;
- puVar2 = puVar2 + 1;
- }
- FUN_08001cc8();
- FUN_08001734();
- return;
- }
复制代码
SystemInit
- void FUN_08001cc8(void)
- {
- uint *puVar1;
- uint *puVar2;
- uint *puVar3;
- uint uVar4;
- int local_10;
-
- uVar4 = DAT_08001dc0;
- puVar1 = DAT_08001dbc;
- *DAT_08001dbc = *DAT_08001dbc | 1;
- puVar1[1] = uVar4 & puVar1[1];
- *puVar1 = *puVar1 & 0xfef6ffff;
- *puVar1 = *puVar1 & 0xfffbffff;
- puVar1[1] = puVar1[1] & 0xff80ffff;
- puVar1[2] = 0x9f0000;
- local_10 = 0;
- *puVar1 = *puVar1 | 0x10000;
- puVar3 = DAT_08001dc8;
- puVar2 = DAT_08001dbc;
- do {
- local_10 = local_10 + 1;
- if ((*puVar1 & 0x20000) != 0) break;
- } while (local_10 != 0x500);
- uVar4 = *DAT_08001dbc & 0x20000;
- if (uVar4 != 0) {
- uVar4 = 1;
- }
- if (uVar4 == 1) {
- *DAT_08001dc8 = *DAT_08001dc8 | 0x10;
- *puVar3 = *puVar3 & 0xfffffffc;
- *puVar3 = *puVar3 | 2;
- puVar2[1] = puVar2[1];
- puVar2[1] = puVar2[1];
- puVar2[1] = puVar2[1] | 0x400;
- puVar2[1] = puVar2[1] & 0xffc0ffff;
- puVar2[1] = puVar2[1] | 0x1d0000;
- *puVar2 = *puVar2 | 0x1000000;
- puVar1 = DAT_08001dbc;
- do {
- } while (-1 < (int)(*puVar2 << 6));
- puVar2[1] = puVar2[1] & 0xfffffffc;
- puVar2[1] = puVar2[1] | 2;
- do {
- } while ((puVar1[1] & 0xc) != 8);
- }
- *(undefined4 *)(DAT_08001dc4 + 8) = 0x8000000;
- return;
- }
复制代码
Main函数
- void FUN_08001734(void)
- {
- FUN_08000840();
- FUN_080017c0();
- FUN_0800131c(DAT_08001798,8,DAT_08001794);
- FUN_0800074c(PTR_DAT_080017a4,0,DAT_080017a0,0x100,PTR_s_IdleTask_0800179c,0);
- FUN_0800074c(PTR_LAB_080016de+1_080017b0,0,DAT_080017ac,0x100,PTR_s_Task1_080017a8,1);
- FUN_0800074c(PTR_FUN_08001708+1_080017bc,0,DAT_080017b8,0x100,PTR_s_Task2_080017b4,2);
- FUN_08000850();
- do {
- /* WARNING: Do nothing block with infinite loop */
- } while( true );
- }
复制代码 |
|