IoSetSystemPartition

NTSTATUS __stdcall IoSetSystemPartition(_UNICODE_STRING *VolumeNameString){
  PVOID v2; 
  INT64 v3; 
  int v4; 
  NTSTATUS v5; 
  int v6; 
  INT64 CreateOptions; 
  UINT64 CreateOptionsa; 
  wchar_t *CreateOptionsb; 
  UINT64 *Disposition; 
  UINT64 *Dispositiona; 
  PVOID Handle; 
  VOID *KeyHandle; 
  _UNICODE_STRING KeyName; 
  _UNICODE_STRING DestinationString; 
  _OBJECT_ATTRIBUTES ObjectAttributes; 
  int v18; 
  int v19; 
  int v20; 
  int v21; 
  int v22; 
  int v23; 
  int v24; 
  int v25; 

  v2 = 0i64;
  KeyName = 0i64;
  DestinationString = 0i64;
  RtlInitUnicodeString(&DestinationString, L"\\REGISTRY\\MACHINE\\SYSTEM");
  *(_QWORD *)&ObjectAttributes.Length = 48i64;
  ObjectAttributes.ObjectName = &DestinationString;
  *(_QWORD *)&ObjectAttributes.Attributes = 576i64;
  ObjectAttributes.RootDirectory = 0i64;
  *(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
  v4 = ZwOpenKey(&KeyHandle, 0xF003Fui64, &ObjectAttributes, v3, CreateOptions, (INT64)Disposition, 0i64, 0i64);
  if( v4 >= 0 )
  {
    KeyName.Buffer = (wchar_t *)&v18;
    v18 = 6619219;
    v19 = 7667828;
    v20 = 112;
    *(_DWORD *)&KeyName.Length = 786442;
    LODWORD(CreateOptionsa) = 0;
    v5 = IopCreateRegistryKeyEx(&Handle, KeyHandle, &KeyName, 0xF003Fui64, CreateOptionsa, 0i64);
    v2 = Handle;
    v4 = v5;
    if( v5 >= 0 )
    {
      v6 = VolumeNameString->Length + 2;
      v18 = 7929939;
      LODWORD(Dispositiona) = v6;
      CreateOptionsb = VolumeNameString->Buffer;
      v19 = 7602291;
      v20 = 7143525;
      v21 = 6357072;
      v22 = 7602290;
      v23 = 7602281;
      v24 = 7274601;
      v25 = 110;
      *(_DWORD *)&KeyName.Length = 2097182;
      v4 = ZwSetValueKey(Handle, &KeyName, 0i64, 1ui64, CreateOptionsb, (UINT64)Dispositiona);
    }
  }
  if( KeyHandle )
    ZwClose((_HANDLE)KeyHandle);
  if( v2 )
    ZwClose((_HANDLE)v2);
  return v4;
}

Referenced by:

No references.