SiOpenRegistryKey

INT64 __fastcall SiOpenRegistryKey(VOID *ParentHandle, WCHAR *KeyName, UINT64 DesiredAccess, VOID **Handle){
  NTSTATUS v5; 
  struct _UNICODE_STRING DestinationString; 
  struct _OBJECT_ATTRIBUTES ObjectAttributes; 
  void *KeyHandle; 
  *(&ObjectAttributes.Length + 1) = 0;
  *(&ObjectAttributes.Attributes + 1) = 0;
  KeyHandle = 0i64;
  DestinationString = 0i64;
  RtlInitUnicodeString(&DestinationString, KeyName, DesiredAccess);
  ObjectAttributes.RootDirectory = 0i64;
  ObjectAttributes.ObjectName = &DestinationString;
  ObjectAttributes.Length = 48;
  ObjectAttributes.Attributes = 576;
  *(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
  v5 = ZwOpenKey(&KeyHandle, 0x20019u, &ObjectAttributes);
  if( v5 < 0 )
  {
    if( KeyHandle )
      ZwClose(KeyHandle);
  }
  else
  {
    *Handle = KeyHandle;
  }
  return(unsigned int)v5;
}

Referenced by:

SiGetRegistryValue