把下面这段代码转换成C++代码,其中用了三个goto,惭愧!
00437A95 |. 8845 F0 MOV BYTE PTR SS:[EBP-10],AL
00437A98 |> 8B4D F0 /MOV ECX,DWORD PTR SS:[EBP-10]
00437A9B |. 81E1 FF000000 |AND ECX,0FF
00437AA1 |. 83F9 41 |CMP ECX,41
00437AA4 7C 0E JL SHORT ClockWis.00437AB4
00437AA6 |. 8B55 F0 |MOV EDX,DWORD PTR SS:[EBP-10]
00437AA9 |. 81E2 FF000000 |AND EDX,0FF
00437AAF |. 83FA 5A |CMP EDX,5A
00437AB2 |. 7E 30 |JLE SHORT ClockWis.00437AE4
00437AB4 |> 8A45 F0 |MOV AL,BYTE PTR SS:[EBP-10]
00437AB7 |. 04 4A |ADD AL,4A
00437AB9 |. 8845 F0 |MOV BYTE PTR SS:[EBP-10],AL
00437ABC |. 8B4D F0 |MOV ECX,DWORD PTR SS:[EBP-10]
00437ABF |. 81E1 FF000000 |AND ECX,0FF
00437AC5 |. 83F9 4F |CMP ECX,4F
00437AC8 |. 74 0E |JE SHORT ClockWis.00437AD8
00437ACA |. 8B55 F0 |MOV EDX,DWORD PTR SS:[EBP-10]
00437ACD |. 81E2 FF000000 |AND EDX,0FF
00437AD3 |. 83FA 49 |CMP EDX,49
00437AD6 |. 75 0A |JNZ SHORT ClockWis.00437AE2
00437AD8 |> 8A45 F0 |MOV AL,BYTE PTR SS:[EBP-10]
00437ADB |. 04 4A |ADD AL,4A
00437ADD |. 8845 F0 |MOV BYTE PTR SS:[EBP-10],AL
00437AE0 |.^ EB B6 |JMP SHORT ClockWis.00437A98
00437AE2 |>^ EB B4 \JMP SHORT ClockWis.00437A98
00437AE4 |> 8A4D F0 MOV CL,BYTE PTR SS:[EBP-10]
下面是我转换后的C++代码:
temp1=temp;
B2:while(1)
{
temp=temp1;
if(temp>256)
temp=temp-256;
if(temp<65)
{
B1: temp=temp1;
temp=temp+74;
temp1=temp;
if(temp>256)
temp=temp-256;
if(temp==79)
{
temp=temp1;
temp=temp+74;
temp1=temp;
}
else
{
temp=temp1;
if(temp>256)
temp=temp-256;
if(temp==73)
{
temp=temp1;
temp=temp+74;
temp1=temp;
}
goto B2;
}
}
else
temp=temp1;
if(temp>256)
temp=temp-256;
if(temp<=90)
goto B3;
else
goto B1;
}
B3: regNum[3]=temp;
请高手指点一下,如何使之更简洁?多些!
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)