关于 Malloc
BUCL::Com::CCoTaskAutoString *__fastcall BUCL::Com::CCoTaskAutoString::CCoTaskAutoString(BUCL::Com::CCoTaskAutoString *this, struct IMalloc *a2)
{
BUCL::Com::CCoTaskAutoString *v2;
struct IMalloc *v3;
ULONG (__stdcall *v4)(IMalloc *);
*((_QWORD *)this + 1) = 0i64;
v2 = this;
*(_QWORD *)this = a2;
v3 = a2;
v4 = a2->lpVtbl->AddRef;
_guard_check_icall_fptr(a2->lpVtbl->AddRef);
((void (__fastcall *)(_QWORD))v4)(v3);
return v2;
}
__int64 __fastcall Windows::COM::CQueueExecutor::ICSIInstallerServices_get_IsolationAllocator(Windows::COM::CQueueExecutor *this, struct IMalloc **a2)
{
int v2;
int v3;
__int64 result;
int v5;
v2 = Windows::COM::GetIMalloc((Windows::COM *)a2, a2);
v3 = v2;
if ( v2 >= 0 )
{
result = 0i64;
}
else
{
v5 = v2;
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CVoidRaiseFrame>::ReportErrorPropagation(&v5);
result = (unsigned int)v3;
}
return result;
}
__int64 __fastcall `anonymous namespace'::ConvertOperation(__int64 a1, __m128i *a2)
{
__int64 v2;
__m128i *v3;
__int64 v4;
void *v5;
const unsigned __int16 **v6;
__int64 v7;
signed int v8;
unsigned int v9;
const unsigned __int16 **v10;
__int64 v11;
const unsigned __int16 **v12;
_DWORD *v13;
_DWORD *v14;
const unsigned __int16 **v15;
_DWORD *v16;
struct tagBLOB *v17;
_DWORD *v18;
_DWORD *v19;
_DWORD *v20;
_DWORD *v21;
_DWORD *v22;
_DWORD *v23;
struct tagBLOB *v24;
Windows::COM *v25;
const unsigned __int16 **v26;
Windows::COM *v27;
_DWORD *v28;
const unsigned __int16 **v29;
struct tagBLOB *v30;
__int64 v32;
__m128i v33;
__m128i v34;
__int64 v35;
const char *v36;
unsigned int v37;
v2 = a1;
v3 = a2;
Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame::CSimpleHResultCarryingFrame((Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame *)&v37);
v4 = 0i64;
v35 = 0i64;
v34.m128i_i64[0] = 0i64;
v34.m128i_i64[1] = 0i64;
LODWORD(v5) = Windows::COM::CoTaskMemAlloc((Windows::COM *)0x40);
v7 = (__int64)v5;
if ( v5 )
{
memset_0(v5, 0, 0x40ui64);
v34.m128i_i64[1] = v7;
v4 = v7;
v35 = v7;
}
if ( !v4 )
{
v8 = -2147024882;
v37 = -2147024882;
`anonymous namespace'::AutoComponentStorePrimitiveChange::~AutoComponentStorePrimitiveChange(&v34);
LODWORD(v35) = 387;
v34.m128i_i64[0] = (__int64)"base\\wcp\\componentstore\\com\\enumprimitivechanges.cpp";
v34.m128i_i64[1] = (__int64)"`anonymous-namespace'::ConvertOperation";
v36 = "pChange = AutoChange.Allocate()";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v37,
(Windows::ErrorHandling::COM *)&v34);
return (unsigned int)v8;
}
if ( *(_DWORD *)v2 != 1 )
{
switch ( *(_DWORD *)v2 )
{
case 2:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 24i64),
(const struct _UNICODE_STRING *)(v4 + 16),
v12);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v13 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 4;
*(_DWORD *)v4 = *v13;
goto LABEL_68;
}
}
break;
case 3:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v14 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 1;
*(_DWORD *)v4 = *v14;
goto LABEL_68;
}
break;
case 4:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 24i64),
(const struct _UNICODE_STRING *)(v4 + 16),
v15);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v16 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 3;
*(_DWORD *)v4 = *v16;
goto LABEL_68;
}
}
break;
case 5:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 24i64),
(const struct _LBLOB *)(v4 + 16),
v17);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v18 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 7;
*(_DWORD *)v4 = *v18;
*(_QWORD *)(v4 + 32) = *(_QWORD *)(v2 + 8) + 48i64);
goto LABEL_68;
}
}
break;
case 6:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = `anonymous namespace'::CopySecurityDescriptor(
*(void **)(v2 + 8) + 24i64),
(_QWORD *)(v4 + 16));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v19 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 8;
*(_DWORD *)v4 = *v19;
*(_DWORD *)(v4 + 24) = *(_DWORD *)(v2 + 8) + 4i64);
goto LABEL_68;
}
}
break;
case 7:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = `anonymous namespace'::CopySecurityDescriptor(
*(void **)(v2 + 8) + 24i64),
(_QWORD *)(v4 + 16));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v20 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 5;
*(_DWORD *)v4 = *v20;
*(_DWORD *)(v4 + 24) = *(_DWORD *)(v2 + 8) + 4i64);
goto LABEL_68;
}
}
break;
case 8:
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 16i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = `anonymous namespace'::CopySecurityDescriptor(
*(void **)(v2 + 8) + 8i64),
(_QWORD *)(v4 + 16));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v21 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 6;
*(_DWORD *)v4 = *v21;
*(_QWORD *)(v4 + 32) = *(_QWORD *)(v2 + 8) + 32i64);
*(_QWORD *)(v4 + 40) = *(_QWORD *)(v2 + 8) + 40i64);
*(_QWORD *)(v4 + 48) = *(_QWORD *)(v2 + 8) + 48i64);
*(_QWORD *)(v4 + 56) = *(_QWORD *)(v2 + 8) + 56i64);
*(_DWORD *)(v4 + 24) = *(_DWORD *)(v2 + 8) + 4i64);
goto LABEL_68;
}
}
break;
case 9:
v9 = `anonymous namespace'::ConvertNtKeyPathToWin32KeyPath(
*(_QWORD *)(v2 + 8) + 8i64,
(const struct _LUNICODE_STRING *)(v4 + 16),
(_QWORD *)(v4 + 8));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = `anonymous namespace'::CopySecurityDescriptor(
*(void **)(v2 + 8) + 24i64),
(_QWORD *)(v4 + 32));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v22 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 20;
*(_DWORD *)v4 = *v22;
*(_QWORD *)(v4 + 24) = 0i64;
goto LABEL_68;
}
}
break;
case 0xA:
v9 = `anonymous namespace'::ConvertNtKeyPathToWin32KeyPath(
*(_QWORD *)(v2 + 8) + 8i64,
(const struct _LUNICODE_STRING *)(v4 + 16),
(_QWORD *)(v4 + 8));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v23 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 21;
*(_DWORD *)v4 = *v23;
goto LABEL_68;
}
break;
case 0xB:
v9 = `anonymous namespace'::ConvertNtKeyPathToWin32KeyPath(
*(_QWORD *)(v2 + 8) + 8i64,
(const struct _LUNICODE_STRING *)(v4 + 16),
(_QWORD *)(v4 + 8));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v25 = (Windows::COM *)(v2 + 8) + 24i64);
if ( !*(_WORD *)v25
|| (v9 = Windows::COM::CopyOut(
v25,
(const struct _UNICODE_STRING *)(v4 + 24),
(const unsigned __int16 **)v24),
v8 = v9,
(v9 & 0x80000000) == 0) )
{
*(_DWORD *)v4 = **(_DWORD **)(v2 + 8);
*(_DWORD *)(v4 + 32) = *(_DWORD *)(v2 + 8) + 40i64);
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 48i64),
(const struct _LBLOB *)(v4 + 40),
v24);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v34.m128i_i32[0] = 24;
goto LABEL_68;
}
}
}
break;
case 0xC:
v9 = `anonymous namespace'::ConvertNtKeyPathToWin32KeyPath(
*(_QWORD *)(v2 + 8) + 8i64,
(const struct _LUNICODE_STRING *)(v4 + 16),
(_QWORD *)(v4 + 8));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v27 = (Windows::COM *)(v2 + 8) + 24i64);
if ( !*(_WORD *)v27
|| (v9 = Windows::COM::CopyOut(v27, (const struct _UNICODE_STRING *)(v4 + 24), v26),
v8 = v9,
(v9 & 0x80000000) == 0) )
{
v28 = *(_DWORD **)(v2 + 8);
v34.m128i_i32[0] = 25;
*(_DWORD *)v4 = *v28;
goto LABEL_68;
}
}
break;
case 0xD:
*(_DWORD *)v4 = **(_DWORD **)(v2 + 8);
v9 = `anonymous namespace'::ConvertNtKeyPathToWin32KeyPath(
*(_QWORD *)(v2 + 8) + 8i64,
(const struct _LUNICODE_STRING *)(v4 + 16),
(_QWORD *)(v4 + 8));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = `anonymous namespace'::CopySecurityDescriptor(
*(void **)(v2 + 8) + 24i64),
(_QWORD *)(v4 + 32));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v34.m128i_i32[0] = 22;
goto LABEL_68;
}
}
break;
default:
if ( *(_DWORD *)v2 != 17 )
{
Windows::ErrorHandling::CBaseFrame::BreakIn();
JUMPOUT&byte_18005D0F2);
}
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 8i64),
(const struct _UNICODE_STRING *)(v4 + 8),
v6);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 24i64),
(const struct _UNICODE_STRING *)(v4 + 16),
v29);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = `anonymous namespace'::CopySecurityDescriptor(
*(void **)(v2 + 8) + 40i64),
(_QWORD *)(v4 + 24));
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 48i64),
(const struct _LBLOB *)(v4 + 40),
v30);
v8 = v9;
if ( (v9 & 0x80000000) == 0 )
{
v32 = *(_QWORD *)(v2 + 8);
v34.m128i_i32[0] = 26;
*(_DWORD *)(v4 + 32) = *(_DWORD *)(v32 + 4);
*(_DWORD *)v4 = **(_DWORD **)(v2 + 8);
*(_DWORD *)(v4 + 56) = *(_DWORD *)(v2 + 8) + 72i64);
*(_DWORD *)(v4 + 60) = *(_DWORD *)(v2 + 8) + 76i64);
goto LABEL_68;
}
}
}
}
break;
}
LABEL_64:
v37 = v9;
`anonymous namespace'::AutoComponentStorePrimitiveChange::~AutoComponentStorePrimitiveChange(&v34);
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CVoidRaiseFrame>::ReportErrorPropagation(&v37);
return (unsigned int)v8;
}
v9 = Windows::COM::CopyOut((Windows::COM *)(v2 + 8) + 8i64), (const struct _UNICODE_STRING *)(v4 + 8), v6);
v8 = v9;
if ( (v9 & 0x80000000) != 0 )
goto LABEL_64;
v9 = Windows::COM::CopyOut(
(Windows::COM *)(v2 + 8) + 24i64),
(const struct _UNICODE_STRING *)(v4 + 16),
v10);
v8 = v9;
if ( (v9 & 0x80000000) != 0 )
goto LABEL_64;
v9 = `anonymous namespace'::CopySecurityDescriptor(v2 + 8) + 40i64), (_QWORD *)(v4 + 24));
v8 = v9;
if ( (v9 & 0x80000000) != 0 )
goto LABEL_64;
v11 = *(_QWORD *)(v2 + 8);
v34.m128i_i32[0] = 2;
*(_DWORD *)(v4 + 32) = *(_DWORD *)(v11 + 4);
*(_DWORD *)v4 = **(_DWORD **)(v2 + 8);
LABEL_68:
v33 = v34;
v35 = 0i64;
v34.m128i_i64[0] = 0i64;
_mm_storeu_si128(v3, v33);
v34.m128i_i64[1] = 0i64;
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetCanonicalSuccess(&v37);
`anonymous namespace'::AutoComponentStorePrimitiveChange::~AutoComponentStorePrimitiveChange(&v34);
return v37;
}
__int64 __fastcall `anonymous namespace'::CopySecurityDescriptor(void *Src, _QWORD *a2)
{
signed int v2;
_QWORD *v3;
void *v4;
void *v5;
ULONG v6;
size_t v7;
void *v8;
const char *v10;
const char *v11;
int v12;
const char *v13;
int v14;
v2 = 0;
v3 = a2;
v4 = Src;
v5 = 0i64;
if ( !Src )
goto LABEL_5;
v6 = RtlLengthSecurityDescriptor(Src);
v7 = v6;
LODWORD(v8) = Windows::COM::CoTaskMemAlloc((Windows::COM *)v6);
v5 = v8;
if ( v8 )
{
memcpy_0(v8, v4, v7);
LABEL_5:
*v3 = v5;
return (unsigned int)v2;
}
v2 = -2147024882;
v14 = -2147024882;
v12 = 328;
v10 = "base\\wcp\\componentstore\\com\\enumprimitivechanges.cpp";
v11 = "`anonymous-namespace'::CopySecurityDescriptor";
v13 = "TmpOut.Allocate(cbSid)";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v14,
(Windows::ErrorHandling::COM *)&v10);
return (unsigned int)v2;
}
__int64 __fastcall Windows::WCP::COM::LocalTransformerServices::GetIsolationAllocator(Windows::WCP::COM::LocalTransformerServices *this, struct IMalloc **a2)
{
int v2;
int v3;
const char *v5;
const char *v6;
int v7;
const char *v8;
int v9;
v9 = -2147023537;
if ( a2 )
{
*a2 = 0i64;
v2 = Windows::COM::CQueueExecutor::ICSIInstallerServices_get_IsolationAllocator(this, a2);
v3 = v2;
if ( v2 >= 0 )
return 0i64;
v9 = v2;
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CVoidRaiseFrame>::ReportErrorPropagation(&v9);
}
else
{
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetInvalidParameter_NullPointer(&v9);
v7 = 429;
v5 = "base\\wcp\\componentstore\\com\\pluginservices.cpp";
v6 = "Windows::WCP::COM::LocalTransformerServices::GetIsolationAllocator";
v8 = "Not-null check failed: ppAllocator";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v9,
(Windows::ErrorHandling::COM *)&v5);
v3 = v9;
}
return (unsigned int)v3;
}
__int64 __fastcall Windows::WCP::COM::LocalInstallerServices::get_IsolationAllocator(Windows::WCP::COM::LocalInstallerServices *this, struct IMalloc **a2)
{
int v2;
int v3;
const char *v5;
const char *v6;
int v7;
const char *v8;
int v9;
v9 = -2147023537;
if ( !a2 )
{
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetInvalidParameter_NullPointer(&v9);
v7 = 285;
v5 = "base\\wcp\\componentstore\\com\\pluginservices.cpp";
v6 = "Windows::WCP::COM::LocalInstallerServices::get_IsolationAllocator";
v8 = "Not-null check failed: ppAllocator";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v9,
(Windows::ErrorHandling::COM *)&v5);
return (unsigned int)v9;
}
*a2 = 0i64;
v3 = Windows::COM::CQueueExecutor::ICSIInstallerServices_get_IsolationAllocator(this, a2);
v2 = v3;
if ( v3 < 0 )
{
v9 = v3;
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CVoidRaiseFrame>::ReportErrorPropagation(&v9);
return (unsigned int)v2;
}
return 0i64;
}
int __fastcall Windows::COM::CoTaskMemAlloc(Windows::COM *this)
{
Windows::COM *v1;
int result;
__int64 v3;
int (__fastcall *v4)(__int64, Windows::COM *);
v1 = this;
if ( (unsigned __int64)this <= 0xFFFFFFFF )
{
v3 = `anonymous namespace'::g_pIMalloc;
v4 = *(int (__fastcall **)(__int64, Windows::COM *))`anonymous namespace'::g_pIMalloc + 24i64);
_guard_check_icall_fptr`anonymous namespace'::g_pIMalloc + 24i64));
result = v4(v3, v1);
}
else
{
result = 0;
}
return result;
}
void __fastcall Windows::COM::CoTaskMemFree(Windows::COM *this, const void *a2)
{
__int64 v2;
Windows::COM *v3;
void (__fastcall *v4)(__int64, Windows::COM *);
v2 = `anonymous namespace'::g_pIMalloc;
v3 = this;
v4 = *(void (__fastcall **)(__int64, Windows::COM *))`anonymous namespace'::g_pIMalloc + 40i64);
_guard_check_icall_fptr`anonymous namespace'::g_pIMalloc + 40i64));
v4(v2, v3);
}
__int64 __fastcall Windows::COM::GetIMalloc(Windows::COM *this, struct IMalloc **a2)
{
int v2;
Windows::COM *v3;
__int64 v4;
void (__fastcall *v5)(__int64);
const char *v7;
const char *v8;
int v9;
const char *v10;
int v11;
v2 = 0;
v11 = -2147023537;
v3 = this;
if ( this )
{
*(_QWORD *)this = 0i64;
v4 = `anonymous namespace'::g_pIMalloc;
if ( `anonymous namespace'::g_pIMalloc )
{
v5 = *(void (__fastcall **)(__int64))`anonymous namespace'::g_pIMalloc + 8i64);
_guard_check_icall_fptr`anonymous namespace'::g_pIMalloc + 8i64));
v5(v4);
*(_QWORD *)v3 = v4;
}
}
else
{
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetInvalidParameter_NullPointer(&v11);
v9 = 1495;
v7 = "base\\wcp\\dll\\offline.cpp";
v8 = "Windows::COM::GetIMalloc";
v10 = "Not-null check failed: ppIMalloc";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v11,
(Windows::ErrorHandling::COM *)&v7);
v2 = v11;
}
return (unsigned int)v2;
}
__int64 __fastcall SetIsolationIMalloc(__int64 a1)
{
void (__fastcall *v2)(__int64);
void (__fastcall *v4)(__int64);
_RDI = a1;
if ( a1 )
{
v2 = *(void (__fastcall **)(__int64))a1 + 8i64);
_guard_check_icall_fptra1 + 8i64));
v2(_RDI);
}
__asm { xchg rdi, cs:?g_pIMalloc@?A0xc4ad6e56@@3PEAUIMalloc@@EA; IMalloc * `anonymous namespace'::g_pIMalloc }
if ( _RDI )
{
v4 = *(void (__fastcall **)(__int64))_RDI + 16i64);
_guard_check_icall_fptr_RDI + 16i64));
v4(_RDI);
}
return 0i64;
}
__int64 __fastcall Windows::COM::CopyOut(Windows::COM *this, const struct _LBLOB *a2, struct tagBLOB *a3)
{
const struct _LBLOB *v3;
Windows::COM *v4;
signed int v5;
Windows::COM *v6;
void *v7;
const char *v9;
const char *v10;
int v11;
const char *v12;
unsigned int v13;
*(_DWORD *)a2 = 0;
v3 = a2;
*((_QWORD *)a2 + 1) = 0i64;
v4 = this;
v13 = -2147023537;
if ( !RtlIsLBlobValid((__int64)this) )
__debugbreak();
if ( *(_QWORD *)v4 > 0xFFFFFFFFui64 )
{
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetInvalidParameter(&v13);
v11 = 146;
v9 = "base\\wcp\\com\\copyout_string.cpp";
v10 = "Windows::COM::CopyOut";
v12 = "InputBlob->Length <= 0xffffffffUL";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v13,
(Windows::ErrorHandling::COM *)&v9);
return v13;
}
v6 = (Windows::COM *)*(_DWORD *)v4;
LODWORD(v7) = Windows::COM::CoTaskMemAlloc(v6);
*((_QWORD *)v3 + 1) = v7;
if ( !v7 )
{
v5 = -2147024882;
v13 = -2147024882;
v11 = 150;
v9 = "base\\wcp\\com\\copyout_string.cpp";
v10 = "Windows::COM::CopyOut";
v12 = "OutputBlob->pBlobData = reinterpret_cast<PBYTE>(Windows::COM::CoTaskMemAlloc(ulAdjustedLength))";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v13,
(Windows::ErrorHandling::COM *)&v9);
return (unsigned int)v5;
}
*(_DWORD *)v3 = (_DWORD)v6;
memcpy_0(v7, *((const void **)v4 + 2), (size_t)v6);
return 0i64;
}
__int64 __fastcall Windows::COM::CopyOut(Windows::COM *this, const struct _LUNICODE_STRING *a2, unsigned __int16 **a3)
{
const char *v3;
const struct _LUNICODE_STRING *v4;
Windows::COM *v5;
unsigned __int64 v6;
signed int v7;
signed int v8;
int v9;
unsigned int v10;
char *v11;
char *v12;
const char *v14;
const char *v15;
int v16;
const char *v17;
int v18;
v3 = 0i64;
v18 = -2147023537;
v4 = a2;
v5 = this;
if ( !a2 )
{
v7 = 24;
v3 = "Not-null check failed: StringOut";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetInvalidParameter_NullPointer(&v18);
v9 = v18;
goto LABEL_18;
}
*(_QWORD *)a2 = 0i64;
if ( !this )
return 0i64;
v6 = *(_QWORD *)this;
if ( !*(_QWORD *)this )
return 0i64;
if ( v6 & 1 )
__debugbreak();
if ( v6 <= 0xFFFFFFFD )
{
v10 = 0;
if ( (unsigned int)(v6 >> 1) )
{
while ( *(_WORD *)v5 + 2) + 2i64 * v10) )
{
if ( ++v10 >= (unsigned int)(v6 >> 1) )
goto LABEL_12;
}
v7 = 39;
v3 = "StringIn->Buffer[i] != L'\\0'";
v8 = -1073741471;
goto LABEL_8;
}
LABEL_12:
LODWORD(v11) = Windows::COM::CoTaskMemAlloc((Windows::COM *)((unsigned int)v6 + 2i64));
v12 = v11;
if ( !v11 )
{
v9 = -2147024882;
v7 = 43;
v18 = -2147024882;
v3 = "pszTemp = reinterpret_cast<PWSTR>(Windows::COM::CoTaskMemAlloc(static_cast<ULONG>(cb) + sizeof(WCHAR)))";
goto LABEL_18;
}
memcpy_0(v11, *((const void **)v5 + 2), v6);
*(_WORD *)&v12[v6] = 0;
*(_QWORD *)v4 = v12;
return 0i64;
}
v7 = 34;
v8 = -1073740757;
LABEL_8:
v9 = ConvertNtStatusToHResult(v8);
v18 = v9;
LABEL_18:
v16 = v7;
v14 = "base\\wcp\\com\\copyout_string.cpp";
v17 = v3;
v15 = "Windows::COM::CopyOut";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v18,
(Windows::ErrorHandling::COM *)&v14);
return (unsigned int)v9;
}
__int64 __fastcall Windows::AutoIMallocPtr<unsigned short>::AutoIMallocPtr<unsigned short>(__int64 a1, __int64 a2)
{
__int64 v2;
__int64 v3;
void (__fastcall *v4)(__int64);
__int64 result;
v2 = a1;
v3 = a2;
v4 = *(void (__fastcall **)(__int64))a2 + 8i64);
_guard_check_icall_fptra2 + 8i64));
v4(v3);
*(_QWORD *)v2 = 0i64;
result = v2;
*(_QWORD *)(v2 + 8) = v3;
return result;
}
int __fastcall Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(_QWORD *a1)
{
__int64 v1;
_QWORD *v2;
int (__fastcall *v3)(__int64);
int result;
v1 = *a1;
v2 = a1;
if ( *a1 )
{
v3 = *(int (__fastcall **)(__int64))v1 + 16i64);
_guard_check_icall_fptrv1 + 16i64));
result = v3(v1);
*v2 = 0i64;
}
return result;
}
int __fastcall Windows::AutoIMallocPtr<unsigned short>::~AutoIMallocPtr<unsigned short>(__int64 a1)
{
__int64 v1;
__int64 v2;
__int64 v3;
int (__fastcall *v4)(__int64, __int64);
int result;
__int64 v6;
int (__fastcall *v7)(__int64);
v1 = *(_QWORD *)a1;
v2 = a1;
if ( *(_QWORD *)a1 )
{
v3 = *(_QWORD *)(a1 + 8);
v4 = *(int (__fastcall **)(__int64, __int64))v3 + 40i64);
_guard_check_icall_fptrv3 + 40i64));
result = v4(v3, v1);
*(_QWORD *)v2 = 0i64;
}
v6 = *(_QWORD *)(v2 + 8);
if ( v6 )
{
v7 = *(int (__fastcall **)(__int64))v6 + 16i64);
_guard_check_icall_fptrv6 + 16i64));
result = v7(v6);
*(_QWORD *)(v2 + 8) = 0i64;
}
return result;
}
__int64 __fastcall GetExpandedPathParameter(int a1, __int64 *a2, __int64 a3, void *a4)
{
__int64 v4;
void *v5;
__int64 *v6;
int v7;
void *v8;
int v9;
int *v10;
int v11;
__int64 v12;
_QWORD *v13;
signed int v14;
__int64 v15;
_QWORD *v16;
signed int v17;
int v18;
__int64 v19;
__int64 v20;
_QWORD *v21;
signed int v22;
int (__fastcall *v23)(__int64 *, __int64 *, __int64);
__int64 v24;
__int64 v25;
void (__fastcall *v26)(__int64, __int64);
__int64 v27;
__int64 v28;
void (__fastcall *v29)(__int64, __int64);
__int64 v31;
__int64 v32;
void (__fastcall *v33)(__int64, __int64);
__int64 v34;
__int64 v35;
void (__fastcall *v36)(__int64, __int64);
int (__fastcall *v37)(__int64 *, __int64 *, __int64);
__int64 v38;
int v39;
int *v40;
unsigned int v41;
__int64 v42;
__int64 v43;
__int64 v44;
__int64 v45;
__int64 v46;
int v47;
__int64 vars30;
int *retaddr;
int v50;
v4 = vars30;
v5 = a4;
v6 = a2;
v44 = a3;
v7 = a1;
v41 = -1073741595;
if ( vars30 )
{
Windows::AutoPODBase<_LUNICODE_STRING,Windows::Auto<_LUNICODE_STRING>>::Close(vars30);
v5 = v8;
a3 = v44;
}
if ( retaddr )
*retaddr = 0;
if ( v7 & 0xFFFFFFFC )
{
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CVoidRaiseFrame>::SetInvalidParameter(&v41);
v39 = 112;
v40 = (int *)"Valid flags check failed: Flags";
LABEL_12:
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CVoidRaiseFrame>::ReportErrorOrigination(
&v41,
(__int64)&v38);
return v41;
}
if ( !v6 || !a3 || !v5 || !v4 )
{
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CVoidRaiseFrame>::SetInvalidParameter(&v41);
v39 = v9;
v40 = v10;
goto LABEL_12;
}
v12 = *v6;
v46 = 0i64;
v13 = Windows::AutoGenericHandle<ICSISmartInstaller *,0,&void Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(ICSISmartInstaller *)>::GetInitPointer(&v46);
_guard_check_icall_fptr(v12 + 24));
v14 = (__int64 *, _QWORD *))(v12 + 24))(v6, v13);
if ( v14 < 0 )
{
v11 = ConvertHResultToNtStatus(v14);
LABEL_28:
if ( v46 )
Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(v46);
return (unsigned int)v11;
}
v47 = 0;
Windows::AutoIMallocPtr<unsigned short>::AutoIMallocPtr<unsigned short>((__int64)&v42, v46);
v15 = *v6;
v16 = Windows::AutoGenericHandle<ICSISmartInstaller *,0,&void Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(ICSISmartInstaller *)>::GetInitPointer(&v42);
_guard_check_icall_fptr(v15 + 64));
v40 = &v47;
v17 = (__int64 *, _QWORD, __int64, _QWORD *))(v15 + 64))(v6, v7 & 1, v44, v16);
if ( v17 < 0 )
{
v11 = ConvertHResultToNtStatus(v17);
LABEL_25:
v27 = v42;
if ( v42 )
{
v28 = v43;
v29 = *(void (__fastcall **)(__int64, __int64))v43 + 40i64);
_guard_check_icall_fptrv43 + 40i64));
v29(v28, v27);
v42 = 0i64;
}
Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(&v43);
goto LABEL_28;
}
v18 = v47;
if ( !(v47 & 1) )
{
Windows::AutoIMallocPtr<unsigned short>::AutoIMallocPtr<unsigned short>((__int64)&v44, v46);
v19 = v42;
v20 = *v6;
v21 = Windows::AutoGenericHandle<ICSISmartInstaller *,0,&void Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(ICSISmartInstaller *)>::GetInitPointer(&v44);
_guard_check_icall_fptr(v20 + 72));
LODWORD(v40) = v50;
v22 = (__int64 *, _QWORD, __int64, _QWORD *))(v20 + 72))(
v6,
((unsigned int)(unsigned __int8)v7 >> 1) & 1,
v19,
v21);
if ( v22 < 0 )
{
v11 = ConvertHResultToNtStatus(v22);
LABEL_22:
v24 = v44;
if ( v44 )
{
v25 = v45;
v26 = *(void (__fastcall **)(__int64, __int64))v45 + 40i64);
_guard_check_icall_fptrv45 + 40i64));
v26(v25, v24);
v44 = 0i64;
}
Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(&v45);
goto LABEL_25;
}
v11 = RtlInitLUnicodeStringFromNullTerminatedString(v44, (__int64)&v38);
if ( v11 < 0 )
goto LABEL_22;
v23 = v37;
_guard_check_icall_fptr(v37);
v11 = v23(v6, &v38, v4);
if ( v11 < 0 )
goto LABEL_22;
v31 = v44;
if ( v44 )
{
v32 = v45;
v33 = *(void (__fastcall **)(__int64, __int64))v45 + 40i64);
_guard_check_icall_fptrv45 + 40i64));
v33(v32, v31);
v44 = 0i64;
}
Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(&v45);
v18 = v47;
}
if ( retaddr )
*retaddr = v18;
v34 = v42;
if ( v42 )
{
v35 = v43;
v36 = *(void (__fastcall **)(__int64, __int64))v43 + 40i64);
_guard_check_icall_fptrv43 + 40i64));
v36(v35, v34);
v42 = 0i64;
}
Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(&v43);
if ( v46 )
Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(v46);
return 0i64;
}
__int64 __fastcall Windows::WCP::Transformers::Rtl::GetLUnicodeParameter(unsigned int a1, __int64 *a2, __int64 a3, __int64 a4)
{
int *v4;
__int64 v5;
__int64 v6;
__int64 *v7;
unsigned int v8;
int v9;
const char *v10;
__int64 v11;
_QWORD *v12;
signed int v13;
int v14;
__int64 v15;
__int64 v16;
void (__fastcall *v17)(__int64, __int64);
__int64 v18;
__int64 v19;
_QWORD *v20;
signed int v21;
int v22;
int v23;
__int64 v24;
__int64 v25;
void (__fastcall *v26)(__int64, __int64);
__int64 *v28;
const char *v29;
const char *v30;
__int64 v31;
const char *v32;
int *v33;
__int64 v34;
__int64 v35;
__int64 v36;
int v37;
int *vars30;
v4 = vars30;
v5 = a4;
LODWORD(v33) = -1073741595;
v6 = a3;
v7 = a2;
v8 = a1;
if ( a4 )
Windows::AutoPODBase<_LUNICODE_STRING,Windows::Auto<_LUNICODE_STRING>>::Close(a4);
if ( vars30 )
*vars30 = 0;
if ( v8 & 0xFFFFFFFE )
{
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CVoidRaiseFrame>::SetInvalidParameter(&v33);
LODWORD(v31) = 183;
v29 = "base\\wcp\\transformers\\lib\\transformer_support.cpp";
v30 = "Windows::WCP::Transformers::Rtl::GetLUnicodeParameter";
v32 = "Valid flags check failed: Flags";
LABEL_10:
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CVoidRaiseFrame>::ReportErrorOrigination(
(unsigned int *)&v33,
(__int64)&v29);
return (unsigned int)v33;
}
if ( !v7 || !v5 )
{
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CVoidRaiseFrame>::SetInvalidParameter(&v33);
LODWORD(v31) = v9;
v29 = "base\\wcp\\transformers\\lib\\transformer_support.cpp";
v30 = "Windows::WCP::Transformers::Rtl::GetLUnicodeParameter";
v32 = v10;
goto LABEL_10;
}
v36 = 0i64;
v11 = *v7;
v12 = Windows::AutoGenericHandle<ICSISmartInstaller *,0,&void Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(ICSISmartInstaller *)>::GetInitPointer(&v36);
_guard_check_icall_fptr(v11 + 24));
v13 = (__int64 *, _QWORD *))(v11 + 24))(v7, v12);
if ( v13 < 0 )
{
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CSimpleNtStatusCarryingFrame>::SetHResult(
(signed int *)&v33,
v13);
goto LABEL_28;
}
Windows::AutoIMallocPtr<unsigned short>::AutoIMallocPtr<unsigned short>((__int64)&v34, v36);
v28 = (__int64 *)&v29;
v14 = Windows::StringUtil::Rtl::DuplicateToNullTerminatedString<_LUNICODE_STRING const,_LUNICODE_STRING>(
v6,
(__int64 *)&v28);
if ( v14 >= 0 )
{
v18 = v31;
v37 = 0;
v19 = *v7;
v20 = Windows::AutoGenericHandle<ICSISmartInstaller *,0,&void Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(ICSISmartInstaller *)>::GetInitPointer(&v34);
_guard_check_icall_fptr(v19 + 64));
v33 = &v37;
v21 = (__int64 *, _QWORD, __int64, _QWORD *))(v19 + 64))(v7, v8, v18, v20);
if ( v21 < 0 )
{
Windows::ErrorHandling::Rtl::CBaseFrame<Windows::ErrorHandling::Rtl::CSimpleNtStatusCarryingFrame>::SetHResult(
(signed int *)&v33,
v21);
goto LABEL_25;
}
v22 = v37;
if ( !(v37 & 1) )
{
v23 = Windows::StringUtil::Rtl::DuplicateString(v34, v5);
if ( v23 < 0 )
{
LODWORD(v33) = v23;
LABEL_25:
FileInstaller::CFileInstallerHierarchy::CIStackElement::~CIStackElement((FileInstaller::CFileInstallerHierarchy::CIStackElement *)&v29);
v24 = v34;
if ( v34 )
{
v25 = v35;
v26 = *(void (__fastcall **)(__int64, __int64))v35 + 40i64);
_guard_check_icall_fptrv35 + 40i64));
v26(v25, v24);
v34 = 0i64;
}
goto LABEL_27;
}
v22 = v37;
}
if ( v4 )
*v4 = v22;
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::SetCanonicalSuccess(&v33);
goto LABEL_25;
}
LODWORD(v33) = v14;
FileInstaller::CFileInstallerHierarchy::CIStackElement::~CIStackElement((FileInstaller::CFileInstallerHierarchy::CIStackElement *)&v29);
v15 = v34;
if ( v34 )
{
v16 = v35;
v17 = *(void (__fastcall **)(__int64, __int64))v35 + 40i64);
_guard_check_icall_fptrv35 + 40i64));
v17(v16, v15);
v34 = 0i64;
}
LABEL_27:
Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(&v35);
LABEL_28:
if ( v36 )
Windows::`anonymous namespace'::CloseWithRelease<ICSISmartInstaller>(v36);
return (unsigned int)v33;
}
void *__fastcall ORTlsAlloc(unsigned __int64 a1)
{
unsigned __int64 v1;
char *v2;
signed __int64 v3;
void *result;
_QWORD *v5;
v1 = a1;
v2 = (char *)TlsGetValue(TlsIndex);
v3 = (signed __int64)(v2 + 112);
if ( v1 + 16 <= v1 )
{
result = 0i64;
LABEL_8:
*((_DWORD *)v2 + 44) = 1;
return result;
}
result = malloc(v1 + 16);
if ( result )
{
v5 = (_QWORD *)*((_QWORD *)v2 + 15);
*(_QWORD *)result = v3;
*((_QWORD *)result + 1) = v5;
if ( *v5 != v3 )
__fastfail(3u);
*v5 = result;
*((_QWORD *)v2 + 15) = result;
result = (char *)result + 16;
}
if ( !result )
goto LABEL_8;
return result;
}
int __fastcall Windows::FreeAndNull<unsigned short>(__int64 *a1)
{
__int64 v1;
__int64 v2;
int (__fastcall *v3)(__int64, __int64);
int result;
v1 = *a1;
if ( *a1 )
{
*a1 = 0i64;
v2 = `anonymous namespace'::g_pIMalloc;
v3 = *(int (__fastcall **)(__int64, __int64))`anonymous namespace'::g_pIMalloc + 40i64);
_guard_check_icall_fptr`anonymous namespace'::g_pIMalloc + 40i64));
result = v3(v2, v1);
}
return result;
}
__int64 __fastcall StageAndLockParameterSet::Allocate(StageAndLockParameterSet *this, unsigned __int64 a2)
{
unsigned __int64 v2;
StageAndLockParameterSet *v3;
Windows::COM *v4;
unsigned __int64 v5;
unsigned __int64 v6;
char *v7;
char *v8;
signed int v9;
signed int v10;
const char *v11;
signed __int64 v12;
signed __int64 v13;
signed __int64 v14;
__int64 result;
const char *v16;
const char *v17;
int v18;
const char *v19;
int v20;
v2 = a2;
v3 = this;
if ( HIDWORD(a2) )
{
v5 = 171798691840i64 * (a2 >> 32);
v6 = 40i64 * (unsigned int)a2;
v4 = (Windows::COM *)(v5 + v6);
if ( v5 + v6 < v5 || (unsigned __int64)v4 < v6 )
{
v9 = 85;
v11 = "BUCL::Com::Multiply(cbNecessary, cItems, cbNecessary)";
v10 = -2147024362;
goto LABEL_9;
}
}
else
{
v4 = (Windows::COM *)(40i64 * (unsigned int)a2);
}
LODWORD(v7) = Windows::COM::CoTaskMemAlloc(v4);
*(_QWORD *)v3 = v7;
v8 = v7;
if ( v7 )
{
memset_0(v7, 0, (size_t)v4);
v12 = (signed __int64)&v8[8 * v2];
*((_QWORD *)v3 + 2) = v8;
v13 = v12 + 8 * v2;
*((_QWORD *)v3 + 3) = v12;
v14 = v13 + 8 * v2;
*((_QWORD *)v3 + 5) = v13;
*((_QWORD *)v3 + 6) = v14;
*((_QWORD *)v3 + 4) = v14 + 8 * v2;
result = 0i64;
*((_QWORD *)v3 + 1) = v2;
return result;
}
v9 = 86;
v10 = -2147024882;
v11 = "m_RawData.Allocate(cbNecessary)";
LABEL_9:
v20 = v10;
v19 = v11;
v16 = "base\\wcp\\servicingapi\\cmitransaction.cpp";
v18 = v9;
v17 = "StageAndLockParameterSet::Allocate";
Windows::ErrorHandling::COM::CBaseFrame<Windows::ErrorHandling::COM::CSimpleHResultCarryingFrame>::ReportErrorOrigination(
&v20,
(Windows::ErrorHandling::COM *)&v16);
return (unsigned int)v10;
}