关于 Malloc

179 篇文章 0 订阅
86 篇文章 0 订阅

关于 Malloc

//----- (00000001800175FC) ----------------------------------------------------
BUCL::Com::CCoTaskAutoString *__fastcall BUCL::Com::CCoTaskAutoString::CCoTaskAutoString(BUCL::Com::CCoTaskAutoString *this, struct IMalloc *a2)
{
  BUCL::Com::CCoTaskAutoString *v2; // rsi@1
  struct IMalloc *v3; // rdi@1
  ULONG (__stdcall *v4)(IMalloc *); // rbx@1

  *((_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;
}


//----- (00000001800443E4) ----------------------------------------------------
__int64 __fastcall Windows::COM::CQueueExecutor::ICSIInstallerServices_get_IsolationAllocator(Windows::COM::CQueueExecutor *this, struct IMalloc **a2)
{
  int v2; // eax@1
  int v3; // ebx@1
  __int64 result; // rax@2
  int v5; // [sp+20h] [bp-18h]@2

  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;
}


//----- (000000018005CAA4) ----------------------------------------------------
__int64 __fastcall `anonymous namespace'::ConvertOperation(__int64 a1, __m128i *a2)
{
  __int64 v2; // rsi@1
  __m128i *v3; // r14@1
  __int64 v4; // rdi@1
  void *v5; // rax@1
  const unsigned __int16 **v6; // r8@1
  __int64 v7; // rbx@1
  signed int v8; // ebx@4
  unsigned int v9; // eax@6
  const unsigned __int16 **v10; // r8@6
  __int64 v11; // rax@9
  const unsigned __int16 **v12; // r8@11
  _DWORD *v13; // rax@13
  _DWORD *v14; // rax@16
  const unsigned __int16 **v15; // r8@18
  _DWORD *v16; // rax@20
  struct tagBLOB *v17; // r8@22
  _DWORD *v18; // rax@24
  _DWORD *v19; // rax@28
  _DWORD *v20; // rax@32
  _DWORD *v21; // rax@36
  _DWORD *v22; // rax@40
  _DWORD *v23; // rax@43
  struct tagBLOB *v24; // r8@45
  Windows::COM *v25; // rcx@46
  const unsigned __int16 **v26; // r8@51
  Windows::COM *v27; // rcx@52
  _DWORD *v28; // rax@54
  const unsigned __int16 **v29; // r8@60
  struct tagBLOB *v30; // r8@62
  __int64 v32; // rax@67
  __m128i v33; // xmm0@68
  __m128i v34; // [sp+20h] [bp-30h]@1
  __int64 v35; // [sp+30h] [bp-20h]@1
  const char *v36; // [sp+38h] [bp-18h]@4
  unsigned int v37; // [sp+40h] [bp-10h]@1

  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 *)(*(_QWORD *)(v2 + 8) + 8i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = Windows::COM::CopyOut(
                 (Windows::COM *)(*(_QWORD *)(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 *)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 8i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = Windows::COM::CopyOut(
                 (Windows::COM *)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 8i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = Windows::COM::CopyOut(
                 (Windows::COM *)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 48i64);
            goto LABEL_68;
          }
        }
        break;
      case 6:
        v9 = Windows::COM::CopyOut(
               (Windows::COM *)(*(_QWORD *)(v2 + 8) + 8i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = `anonymous namespace'::CopySecurityDescriptor(
                 *(void **)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 4i64);
            goto LABEL_68;
          }
        }
        break;
      case 7:
        v9 = Windows::COM::CopyOut(
               (Windows::COM *)(*(_QWORD *)(v2 + 8) + 8i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = `anonymous namespace'::CopySecurityDescriptor(
                 *(void **)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 4i64);
            goto LABEL_68;
          }
        }
        break;
      case 8:
        v9 = Windows::COM::CopyOut(
               (Windows::COM *)(*(_QWORD *)(v2 + 8) + 16i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = `anonymous namespace'::CopySecurityDescriptor(
                 *(void **)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 32i64);
            *(_QWORD *)(v4 + 40) = *(_QWORD *)(*(_QWORD *)(v2 + 8) + 40i64);
            *(_QWORD *)(v4 + 48) = *(_QWORD *)(*(_QWORD *)(v2 + 8) + 48i64);
            *(_QWORD *)(v4 + 56) = *(_QWORD *)(*(_QWORD *)(v2 + 8) + 56i64);
            *(_DWORD *)(v4 + 24) = *(_DWORD *)(*(_QWORD *)(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 **)(*(_QWORD *)(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 *)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 40i64);
            v9 = Windows::COM::CopyOut(
                   (Windows::COM *)(*(_QWORD *)(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 *)(*(_QWORD *)(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 **)(*(_QWORD *)(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(*(_QWORD *)&byte_18005D0F2);
        }
        v9 = Windows::COM::CopyOut(
               (Windows::COM *)(*(_QWORD *)(v2 + 8) + 8i64),
               (const struct _UNICODE_STRING *)(v4 + 8),
               v6);
        v8 = v9;
        if ( (v9 & 0x80000000) == 0 )
        {
          v9 = Windows::COM::CopyOut(
                 (Windows::COM *)(*(_QWORD *)(v2 + 8) + 24i64),
                 (const struct _UNICODE_STRING *)(v4 + 16),
                 v29);
          v8 = v9;
          if ( (v9 & 0x80000000) == 0 )
          {
            v9 = `anonymous namespace'::CopySecurityDescriptor(
                   *(void **)(*(_QWORD *)(v2 + 8) + 40i64),
                   (_QWORD *)(v4 + 24));
            v8 = v9;
            if ( (v9 & 0x80000000) == 0 )
            {
              v9 = Windows::COM::CopyOut(
                     (Windows::COM *)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 72i64);
                *(_DWORD *)(v4 + 60) = *(_DWORD *)(*(_QWORD *)(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 *)(*(_QWORD *)(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 *)(*(_QWORD *)(v2 + 8) + 24i64),
         (const struct _UNICODE_STRING *)(v4 + 16),
         v10);
  v8 = v9;
  if ( (v9 & 0x80000000) != 0 )
    goto LABEL_64;
  v9 = `anonymous namespace'::CopySecurityDescriptor(*(void **)(*(_QWORD *)(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;
}
// 18005C6D4: using guessed type int __fastcall `anonymous namespace'::AutoComponentStorePrimitiveChange::~AutoComponentStorePrimitiveChange(_QWORD);
// 18005D0F2: using guessed type char;


//----- (000000018005D170) ----------------------------------------------------
__int64 __fastcall `anonymous namespace'::CopySecurityDescriptor(void *Src, _QWORD *a2)
{
  signed int v2; // edi@1
  _QWORD *v3; // r14@1
  void *v4; // rsi@1
  void *v5; // rbx@1
  ULONG v6; // eax@2
  size_t v7; // rbp@2
  void *v8; // rax@2
  const char *v10; // [sp+20h] [bp-48h]@3
  const char *v11; // [sp+28h] [bp-40h]@3
  int v12; // [sp+30h] [bp-38h]@3
  const char *v13; // [sp+38h] [bp-30h]@3
  int v14; // [sp+40h] [bp-28h]@3

  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;
}


//----- (000000018005F0B0) ----------------------------------------------------
__int64 __fastcall Windows::WCP::COM::LocalTransformerServices::GetIsolationAllocator(Windows::WCP::COM::LocalTransformerServices *this, struct IMalloc **a2)
{
  int v2; // eax@2
  int v3; // ebx@2
  const char *v5; // [sp+20h] [bp-38h]@5
  const char *v6; // [sp+28h] [bp-30h]@5
  int v7; // [sp+30h] [bp-28h]@5
  const char *v8; // [sp+38h] [bp-20h]@5
  int v9; // [sp+40h] [bp-18h]@1

  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;
}


//----- (0000000180061650) ----------------------------------------------------
__int64 __fastcall Windows::WCP::COM::LocalInstallerServices::get_IsolationAllocator(Windows::WCP::COM::LocalInstallerServices *this, struct IMalloc **a2)
{
  int v2; // ebx@2
  int v3; // eax@3
  const char *v5; // [sp+20h] [bp-38h]@2
  const char *v6; // [sp+28h] [bp-30h]@2
  int v7; // [sp+30h] [bp-28h]@2
  const char *v8; // [sp+38h] [bp-20h]@2
  int v9; // [sp+40h] [bp-18h]@1

  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;
}


//----- (00000001800B19E0) ----------------------------------------------------
int __fastcall Windows::COM::CoTaskMemAlloc(Windows::COM *this)
{
  Windows::COM *v1; // rsi@1
  int result; // eax@2
  __int64 v3; // rdi@3
  int (__fastcall *v4)(__int64, Windows::COM *); // rbx@3

  v1 = this;
  if ( (unsigned __int64)this <= 0xFFFFFFFF )
  {
    v3 = `anonymous namespace'::g_pIMalloc;
    v4 = *(int (__fastcall **)(__int64, Windows::COM *))(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 24i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 24i64));
    result = v4(v3, v1);
  }
  else
  {
    result = 0;
  }
  return result;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);
// 1802FDBA0: using guessed type __int64 `anonymous namespace'::g_pIMalloc;

//----- (00000001800B1A40) ----------------------------------------------------
void __fastcall Windows::COM::CoTaskMemFree(Windows::COM *this, const void *a2)
{
  __int64 v2; // rdi@1
  Windows::COM *v3; // rsi@1
  void (__fastcall *v4)(__int64, Windows::COM *); // rbx@1

  v2 = `anonymous namespace'::g_pIMalloc;
  v3 = this;
  v4 = *(void (__fastcall **)(__int64, Windows::COM *))(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 40i64);
  _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 40i64));
  v4(v2, v3);
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);
// 1802FDBA0: using guessed type __int64 `anonymous namespace'::g_pIMalloc;



//----- (00000001800B1F24) ----------------------------------------------------
__int64 __fastcall Windows::COM::GetIMalloc(Windows::COM *this, struct IMalloc **a2)
{
  int v2; // edi@1
  Windows::COM *v3; // r14@1
  __int64 v4; // rsi@2
  void (__fastcall *v5)(__int64); // rbx@3
  const char *v7; // [sp+20h] [bp-38h]@4
  const char *v8; // [sp+28h] [bp-30h]@4
  int v9; // [sp+30h] [bp-28h]@4
  const char *v10; // [sp+38h] [bp-20h]@4
  int v11; // [sp+40h] [bp-18h]@1

  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))(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 8i64);
      _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)`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;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);
// 1802FDBA0: using guessed type __int64 `anonymous namespace'::g_pIMalloc;


//----- (00000001800B4EA0) ----------------------------------------------------
__int64 __fastcall SetIsolationIMalloc(__int64 a1)
{
  void (__fastcall *v2)(__int64); // rbx@2
  void (__fastcall *v4)(__int64); // rbx@4

  _RDI = a1;
  if ( a1 )
  {
    v2 = *(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 8i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)a1 + 8i64));
    v2(_RDI);
  }
  __asm { xchg    rdi, cs:?g_pIMalloc@?A0xc4ad6e56@@3PEAUIMalloc@@EA; IMalloc * `anonymous namespace'::g_pIMalloc }
  if ( _RDI )
  {
    v4 = *(void (__fastcall **)(__int64))(*(_QWORD *)_RDI + 16i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)_RDI + 16i64));
    v4(_RDI);
  }
  return 0i64;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);
// 1802FDBA0: using guessed type __int64 `anonymous namespace'::g_pIMalloc;


//----- (000000018019C6E0) ----------------------------------------------------
__int64 __fastcall Windows::COM::CopyOut(Windows::COM *this, const struct _LBLOB *a2, struct tagBLOB *a3)
{
  const struct _LBLOB *v3; // rdi@1
  Windows::COM *v4; // rbx@1
  signed int v5; // ebx@4
  Windows::COM *v6; // rsi@5
  void *v7; // rax@5
  const char *v9; // [sp+20h] [bp-30h]@4
  const char *v10; // [sp+28h] [bp-28h]@4
  int v11; // [sp+30h] [bp-20h]@4
  const char *v12; // [sp+38h] [bp-18h]@4
  unsigned int v13; // [sp+40h] [bp-10h]@1

  *(_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;
}


//----- (000000018019C7FC) ----------------------------------------------------
__int64 __fastcall Windows::COM::CopyOut(Windows::COM *this, const struct _LUNICODE_STRING *a2, unsigned __int16 **a3)
{
  const char *v3; // rdi@1
  const struct _LUNICODE_STRING *v4; // r15@1
  Windows::COM *v5; // rsi@1
  unsigned __int64 v6; // rbx@3
  signed int v7; // esi@7
  signed int v8; // ecx@7
  int v9; // ebx@8
  unsigned int v10; // ecx@9
  char *v11; // rax@12
  char *v12; // r14@12
  const char *v14; // [sp+20h] [bp-30h]@18
  const char *v15; // [sp+28h] [bp-28h]@18
  int v16; // [sp+30h] [bp-20h]@18
  const char *v17; // [sp+38h] [bp-18h]@18
  int v18; // [sp+40h] [bp-10h]@1

  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 *)(*((_QWORD *)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;
}


//----- (00000001801E8130) ----------------------------------------------------
__int64 __fastcall Windows::AutoIMallocPtr<unsigned short>::AutoIMallocPtr<unsigned short>(__int64 a1, __int64 a2)
{
  __int64 v2; // rsi@1
  __int64 v3; // rdi@1
  void (__fastcall *v4)(__int64); // rbx@1
  __int64 result; // rax@1

  v2 = a1;
  v3 = a2;
  v4 = *(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 8i64);
  _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)a2 + 8i64));
  v4(v3);
  *(_QWORD *)v2 = 0i64;
  result = v2;
  *(_QWORD *)(v2 + 8) = v3;
  return result;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);


//----- (00000001801E817C) ----------------------------------------------------
int __fastcall Windows::Implementation::CloseWithIMalloc<unsigned short *>::~CloseWithIMalloc<unsigned short *>(_QWORD *a1)
{
  __int64 v1; // rdi@1
  _QWORD *v2; // rsi@1
  int (__fastcall *v3)(__int64); // rbx@2
  int result; // eax@2

  v1 = *a1;
  v2 = a1;
  if ( *a1 )
  {
    v3 = *(int (__fastcall **)(__int64))(*(_QWORD *)v1 + 16i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v1 + 16i64));
    result = v3(v1);
    *v2 = 0i64;
  }
  return result;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);

//----- (00000001801E81C8) ----------------------------------------------------
int __fastcall Windows::AutoIMallocPtr<unsigned short>::~AutoIMallocPtr<unsigned short>(__int64 a1)
{
  __int64 v1; // rbp@1
  __int64 v2; // rsi@1
  __int64 v3; // rdi@2
  int (__fastcall *v4)(__int64, __int64); // rbx@2
  int result; // eax@2
  __int64 v6; // rdi@3
  int (__fastcall *v7)(__int64); // rbx@4

  v1 = *(_QWORD *)a1;
  v2 = a1;
  if ( *(_QWORD *)a1 )
  {
    v3 = *(_QWORD *)(a1 + 8);
    v4 = *(int (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 40i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v3 + 40i64));
    result = v4(v3, v1);
    *(_QWORD *)v2 = 0i64;
  }
  v6 = *(_QWORD *)(v2 + 8);
  if ( v6 )
  {
    v7 = *(int (__fastcall **)(__int64))(*(_QWORD *)v6 + 16i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v6 + 16i64));
    result = v7(v6);
    *(_QWORD *)(v2 + 8) = 0i64;
  }
  return result;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);


//----- (00000001801E8470) ----------------------------------------------------
__int64 __fastcall GetExpandedPathParameter(int a1, __int64 *a2, __int64 a3, void *a4)
{
  __int64 v4; // r13@1
  void *v5; // rax@1
  __int64 *v6; // r12@1
  int v7; // er14@1
  void *v8; // ST00_8@2
  int v9; // eax@11
  int *v10; // rdx@11
  int v11; // ebx@12
  __int64 v12; // rbx@13
  _QWORD *v13; // rdi@13
  signed int v14; // eax@13
  __int64 v15; // rbx@15
  _QWORD *v16; // rdi@15
  signed int v17; // eax@15
  int v18; // eax@17
  __int64 v19; // rsi@18
  __int64 v20; // rbx@18
  _QWORD *v21; // rdi@18
  signed int v22; // eax@18
  int (__fastcall *v23)(__int64 *, __int64 *, __int64); // rbx@21
  __int64 v24; // r14@22
  __int64 v25; // rsi@23
  void (__fastcall *v26)(__int64, __int64); // rdi@23
  __int64 v27; // r14@25
  __int64 v28; // rsi@26
  void (__fastcall *v29)(__int64, __int64); // rdi@26
  __int64 v31; // rsi@31
  __int64 v32; // rdi@32
  void (__fastcall *v33)(__int64, __int64); // rbx@32
  __int64 v34; // rsi@36
  __int64 v35; // rdi@37
  void (__fastcall *v36)(__int64, __int64); // rbx@37
  int (__fastcall *v37)(__int64 *, __int64 *, __int64); // [sp+0h] [bp-61h]@20
  __int64 v38; // [sp+8h] [bp-59h]@12
  int v39; // [sp+18h] [bp-49h]@6
  int *v40; // [sp+20h] [bp-41h]@6
  unsigned int v41; // [sp+28h] [bp-39h]@1
  __int64 v42; // [sp+30h] [bp-31h]@15
  __int64 v43; // [sp+38h] [bp-29h]@26
  __int64 v44; // [sp+40h] [bp-21h]@1
  __int64 v45; // [sp+48h] [bp-19h]@23
  __int64 v46; // [sp+50h] [bp-11h]@13
  int v47; // [sp+58h] [bp-9h]@15
  __int64 vars30; // [sp+D0h] [bp+6Fh]@1
  int *retaddr; // [sp+D8h] [bp+77h]@3
  int v50; // [sp+E0h] [bp+7Fh]@0

  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(*(_QWORD *)(v12 + 24));
  v14 = (*(int (__fastcall **)(__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(*(_QWORD *)(v15 + 64));
  v40 = &v47;
  v17 = (*(int (__fastcall **)(__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))(*(_QWORD *)v43 + 40i64);
      _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v43 + 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(*(_QWORD *)(v20 + 72));
    LODWORD(v40) = v50;
    v22 = (*(int (__fastcall **)(__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))(*(_QWORD *)v45 + 40i64);
        _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v45 + 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))(*(_QWORD *)v45 + 40i64);
      _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v45 + 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))(*(_QWORD *)v43 + 40i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v43 + 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;
}
// 1801E8470: too many cbuild loops
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);


//----- (00000001801E87E0) ----------------------------------------------------
__int64 __fastcall Windows::WCP::Transformers::Rtl::GetLUnicodeParameter(unsigned int a1, __int64 *a2, __int64 a3, __int64 a4)
{
  int *v4; // r14@1
  __int64 v5; // r15@1
  __int64 v6; // rsi@1
  __int64 *v7; // r12@1
  unsigned int v8; // er13@1
  int v9; // edx@9
  const char *v10; // r8@9
  __int64 v11; // rbx@11
  _QWORD *v12; // rdi@11
  signed int v13; // eax@11
  int v14; // eax@13
  __int64 v15; // rsi@14
  __int64 v16; // rdi@15
  void (__fastcall *v17)(__int64, __int64); // rbx@15
  __int64 v18; // rsi@16
  __int64 v19; // rbx@16
  _QWORD *v20; // rdi@16
  signed int v21; // eax@16
  int v22; // eax@18
  int v23; // eax@19
  __int64 v24; // rsi@25
  __int64 v25; // rdi@26
  void (__fastcall *v26)(__int64, __int64); // rbx@26
  __int64 *v28; // [sp+0h] [bp-51h]@13
  const char *v29; // [sp+8h] [bp-49h]@6
  const char *v30; // [sp+10h] [bp-41h]@6
  __int64 v31; // [sp+18h] [bp-39h]@6
  const char *v32; // [sp+20h] [bp-31h]@6
  int *v33; // [sp+28h] [bp-29h]@1
  __int64 v34; // [sp+30h] [bp-21h]@13
  __int64 v35; // [sp+38h] [bp-19h]@15
  __int64 v36; // [sp+40h] [bp-11h]@11
  int v37; // [sp+48h] [bp-9h]@16
  int *vars30; // [sp+D0h] [bp+7Fh]@1

  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(*(_QWORD *)(v11 + 24));
  v13 = (*(int (__fastcall **)(__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(*(_QWORD *)(v19 + 64));
    v33 = &v37;
    v21 = (*(int (__fastcall **)(__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))(*(_QWORD *)v35 + 40i64);
          _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v35 + 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))(*(_QWORD *)v35 + 40i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)v35 + 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;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);


//----- (0000000180211D70) ----------------------------------------------------
void *__fastcall ORTlsAlloc(unsigned __int64 a1)
{
  unsigned __int64 v1; // rbx@1
  char *v2; // rsi@1
  signed __int64 v3; // rdi@1
  void *result; // rax@2
  _QWORD *v5; // rcx@4

  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;
}


//----- (0000000180221990) ----------------------------------------------------
int __fastcall Windows::FreeAndNull<unsigned short>(__int64 *a1)
{
  __int64 v1; // rsi@1
  __int64 v2; // rdi@2
  int (__fastcall *v3)(__int64, __int64); // rbx@2
  int result; // eax@2

  v1 = *a1;
  if ( *a1 )
  {
    *a1 = 0i64;
    v2 = `anonymous namespace'::g_pIMalloc;
    v3 = *(int (__fastcall **)(__int64, __int64))(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 40i64);
    _guard_check_icall_fptr(*(_QWORD *)(*(_QWORD *)`anonymous namespace'::g_pIMalloc + 40i64));
    result = v3(v2, v1);
  }
  return result;
}
// 180244BE0: using guessed type int (__fastcall *_guard_check_icall_fptr)(_QWORD);
// 1802FDBA0: using guessed type __int64 `anonymous namespace'::g_pIMalloc;


//----- (00000001802230D0) ----------------------------------------------------
__int64 __fastcall StageAndLockParameterSet::Allocate(StageAndLockParameterSet *this, unsigned __int64 a2)
{
  unsigned __int64 v2; // rdi@1
  StageAndLockParameterSet *v3; // r14@1
  Windows::COM *v4; // rbx@2
  unsigned __int64 v5; // rcx@3
  unsigned __int64 v6; // rdx@3
  char *v7; // rax@5
  char *v8; // rsi@5
  signed int v9; // eax@6
  signed int v10; // ebx@6
  const char *v11; // rcx@6
  signed __int64 v12; // rax@7
  signed __int64 v13; // rcx@7
  signed __int64 v14; // rax@7
  __int64 result; // rax@7
  const char *v16; // [sp+20h] [bp-48h]@9
  const char *v17; // [sp+28h] [bp-40h]@9
  int v18; // [sp+30h] [bp-38h]@9
  const char *v19; // [sp+38h] [bp-30h]@9
  int v20; // [sp+40h] [bp-28h]@9

  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;
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值