Created
December 23, 2022 10:36
-
-
Save ahmetabdi/de269d5758a4e043e0f2c190c0c2eeff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int __cdecl sub_10003CC0(unsigned __int8 *a1, unsigned int a2, int a3) | |
{ | |
unsigned __int8 *v3; // edx | |
unsigned int v4; // esi | |
int v5; // edi | |
unsigned int v6; // ecx | |
int v7; // ebx | |
unsigned int v8; // edi | |
unsigned int v9; // ecx | |
int v10; // ebx | |
int v11; // ebx | |
int v12; // eax | |
unsigned int v13; // edi | |
unsigned int v14; // ebx | |
int v15; // ecx | |
unsigned int v16; // eax | |
unsigned int v17; // ebx | |
unsigned int v18; // ecx | |
int v19; // edi | |
unsigned int v20; // eax | |
unsigned int v21; // ecx | |
unsigned int v22; // edi | |
int v23; // ebx | |
unsigned int v24; // eax | |
unsigned int v25; // edi | |
unsigned int v26; // ebx | |
int v27; // ecx | |
unsigned int v28; // eax | |
unsigned int v29; // ecx | |
int v30; // edi | |
int v31; // eax | |
int v32; // eax | |
int v34; // ecx | |
unsigned int v35; // edi | |
int v36; // ebx | |
int v37; // eax | |
unsigned int v38; // edi | |
unsigned int v39; // ebx | |
int v40; // ecx | |
unsigned int v41; // eax | |
unsigned int v42; // ebx | |
unsigned int v43; // ecx | |
int v44; // edi | |
unsigned int v45; // eax | |
unsigned int v46; // ecx | |
unsigned int v47; // edi | |
int v48; // ebx | |
unsigned int v49; // eax | |
unsigned int v50; // edi | |
unsigned int v51; // ebx | |
int v52; // ecx | |
unsigned int v53; // eax | |
unsigned int v54; // ecx | |
int v55; // edi | |
int v56; // eax | |
int v57; // eax | |
int v58; // ecx | |
unsigned int v59; // edi | |
int v60; // ebx | |
int v61; // eax | |
unsigned int v62; // edi | |
unsigned int v63; // ebx | |
int v64; // ecx | |
unsigned int v65; // eax | |
unsigned int v66; // ebx | |
unsigned int v67; // ecx | |
int v68; // edi | |
unsigned int v69; // eax | |
unsigned int v70; // ecx | |
unsigned int v71; // edi | |
int v72; // ebx | |
unsigned int v73; // eax | |
unsigned int v74; // edi | |
unsigned int v75; // ebx | |
int v76; // ecx | |
unsigned int v77; // eax | |
unsigned int v78; // ecx | |
bool v79; // zf | |
unsigned int v80; // edi | |
unsigned int v81; // ecx | |
unsigned int v82; // ebx | |
unsigned int v83; // esi | |
unsigned int v84; // ecx | |
unsigned int v85; // [esp+Ch] [ebp-4h] | |
unsigned int v86; // [esp+Ch] [ebp-4h] | |
unsigned int v87; // [esp+Ch] [ebp-4h] | |
int v88; // [esp+Ch] [ebp-4h] | |
v3 = a1; | |
v4 = a2; | |
v5 = a2 + a3 - 559038737; | |
v6 = v5; | |
v7 = v5; | |
if ( ((unsigned __int8)a1 & 3) != 0 ) | |
{ | |
if ( ((unsigned __int8)a1 & 1) != 0 ) | |
{ | |
if ( a2 > 0xC ) | |
{ | |
v3 = a1; | |
v87 = (a2 - 13) / 0xC + 1; | |
do | |
{ | |
v58 = ((v3[5] + ((v3[6] + (v3[7] << 8)) << 8)) << 8) + v3[4] + v6; | |
v59 = ((a1[9] + ((a1[10] + (v3[11] << 8)) << 8)) << 8) + a1[8] + v5; | |
v60 = (v59 >> 28) ^ (*a1 + ((a1[1] + ((a1[2] + (a1[3] << 8)) << 8)) << 8) - v59 + v7); | |
v61 = 16 * v59; | |
v62 = v58 + v59; | |
v63 = v61 ^ v60; | |
v64 = (v63 >> 26) ^ (v58 - v63); | |
v65 = v63 << 6; | |
v66 = v62 + v63; | |
v67 = v65 ^ v64; | |
v68 = HIBYTE(v67) ^ (v62 - v67); | |
v69 = v67 << 8; | |
v70 = v66 + v67; | |
v71 = v69 ^ v68; | |
v72 = HIWORD(v71) ^ (v66 - v71); | |
v73 = v71 << 16; | |
v74 = v70 + v71; | |
v75 = v73 ^ v72; | |
v76 = (v75 << 19) ^ (v70 - v75); | |
v77 = v75 >> 13; | |
v7 = v74 + v75; | |
v78 = v77 ^ v76; | |
v5 = (16 * v78) ^ (v78 >> 28) ^ (v74 - v78); | |
v6 = v7 + v78; | |
v4 = a2 - 12; | |
v3 = a1 + 12; | |
a2 -= 12; | |
v79 = v87-- == 1; | |
a1 += 12; | |
} | |
while ( !v79 ); | |
} | |
switch ( v4 ) | |
{ | |
case 0u: | |
return v5; | |
case 1u: | |
goto LABEL_49; | |
case 2u: | |
goto LABEL_48; | |
case 3u: | |
goto LABEL_47; | |
case 4u: | |
goto LABEL_46; | |
case 5u: | |
goto LABEL_45; | |
case 6u: | |
goto LABEL_44; | |
case 7u: | |
goto LABEL_43; | |
case 8u: | |
goto LABEL_42; | |
case 9u: | |
goto LABEL_41; | |
case 0xAu: | |
goto LABEL_40; | |
case 0xBu: | |
goto LABEL_39; | |
case 0xCu: | |
v5 += v3[11] << 24; | |
LABEL_39: | |
v5 += v3[10] << 16; | |
LABEL_40: | |
v5 += v3[9] << 8; | |
LABEL_41: | |
v5 += v3[8]; | |
LABEL_42: | |
v6 += v3[7] << 24; | |
LABEL_43: | |
v6 += v3[6] << 16; | |
LABEL_44: | |
v6 += v3[5] << 8; | |
LABEL_45: | |
v6 += v3[4]; | |
LABEL_46: | |
v7 += v3[3] << 24; | |
LABEL_47: | |
v7 += v3[2] << 16; | |
LABEL_48: | |
v7 += v3[1] << 8; | |
LABEL_49: | |
v32 = *v3; | |
LABEL_50: | |
v7 += v32; | |
break; | |
default: | |
break; | |
} | |
} | |
else | |
{ | |
if ( a2 > 0xC ) | |
{ | |
v3 = a1; | |
v86 = (a2 - 13) / 0xC + 1; | |
do | |
{ | |
v34 = (*((unsigned __int16 *)v3 + 3) << 16) + *((unsigned __int16 *)v3 + 2) + v6; | |
v35 = (*((unsigned __int16 *)v3 + 5) << 16) + *((unsigned __int16 *)a1 + 4) + v5; | |
v36 = (v35 >> 28) ^ (*(unsigned __int16 *)a1 + (*((unsigned __int16 *)a1 + 1) << 16) - v35 + v7); | |
v4 = a2 - 12; | |
v37 = 16 * v35; | |
v38 = v34 + v35; | |
v39 = v37 ^ v36; | |
a2 -= 12; | |
v3 = a1 + 12; | |
v40 = (v39 >> 26) ^ (v34 - v39); | |
a1 += 12; | |
v41 = v39; | |
v42 = v38 + v39; | |
v43 = (v41 << 6) ^ v40; | |
v44 = HIBYTE(v43) ^ (v38 - v43); | |
v45 = v43 << 8; | |
v46 = v42 + v43; | |
v47 = v45 ^ v44; | |
v48 = HIWORD(v47) ^ (v42 - v47); | |
v49 = v47 << 16; | |
v50 = v46 + v47; | |
v51 = v49 ^ v48; | |
v52 = (v51 << 19) ^ (v46 - v51); | |
v53 = v51 >> 13; | |
v7 = v50 + v51; | |
v54 = v53 ^ v52; | |
v55 = (v54 >> 28) ^ (v50 - v54); | |
v56 = 16 * v54; | |
v6 = v7 + v54; | |
v5 = v56 ^ v55; | |
--v86; | |
} | |
while ( v86 ); | |
} | |
switch ( v4 ) | |
{ | |
case 0u: | |
return v5; | |
case 1u: | |
goto LABEL_49; | |
case 2u: | |
goto LABEL_33; | |
case 3u: | |
v7 += v3[2] << 16; | |
LABEL_33: | |
v32 = *(unsigned __int16 *)v3; | |
goto LABEL_50; | |
case 4u: | |
goto LABEL_30; | |
case 5u: | |
v57 = v3[4]; | |
goto LABEL_29; | |
case 6u: | |
goto LABEL_28; | |
case 7u: | |
v6 += v3[6] << 16; | |
LABEL_28: | |
v57 = *((unsigned __int16 *)v3 + 2); | |
LABEL_29: | |
v6 += v57; | |
LABEL_30: | |
v7 += (*((unsigned __int16 *)v3 + 1) << 16) + *(unsigned __int16 *)a1; | |
break; | |
case 8u: | |
goto LABEL_26; | |
case 9u: | |
v5 += v3[8]; | |
LABEL_26: | |
v6 += (*((unsigned __int16 *)v3 + 3) << 16) + *((unsigned __int16 *)a1 + 2); | |
v7 += (*((unsigned __int16 *)a1 + 1) << 16) + *(unsigned __int16 *)a1; | |
break; | |
case 0xAu: | |
goto LABEL_24; | |
case 0xBu: | |
v5 += v3[10] << 16; | |
LABEL_24: | |
v5 += *((unsigned __int16 *)v3 + 4); | |
v6 += (*((unsigned __int16 *)v3 + 3) << 16) + *((unsigned __int16 *)a1 + 2); | |
v7 += (*((unsigned __int16 *)a1 + 1) << 16) + *(unsigned __int16 *)a1; | |
break; | |
case 0xCu: | |
v5 += (*((unsigned __int16 *)v3 + 5) << 16) + *((unsigned __int16 *)a1 + 4); | |
v6 += (*((unsigned __int16 *)a1 + 3) << 16) + *((unsigned __int16 *)a1 + 2); | |
v7 += (*((unsigned __int16 *)a1 + 1) << 16) + *(unsigned __int16 *)a1; | |
break; | |
default: | |
break; | |
} | |
} | |
} | |
else | |
{ | |
if ( a2 > 0xC ) | |
{ | |
v3 = a1; | |
v85 = (a2 - 13) / 0xC + 1; | |
do | |
{ | |
v8 = *((_DWORD *)v3 + 2) + v5; | |
v4 -= 12; | |
v9 = *((_DWORD *)v3 + 1) + v6; | |
v10 = *(_DWORD *)v3 + v7 - v8; | |
v3 += 12; | |
v11 = (v8 >> 28) ^ v10; | |
v12 = 16 * v8; | |
v13 = v9 + v8; | |
v14 = v12 ^ v11; | |
v15 = (v14 >> 26) ^ (v9 - v14); | |
v16 = v14 << 6; | |
v17 = v13 + v14; | |
v18 = v16 ^ v15; | |
v19 = HIBYTE(v18) ^ (v13 - v18); | |
v20 = v18 << 8; | |
v21 = v17 + v18; | |
v22 = v20 ^ v19; | |
v23 = HIWORD(v22) ^ (v17 - v22); | |
v24 = v22 << 16; | |
v25 = v21 + v22; | |
v26 = v24 ^ v23; | |
v27 = (v26 << 19) ^ (v21 - v26); | |
v28 = v26 >> 13; | |
v7 = v25 + v26; | |
v29 = v28 ^ v27; | |
v30 = (v29 >> 28) ^ (v25 - v29); | |
v31 = 16 * v29; | |
v6 = v7 + v29; | |
v5 = v31 ^ v30; | |
--v85; | |
} | |
while ( v85 ); | |
} | |
switch ( v4 ) | |
{ | |
case 0u: | |
return v5; | |
case 1u: | |
goto LABEL_49; | |
case 2u: | |
goto LABEL_33; | |
case 3u: | |
v32 = *(_DWORD *)v3 & 0xFFFFFF; | |
goto LABEL_50; | |
case 4u: | |
goto LABEL_8; | |
case 5u: | |
v6 += v3[4]; | |
v7 += *(_DWORD *)v3; | |
break; | |
case 6u: | |
v6 += *((unsigned __int16 *)v3 + 2); | |
v7 += *(_DWORD *)v3; | |
break; | |
case 7u: | |
v6 += *((_DWORD *)v3 + 1) & 0xFFFFFF; | |
v7 += *(_DWORD *)v3; | |
break; | |
case 8u: | |
goto LABEL_7; | |
case 9u: | |
v6 += *((_DWORD *)v3 + 1); | |
v5 += v3[8]; | |
v7 += *(_DWORD *)v3; | |
break; | |
case 0xAu: | |
v6 += *((_DWORD *)v3 + 1); | |
v5 += *((unsigned __int16 *)v3 + 4); | |
v7 += *(_DWORD *)v3; | |
break; | |
case 0xBu: | |
v6 += *((_DWORD *)v3 + 1); | |
v5 += *((_DWORD *)v3 + 2) & 0xFFFFFF; | |
v7 += *(_DWORD *)v3; | |
break; | |
case 0xCu: | |
v5 += *((_DWORD *)v3 + 2); | |
LABEL_7: | |
v6 += *((_DWORD *)v3 + 1); | |
LABEL_8: | |
v7 += *(_DWORD *)v3; | |
break; | |
default: | |
break; | |
} | |
} | |
v88 = (v6 ^ v5) - ((v6 << 14) ^ (v6 >> 18)); | |
v80 = (v7 ^ v88) - ((v88 << 11) ^ ((unsigned __int64)(unsigned int)v88 >> 21)); | |
v81 = (v80 ^ v6) - ((v80 >> 7) ^ (v80 << 25)); | |
v82 = (v81 ^ v88) - ((v81 << 16) ^ HIWORD(v81)); | |
v83 = (v80 ^ v82) - ((16 * v82) ^ (v82 >> 28)); | |
v84 = (v83 ^ v81) - ((v83 << 14) ^ (v83 >> 18)); | |
return (v84 ^ v82) - ((v84 >> 8) ^ (v84 << 24)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment