NP_CONTEXT::NpStart

__int64 __fastcall NP_CONTEXT::NpStart(struct NP_CONTEXT *a1, struct NP_CONTEXT::_NP_PARAMETERS *a2){
  PVOID *p_P; 
  bool v3; 
  PVOID *v6; 
  char *v7; 
  PVOID *v8; 
  __int128 v9; 
  __int64 v10; 
  unsigned int v11; 
  PVOID *v12; 
  VOID **PoolWithTag; 
  unsigned __int64 v15; 
  PVOID P; 
  PVOID *v17; 

  P = 0i64;
  p_P = &P;
  v3 = *((_DWORD *)a2 + 1) == 0;
  v17 = &P;
  if( !v3 )
  {
    do
    {
      PoolWithTag = ExAllocatePoolWithTag(0x200ui64, 0x1000ui64, 1884188019i64);
      p_P = PoolWithTag;
      if( !PoolWithTag )
      {
        v11 = -1073741670;
        goto LABEL_11;
      }
      *PoolWithTag = (char *)*v17 + 1;
      *v17 = PoolWithTag;
      v15 = *((unsigned int *)a2 + 1);
      v17 = PoolWithTag;
    }
    while( (unsigned __int64)*PoolWithTag < v15 );
  }
  v6 = (PVOID *)((char *)a1 + 64);
  if( *p_P )
  {
    v7 = (char *)*p_P + **((_QWORD **)a1 + 9);
    *p_P = *v6;
    *v6 = P;
    v8 = (PVOID *)*((_QWORD *)a1 + 9);
    if( v8 == v6 )
    {
      v8 = v17;
      *((_QWORD *)a1 + 9) = v17;
    }
    *v8 = v7;
    p_P = &P;
    P = 0i64;
    v17 = &P;
  }
  v9 = *((_OWORD *)a2 + 1);
  *(_OWORD *)a1 = *(_OWORD *)a2;
  v10 = *((_QWORD *)a2 + 4);
  v11 = 0;
  *((_OWORD *)a1 + 1) = v9;
  *((_QWORD *)a1 + 4) = v10;
  while( p_P != &P )
  {
    v12 = (PVOID *)P;
    P = *(PVOID *)P;
    if( v12 == p_P )
    {
      P = 0i64;
      v17 = &P;
    }
    else
    {
      *p_P = (char *)*p_P - 1;
    }
    ExFreePoolWithTag(v12, 0);
LABEL_11:
    p_P = v17;
  }
  return v11;
}

Referenced by:

No references.