Labels in C#
So I'm reversing in IDA and came across a function what is a pain in the ass to follow logic on, so I'm going to put it in C# and test the code directly. I got a basic understanding of what it does from reading the references to the function in ida, but I want to confirm what I think it does. The function requires a label which doesn't work in C# for some odd reason.
Picture of the function:
https://i.gyazo.com/e11d376bc296dbea...383903fbc8.png
Error:
Error 2 No such label 'Label' within the scope of the goto statement
Any help will be appreciated.
Picture of the function:
https://i.gyazo.com/e11d376bc296dbea...383903fbc8.png
Error:
Error 2 No such label 'Label' within the scope of the goto statement
Code:
unsafe static int sub_47A540(int a1, int a2, uint a3)
{
int v3; // ecx@1
int v4; // edx@1
uint v5; // esi@1
int v6; // eax@5
v3 = a2;
v4 = a1;
v5 = a3;
if (a3 < 4)
{
LABEL_4:
if (v5 == 0)
return 0;
}
else
{
while (*(uint*)v4 == *(uint*)v3)
{
v5 -= 4;
v3 += 4;
v4 += 4;
if (v5 < 4)
goto LABEL_4;
}
}
v6 = *(byte*)v4 - *(byte*)v3;
if (*(byte*)v4 != *(byte*)v3)
return (v6 >> 31) | 1;
if (v5 <= 1)
return 0;
v6 = *(byte*)(v4 + 1) - *(byte*)(v3 + 1);
if (*(byte*)(v4 + 1) != *(byte*)(v3 + 1))
return (v6 >> 31) | 1;
if (v5 <= 2)
return 0;
v6 = *(byte*)(v4 + 2) - *(byte*)(v3 + 2);
if (*(byte*)(v4 + 2) != *(byte*)(v3 + 2))
return (v6 >> 31) | 1;
if (v5 > 3)
{
v6 = *(byte*)(v4 + 3) - *(byte*)(v3 + 3);
return (v6 >> 31) | 1;
}
return 0;
}
