-
Notifications
You must be signed in to change notification settings - Fork 1
Decompiled : Decoding Portal AID
iamkisly edited this page Dec 19, 2016
·
1 revision
char aArtPortalS[] = "art\\portal\\%s"; // idb
//----- (0049FC50) --------------------------------------------------------
int __cdecl sub_49FC50(int a1, char *a2)
{
int v2; // eax@1
int result; // eax@2
v2 = sub_49FF20(a1);
sprintf(a2, aArtPortalS, v2);
if ( sub_518080(a1) )
{
result = 1;
a2[strlen(a2) - 6] = 68;
}
else
{
result = 1;
}
return result;
}
//----- (0049FF20) --------------------------------------------------------
int __cdecl sub_49FF20(unsigned int a1)
{
int v1; // edi@1
int v3; // [sp+8h] [bp-8h]@3
int v4; // [sp+Ch] [bp-4h]@3
v1 = sub_516C20(a1);
if ( !sub_518770(a1) )
v1 += 1001;
v3 = v1;
sub_452000(dword_5B39D8, &v3);
return v4;
}
//dword_5B39D8 what into variable?
//----- (00516C20) --------------------------------------------------------
int __cdecl sub_516C20(unsigned int a1)
{
unsigned int v1; // eax@1
int result; // eax@6
v1 = sub_516C10(a1);
if ( v1 && v1 != 1 && v1 != 2 && v1 != 12 )
{
switch ( v1 )
{
case 0xDu:
result = (a1 >> 20) & 0xFF;
break;
case 6u:
result = (a1 >> 17) & 0x7FF;
break;
case 5u:
result = (a1 >> 16) & 0xFFF;
break;
default:
result = (a1 >> 19) & 0x1FF;
break;
}
}
else
{
result = 0;
}
return result;
}
//----- (00518770) --------------------------------------------------------
int __cdecl sub_518770(unsigned int a1)
{
int result; // eax@2
if ( sub_516C10(a1) == 3 )
result = (a1 >> 10) & 1;
else
result = 0;
return result;
}
char aErrorMissingLi[] = "Error! Missing line %d in %s"; // idb
//----- (00452000) --------------------------------------------------------
int __cdecl sub_452000(int a1, void *a2)
{
void *v2; // eax@1
int result; // eax@2
v2 = bsearch(
a2,
*((const void **)dword_5A9980 + 71 * a1 + 68),
*((_DWORD *)dword_5A9980 + 71 * a1 + 66),
8u,
sub_452970);
if ( v2 )
{
*(_DWORD *)a2 = *(_DWORD *)v2;
result = *((_DWORD *)v2 + 1);
*((_DWORD *)a2 + 1) = result;
}
else
{
result = sprintf(byte_5A91A4, aErrorMissingLi, *(_DWORD *)a2, (char *)dword_5A9980 + 284 * a1);
*((_DWORD *)a2 + 1) = byte_5A91A4;
}
return result;
}
//dword_5A9980 what into variable?
//char byte_5A91A4[2000]; // idb
//----- (00452970) --------------------------------------------------------
int __cdecl sub_452970(const void *a1, const void *a2)
{
int result; // eax@2
if ( *(_DWORD *)a1 >= *(_DWORD *)a2 )
result = *(_DWORD *)a1 != *(_DWORD *)a2;
else
result = -1;
return result;
}