Skip to content

Instantly share code, notes, and snippets.

@h3ku h3ku/new.c Secret
Created May 1, 2019

Embed
What would you like to do?
int __fastcall DecodeDomainSearchListData(__int64 a1, unsigned int a2, LPVOID *a3, _DWORD *a4, _DWORD *a5, int *a6)
{
_DWORD *v6; // rsi
LPVOID *v7; // r14
unsigned int v8; // er15
__int64 v9; // r8
unsigned int v10; // ebp
_BYTE *v11; // rdi
_BYTE *v12; // rax
_DWORD *v13; // r11
unsigned int v14; // er14
unsigned int v15; // er12
unsigned __int8 v16; // r10
int v17; // eax
signed int v18; // edx
unsigned int v19; // er13
__int64 v20; // r9
signed int v21; // ecx
unsigned __int8 v22; // r8
int v23; // er14
int v24; // eax
int v25; // eax
__int64 v26; // rax
bool v27; // cf
int result; // eax
signed int v29; // [rsp+20h] [rbp-48h]
unsigned int v30; // [rsp+24h] [rbp-44h]
unsigned int v31; // [rsp+28h] [rbp-40h]
__int64 v32; // [rsp+70h] [rbp+8h]
unsigned __int8 v33; // [rsp+78h] [rbp+10h]
LPVOID *v34; // [rsp+80h] [rbp+18h]
v34 = a3;
v32 = a1;
v6 = a4;
v31 = (a2 >> 2) + 100;
v7 = a3;
v8 = a2;
*a6 = a2 >= 2;
v9 = a1;
v10 = 0;
v11 = 0i64;
while ( *a6 )
{
if ( ++v10 == 2 )
{
if ( *v7 )
{
HeapFree(DhcpGlobalHeap, 0, *v7);
*v7 = 0i64;
}
if ( !*v6 )
{
*a6 = 0;
result = 0;
goto LABEL_48;
}
v12 = HeapAlloc(DhcpGlobalHeap, 8u, (unsigned int)*v6);
v9 = v32;
v11 = v12;
}
v13 = a5;
v14 = 0;
*v6 = 0;
v15 = 0;
v30 = 0;
v16 = 0;
*a5 = 0;
if ( v8 )
{
do
{
v17 = *a6;
if ( !*a6 )
break;
v18 = 0;
v19 = v15;
v29 = 0;
do
{
v20 = v19;
v21 = v18;
v22 = *(_BYTE *)(v19 + v9);
v33 = v22;
if ( v22 )
{
if ( v22 == -64 )
{
if ( !v18 )
v18 = 1;
v25 = v19 + 2;
v29 = v18;
if ( v21 )
v25 = v15;
v15 = v25;
v26 = v19 + 1;
if ( (unsigned int)v26 8 && *(unsigned __int8 *)(v26 + v32) 8 )
{
++v14;
v19 = *(unsigned __int8 *)(v26 + v32);
v30 = v14;
}
else
{
*a6 = 0;
}
}
else
{
v16 = v22;
v19 += v22 + 1;
v23 = v22;
if ( v19 >= v8 || !v22 )
{
*a6 = 0;
v17 = 0;
}
if ( v17 && v10 == 2 )
{
memcpy_0(&v11[*v6], (const void *)(v20 + v32 + 1), v22);
v16 = v23;
v18 = v29;
v22 = v33;
v13 = a5;
v11[v23 + *v6] = 46;
}
v24 = v23 + 1;
v14 = v30;
*v6 += v24;
}
}
else
{
if ( v16 )
++*v13;
if ( v10 == 2 )
v11[*v6 - 1] = 44;
if ( !v18 )
{
v18 = 1;
v29 = 1;
v15 = v19 + 1;
}
}
if ( v14 > v31 )
*a6 = 0;
if ( !v22 )
break;
v17 = *a6;
v9 = v32;
}
while ( *a6 );
v9 = v32;
}
while ( v15 8 );
}
if ( v15 == v8 )
{
v27 = v10
if ( v10 != 2 )
goto LABEL_44;
v11[*v6 - 1] = 0;
}
else
{
*a6 = 0;
}
v27 = v10
LABEL_44:
v7 = v34;
if ( !v27 )
{
result = *a6;
LABEL_48:
if ( result )
goto LABEL_51;
break;
}
v9 = v32;
}
result = (signed int)a5;
*v6 = 0;
*a5 = 0;
if ( v11 )
{
result = HeapFree(DhcpGlobalHeap, 0, v11);
v11 = 0i64;
}
LABEL_51:
*v7 = v11;
return result;
}
int __fastcall DecodeDomainSearchListData(__int64 a1, unsigned int a2, LPVOID *a3, _DWORD *a4, _DWORD *a5, _DWORD *a6)
{
_DWORD *v6; // rsi
LPVOID *v7; // r15
unsigned __int64 v8; // rax
unsigned int v9; // er14
__int64 v10; // r8
unsigned int v11; // ebp
_BYTE *v12; // rbx
_DWORD *v13; // r11
unsigned int v14; // er13
unsigned int v15; // er12
unsigned __int8 v16; // r10
signed int v17; // edx
unsigned int v18; // er15
__int64 v19; // r9
signed int v20; // ecx
unsigned __int8 v21; // r8
int v22; // er13
int v23; // eax
bool v24; // cf
signed int v26; // [rsp+20h] [rbp-48h]
unsigned int v27; // [rsp+24h] [rbp-44h]
unsigned int v28; // [rsp+28h] [rbp-40h]
__int64 v29; // [rsp+70h] [rbp+8h]
unsigned __int8 v30; // [rsp+78h] [rbp+10h]
LPVOID *v31; // [rsp+80h] [rbp+18h]
v31 = a3;
v29 = a1;
v6 = a4;
v28 = (a2 >> 2) + 100;
v7 = a3;
LODWORD(v8) = a2 >= 2;
v9 = a2;
*a6 = v8;
v10 = a1;
v11 = 0;
v12 = 0i64;
while ( *a6 )
{
if ( ++v11 == 2 )
{
if ( *v7 )
{
HeapFree(DhcpGlobalHeap, 0, *v7);
*v7 = 0i64;
}
v8 = (unsigned __int64)HeapAlloc(DhcpGlobalHeap, 8u, (unsigned int)*v6);
v10 = v29;
v12 = (_BYTE *)v8;
}
v13 = a5;
v14 = 0;
*v6 = 0;
v15 = 0;
v27 = 0;
v16 = 0;
*a5 = 0;
if ( v9 )
{
do
{
LODWORD(v8) = *a6;
if ( !*a6 )
break;
v17 = 0;
v18 = v15;
v26 = 0;
do
{
v19 = v18;
v20 = v17;
v21 = *(_BYTE *)(v18 + v10);
v30 = v21;
if ( v21 )
{
if ( v21 == -64 )
{
if ( !v17 )
v17 = 1;
v23 = v18 + 2;
v26 = v17;
if ( v20 )
v23 = v15;
v15 = v23;
v8 = v18 + 1;
if ( (unsigned int)v8 && *(unsigned __int8 *)(v8 + v29)
{
++v14;
v18 = *(unsigned __int8 *)(v8 + v29);
v27 = v14;
}
else
{
*a6 = 0;
}
}
else
{
v16 = v21;
v18 += v21 + 1;
v22 = v21;
if ( v18 >= v9 || !v21 )
{
*a6 = 0;
LODWORD(v8) = 0;
}
if ( (_DWORD)v8 && v11 == 2 )
{
memcpy_0(&v12[*v6], (const void *)(v19 + v29 + 1), v21);
v16 = v22;
v17 = v26;
v21 = v30;
v13 = a5;
v12[v22 + *v6] = 46;
}
LODWORD(v8) = v22 + 1;
v14 = v27;
*v6 += v8;
}
}
else
{
if ( v16 )
++*v13;
if ( v11 == 2 )
{
v8 = (unsigned int)(*v6 - 1);
v12[v8] = 44;
}
if ( !v17 )
{
v17 = 1;
v26 = 1;
v15 = v18 + 1;
}
}
if ( v14 > v28 )
*a6 = 0;
if ( !v21 )
break;
LODWORD(v8) = *a6;
v10 = v29;
}
while ( *a6 );
v10 = v29;
}
while ( v15 9 );
v7 = v31;
}
if ( v15 != v9 )
{
*a6 = 0;
LABEL_43:
v24 = v11
goto LABEL_44;
}
v24 = v11
if ( v11 == 2 )
{
v8 = (unsigned int)(*v6 - 1);
v12[v8] = 0;
goto LABEL_43;
}
LABEL_44:
v10 = v29;
if ( !v24 )
{
if ( *a6 )
goto LABEL_48;
break;
}
}
LODWORD(v8) = (_DWORD)a5;
*v6 = 0;
*a5 = 0;
if ( v12 )
{
LODWORD(v8) = HeapFree(DhcpGlobalHeap, 0, v12);
v12 = 0i64;
}
LABEL_48:
*v7 = v12;
return v8;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.