我正在与 Ghidra 合作。我的汇编代码与反编译代码不匹配:
* FUNCTION *
**************************************************************
undefined __stdcall CalCrc8(undefined4 param_1, int para
assume LRset = 0x0
assume TMode = 0x1
undefined r0:1 <RETURN>
undefined4 r0:4 param_1
int r1:4 param_2
int r2:4 param_3
CalCrc8 XREF[2]: Entry Point(*),
Frame_Cap:0005a2b8(c)
00059dd8 05 4b ldr r3,[DAT_00059df0] = 0005F314h
00059dda 10 b5 push { r4, lr }
00059ddc 8a 18 add param_3,param_2,param_3
00059dde 7b 44 add r3,pc
00059de0 03 e0 b LAB_00059dea
LAB_00059de2 XREF[1]: 00059dec(j)
00059de2 11 f8 01 4b ldrb.w r4,[param_2],#0x1
00059de6 60 40 eor param_1,r4
00059de8 18 5c ldrb param_1,[r3,param_1]=>Crc8Table =
LAB_00059dea XREF[1]: 00059de0(j)
00059dea 91 42 cmp param_2,param_3
00059dec f9 d1 bne LAB_00059de2
00059dee 10 bd pop { r4, pc }
DAT_00059df0 XREF[1]: CalCrc8:00059dd8(R)
00059df0 14 f3 05 00 undefined4 0005F314h ? -> 0005f314
void CalCrc8(undefined4 param_1,int param_2,int param_3)
{
param_3 = param_2 + param_3;
while (param_2 != param_3) {
param_2 = param_2 + 1;
}
return;
}
XOR(地址 00059de6)和从 CRC8Table 获取值丢失。如何修复反编译的代码?
架构是ARM32v8。