# CVE-2026-113814 — spaceport.sys patch diff

`spaceport.sys` 10.0.26100.9711 -> 10.0.26100.9974 (ghidriff).

## `ScAnsiToUnicodeString`  (modified)

```diff
--- ScAnsiToUnicodeString
+++ ScAnsiToUnicodeString
@@ -1,13 +1,44 @@
+

+/* long __cdecl ScAnsiToUnicodeString(char * __ptr64,struct _UNICODE_STRING * __ptr64) */

 

 long __cdecl ScAnsiToUnicodeString(char *param_1,_UNICODE_STRING *param_2)

 

 {

-  longlong in_RAX;

-  long unaff_EBX;

+  void *pvVar1;

+  uint uVar2;

+  int iVar3;

+  undefined8 local_28;

+  void *pvStack_20;

+  undefined8 local_18;

+  undefined8 uStack_10;

   

-  if (in_RAX != 0) {

-    ExFreePoolWithTag();

+  local_18 = 0;

+  uStack_10 = 0;

+  local_28 = 0;

+  pvStack_20 = (void *)0x0;

+  ScTrimString(param_1);

+  RtlInitAnsiString(&local_18,param_1);

+  uVar2 = RtlxAnsiStringToUnicodeSize(&local_18);

+  local_28._0_4_ = CONCAT22((short)uVar2,(undefined2)local_28);

+  pvStack_20 = SC_ENV::Allocate((ulonglong)uVar2,0x58587053,'\0',0);

+  if (pvStack_20 == (void *)0x0) {

+    iVar3 = -0x3fffff66;

   }

-  return unaff_EBX;

+  else {

+    iVar3 = RtlAnsiStringToUnicodeString(&local_28,&local_18,0);

+    if (-1 < iVar3) {

+      if (*(longlong *)(param_2 + 8) != 0) {

+        ExFreePoolWithTag(*(longlong *)(param_2 + 8),0);

+      }

+      pvVar1 = pvStack_20;

+      pvStack_20 = (void *)0x0;

+      *(undefined8 *)param_2 = local_28;

+      *(void **)(param_2 + 8) = pvVar1;

+    }

+  }

+  if (pvStack_20 != (void *)0x0) {

+    ExFreePoolWithTag(pvStack_20,0);

+  }

+  return iVar3;

 }
```

## `SpGetDeviceProperty`  (modified)

```diff
--- SpGetDeviceProperty
+++ SpGetDeviceProperty
@@ -1,9 +1,43 @@
+

+/* long __cdecl SpGetDeviceProperty(struct _DEVICE_OBJECT * __ptr64,struct _DEVPROPKEY const *

+   __ptr64,void * __ptr64 * __ptr64) */

 

 long __cdecl SpGetDeviceProperty(_DEVICE_OBJECT *param_1,_DEVPROPKEY *param_2,void **param_3)

 

 {

-  long in_EAX;

+  int iVar1;

+  int iVar2;

+  void *pvVar3;

+  uint local_res18 [2];

+  undefined4 local_res20 [2];

   

-  return in_EAX;

+  *param_3 = (void *)0x0;

+  local_res18[0] = 0;

+  local_res20[0] = 0;

+  iVar1 = IoGetDevicePropertyData();

+  iVar2 = 0;

+  if (iVar1 != -0x3fffffdd) {

+    iVar2 = iVar1;

+  }

+  if (local_res18[0] == 0) {

+    iVar2 = -0x3ffffffc;

+  }

+  else if (-1 < iVar2) {

+    pvVar3 = SC_ENV::Allocate((ulonglong)local_res18[0],0x58587053,'\0',0);

+    if (pvVar3 == (void *)0x0) {

+      iVar2 = -0x3fffff66;

+    }

+    else {

+      iVar2 = IoGetDevicePropertyData

+                        (param_1,param_2,0,0,local_res18[0],pvVar3,local_res18,local_res20);

+      if (iVar2 < 0) {

+        SC_ENV_ALLOCATOR::operator_delete(pvVar3);

+      }

+      else {

+        *param_3 = pvVar3;

+      }

+    }

+  }

+  return iVar2;

 }
```

## `SpQueryRootId`  (modified)

```diff
--- SpQueryRootId
+++ SpQueryRootId
@@ -1,9 +1,42 @@
+

+/* long __cdecl SpQueryRootId(class SP_CONTROL * __ptr64,struct _IRP * __ptr64) */

 

 long __cdecl SpQueryRootId(SP_CONTROL *param_1,_IRP *param_2)

 

 {

-  long in_EAX;

+  int iVar1;

+  ulonglong uVar2;

+  long lVar3;

+  void *_Dst;

+  wchar_t *pwVar4;

+  ulonglong local_18;

+  void *pvStack_10;

   

-  return in_EAX;

+  local_18 = 0;

+  pvStack_10 = (void *)0x0;

+  iVar1 = *(int *)(*(longlong *)(param_2 + 0xb8) + 8);

+  if ((iVar1 == 0) || (iVar1 == 1)) {

+    pwVar4 = L"Root\\Spaceport";

+  }

+  else {

+    if (iVar1 != 3) {

+      return -0x3fffff45;

+    }

+    pwVar4 = L"0000";

+  }

+  RtlInitUnicodeString(&local_18,pwVar4);

+  _Dst = SC_ENV::Allocate((local_18 & 0xffff) + 4,0x58587053,'\0',0);

+  uVar2 = local_18;

+  if (_Dst == (void *)0x0) {

+    lVar3 = -0x3fffff66;

+  }

+  else {

+    memmove(_Dst,pvStack_10,local_18 & 0xffff);

+    *(undefined2 *)((longlong)_Dst + (uVar2 >> 1 & 0x7fff) * 2) = 0;

+    *(undefined2 *)((longlong)_Dst + (local_18 >> 1 & 0x7fff) * 2 + 2) = 0;

+    lVar3 = 0;

+    *(void **)(param_2 + 0x38) = _Dst;

+  }

+  return lVar3;

 }
```

## `LogCoreWriteDataRecord`  (modified)

```diff
--- LogCoreWriteDataRecord
+++ LogCoreWriteDataRecord
@@ -1,13 +1,85 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* long __cdecl LogCoreWriteDataRecord(struct _LOG_HANDLE * __ptr64,void * __ptr64,void *

+   __ptr64,unsigned long,void * __ptr64,unsigned long,void * __ptr64,unsigned long,union _SL_LSN *

+   __ptr64) */

 

 long __cdecl

 LogCoreWriteDataRecord

           (_LOG_HANDLE *param_1,void *param_2,void *param_3,ulong param_4,void *param_5,

           ulong param_6,void *param_7,ulong param_8,_SL_LSN *param_9)

 

 {

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  uint uVar1;

+  ulonglong uVar2;

+  ulonglong uVar3;

+  long lVar4;

+  undefined8 *puVar5;

+  ulonglong *puVar6;

+  longlong lVar7;

+  uint uVar8;

+  ulonglong local_res8;

+  undefined8 in_stack_ffffffffffffffb8;

+  undefined4 uVar9;

+  

+  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffb8 >> 0x20);

+  uVar1 = *(uint *)(param_1 + 0xe48);

+  local_res8 = 0xffffffffffffffff;

+  uVar8 = (param_8 - 1) + uVar1 + param_4;

+  uVar2 = (ulonglong)(uVar8 - uVar8 % uVar1);

+  uVar3 = uVar2 / uVar1;

+  lVar4 = LogAllocateSpace(param_1,(void *)(uVar2 % (ulonglong)uVar1),(ulong)uVar3,

+                           (_SL_LSN *)&local_res8);

+  if (-1 < lVar4) {

+    memset(param_3,0,(ulonglong)param_4);

+    uVar2 = local_res8;

+    uVar1 = *(uint *)(param_1 + 0xe48);

+    uVar8 = (param_4 - 1) + uVar1;

+    LogInitializeEntryHeader

+              (param_3,param_1,local_res8,uVar3,CONCAT44(uVar9,(uVar8 - uVar8 % uVar1) / uVar1));

+    puVar6 = (ulonglong *)((ulonglong)*(uint *)((longlong)param_3 + 0x40) + (longlong)param_3);

+    puVar6[1] = 0;

+    puVar6[2] = 0;

+    puVar6[5] = 2;

+    *puVar6 = uVar2;

+    *(ulong *)(puVar6 + 3) = param_6;

+    *(ulong *)((longlong)puVar6 + 0x1c) = param_8;

+    *(undefined4 *)(puVar6 + 4) = 0x30;

+    *(ulong *)((longlong)puVar6 + 0x24) = ((int)param_3 - (int)puVar6) + param_4;

+    if (param_6 != 0) {

+      memmove(puVar6 + 6,param_5,(ulonglong)param_6);

+    }

+    if (((param_8 == 0) ||

+        (lVar4 = LogEncodeEntryPayload(param_1,param_3,param_7,param_8), -1 < lVar4)) &&

+       (lVar4 = LogEncodeEntryHeader(param_1,param_3), -1 < lVar4)) {

+      lVar7 = ((uVar2 & 0xffffffff) + *(longlong *)(param_1 + 8)) *

+              (ulonglong)*(uint *)(param_1 + 0xe48);

+      puVar5 = SC_ENV::Allocate(0x38,0x6c587053,'\0',0);

+      if (puVar5 == (undefined8 *)0x0) {

+        lVar4 = -0x3fffff66;

+      }

+      else {

+        *puVar5 = param_1;

+        *(ulong *)(puVar5 + 2) = param_4 + param_8;

+        puVar5[1] = param_3;

+        puVar5[3] = lVar7;

+        puVar5[4] = uVar2;

+        puVar5[5] = param_9;

+        *(undefined4 *)(puVar5 + 6) = 0;

+        if (param_9 != (_SL_LSN *)0x0) {

+          *(ulonglong *)param_9 = uVar2;

+        }

+        lVar4 = SC_ENV::SendAsynchronousFsdRequest

+                          (param_2,'\x04',param_3,param_4 + param_8,lVar7,LogWriteEntryCompletion,

+                           puVar5);

+        if (lVar4 < 0) {

+          ExFreePoolWithTag(puVar5,0);

+        }

+        else {

+          *(int *)(param_1 + 0xe8c) = *(int *)(param_1 + 0xe8c) + 1;

+        }

+      }

+    }

+  }

+  return lVar4;

 }
```

## `UnformatField`  (modified)

```diff
--- UnformatField
+++ UnformatField
@@ -1,24 +1,40 @@
+

+/* long __cdecl UnformatField(void * __ptr64 * __ptr64,unsigned long,unsigned long,unsigned char *

+   __ptr64 & __ptr64,unsigned long & __ptr64) */

 

 long __cdecl

 UnformatField(void **param_1,ulong param_2,ulong param_3,uchar **param_4,ulong *param_5)

 

 {

-  long unaff_EBX;

-  ulong unaff_EBP;

-  uint unaff_ESI;

-  uint unaff_EDI;

-  longlong in_R11;

-  uchar **unaff_R12;

-  longlong *unaff_R14;

-  ulong *unaff_R15;

+  void *pvVar1;

+  long lVar2;

+  ulonglong uVar3;

+  uint uVar4;

+  uint uVar5;

   

-  if (unaff_EDI != 0) {

-    do {

-      UnformatField((void *)((ulonglong)unaff_ESI + in_R11),unaff_EBP,unaff_R12,unaff_R15);

-      unaff_ESI = unaff_ESI + unaff_EBP;

-    } while (unaff_ESI < unaff_EDI);

+  uVar3 = 0;

+  lVar2 = 0;

+  *param_1 = (void *)0x0;

+  uVar5 = param_2 * param_3;

+  if (*param_5 < uVar5) {

+    lVar2 = -0x7ffffffb;

   }

-  *unaff_R14 = in_R11;

-  return unaff_EBX;

+  else {

+    pvVar1 = SC_ENV::Allocate((ulonglong)uVar5,0x58587053,'\0',0);

+    if (pvVar1 == (void *)0x0) {

+      lVar2 = -0x3fffff66;

+    }

+    else {

+      if (uVar5 != 0) {

+        do {

+          UnformatField((void *)(uVar3 + (longlong)pvVar1),param_2,param_4,param_5);

+          uVar4 = (int)uVar3 + param_2;

+          uVar3 = (ulonglong)uVar4;

+        } while (uVar4 < uVar5);

+      }

+      *param_1 = pvVar1;

+    }

+  }

+  return lVar2;

 }
```

## `LogCoreReadDataRecord`  (modified)

```diff
--- LogCoreReadDataRecord
+++ LogCoreReadDataRecord
@@ -1,93 +1,97 @@
+

+/* long __cdecl LogCoreReadDataRecord(struct _LOG_HANDLE * __ptr64,void * __ptr64,union

+   _SL_LSN,unsigned long,void * __ptr64,unsigned long,void * __ptr64,unsigned long,__int64) */

 

 long __cdecl

-LogCoreReadDataRecord(longlong param_1,undefined8 param_2,undefined8 param_3,longlong param_4)

+LogCoreReadDataRecord

+          (longlong param_1,void *param_2,ulonglong param_3,uint param_4,undefined8 param_5,

+          undefined4 param_6,void *param_7,uint param_8,longlong param_9)

 

 {

-  char *pcVar1;

+  uint uVar1;

   longlong lVar2;

   long lVar3;

   void *_Dst;

   _LOG_READ_IO_CONTEXT *p_Var4;

-  ulonglong unaff_RBX;

-  longlong unaff_RBP;

-  __uint64 unaff_RSI;

-  longlong unaff_RDI;

-  longlong unaff_R14;

-  void *in_stack_00000088;

-  undefined8 in_stack_000000a0;

-  undefined4 in_stack_000000a8;

-  void *in_stack_000000b0;

-  uint in_stack_000000b8;

-  longlong in_stack_000000c0;

+  int iVar5;

+  ulonglong _Size;

+  uint uVar6;

+  longlong lVar7;

+  ulonglong in_stack_ffffffffffffffa8;

   

-  pcVar1 = (char *)(unaff_RBX + 0x75 + param_1 * 4);

-  *pcVar1 = *pcVar1 + (char)param_1;

-  *(byte *)(unaff_RDI + 0x6c587053) = *(byte *)(unaff_RDI + 0x6c587053) | (byte)(unaff_RBX >> 8);

-  param_4 = (unaff_R14 + (unaff_RBX & 0xffffffff)) * param_4;

-  _Dst = SC_ENV::Allocate(unaff_RSI,(ulong)unaff_RDI,'\0',0);

-  if (_Dst == (void *)0x0) {

-    lVar3 = -0x3fffff66;

+  _Size = (ulonglong)param_4;

+  uVar1 = *(uint *)(param_1 + 0xe48);

+  iVar5 = (int)param_3;

+  uVar6 = (param_4 - 1) + uVar1;

+  if ((uint)(*(int *)(param_1 + 0xe58) - iVar5) < (uVar6 - uVar6 % uVar1) / uVar1) {

+    lVar3 = -0x3ffffdfa;

   }

   else {

-    p_Var4 = SC_ENV::Allocate(0x60,(ulong)unaff_RDI,'\0',0);

-    if (p_Var4 == (_LOG_READ_IO_CONTEXT *)0x0) {

+    lVar7 = (*(longlong *)(param_1 + 8) + (param_3 & 0xffffffff)) * (ulonglong)uVar1;

+    _Dst = SC_ENV::Allocate(_Size,0x6c587053,'\0',0);

+    if (_Dst == (void *)0x0) {

       lVar3 = -0x3fffff66;

     }

     else {

-      lVar2 = *(longlong *)(unaff_RBP + 0x2e60);

-      *(longlong *)p_Var4 = unaff_RBP;

-      *(void **)(p_Var4 + 8) = _Dst;

-      *(ulong *)(p_Var4 + 0x10) = (ulong)unaff_RSI;

-      *(longlong *)(p_Var4 + 0x18) = param_4;

-      *(undefined8 *)(p_Var4 + 0x20) = in_stack_000000a0;

-      *(undefined4 *)(p_Var4 + 0x28) = in_stack_000000a8;

-      *(longlong *)(p_Var4 + 0x48) = in_stack_000000c0;

-      *(void **)(p_Var4 + 0x30) = in_stack_000000b0;

-      *(undefined8 *)(p_Var4 + 0x38) = 0;

-      *(uint *)(p_Var4 + 0x40) = in_stack_000000b8;

-      *(ulonglong *)(p_Var4 + 0x50) = unaff_RBX;

-      *(undefined8 *)(p_Var4 + 0x58) = 0;

-      if (lVar2 == 0) {

-        lVar3 = SC_ENV::SendAsynchronousFsdRequest

-                          (in_stack_00000088,'\x03',_Dst,(ulong)unaff_RSI,param_4,

-                           LogReadHeaderCompletion,p_Var4);

-        if (-1 < lVar3) {

-          LOCK();

-          *(int *)(p_Var4 + 0x58) = *(int *)(p_Var4 + 0x58) + 1;

-          UNLOCK();

-          if ((in_stack_000000b8 != 0) &&

-             (lVar3 = SC_ENV::SendAsynchronousFsdRequest

-                                (in_stack_00000088,'\x03',in_stack_000000b0,in_stack_000000b8,

-                                 unaff_RSI + param_4 + in_stack_000000c0,LogReadPayloadCompletion,

-                                 p_Var4), -1 < lVar3)) {

+      p_Var4 = SC_ENV::Allocate(0x60,0x6c587053,'\0',0);

+      if (p_Var4 == (_LOG_READ_IO_CONTEXT *)0x0) {

+        lVar3 = -0x3fffff66;

+      }

+      else {

+        lVar2 = *(longlong *)(param_1 + 0x2e60);

+        *(longlong *)p_Var4 = param_1;

+        *(void **)(p_Var4 + 8) = _Dst;

+        *(uint *)(p_Var4 + 0x10) = param_4;

+        *(longlong *)(p_Var4 + 0x18) = lVar7;

+        *(undefined8 *)(p_Var4 + 0x20) = param_5;

+        *(undefined4 *)(p_Var4 + 0x28) = param_6;

+        *(longlong *)(p_Var4 + 0x48) = param_9;

+        *(void **)(p_Var4 + 0x30) = param_7;

+        *(undefined8 *)(p_Var4 + 0x38) = 0;

+        *(uint *)(p_Var4 + 0x40) = param_8;

+        *(ulonglong *)(p_Var4 + 0x50) = param_3;

+        *(undefined8 *)(p_Var4 + 0x58) = 0;

+        if (lVar2 == 0) {

+          lVar3 = SC_ENV::SendAsynchronousFsdRequest

+                            (param_2,'\x03',_Dst,param_4,lVar7,LogReadHeaderCompletion,p_Var4);

+          if (-1 < lVar3) {

             LOCK();

             *(int *)(p_Var4 + 0x58) = *(int *)(p_Var4 + 0x58) + 1;

             UNLOCK();

+            if ((param_8 != 0) &&

+               (lVar3 = SC_ENV::SendAsynchronousFsdRequest

+                                  (param_2,'\x03',param_7,param_8,_Size + lVar7 + param_9,

+                                   LogReadPayloadCompletion,p_Var4), -1 < lVar3)) {

+              LOCK();

+              *(int *)(p_Var4 + 0x58) = *(int *)(p_Var4 + 0x58) + 1;

+              UNLOCK();

+            }

           }

         }

+        else {

+          memmove(_Dst,(void *)((ulonglong)(uint)(iVar5 * *(int *)(param_1 + 0xe48)) + lVar2),_Size)

+          ;

+          lVar3 = LogValidateEntryHeader

+                            (param_1,param_3,_Dst,param_4,

+                             in_stack_ffffffffffffffa8 & 0xffffffffffffff00);

+          if (-1 < lVar3) {

+            if (param_8 != 0) {

+              memmove(param_7,(void *)((uint)(iVar5 * *(int *)(param_1 + 0xe48)) + _Size +

+                                       *(longlong *)(param_1 + 0x2e60) + param_9),(ulonglong)param_8

+                     );

+            }

+            *(void **)(p_Var4 + 0x38) = param_7;

+            lVar3 = LogReadRecordComplete(p_Var4);

+          }

+        }

+        if (*(int *)(p_Var4 + 0x58) != 0) {

+          return lVar3;

+        }

+        ExFreePoolWithTag(p_Var4,0);

       }

-      else {

-        memmove(_Dst,(void *)((ulonglong)(uint)((int)unaff_RBX * *(int *)(unaff_RBP + 0xe48)) +

-                             lVar2),unaff_RSI);

-        lVar3 = LogValidateEntryHeader();

-        if (-1 < lVar3) {

-          if (in_stack_000000b8 != 0) {

-            memmove(in_stack_000000b0,

-                    (void *)((uint)((int)unaff_RBX * *(int *)(unaff_RBP + 0xe48)) + unaff_RSI +

-                             *(longlong *)(unaff_RBP + 0x2e60) + in_stack_000000c0),

-                    (ulonglong)in_stack_000000b8);

-          }

-          *(void **)(p_Var4 + 0x38) = in_stack_000000b0;

-          lVar3 = LogReadRecordComplete(p_Var4);

-        }

-      }

-      if (*(int *)(p_Var4 + 0x58) != 0) {

-        return lVar3;

-      }

-      ExFreePoolWithTag(p_Var4,0);

+      ExFreePoolWithTag(_Dst,0);

     }

-    ExFreePoolWithTag(_Dst,0);

   }

   return lVar3;

 }
```

## `SlLogOpenLog`  (modified)

```diff
--- SlLogOpenLog
+++ SlLogOpenLog
@@ -1,123 +1,107 @@
+

+/* long __cdecl SlLogOpenLog(void * __ptr64,unsigned char,unsigned char,unsigned

+   long,__int64,__int64,void * __ptr64 * __ptr64) */

 

 long __cdecl

 SlLogOpenLog(void *param_1,uchar param_2,uchar param_3,ulong param_4,__int64 param_5,__int64 param_6

             ,void **param_7)

 

 {

   longlong lVar1;

   undefined8 uVar2;

-  undefined1 auVar3 [16];

-  undefined1 auVar4 [16];

-  char cVar5;

-  undefined4 uVar6;

-  long lVar7;

-  char *in_RAX;

-  longlong lVar9;

+  ulonglong uVar3;

+  undefined4 uVar4;

+  long lVar5;

+  longlong lVar6;

   _LOG_HANDLE *_Dst;

-  void *pvVar10;

-  undefined7 in_register_00000011;

-  uint unaff_EBP;

-  uint uVar11;

-  _SL_LOG_CONTROL_AREA *unaff_RSI;

-  __uint64 unaff_RDI;

-  undefined8 *unaff_R12;

-  char unaff_R13B;

-  void *in_stack_00000060;

-  char in_stack_00000070;

-  char *pcVar8;

+  void *pvVar7;

+  _SL_LOG_CONTROL_AREA *_Src;

   

-  auVar3._9_7_ = in_register_00000011;

-  auVar3[8] = param_2;

-  cVar5 = (char)in_RAX + *in_RAX;

-  pcVar8 = (char *)CONCAT71((int7)((ulonglong)in_RAX >> 8),cVar5);

-  pcVar8[-0x75] = pcVar8[-0x75] + (char)param_1;

-  *pcVar8 = *pcVar8 + cVar5;

-  pcVar8[-0x67] = pcVar8[-0x67] + (char)param_1;

-  auVar3._0_8_ = pcVar8;

-  auVar4 = auVar3 / SEXT816((longlong)param_1);

-  lVar9 = auVar4._0_8_;

-  if (SUB168(auVar3 % SEXT816((longlong)param_1),0) != 0) {

+  _Src = (_SL_LOG_CONTROL_AREA *)0x0;

+  uVar3 = (ulonglong)param_4;

+  *param_7 = (void *)0x0;

+  if ((((param_4 == 0) || (param_5 < 0x2001)) || ((ulonglong)param_5 % uVar3 != 0)) ||

+     (lVar6 = param_6 / (longlong)uVar3, param_6 % (longlong)uVar3 != 0)) {

     return -0x3ffffff3;

   }

-  lVar1 = lVar9 + (longlong)(unaff_RDI - 0x1000) / (longlong)param_1;

+  lVar1 = lVar6 + (param_5 + -0x1000) / (longlong)uVar3;

   _Dst = SC_ENV::Allocate(0x2e70,0x6c587053,'\0',0);

   if (_Dst == (_LOG_HANDLE *)0x0) {

     return -0x3fffff66;

   }

-  uVar11 = (uint)unaff_RSI;

-  *(uint *)(_Dst + 0xe54) = *(uint *)(_Dst + 0xe54) & uVar11;

-  *(uint *)(_Dst + 0xe50) = *(uint *)(_Dst + 0xe50) & uVar11;

-  *(uint *)(_Dst + 0xe5c) = *(uint *)(_Dst + 0xe5c) & uVar11;

-  *(uint *)(_Dst + 0xe48) = unaff_EBP;

+  *(undefined4 *)(_Dst + 0xe54) = 0;

+  *(undefined4 *)(_Dst + 0xe50) = 0;

+  *(undefined4 *)(_Dst + 0xe5c) = 0;

+  *(ulong *)(_Dst + 0xe48) = param_4;

   *(undefined4 *)(_Dst + 0xe40) = 1;

-  *(longlong *)(_Dst + 8) = lVar9;

+  *(longlong *)(_Dst + 8) = lVar6;

   *(longlong *)(_Dst + 0x10) = lVar1;

-  uVar6 = (undefined4)(0x1000 / (ulonglong)unaff_EBP);

-  *(undefined4 *)(_Dst + 0xe4c) = uVar6;

-  *(int *)(_Dst + 0xe58) = (int)lVar1 - auVar4._0_4_;

+  uVar4 = (undefined4)(0x1000 / uVar3);

+  *(undefined4 *)(_Dst + 0xe4c) = uVar4;

+  *(int *)(_Dst + 0xe58) = (int)lVar1 - (int)lVar6;

   *(undefined8 *)(_Dst + 0xe60) = 0xffffffffffffffff;

-  if (in_stack_00000070 == (char)unaff_RSI) {

+  if (param_3 == '\0') {

 LAB_0:

-    if (unaff_R13B == '\0') {

+    if (param_2 == '\0') {

       *(undefined4 *)(_Dst + 0xe40) = 2;

-      unaff_RSI = SC_ENV::Allocate(0xe40,0x6c587053,'\0',0);

-      if (unaff_RSI == (_SL_LOG_CONTROL_AREA *)0x0) goto LAB_1;

-      lVar7 = LogCoreReadControlArea(_Dst,in_stack_00000060,unaff_RSI);

-      if (lVar7 < 0) {

+      _Src = SC_ENV::Allocate(0xe40,0x6c587053,'\0',0);

+      if (_Src == (_SL_LOG_CONTROL_AREA *)0x0) goto LAB_1;

+      lVar5 = LogCoreReadControlArea(_Dst,param_1,_Src);

+      if (lVar5 < 0) {

         *(undefined4 *)(_Dst + 0xe40) = 3;

       }

       else {

-        if ((lVar9 == *(longlong *)(unaff_RSI + 8)) && (lVar1 == *(longlong *)(unaff_RSI + 0x10))) {

-          memmove(_Dst,unaff_RSI,0xe40);

+        if ((lVar6 == *(longlong *)(_Src + 8)) && (lVar1 == *(longlong *)(_Src + 0x10))) {

+          memmove(_Dst,_Src,0xe40);

           *(int *)(_Dst + 0x38) = *(int *)(_Dst + 0x38) + 1;

           *(undefined4 *)(_Dst + 0xe54) = *(undefined4 *)(_Dst + 0x24);

           *(undefined4 *)(_Dst + 0xe5c) = *(undefined4 *)(_Dst + 0x24);

-          uVar6 = 4;

+          uVar4 = 4;

           goto LAB_2;

         }

-        lVar7 = -0x3fffffce;

+        lVar5 = -0x3fffffce;

       }

     }

     else {

-      *(uint *)(_Dst + 0x1c) = *(uint *)(_Dst + 0x1c) & uVar11;

-      *(ulonglong *)_Dst = *(ulonglong *)_Dst & (ulonglong)unaff_RSI;

-      *(undefined4 *)(_Dst + 0x18) = uVar6;

+      *(undefined4 *)(_Dst + 0x1c) = 0;

+      *(undefined8 *)_Dst = 0;

+      *(undefined4 *)(_Dst + 0x18) = uVar4;

       *(undefined8 *)(_Dst + 0x20) = *(undefined8 *)(_Dst + 0x18);

       *(undefined4 *)(_Dst + 0x38) = 1;

-      lVar7 = SC_ENV::CreateGuid((_GUID *)(_Dst + 0x28));

-      if (lVar7 < 0) goto LAB_3;

-      uVar6 = 6;

+      lVar5 = SC_ENV::CreateGuid((_GUID *)(_Dst + 0x28));

+      if (lVar5 < 0) goto LAB_3;

+      uVar4 = 6;

 LAB_2:

-      *(undefined4 *)(_Dst + 0xe40) = uVar6;

+      *(undefined4 *)(_Dst + 0xe40) = uVar4;

       uVar2 = *(undefined8 *)(_Dst + 0x18);

       *(undefined4 *)(_Dst + 0xe88) = 0;

       *(undefined4 *)(_Dst + 0xe8c) = 0;

       *(undefined8 *)(_Dst + 0xe70) = uVar2;

       *(undefined8 *)(_Dst + 0xe78) = uVar2;

       *(undefined8 *)(_Dst + 0xe80) = uVar2;

-      *unaff_R12 = _Dst;

+      *param_7 = _Dst;

       _Dst = (_LOG_HANDLE *)0x0;

-      if (unaff_RSI == (_SL_LOG_CONTROL_AREA *)0x0) {

-        return lVar7;

+      if (_Src == (_SL_LOG_CONTROL_AREA *)0x0) {

+        return lVar5;

       }

     }

-    ExFreePoolWithTag(unaff_RSI,0);

+    ExFreePoolWithTag(_Src,0);

     if (_Dst == (_LOG_HANDLE *)0x0) {

-      return lVar7;

+      return lVar5;

     }

   }

   else {

-    pvVar10 = SC_ENV::Allocate(unaff_RDI,0x6c587053,'\0',0);

-    *(void **)(_Dst + 0x2e60) = pvVar10;

-    if (pvVar10 != (void *)0x0) goto LAB_0;

+    pvVar7 = SC_ENV::Allocate(param_5,0x6c587053,'\0',0);

+    *(void **)(_Dst + 0x2e60) = pvVar7;

+    if (pvVar7 != (void *)0x0) goto LAB_0;

 LAB_1:

-    lVar7 = -0x3fffff66;

+    lVar5 = -0x3fffff66;

   }

 LAB_3:

   if (*(longlong *)(_Dst + 0x2e60) != 0) {

     ExFreePoolWithTag(*(longlong *)(_Dst + 0x2e60),0);

   }

   ExFreePoolWithTag(_Dst,0);

-  return lVar7;

+  return lVar5;

 }
```

## `SpIdsToString`  (modified)

```diff
--- SpIdsToString
+++ SpIdsToString
@@ -1,115 +1,20 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* unsigned short * __ptr64 __cdecl SpIdsToString(struct _SP_IDS_EX * __ptr64) */

 

 ushort * __cdecl SpIdsToString(_SP_IDS_EX *param_1)

 

 {

-  ulong uVar1;

-  _KSR_MEMORY_RUN *p_Var2;

-  code *pcVar3;

-  undefined4 uVar4;

-  undefined4 uVar5;

-  undefined4 uVar6;

-  SP_CONTROL *pSVar7;

-  uint uVar8;

-  _KSR_MEMORY_RUN *in_RAX;

-  SP_CONTROL *pSVar9;

-  _KSR_MEMORY_RUN *p_Var10;

-  _KSR_MEMORY_RUN *p_Var11;

-  undefined8 *puVar12;

-  longlong unaff_RBP;

-  _KSR_MEMORY_RUN *unaff_RSI;

-  _KSR_MEMORY_RUN *unaff_RDI;

-  _KSR_MEMORY_RUN *p_Var13;

-  undefined4 unaff_R13D;

-  undefined8 unaff_R14;

-  undefined4 auStackX_20 [2];

-  undefined8 uStack_8;

+  ushort *puVar1;

+  uint uVar2;

   

-  do {

-    *(undefined4 *)(in_RAX + 0x28) = 0;

-    *(longlong *)(in_RAX + 0x30) = 0;

-    *(longlong *)((longlong)register0x00000020 + 0x28) = unaff_RBP + -0x50;

-    *(undefined4 *)((longlong)register0x00000020 + 0x20) = 1;

-    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002ddc7;

-    p_Var13 = unaff_RSI;

-    uVar8 = KsrClaimPersistedMemory();

-    if ((int)uVar8 < 0) {

-LAB_0:

-      p_Var10 = (_KSR_MEMORY_RUN *)0x0;

-      *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002de69;

-      ExFreePoolWithTag();

-      goto LAB_1;

-    }

-    uVar1 = *(ulong *)(unaff_RBP + -0x50);

-    p_Var13 = (_KSR_MEMORY_RUN *)(unaff_RBP + -0x48);

-    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002dde8;

-    p_Var10 = unaff_RSI;

-    uVar8 = SpMapKsrRuns(uVar1,unaff_RSI,(_MDL **)p_Var13);

-    p_Var11 = (_KSR_MEMORY_RUN *)(ulonglong)uVar8;

-    if ((int)uVar8 < 0) goto LAB_0;

-    uVar4 = *(undefined4 *)(unaff_RBP + -0x3c);

-    uVar5 = *(undefined4 *)(unaff_RBP + -0x38);

-    uVar6 = *(undefined4 *)(unaff_RBP + -0x34);

-    *(undefined4 *)(unaff_RDI + 0x10) = *(undefined4 *)(unaff_RBP + -0x40);

-    *(undefined4 *)(unaff_RDI + 0x14) = uVar4;

-    *(undefined4 *)(unaff_RDI + 0x18) = uVar5;

-    *(undefined4 *)(unaff_RDI + 0x1c) = uVar6;

-    *(undefined4 *)(unaff_RDI + 0x20) = *(undefined4 *)(unaff_RBP + -0x30);

-    *(longlong *)(unaff_RDI + 0x30) = *(longlong *)(unaff_RBP + -0x48);

-    pSVar7 = SpControlExt;

-    pSVar9 = SpControlExt + 3000;

-    *(undefined4 *)(unaff_RDI + 0x28) = unaff_R13D;

-    p_Var2 = *(_KSR_MEMORY_RUN **)(pSVar7 + 0xbc0);

-    if (*(SP_CONTROL **)p_Var2 == pSVar9) {

-      *(SP_CONTROL **)unaff_RDI = pSVar9;

-      *(_KSR_MEMORY_RUN **)(unaff_RDI + 8) = p_Var2;

-      *(_KSR_MEMORY_RUN **)p_Var2 = unaff_RDI;

-      *(_KSR_MEMORY_RUN **)(pSVar7 + 0xbc0) = unaff_RDI;

-      unaff_RDI = p_Var2;

-      goto LAB_1;

-    }

-    pcVar3 = (code *)swi(0x29);

-    (*pcVar3)(3);

-    puVar12 = (undefined8 *)((longlong)register0x00000020 + 8);

-    unaff_RDI = (_KSR_MEMORY_RUN *)((ulonglong)*(ushort *)(unaff_RBP + -0x2a) << 3);

-    p_Var13 = (_KSR_MEMORY_RUN *)0x0;

-    *(undefined8 *)register0x00000020 = 0x14002de3d;

-    p_Var10 = p_Var11;

-    unaff_RSI = SC_ENV::Allocate((__uint64)unaff_RDI,uVar8,'\0',0);

-    if (unaff_RSI == (_KSR_MEMORY_RUN *)0x0) {

-      uVar8 = 0xc000009a;

-      register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);

-      goto LAB_2;

-    }

-    p_Var13 = (_KSR_MEMORY_RUN *)0x0;

-    p_Var10 = (_KSR_MEMORY_RUN *)0x38;

-    *(undefined8 *)register0x00000020 = 0x14002dd8c;

-    in_RAX = SC_ENV::Allocate(0x38,uVar8,'\0',0);

-    register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);

-    unaff_RDI = in_RAX;

-  } while (in_RAX != (_KSR_MEMORY_RUN *)0x0);

-  uVar8 = 0xc000009a;

-  unaff_RDI = p_Var10;

-  p_Var10 = p_Var11;

-  register0x00000020 = (BADSPACEBASE *)puVar12;

-LAB_1:

-  if ((unaff_RSI != (_KSR_MEMORY_RUN *)0x0) && (unaff_RSI != (_KSR_MEMORY_RUN *)(unaff_RBP + -0x28))

-     ) {

-    p_Var10 = (_KSR_MEMORY_RUN *)0x0;

-    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002de8f;

-    ExFreePoolWithTag();

-    unaff_RDI = unaff_RSI;

+  puVar1 = SC_ENV::Allocate((ulonglong)(*(int *)(param_1 + 0x20) * 0x26 + 1) * 2,0x58587053,'\0',0);

+  uVar2 = 0;

+  if ((puVar1 != (ushort *)0x0) && (*(int *)(param_1 + 0x20) != 0)) {

+    do {

+      SpIdToString((_GUID *)(param_1 + (ulonglong)uVar2 * 0x10 + 0x24),puVar1 + uVar2 * 0x26);

+      uVar2 = uVar2 + 1;

+    } while (uVar2 < *(uint *)(param_1 + 0x20));

   }

-  if ((int)uVar8 < 0) {

-LAB_2:

-    if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 0x10) != 0) {

-      *(uint *)((longlong)register0x00000020 + 0x20) = uVar8;

-      *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002dead;

-      McTemplateK0xq_EtwWriteTransfer(unaff_RDI,p_Var10,p_Var13,unaff_R14);

-    }

-  }

-  *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002debb;

-  return (ushort *)0x0;

+  return puVar1;

 }
```

## `SpMapCallback`  (modified)

```diff
--- SpMapCallback
+++ SpNotify
@@ -1,15 +1,53 @@
 

-/* WARNING: Control flow encountered bad instruction data */

-

-long __cdecl

-SpMapCallback(_DEVICE_OBJECT *param_1,_LIST_ENTRY *param_2,_LIST_ENTRY *param_3,void *param_4)

+void __cdecl SpNotify(undefined8 param_1,undefined8 param_2,undefined8 param_3)

 

 {

-  undefined4 *unaff_RSI;

-  undefined4 *unaff_RDI;

+  char in_CL;

+  longlong lVar1;

+  SP_PRM *this;

+  undefined4 unaff_EBX;

+  void *unaff_RBP;

+  _SP_NOTIFICATION_INFO *unaff_RSI;

+  char *unaff_RDI;

+  undefined4 unaff_R12D;

+  undefined8 unaff_R14;

+  undefined8 unaff_R15;

+  undefined8 uVar2;

+  undefined8 in_XMM0_Qb;

+  undefined8 in_XMM1_Qa;

+  undefined8 in_XMM1_Qb;

   

-  *unaff_RDI = *unaff_RSI;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  *unaff_RDI = *unaff_RDI - in_CL;

+  *(undefined8 *)unaff_RSI = param_1;

+  *(undefined8 *)(unaff_RSI + 8) = in_XMM0_Qb;

+  *(undefined4 *)(unaff_RSI + 0x20) = unaff_R12D;

+  *(undefined8 *)(unaff_RSI + 0x10) = in_XMM1_Qa;

+  *(undefined8 *)(unaff_RSI + 0x18) = in_XMM1_Qb;

+  *(undefined4 *)(unaff_RSI + 0x24) = unaff_EBX;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((byte)((byte)param_2 & (byte)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c)) != 0)) &&

+     (2 < (byte)WPP_GLOBAL_Control[0x29])) {

+    WPP_SF_L_guid__guid_D

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),param_2,param_3,unaff_R12D,unaff_R14,

+               unaff_R15);

+  }

+  lVar1 = *(longlong *)unaff_RSI - *(longlong *)(SpControlExt + 0x168);

+  if (lVar1 == 0) {

+    lVar1 = *(longlong *)(unaff_RSI + 8) - *(longlong *)(SpControlExt + 0x170);

+  }

+  this = (SP_PRM *)0x0;

+  if (lVar1 != 0) {

+    LOCK();

+    *(uint *)(SpControlExt + 0x640) = *(uint *)(SpControlExt + 0x640) | 2;

+    UNLOCK();

+    this = (SP_PRM *)(SpControlExt + 0x570);

+    SP_WORKITEM::Insert((SP_WORKITEM *)this,(_LIST_ENTRY *)0x0,0,'\0');

+  }

+  if (*(longlong *)(SpControlExt + 0xb58) != 0) {

+    SP_PRM::SendMessage(this,unaff_RSI,unaff_RBP);

+  }

+  uVar2 = IoReportTargetDeviceChangeAsynchronous(*(undefined8 *)(SpControlExt + 0x18));

+  ExFreePoolWithTag(uVar2,0);

+  return;

 }
```

## `SpIdsToString`  (modified)

```diff
--- SpIdsToString
+++ SpKSRClaimRuns
@@ -1,20 +1,133 @@
 

-/* unsigned short * __ptr64 __cdecl SpIdsToString(struct _SP_IDS_EX * __ptr64) */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Type propagation algorithm not settling */

+/* long __cdecl SpKSRClaimRuns(struct _GUID const * __ptr64,unsigned __int64,void * __ptr64) */

 

-ushort * __cdecl SpIdsToString(_SP_IDS_EX *param_1)

+long __cdecl SpKSRClaimRuns(_GUID *param_1,__uint64 param_2,void *param_3)

 

 {

-  ushort *puVar1;

-  uint uVar2;

+  code *pcVar1;

+  SP_CONTROL *pSVar2;

+  ulong uVar3;

+  uint uVar4;

+  _GUID *p_Var5;

+  SP_CONTROL *pSVar6;

+  _KSR_MEMORY_RUN *p_Var7;

+  _GUID *p_Var8;

+  _KSR_MEMORY_RUN *p_Var9;

+  _KSR_MEMORY_RUN *p_Var10;

+  undefined1 *puVar11;

+  undefined1 *puVar12;

+  _KSR_MEMORY_RUN *p_Var13;

+  undefined8 uStack_b0;

+  undefined1 auStack_a8 [32];

+  ulong *local_88;

+  longlong local_80;

+  ulong local_78 [2];

+  longlong local_70;

+  undefined8 local_68;

+  undefined8 uStack_60;

+  undefined8 local_58;

+  _KSR_MEMORY_RUN local_50 [32];

+  ulonglong local_30;

   

-  puVar1 = SC_ENV::Allocate((ulonglong)(*(int *)(param_1 + 0x20) * 0x26 + 1) * 2,0x58587053,'\0',0);

-  uVar2 = 0;

-  if ((puVar1 != (ushort *)0x0) && (*(int *)(param_1 + 0x20) != 0)) {

+  puVar11 = auStack_a8;

+  local_30 = __security_cookie ^ (ulonglong)auStack_a8;

+  local_78[0] = 0;

+  p_Var13 = (_KSR_MEMORY_RUN *)&local_68;

+  local_70 = 0;

+  local_78[1] = 0;

+  local_58 = 0;

+  local_88 = local_78 + 1;

+  local_68 = 0;

+  uStack_60 = 0;

+  p_Var8 = param_1;

+  p_Var9 = (_KSR_MEMORY_RUN *)param_2;

+  uVar4 = KsrQueryMetadata();

+  puVar12 = auStack_a8;

+  if (-1 < (int)uVar4) {

+    p_Var10 = (_KSR_MEMORY_RUN *)0x58587053;

+    if (4 < local_58._6_2_) goto LAB_0;

+    p_Var7 = local_50;

+    puVar12 = auStack_a8;

     do {

-      SpIdToString((_GUID *)(param_1 + (ulonglong)uVar2 * 0x10 + 0x24),puVar1 + uVar2 * 0x26);

-      uVar2 = uVar2 + 1;

-    } while (uVar2 < *(uint *)(param_1 + 0x20));

+      p_Var9 = p_Var10;

+      p_Var13 = (_KSR_MEMORY_RUN *)0x0;

+      p_Var8 = (_GUID *)0x38;

+      *(undefined8 *)(puVar12 + -8) = 0x14002dd8c;

+      p_Var5 = SC_ENV::Allocate(0x38,(ulong)p_Var9,'\0',0);

+      if (p_Var5 == (_GUID *)0x0) {

+        uVar4 = 0xc000009a;

+LAB_1:

+        if ((p_Var7 != (_KSR_MEMORY_RUN *)0x0) && (p_Var7 != local_50)) {

+          p_Var9 = (_KSR_MEMORY_RUN *)0x0;

+          *(undefined8 *)(puVar12 + -8) = 0x14002de8f;

+          ExFreePoolWithTag();

+          p_Var8 = (_GUID *)p_Var7;

+        }

+        if ((int)uVar4 < 0) goto LAB_2;

+        goto LAB_3;

+      }

+      *(undefined4 *)(p_Var5 + 0x28) = 0;

+      *(longlong *)(p_Var5 + 0x30) = 0;

+      *(ulong **)(puVar12 + 0x28) = local_78;

+      *(undefined4 *)(puVar12 + 0x20) = 1;

+      *(undefined8 *)(puVar12 + -8) = 0x14002ddc7;

+      p_Var13 = p_Var7;

+      uVar4 = KsrClaimPersistedMemory(param_1);

+      uVar3 = local_78[0];

+      if ((int)uVar4 < 0) {

+LAB_4:

+        p_Var9 = (_KSR_MEMORY_RUN *)0x0;

+        *(undefined8 *)(puVar12 + -8) = 0x14002de69;

+        ExFreePoolWithTag();

+        p_Var8 = p_Var5;

+        goto LAB_1;

+      }

+      p_Var13 = (_KSR_MEMORY_RUN *)&local_70;

+      *(undefined8 *)(puVar12 + -8) = 0x14002dde8;

+      p_Var9 = p_Var7;

+      uVar4 = SpMapKsrRuns(uVar3,p_Var7,(_MDL **)p_Var13);

+      p_Var10 = (_KSR_MEMORY_RUN *)(ulonglong)uVar4;

+      if ((int)uVar4 < 0) goto LAB_4;

+      *(undefined4 *)(p_Var5 + 0x10) = (undefined4)local_68;

+      *(undefined4 *)(p_Var5 + 0x14) = local_68._4_4_;

+      *(undefined4 *)(p_Var5 + 0x18) = (undefined4)uStack_60;

+      *(undefined4 *)(p_Var5 + 0x1c) = uStack_60._4_4_;

+      *(undefined4 *)(p_Var5 + 0x20) = (undefined4)local_58;

+      *(longlong *)(p_Var5 + 0x30) = local_70;

+      pSVar2 = SpControlExt;

+      pSVar6 = SpControlExt + 3000;

+      *(undefined4 *)(p_Var5 + 0x28) = 4;

+      p_Var8 = *(_GUID **)(pSVar2 + 0xbc0);

+      if (*(SP_CONTROL **)p_Var8 == pSVar6) {

+        *(SP_CONTROL **)p_Var5 = pSVar6;

+        *(_GUID **)(p_Var5 + 8) = p_Var8;

+        *(_GUID **)p_Var8 = p_Var5;

+        *(_GUID **)(pSVar2 + 0xbc0) = p_Var5;

+        goto LAB_1;

+      }

+      pcVar1 = (code *)swi(0x29);

+      (*pcVar1)(3);

+      puVar11 = puVar12 + 8;

+LAB_0:

+      p_Var8 = (_GUID *)((local_58 >> 0x30) << 3);

+      p_Var13 = (_KSR_MEMORY_RUN *)0x0;

+      *(undefined8 *)(puVar11 + -8) = 0x14002de3d;

+      p_Var9 = p_Var10;

+      p_Var7 = SC_ENV::Allocate((__uint64)p_Var8,(ulong)p_Var10,'\0',0);

+      puVar12 = puVar11;

+    } while (p_Var7 != (_KSR_MEMORY_RUN *)0x0);

+    uVar4 = 0xc000009a;

   }

-  return puVar1;

+LAB_2:

+  if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 0x10) != 0) {

+    *(uint *)(puVar12 + 0x20) = uVar4;

+    *(undefined8 *)(puVar12 + -8) = 0x14002dead;

+    McTemplateK0xq_EtwWriteTransfer(p_Var8,p_Var9,p_Var13,param_2);

+  }

+LAB_3:

+  *(undefined8 *)(puVar12 + -8) = 0x14002debb;

+  return 0;

 }
```

## `SpQueryId`  (modified)

```diff
--- SpQueryId
+++ SpQueryId
@@ -1,9 +1,72 @@
+

+/* long __cdecl SpQueryId(class SP_DEVICE * __ptr64,struct _IRP * __ptr64) */

 

 long __cdecl SpQueryId(SP_DEVICE *param_1,_IRP *param_2)

 

 {

-  long in_EAX;

+  int iVar1;

+  ulonglong uVar2;

+  void *_Dst;

+  wchar_t *pwVar3;

+  int iVar4;

+  char *pcVar5;

+  ulonglong local_18;

+  void *pvStack_10;

   

-  return in_EAX;

+  local_18 = 0;

+  pvStack_10 = (void *)0x0;

+  iVar4 = 0;

+  iVar1 = *(int *)(*(longlong *)(param_2 + 0xb8) + 8);

+  if (iVar1 == 0) {

+    pwVar3 = L"STORAGE\\Disk";

+LAB_0:

+    RtlInitUnicodeString(&local_18,pwVar3);

+LAB_1:

+    _Dst = SC_ENV::Allocate((local_18 & 0xffff) + 4,0x58587053,'\0',0);

+    uVar2 = local_18;

+    if (_Dst != (void *)0x0) {

+      memmove(_Dst,pvStack_10,local_18 & 0xffff);

+      *(undefined2 *)((longlong)_Dst + (uVar2 >> 1 & 0x7fff) * 2) = 0;

+      *(undefined2 *)((longlong)_Dst + (local_18 >> 1 & 0x7fff) * 2 + 2) = 0;

+      *(void **)(param_2 + 0x38) = _Dst;

+LAB_2:

+      if (SP_TL_DEFAULT != 3) {

+        SP_TL_DEFAULT = 3;

+      }

+      pcVar5 = "Exit ";

+      goto LAB_3;

+    }

+    iVar4 = -0x3fffff66;

+  }

+  else {

+    if (iVar1 == 1) {

+      if (param_1[0xc1d] == (SP_DEVICE)0x0) {

+        pwVar3 = L"GenDisk";

+      }

+      else {

+        pwVar3 = L"GenSmrDisk";

+      }

+      goto LAB_0;

+    }

+    if (iVar1 == 3) {

+      local_18 = *(ulonglong *)(param_1 + 0xc28);

+      pvStack_10 = *(void **)(param_1 + 0xc30);

+      goto LAB_1;

+    }

+    iVar4 = *(int *)(param_2 + 0x30);

+    if (((-1 < iVar4) || (iVar4 == -0x7ffffffb)) || (iVar4 == -0x3fffffdd)) goto LAB_2;

+  }

+  if (SP_TL_DEFAULT != 1) {

+    SP_TL_DEFAULT = 1;

+  }

+  pcVar5 = "Error";

+LAB_3:

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 1) != 0)) &&

+     (SP_TL_DEFAULT <= (byte)WPP_GLOBAL_Control[0x29])) {

+    WPP_SF_sd(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x1a,

+              &WPP_c0057829100d352b85ef230e7c5aed76_Traceguids,pcVar5);

+  }

+  return iVar4;

 }
```

## `LogCoreReadDataRecord`  (modified)

```diff
--- LogCoreReadDataRecord
+++ LogCoreScanDataRecord
@@ -1,97 +1,171 @@
 

-/* long __cdecl LogCoreReadDataRecord(struct _LOG_HANDLE * __ptr64,void * __ptr64,union

-   _SL_LSN,unsigned long,void * __ptr64,unsigned long,void * __ptr64,unsigned long,__int64) */

+/* long __cdecl LogCoreScanDataRecord(struct _LOG_HANDLE * __ptr64,void * __ptr64,union _SL_LSN,void

+   * __ptr64,unsigned long,struct _SL_LOG_SCAN_CONTEXT * __ptr64,void * __ptr64,unsigned

+   long,unsigned char,union _SL_LSN * __ptr64) */

 

 long __cdecl

-LogCoreReadDataRecord

-          (longlong param_1,void *param_2,ulonglong param_3,uint param_4,undefined8 param_5,

-          undefined4 param_6,void *param_7,uint param_8,longlong param_9)

+LogCoreScanDataRecord

+          (_LOG_HANDLE *param_1,void *param_2,ulonglong param_3,undefined8 param_4,

+          undefined8 param_5,longlong param_6,void *param_7,undefined8 param_8,undefined8 param_9,

+          ulonglong *param_10)

 

 {

-  uint uVar1;

-  longlong lVar2;

-  long lVar3;

-  void *_Dst;

-  _LOG_READ_IO_CONTEXT *p_Var4;

-  int iVar5;

-  ulonglong _Size;

-  uint uVar6;

-  longlong lVar7;

-  ulonglong in_stack_ffffffffffffffa8;

+  _LOG_HANDLE *p_Var1;

+  uint uVar2;

+  int iVar3;

+  long lVar4;

+  long lVar5;

+  ulonglong uVar6;

+  int iVar7;

+  uint uVar8;

+  int iVar9;

+  uint uVar10;

+  uint uVar11;

+  undefined8 local_58;

+  undefined8 local_50;

+  undefined8 local_48;

+  undefined8 local_40;

+  void *local_38;

   

-  _Size = (ulonglong)param_4;

-  uVar1 = *(uint *)(param_1 + 0xe48);

-  iVar5 = (int)param_3;

-  uVar6 = (param_4 - 1) + uVar1;

-  if ((uint)(*(int *)(param_1 + 0xe58) - iVar5) < (uVar6 - uVar6 % uVar1) / uVar1) {

-    lVar3 = -0x3ffffdfa;

+  local_38 = (void *)0x0;

+  local_58 = (void *)0x0;

+  param_9._0_4_ = 0;

+  lVar4 = LogCoreFetchDataRecord();

+  if (lVar4 < 0) {

+    uVar10 = 1;

+    goto LAB_0;

+  }

+  p_Var1 = param_1 + 0xe48;

+  uVar11 = *(uint *)p_Var1;

+  lVar4 = LogValidateEntryHeader(param_1);

+  if ((lVar4 == -0x3f18ffe2) &&

+     (uVar11 = iRam0000000000000034 * *(uint *)p_Var1, uVar11 <= (uint)param_9)) {

+    lVar4 = LogValidateEntryHeader();

+  }

+  uVar10 = lVar4 >> 0x1f & 2;

+  iVar7 = (int)param_3;

+  if (lVar4 < 0) {

+LAB_1:

+    uVar8 = *(uint *)(param_1 + 0xe48);

+    local_40 = CONCAT44((int)((ulonglong)*(undefined8 *)(param_1 + 0x18) >> 0x20) + 1,

+                        (int)*(undefined8 *)(param_1 + 0x18));

+    iVar9 = iVar7 + uVar11 / uVar8;

+    local_58._4_4_ = (int)(param_3 >> 0x20);

+    iVar3 = local_58._4_4_;

+    local_58 = (void *)CONCAT44(local_58._4_4_,iVar9);

+    for (; uVar11 < (uint)param_9; uVar11 = uVar11 + uVar8) {

+      lVar5 = LogValidateEntryHeader(param_1,local_58,uVar11,uVar8,1);

+      if (((lVar5 + 0x80000000U & 0x80000000) != 0) || (lVar5 == -0x3f18ffe2)) {

+        LOCK();

+        p_Var1 = param_1 + 0x2cd0;

+        uVar11 = *(uint *)p_Var1;

+        *(uint *)p_Var1 = *(uint *)p_Var1 + 1;

+        UNLOCK();

+        lVar4 = 0x105;

+        uVar10 = 7;

+        uVar6 = (ulonglong)(uVar11 + 1);

+        if (0x1f < uVar11) {

+          uVar6 = 0x20;

+        }

+        *(int *)(param_1 + uVar6 * 4 + 0x2cd0) = iVar7;

+        *param_10 = (ulonglong)local_58;

+        goto LAB_0;

+      }

+      iVar9 = iVar9 + 1;

+      local_58 = (void *)CONCAT44(local_58._4_4_,iVar9);

+      if (local_40 <= local_58) {

+        *(undefined1 *)(param_6 + 0xc) = 0;

+        break;

+      }

+      uVar8 = *(uint *)(param_1 + 0xe48);

+    }

+    if (*(char *)(param_6 + 0xc) != '\0') {

+      lVar4 = 0x105;

+      uVar10 = 8;

+      *param_10 = CONCAT44(iVar3 + 1,*(undefined4 *)(param_1 + 0xe4c));

+      *(ulonglong *)(param_1 + 0xe60) = param_3;

+    }

   }

   else {

-    lVar7 = (*(longlong *)(param_1 + 8) + (param_3 & 0xffffffff)) * (ulonglong)uVar1;

-    _Dst = SC_ENV::Allocate(_Size,0x6c587053,'\0',0);

-    if (_Dst == (void *)0x0) {

-      lVar3 = -0x3fffff66;

+    uVar8 = (uRam0000000000000030 - iRam0000000000000034) * *(uint *)p_Var1;

+    if (uVar8 != 0) {

+      if ((uint)param_9 < uVar8 + uVar11) {

+        local_58 = SC_ENV::Allocate((ulonglong)uVar8,0x6c587053,'\0',0);

+        local_38 = local_58;

+        if (local_58 == (void *)0x0) {

+          lVar4 = -0x3fffff66;

+          goto LAB_0;

+        }

+        lVar4 = SC_ENV::SendSynchronousFsdRequest

+                          (param_2,'\x03',local_58,uVar8,

+                           (ulonglong)uVar11 +

+                           (*(longlong *)(param_1 + 8) + (param_3 & 0xffffffff)) *

+                           (ulonglong)*(uint *)p_Var1);

+        if (lVar4 < 0) {

+          uVar10 = 4;

+          goto LAB_0;

+        }

+      }

+      else {

+        local_58 = (void *)(ulonglong)uVar11;

+      }

+      lVar4 = LogValidateEntryPayload(param_1,(_LOG_ENTRY_HEADER *)0x0,0,local_58,uVar8);

+      if (lVar4 < 0) {

+        uVar10 = 3;

+        goto LAB_1;

+      }

+    }

+    if (*(longlong *)(param_1 + 0x2e60) != 0) {

+      uVar2 = *(uint *)p_Var1;

+      memmove((void *)((ulonglong)(iVar7 * uVar2) + *(longlong *)(param_1 + 0x2e60)),(void *)0x0,

+              (ulonglong)uVar11);

+      if (uVar8 != 0) {

+        memmove((void *)((ulonglong)(iVar7 * uVar2 + uVar11) + *(longlong *)(param_1 + 0x2e60)),

+                local_58,(ulonglong)uVar8);

+      }

+    }

+    lVar4 = LogDecodeEntryHeader(param_1,(_LOG_ENTRY_HEADER *)0x0);

+    if (lVar4 < 0) {

+      uVar10 = 5;

     }

     else {

-      p_Var4 = SC_ENV::Allocate(0x60,0x6c587053,'\0',0);

-      if (p_Var4 == (_LOG_READ_IO_CONTEXT *)0x0) {

-        lVar3 = -0x3fffff66;

-      }

-      else {

-        lVar2 = *(longlong *)(param_1 + 0x2e60);

-        *(longlong *)p_Var4 = param_1;

-        *(void **)(p_Var4 + 8) = _Dst;

-        *(uint *)(p_Var4 + 0x10) = param_4;

-        *(longlong *)(p_Var4 + 0x18) = lVar7;

-        *(undefined8 *)(p_Var4 + 0x20) = param_5;

-        *(undefined4 *)(p_Var4 + 0x28) = param_6;

-        *(longlong *)(p_Var4 + 0x48) = param_9;

-        *(void **)(p_Var4 + 0x30) = param_7;

-        *(undefined8 *)(p_Var4 + 0x38) = 0;

-        *(uint *)(p_Var4 + 0x40) = param_8;

-        *(ulonglong *)(p_Var4 + 0x50) = param_3;

-        *(undefined8 *)(p_Var4 + 0x58) = 0;

-        if (lVar2 == 0) {

-          lVar3 = SC_ENV::SendAsynchronousFsdRequest

-                            (param_2,'\x03',_Dst,param_4,lVar7,LogReadHeaderCompletion,p_Var4);

-          if (-1 < lVar3) {

-            LOCK();

-            *(int *)(p_Var4 + 0x58) = *(int *)(p_Var4 + 0x58) + 1;

-            UNLOCK();

-            if ((param_8 != 0) &&

-               (lVar3 = SC_ENV::SendAsynchronousFsdRequest

-                                  (param_2,'\x03',param_7,param_8,_Size + lVar7 + param_9,

-                                   LogReadPayloadCompletion,p_Var4), -1 < lVar3)) {

-              LOCK();

-              *(int *)(p_Var4 + 0x58) = *(int *)(p_Var4 + 0x58) + 1;

-              UNLOCK();

-            }

+      if (param_7 != (void *)0x0) {

+        uVar6 = (ulonglong)uRam0000000000000040;

+        if (*(int *)(uVar6 + 0x28) == 2) {

+          if (0x100000 < *(uint *)(uVar6 + 0x18)) {

+            lVar4 = -0x3fffffdd;

+            uVar10 = 6;

+            goto LAB_0;

           }

+          memmove(param_7,(void *)(*(uint *)(uVar6 + 0x20) + uVar6),

+                  (ulonglong)*(uint *)(uVar6 + 0x18));

         }

         else {

-          memmove(_Dst,(void *)((ulonglong)(uint)(iVar5 * *(int *)(param_1 + 0xe48)) + lVar2),_Size)

-          ;

-          lVar3 = LogValidateEntryHeader

-                            (param_1,param_3,_Dst,param_4,

-                             in_stack_ffffffffffffffa8 & 0xffffffffffffff00);

-          if (-1 < lVar3) {

-            if (param_8 != 0) {

-              memmove(param_7,(void *)((uint)(iVar5 * *(int *)(param_1 + 0xe48)) + _Size +

-                                       *(longlong *)(param_1 + 0x2e60) + param_9),(ulonglong)param_8

-                     );

-            }

-            *(void **)(p_Var4 + 0x38) = param_7;

-            lVar3 = LogReadRecordComplete(p_Var4);

-          }

+          lVar4 = 0x105;

         }

-        if (*(int *)(p_Var4 + 0x58) != 0) {

-          return lVar3;

+      }

+      if (param_10 != (ulonglong *)0x0) {

+        if ((ulonglong)uRam0000000000000030 + (uRam0000000000000028 & 0xffffffff) < 0x100000000) {

+          local_50 = CONCAT44((int)(uRam0000000000000028 >> 0x20),

+                              (int)uRam0000000000000028 + uRam0000000000000030);

+          local_48 = local_50;

         }

-        ExFreePoolWithTag(p_Var4,0);

+        else {

+          local_48 = 0xffffffffffffffff;

+        }

+        if ((int)local_48 == *(int *)(param_1 + 0xe58)) {

+          *(ulonglong *)(param_1 + 0xe60) = local_48;

+          local_48 = CONCAT44((int)(local_48 >> 0x20) + 1,*(undefined4 *)(param_1 + 0xe4c));

+        }

+        *param_10 = local_48;

       }

-      ExFreePoolWithTag(_Dst,0);

     }

   }

-  return lVar3;

+LAB_0:

+  *(uint *)(param_6 + 0x10) = uVar10;

+  if (local_38 != (void *)0x0) {

+    ExFreePoolWithTag(local_38,0);

+  }

+  return lVar4;

 }
```

## `SpKSRClaimRuns`  (modified)

```diff
--- SpKSRClaimRuns
+++ SpMapKsrRuns
@@ -1,133 +1,76 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

-/* WARNING: Type propagation algorithm not settling */

-/* long __cdecl SpKSRClaimRuns(struct _GUID const * __ptr64,unsigned __int64,void * __ptr64) */

+/* long __cdecl SpMapKsrRuns(unsigned long,struct _KSR_MEMORY_RUN * __ptr64,struct _MDL * __ptr64 *

+   __ptr64) */

 

-long __cdecl SpKSRClaimRuns(_GUID *param_1,__uint64 param_2,void *param_3)

+long __cdecl SpMapKsrRuns(ulong param_1,_KSR_MEMORY_RUN *param_2,_MDL **param_3)

 

 {

-  code *pcVar1;

-  SP_CONTROL *pSVar2;

-  ulong uVar3;

-  uint uVar4;

-  _GUID *p_Var5;

-  SP_CONTROL *pSVar6;

+  int iVar1;

+  undefined8 uVar2;

+  _MDL *p_Var3;

+  longlong lVar4;

+  uint uVar5;

+  uint uVar6;

   _KSR_MEMORY_RUN *p_Var7;

-  _GUID *p_Var8;

-  _KSR_MEMORY_RUN *p_Var9;

-  _KSR_MEMORY_RUN *p_Var10;

-  undefined1 *puVar11;

-  undefined1 *puVar12;

-  _KSR_MEMORY_RUN *p_Var13;

-  undefined8 uStack_b0;

-  undefined1 auStack_a8 [32];

-  ulong *local_88;

-  longlong local_80;

-  ulong local_78 [2];

-  longlong local_70;

-  undefined8 local_68;

-  undefined8 uStack_60;

-  undefined8 local_58;

-  _KSR_MEMORY_RUN local_50 [32];

-  ulonglong local_30;

+  uint uVar8;

+  uint uVar9;

+  ulonglong uVar10;

+  ulonglong uVar11;

+  _MDL *p_Var12;

   

-  puVar11 = auStack_a8;

-  local_30 = __security_cookie ^ (ulonglong)auStack_a8;

-  local_78[0] = 0;

-  p_Var13 = (_KSR_MEMORY_RUN *)&local_68;

-  local_70 = 0;

-  local_78[1] = 0;

-  local_58 = 0;

-  local_88 = local_78 + 1;

-  local_68 = 0;

-  uStack_60 = 0;

-  p_Var8 = param_1;

-  p_Var9 = (_KSR_MEMORY_RUN *)param_2;

-  uVar4 = KsrQueryMetadata();

-  puVar12 = auStack_a8;

-  if (-1 < (int)uVar4) {

-    p_Var10 = (_KSR_MEMORY_RUN *)0x58587053;

-    if (4 < local_58._6_2_) goto LAB_0;

-    p_Var7 = local_50;

-    puVar12 = auStack_a8;

+  uVar8 = 0;

+  *param_3 = (_MDL *)0x0;

+  uVar10 = (ulonglong)param_1;

+  uVar9 = 0;

+  if (param_1 != 0) {

+    uVar11 = (ulonglong)param_1;

+    p_Var7 = param_2;

+    uVar9 = uVar8;

     do {

-      p_Var9 = p_Var10;

-      p_Var13 = (_KSR_MEMORY_RUN *)0x0;

-      p_Var8 = (_GUID *)0x38;

-      *(undefined8 *)(puVar12 + -8) = 0x14002dd8c;

-      p_Var5 = SC_ENV::Allocate(0x38,(ulong)p_Var9,'\0',0);

-      if (p_Var5 == (_GUID *)0x0) {

-        uVar4 = 0xc000009a;

-LAB_1:

-        if ((p_Var7 != (_KSR_MEMORY_RUN *)0x0) && (p_Var7 != local_50)) {

-          p_Var9 = (_KSR_MEMORY_RUN *)0x0;

-          *(undefined8 *)(puVar12 + -8) = 0x14002de8f;

-          ExFreePoolWithTag();

-          p_Var8 = (_GUID *)p_Var7;

+      uVar2 = *(undefined8 *)p_Var7;

+      p_Var7 = p_Var7 + 8;

+      uVar9 = uVar9 + (uint)((ulonglong)uVar2 >> 0x28);

+      uVar11 = uVar11 - 1;

+    } while (uVar11 != 0);

+  }

+  p_Var3 = SC_ENV::Allocate((ulonglong)(uVar9 * 8 + 0x30),0x58587053,'\0',0);

+  if (p_Var3 == (_MDL *)0x0) {

+    uVar8 = 0xc000009a;

+  }

+  else {

+    *(undefined8 *)p_Var3 = 0;

+    p_Var12 = p_Var3 + 0x30;

+    *(undefined8 *)(p_Var3 + 0x20) = 0;

+    *(undefined4 *)(p_Var3 + 0x2c) = 0;

+    *(short *)(p_Var3 + 8) = ((short)uVar9 + 6) * 8;

+    *(uint *)(p_Var3 + 0x28) = uVar9 << 0xc;

+    *(undefined2 *)(p_Var3 + 10) = 2;

+    if (param_1 != 0) {

+      do {

+        iVar1 = *(int *)param_2;

+        uVar6 = (uint)((ulonglong)*(undefined8 *)param_2 >> 0x28);

+        uVar9 = uVar8;

+        if (uVar6 != 0) {

+          do {

+            uVar5 = iVar1 + uVar9;

+            uVar9 = uVar9 + 1;

+            *(ulonglong *)p_Var12 = (ulonglong)uVar5;

+            p_Var12 = p_Var12 + 8;

+          } while (uVar9 < uVar6);

         }

-        if ((int)uVar4 < 0) goto LAB_2;

-        goto LAB_3;

-      }

-      *(undefined4 *)(p_Var5 + 0x28) = 0;

-      *(longlong *)(p_Var5 + 0x30) = 0;

-      *(ulong **)(puVar12 + 0x28) = local_78;

-      *(undefined4 *)(puVar12 + 0x20) = 1;

-      *(undefined8 *)(puVar12 + -8) = 0x14002ddc7;

-      p_Var13 = p_Var7;

-      uVar4 = KsrClaimPersistedMemory(param_1);

-      uVar3 = local_78[0];

-      if ((int)uVar4 < 0) {

-LAB_4:

-        p_Var9 = (_KSR_MEMORY_RUN *)0x0;

-        *(undefined8 *)(puVar12 + -8) = 0x14002de69;

-        ExFreePoolWithTag();

-        p_Var8 = p_Var5;

-        goto LAB_1;

-      }

-      p_Var13 = (_KSR_MEMORY_RUN *)&local_70;

-      *(undefined8 *)(puVar12 + -8) = 0x14002dde8;

-      p_Var9 = p_Var7;

-      uVar4 = SpMapKsrRuns(uVar3,p_Var7,(_MDL **)p_Var13);

-      p_Var10 = (_KSR_MEMORY_RUN *)(ulonglong)uVar4;

-      if ((int)uVar4 < 0) goto LAB_4;

-      *(undefined4 *)(p_Var5 + 0x10) = (undefined4)local_68;

-      *(undefined4 *)(p_Var5 + 0x14) = local_68._4_4_;

-      *(undefined4 *)(p_Var5 + 0x18) = (undefined4)uStack_60;

-      *(undefined4 *)(p_Var5 + 0x1c) = uStack_60._4_4_;

-      *(undefined4 *)(p_Var5 + 0x20) = (undefined4)local_58;

-      *(longlong *)(p_Var5 + 0x30) = local_70;

-      pSVar2 = SpControlExt;

-      pSVar6 = SpControlExt + 3000;

-      *(undefined4 *)(p_Var5 + 0x28) = 4;

-      p_Var8 = *(_GUID **)(pSVar2 + 0xbc0);

-      if (*(SP_CONTROL **)p_Var8 == pSVar6) {

-        *(SP_CONTROL **)p_Var5 = pSVar6;

-        *(_GUID **)(p_Var5 + 8) = p_Var8;

-        *(_GUID **)p_Var8 = p_Var5;

-        *(_GUID **)(pSVar2 + 0xbc0) = p_Var5;

-        goto LAB_1;

-      }

-      pcVar1 = (code *)swi(0x29);

-      (*pcVar1)(3);

-      puVar11 = puVar12 + 8;

-LAB_0:

-      p_Var8 = (_GUID *)((local_58 >> 0x30) << 3);

-      p_Var13 = (_KSR_MEMORY_RUN *)0x0;

-      *(undefined8 *)(puVar11 + -8) = 0x14002de3d;

-      p_Var9 = p_Var10;

-      p_Var7 = SC_ENV::Allocate((__uint64)p_Var8,(ulong)p_Var10,'\0',0);

-      puVar12 = puVar11;

-    } while (p_Var7 != (_KSR_MEMORY_RUN *)0x0);

-    uVar4 = 0xc000009a;

+        param_2 = param_2 + 8;

+        uVar10 = uVar10 - 1;

+      } while (uVar10 != 0);

+    }

+    lVar4 = MmMapLockedPagesSpecifyCache(p_Var3,0,0,0,0,0x40000020);

+    if (lVar4 == 0) {

+      uVar8 = 0xc000009a;

+      ExFreePoolWithTag(p_Var3,0);

+    }

+    else {

+      *param_3 = p_Var3;

+    }

   }

-LAB_2:

-  if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 0x10) != 0) {

-    *(uint *)(puVar12 + 0x20) = uVar4;

-    *(undefined8 *)(puVar12 + -8) = 0x14002dead;

-    McTemplateK0xq_EtwWriteTransfer(p_Var8,p_Var9,p_Var13,param_2);

-  }

-LAB_3:

-  *(undefined8 *)(puVar12 + -8) = 0x14002debb;

-  return 0;

+  return uVar8;

 }
```

## `SpLogConfigUpdate`  (modified)

```diff
--- SpLogConfigUpdate
+++ SpLogConfigUpdate
@@ -1,7 +1,43 @@
+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* void __cdecl SpLogConfigUpdate(class SDB_CONFIG * __ptr64,unsigned long,unsigned long) */

 

 void __cdecl SpLogConfigUpdate(SDB_CONFIG *param_1,ulong param_2,ulong param_3)

 

 {

+  void *pvVar1;

+  longlong *plVar2;

+  longlong *plVar3;

+  int iVar4;

+  uint uVar5;

+  undefined8 *puVar6;

+  

+  uVar5 = 0;

+  iVar4 = 0;

+  for (puVar6 = *(undefined8 **)(*(longlong *)(param_1 + 8) + 0x138);

+      puVar6 != (undefined8 *)(*(longlong *)(param_1 + 8) + 0x138); puVar6 = (undefined8 *)*puVar6)

+  {

+    iVar4 = iVar4 + 1;

+  }

+  pvVar1 = SC_ENV::Allocate((ulonglong)(iVar4 * 0x4c + 2),0x58587053,'\0',0);

+  if (pvVar1 != (void *)0x0) {

+    plVar2 = *(longlong **)(param_1 + 8);

+    plVar3 = (longlong *)plVar2[0x27];

+    if (plVar3 != plVar2 + 0x27) {

+      do {

+        SpIdToString((_GUID *)(plVar3[8] + 500),(ushort *)((longlong)pvVar1 + (ulonglong)uVar5 * 2))

+        ;

+        plVar2 = *(longlong **)(param_1 + 8);

+        uVar5 = uVar5 + 0x26;

+        plVar3 = (longlong *)*plVar3;

+      } while (plVar3 != plVar2 + 0x27);

+    }

+    if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 0x40) != 0) {

+      (**(code **)(*plVar2 + 0x10))(plVar2);

+      McTemplateK0jqqqqqqz_EtwWriteTransfer();

+    }

+    SC_ENV_ALLOCATOR::operator_delete(pvVar1);

+  }

   return;

 }
```

## `SpQueryPowerRelations`  (modified)

```diff
--- SpQueryPowerRelations
+++ SpQueryPowerRelations
@@ -1,17 +1,78 @@
+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* long __cdecl SpQueryPowerRelations(class SP_DEVICE * __ptr64,struct _DEVICE_RELATIONS * __ptr64 *

+   __ptr64) */

 

 long __cdecl SpQueryPowerRelations(SP_DEVICE *param_1,_DEVICE_RELATIONS **param_2)

 

 {

-  undefined8 in_R8;

-  char *in_R9;

+  SP_CONTROL *pSVar1;

+  _DEVICE_RELATIONS *p_Var2;

+  longlong lVar3;

+  SP_CONTROL *pSVar4;

+  int iVar5;

+  undefined4 uVar6;

+  ulonglong uVar7;

+  ulonglong uVar8;

+  long lVar9;

+  undefined1 auStack_58 [32];

+  longlong local_38;

+  longlong lStack_30;

+  ulonglong local_28;

   

-  WPP_SF_sd(param_1,0x34,in_R8,in_R9);

-  wil::details::

-  unique_storage<wil::details::resource_policy<_EX_PUSH_LOCK*___ptr64,void_(__cdecl*)(_EX_PUSH_LOCK*___ptr64)_noexcept,&void___cdecl_wil::details::release_push_lock_exclusive(struct__EX_PUSH_LOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_EX_PUSH_LOCK*___ptr64,_EX_PUSH_LOCK*___ptr64,0,std::nullptr_t>_>

-  ::

-  ~unique_storage<wil::details::resource_policy<_EX_PUSH_LOCK*___ptr64,void_(__cdecl*)(_EX_PUSH_LOCK*___ptr64)_noexcept,&void___cdecl_wil::details::release_push_lock_exclusive(struct__EX_PUSH_LOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_EX_PUSH_LOCK*___ptr64,_EX_PUSH_LOCK*___ptr64,0,std::nullptr_t>_>

-            ((unique_storage<wil::details::resource_policy<_EX_PUSH_LOCK*___ptr64,void_(__cdecl*)(_EX_PUSH_LOCK*___ptr64)_noexcept,&void___cdecl_wil::details::release_push_lock_exclusive(struct__EX_PUSH_LOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_EX_PUSH_LOCK*___ptr64,_EX_PUSH_LOCK*___ptr64,0,std::nullptr_t>_>

-              *)&stack0x00000048);

-  return 0;

+  local_28 = __security_cookie ^ (ulonglong)auStack_58;

+  local_38 = *(longlong *)(param_1 + 0x18);

+  lStack_30 = *(longlong *)(param_1 + 0x20);

+  iVar5 = 0;

+  uVar6 = 0;

+  p_Var2 = (_DEVICE_RELATIONS *)0x0;

+  SpAcquireResourceShared((_ERESOURCE *)(SpControlExt + 0x60),'\0');

+  pSVar4 = SpControlExt + 0xf0;

+  pSVar1 = *(SP_CONTROL **)pSVar4;

+  lVar9 = 0;

+  if (pSVar1 != pSVar4) {

+    do {

+      lVar3 = *(longlong *)(pSVar1 + -100) - local_38;

+      if (lVar3 == 0) {

+        lVar3 = *(longlong *)(pSVar1 + -0x5c) - lStack_30;

+      }

+      if ((lVar3 == 0) && (pSVar1[-0xc0] == (SP_CONTROL)0x0)) {

+        iVar5 = iVar5 + 1;

+      }

+      pSVar1 = *(SP_CONTROL **)pSVar1;

+    } while (pSVar1 != pSVar4);

+    lVar9 = 0;

+    if (iVar5 != 0) {

+      p_Var2 = SC_ENV::Allocate((ulonglong)(iVar5 * 8 + 8),0x58587053,'\0',0);

+      if (p_Var2 == (_DEVICE_RELATIONS *)0x0) {

+        lVar9 = -0x3fffff66;

+      }

+      else {

+        pSVar1 = *(SP_CONTROL **)(SpControlExt + 0xf0);

+        uVar7 = 0;

+        if (pSVar1 != SpControlExt + 0xf0) {

+          do {

+            lVar3 = *(longlong *)(pSVar1 + -100) - local_38;

+            if (lVar3 == 0) {

+              lVar3 = *(longlong *)(pSVar1 + -0x5c) - lStack_30;

+            }

+            uVar8 = uVar7;

+            if ((lVar3 == 0) && (pSVar1[-0xc0] == (SP_CONTROL)0x0)) {

+              ObfReferenceObject(*(longlong *)(pSVar1 + 0x38));

+              uVar8 = (ulonglong)((int)uVar7 + 1);

+              *(longlong *)(p_Var2 + uVar7 * 8 + 8) = *(longlong *)(pSVar1 + 0x38);

+            }

+            uVar6 = (undefined4)uVar8;

+            pSVar1 = *(SP_CONTROL **)pSVar1;

+            uVar7 = uVar8;

+          } while (pSVar1 != SpControlExt + 0xf0);

+        }

+        *(undefined4 *)p_Var2 = uVar6;

+      }

+    }

+  }

+  SpReleaseResourceShared((_ERESOURCE *)(SpControlExt + 0x60));

+  *param_2 = p_Var2;

+  return lVar9;

 }
```

## `FUN_14001aa31`  (modified)

```diff
--- FUN_14001aa31
+++ FUN_14000ee5d
@@ -1,18 +1,34 @@
 

-/* WARNING: Control flow encountered bad instruction data */

-

-long FUN_14001aa31(longlong param_1,longlong param_2)

+long FUN_14000ee5d(longlong param_1,longlong param_2)

 

 {

-  char *pcVar1;

-  undefined4 in_EAX;

-  undefined4 in_register_00000004;

-  longlong unaff_RBP;

+  long lVar1;

+  ushort *puVar2;

+  long unaff_EBX;

+  __uint64 _Var3;

+  ushort *unaff_RSI;

+  undefined8 *unaff_RDI;

   

-  pcVar1 = (char *)(CONCAT44(in_register_00000004,in_EAX) + 0x74);

-  *pcVar1 = *pcVar1 + (char)in_EAX;

-  *(undefined4 *)(unaff_RBP + -0x75) = in_EAX;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  lVar1 = -0x3ffffff3;

+  if (param_2 != 0) {

+    lVar1 = unaff_EBX;

+  }

+  if ((param_2 != 0) && (param_1 - param_2 != 0)) {

+    _Var3 = (param_1 - param_2) + 1;

+    puVar2 = SC_ENV::Allocate(_Var3 * 2,0x58587053,'\0',0);

+    if (puVar2 == (ushort *)0x0) {

+      lVar1 = -0x3fffff66;

+    }

+    else {

+      lVar1 = RtlStringCchCopyW(puVar2,_Var3,unaff_RSI);

+      if (lVar1 < 0) {

+        ExFreePoolWithTag(puVar2,0);

+      }

+      else {

+        *unaff_RDI = puVar2;

+      }

+    }

+  }

+  return lVar1;

 }
```

## `SIO_RAID5::GetBitMap`  (modified)

```diff
--- SIO_RAID5::GetBitMap
+++ SIO_RAID5::GetBitMap
@@ -1,2 +1,55 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID5::GetBitMap : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_RAID5::GetBitMap(class SIO_LOG_GET_BITMAP * __ptr64) __ptr64 */

+

+long __thiscall SIO_RAID5::GetBitMap(SIO_RAID5 *this,SIO_LOG_GET_BITMAP *param_1)

+

+{

+  _RTL_BITMAP *p_Var1;

+  void *_Src;

+  uint uVar2;

+  undefined1 uVar3;

+  void *_Dst;

+  uint uVar4;

+  undefined8 *puVar5;

+  undefined **local_38;

+  undefined4 local_30;

+  uint local_2c;

+  undefined8 *local_28;

+  

+  p_Var1 = (_RTL_BITMAP *)(this + 0x50);

+  local_30 = 0;

+  this[0x48] = (SIO_RAID5)0x0;

+  uVar4 = (*(int *)p_Var1 + 7U >> 3) + 0x17 & 0xfffffff8;

+  local_38 = &SC_BITMAP_ENCODER::_vftable_;

+  if ((uint)(*(int *)(param_1 + 8) - *(int *)(param_1 + 0xc)) < uVar4) {

+    uVar4 = *(int *)(param_1 + 0xc) + uVar4;

+    uVar2 = *(int *)(param_1 + 8) * 2;

+    if (uVar4 <= uVar2) {

+      uVar4 = uVar2;

+    }

+    _Dst = SC_ENV::Allocate((ulonglong)uVar4,0x58587053,'\0',0);

+    if (_Dst == (void *)0x0) {

+      return -0x3fffff66;

+    }

+    _Src = *(void **)param_1;

+    memmove(_Dst,_Src,(ulonglong)*(uint *)(param_1 + 0xc));

+    ExFreePoolWithTag(_Src,0);

+    *(void **)param_1 = _Dst;

+    *(uint *)(param_1 + 8) = uVar4;

+  }

+  puVar5 = (undefined8 *)((ulonglong)*(uint *)(param_1 + 0xc) + *(longlong *)param_1);

+  *puVar5 = 0;

+  puVar5[1] = 0;

+  *puVar5 = *(undefined8 *)(this + 0x10);

+  local_2c = *(int *)p_Var1 + 7U >> 3;

+  local_28 = puVar5 + 2;

+  uVar3 = ExAcquireSpinLockExclusive(this + 0x18);

+  SC_BITMAP_ENCODER::EncodeRange((SC_BITMAP_ENCODER *)&local_38,p_Var1);

+  ExReleaseSpinLockExclusive(this + 0x18,uVar3);

+  *(undefined4 *)(puVar5 + 1) = local_30;

+  *(uint *)((longlong)puVar5 + 0xc) = local_2c;

+  *(uint *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + (local_2c + 0x17 & 0xfffffff8);

+  *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;

+  return 0;

+}

+
```

## `SP_ENCLOSURE::SetTimestamp`  (modified)

```diff
--- SP_ENCLOSURE::SetTimestamp
+++ SP_ENCLOSURE::SetTimestamp
@@ -1,2 +1,56 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_ENCLOSURE::SetTimestamp : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* public: long __cdecl SP_ENCLOSURE::SetTimestamp(unsigned __int64) __ptr64 */

+

+long __thiscall SP_ENCLOSURE::SetTimestamp(SP_ENCLOSURE *this,__uint64 param_1)

+

+{

+  long lVar1;

+  void *pvVar2;

+  undefined1 uStackX_11;

+  undefined1 uStackX_12;

+  undefined1 uStackX_13;

+  undefined1 uStackX_14;

+  undefined1 uStackX_15;

+  undefined1 auStack_a8 [32];

+  _SCSI_REQUEST_BLOCK local_88 [10];

+  undefined1 local_7e;

+  undefined4 local_7c;

+  undefined4 local_78;

+  void *local_70;

+  undefined1 local_40;

+  byte local_3f;

+  undefined4 local_3a;

+  ulonglong local_28;

+  

+  local_28 = __security_cookie ^ (ulonglong)auStack_a8;

+  memset(local_88,0,0x58);

+  pvVar2 = SC_ENV::Allocate(0xc,0x58587053,'\0',0);

+  if (pvVar2 == (void *)0x0) {

+    lVar1 = -0x3fffff66;

+  }

+  else {

+    *(char *)((longlong)pvVar2 + 9) = (char)param_1;

+    uStackX_11 = (undefined1)(param_1 >> 8);

+    *(undefined1 *)((longlong)pvVar2 + 8) = uStackX_11;

+    uStackX_12 = (undefined1)(param_1 >> 0x10);

+    *(undefined1 *)((longlong)pvVar2 + 7) = uStackX_12;

+    uStackX_13 = (undefined1)(param_1 >> 0x18);

+    *(undefined1 *)((longlong)pvVar2 + 6) = uStackX_13;

+    uStackX_14 = (undefined1)(param_1 >> 0x20);

+    *(undefined1 *)((longlong)pvVar2 + 5) = uStackX_14;

+    uStackX_15 = (undefined1)(param_1 >> 0x28);

+    *(undefined1 *)((longlong)pvVar2 + 4) = uStackX_15;

+    local_7c = 0x188;

+    local_3f = local_3f & 0xef | 0xf;

+    local_78 = 0xc;

+    local_7e = 0xc;

+    local_40 = 0xa4;

+    local_3a = 0xc000000;

+    local_70 = pvVar2;

+    lVar1 = SendScsiRequest(this,local_88);

+    SC_ENV_ALLOCATOR::operator_delete(pvVar2);

+  }

+  return lVar1;

+}

+
```

## `SIO_CACHE_VERIFIER::Shutdown`  (modified)

```diff
--- SIO_CACHE_VERIFIER::Shutdown
+++ SIO_CACHE_VERIFIER::Shutdown
@@ -1,2 +1,78 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_CACHE_VERIFIER::Shutdown : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl SIO_CACHE_VERIFIER::Shutdown(class SIO_CACHE * __ptr64,long) __ptr64 */

+

+void __thiscall

+SIO_CACHE_VERIFIER::Shutdown(SIO_CACHE_VERIFIER *this,SIO_CACHE *param_1,long param_2)

+

+{

+  longlong lVar1;

+  undefined8 uVar2;

+  void *pvVar3;

+  SIO_CACHE_LINE *pSVar4;

+  undefined4 uVar5;

+  undefined4 uVar6;

+  undefined4 uVar7;

+  undefined4 uVar8;

+  __uint64 local_res8;

+  

+  local_res8 = 0;

+  if (*(longlong *)this != 0) {

+    LogMapping(this,(__uint64)param_1,(longlong)param_2);

+    FreeLines(this);

+    if (param_2 < 0) {

+      uVar5 = 0;

+      uVar6 = 0;

+      uVar7 = 0;

+      uVar8 = 0;

+    }

+    else {

+      pvVar3 = SC_SPARSE::FindFirstObject((SC_SPARSE *)(param_1 + 0xb0),&local_res8);

+      while (pvVar3 != (void *)0x0) {

+        pSVar4 = SC_ENV::Allocate((ulonglong)*(uint *)(param_1 + 0xa8),0x58587053,'\0',0);

+        if (pSVar4 == (SIO_CACHE_LINE *)0x0) {

+          return;

+        }

+        SIO_CACHE_LINE::Initialize

+                  (pSVar4,*(__uint64 *)((longlong)pvVar3 + 0x20),

+                   *(__uint64 *)((longlong)pvVar3 + 0x28),*(ulong *)(param_1 + 0x1e0));

+        *(undefined2 *)(pSVar4 + 0x40) = *(undefined2 *)((longlong)pvVar3 + 0x40);

+        uVar2 = *(undefined8 *)((longlong)pvVar3 + 0x38);

+        *(undefined8 *)(pSVar4 + 0x30) = *(undefined8 *)((longlong)pvVar3 + 0x30);

+        *(undefined8 *)(pSVar4 + 0x38) = uVar2;

+        memmove(*(void **)(pSVar4 + 0x50),*(void **)((longlong)pvVar3 + 0x50),

+                (ulonglong)(*(int *)(param_1 + 0x1e0) + 0x1fU >> 3 & 0x1ffffffc));

+        SC_SPARSE::SetObject(*(SC_SPARSE **)this,local_res8,pSVar4);

+        pvVar3 = SC_SPARSE::FindNextObject((SC_SPARSE *)(param_1 + 0xb0),&local_res8);

+      }

+      pvVar3 = SC_SPARSE::FindFirstObject((SC_SPARSE *)(param_1 + 0x100),&local_res8);

+      while (pvVar3 != (void *)0x0) {

+        pSVar4 = SC_ENV::Allocate((ulonglong)*(uint *)(param_1 + 0xa8),0x58587053,'\0',0);

+        if (pSVar4 == (SIO_CACHE_LINE *)0x0) {

+          return;

+        }

+        SIO_CACHE_LINE::Initialize

+                  (pSVar4,*(__uint64 *)((longlong)pvVar3 + 0x20),

+                   *(__uint64 *)((longlong)pvVar3 + 0x28),*(ulong *)(param_1 + 0x1e0));

+        *(undefined2 *)(pSVar4 + 0x40) = *(undefined2 *)((longlong)pvVar3 + 0x40);

+        uVar2 = *(undefined8 *)((longlong)pvVar3 + 0x38);

+        *(undefined8 *)(pSVar4 + 0x30) = *(undefined8 *)((longlong)pvVar3 + 0x30);

+        *(undefined8 *)(pSVar4 + 0x38) = uVar2;

+        memmove(*(void **)(pSVar4 + 0x50),*(void **)((longlong)pvVar3 + 0x50),

+                (ulonglong)(*(int *)(param_1 + 0x1e0) + 0x1fU >> 3 & 0x1ffffffc));

+        SC_SPARSE::SetObject(*(SC_SPARSE **)(this + 8),local_res8,pSVar4);

+        pvVar3 = SC_SPARSE::FindNextObject((SC_SPARSE *)(param_1 + 0x100),&local_res8);

+      }

+      lVar1 = *(longlong *)(param_1 + 8);

+      uVar5 = *(undefined4 *)(lVar1 + 0x28);

+      uVar6 = *(undefined4 *)(lVar1 + 0x2c);

+      uVar7 = *(undefined4 *)(lVar1 + 0x30);

+      uVar8 = *(undefined4 *)(lVar1 + 0x34);

+    }

+    *(undefined4 *)(this + 0x2c) = uVar5;

+    *(undefined4 *)(this + 0x30) = uVar6;

+    *(undefined4 *)(this + 0x34) = uVar7;

+    *(undefined4 *)(this + 0x38) = uVar8;

+  }

+  return;

+}

+
```

## `SS_STORE_CACHE::Initialize`  (modified)

```diff
--- SS_STORE_CACHE::Initialize
+++ SS_STORE_CACHE::Initialize
@@ -1,2 +1,36 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE_CACHE::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SS_STORE_CACHE::Initialize(void) __ptr64 */

+

+long __thiscall SS_STORE_CACHE::Initialize(SS_STORE_CACHE *this)

+

+{

+  int iVar1;

+  int *piVar2;

+  int *piVar3;

+  long lVar4;

+  

+  piVar3 = (int *)0x0;

+  lVar4 = 0;

+  piVar2 = SC_ENV::Allocate(0x18,0x62537053,'\0',0);

+  if (piVar2 != (int *)0x0) {

+    piVar2[0] = 0;

+    piVar2[1] = 0;

+    piVar2[2] = 0;

+    piVar2[3] = 0;

+    piVar2[4] = 0;

+    piVar2[5] = 0;

+    piVar3 = piVar2;

+  }

+  *(int **)(this + 8) = piVar3;

+  if (piVar3 == (int *)0x0) {

+    lVar4 = -0x3fffff66;

+  }

+  else {

+    for (iVar1 = 0x1f; 0x10000U >> iVar1 == 0; iVar1 = iVar1 + -1) {

+    }

+    *piVar3 = iVar1;

+    piVar3[1] = (int)(0x20000000L >> ((byte)iVar1 & 0x3f));

+  }

+  return lVar4;

+}

+
```

## `SIO_RAID5::RepairRow`  (modified)

```diff
--- SIO_RAID5::RepairRow
+++ SIO_RAID5::RepairRow
@@ -1,2 +1,94 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID5::RepairRow : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_RAID5::RepairRow(class SC_PACKET * __ptr64) __ptr64 */

+

+long __thiscall SIO_RAID5::RepairRow(SIO_RAID5 *this,SC_PACKET *param_1)

+

+{

+  SIO_RAID5 SVar1;

+  undefined4 uVar2;

+  longlong lVar3;

+  uchar uVar4;

+  ulong uVar5;

+  SP_RESILIENCY_INFO *pSVar6;

+  void *pvVar7;

+  SC_PARITY_CONTEXT *pSVar8;

+  uint uVar9;

+  int iVar10;

+  ulonglong uVar11;

+  undefined8 uVar12;

+  

+  uVar2 = *(undefined4 *)(*(longlong *)(*(longlong *)(this + 8) + 0x180) + 0x28);

+  uVar4 = IsRowStable(this,*(ulonglong *)(param_1 + 0x88) >> ((byte)this[0x2a] & 0x3f));

+  if (uVar4 == '\0') {

+    iVar10 = -0x3fffff5d;

+  }

+  else {

+    pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+    iVar10 = *(int *)(pSVar6 + 0x10);

+    pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+    pSVar8 = (SC_PARITY_CONTEXT *)0x0;

+    pvVar7 = SC_ENV::Allocate((ulonglong)*(uint *)(pSVar6 + 8) << 3,0x58587053,'\0',0);

+    if (pvVar7 == (void *)0x0) {

+      iVar10 = -0x3fffff66;

+    }

+    else {

+      uVar11 = 0;

+      while( true ) {

+        pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+        if (*(uint *)(pSVar6 + 8) <= (uint)uVar11) break;

+        pSVar8 = SC_ENV::Allocate((ulonglong)(uint)(iVar10 << 3) + 0x18,0x70587053,'\0',0);

+        *(SC_PARITY_CONTEXT **)((longlong)pvVar7 + uVar11 * 8) = pSVar8;

+        if (pSVar8 == (SC_PARITY_CONTEXT *)0x0) {

+          iVar10 = -0x3fffff66;

+          goto LAB_0;

+        }

+        SC_PARITY::InitializeContext

+                  (*(SC_PARITY **)(*(longlong *)(this + 8) + 0x180),(1 << ((byte)uVar2 & 0x1f)) - 1,

+                   pSVar8);

+        uVar11 = (ulonglong)((uint)uVar11 + 1);

+      }

+      *(uint *)(param_1 + 0x4c) = *(uint *)(param_1 + 0x4c) | 8;

+      *(void **)(param_1 + 0x80) = pvVar7;

+      pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+      uVar5 = SP_RESILIENCY_INFO::NumberOfDataColumns(pSVar6);

+      SVar1 = this[0x2a];

+      uVar12 = CONCAT71((int7)((ulonglong)pSVar8 >> 8),0x14);

+      *(undefined2 *)(param_1 + 0xa9) = 0x40f;

+      *(SIO_RAID5 **)(param_1 + 0xe0) = this;

+      *(SIO_RAID5 **)(param_1 + 0xe8) = this;

+      *(ulong *)(param_1 + 0x90) = uVar5 * (int)(1L << ((byte)SVar1 & 0x3f));

+      SC_DISPATCH::Dispatch((SC_DISPATCH *)this,param_1,(_SC_OPERATION)uVar12);

+      uVar12 = CONCAT71((int7)((ulonglong)uVar12 >> 8),0x17);

+      param_1[0xa8] = (SC_PACKET)0x3;

+      param_1[0xaa] = (SC_PACKET)0x5;

+      SC_DISPATCH::Dispatch((SC_DISPATCH *)this,param_1,(_SC_OPERATION)uVar12);

+      iVar10 = *(int *)(param_1 + 0xb0);

+      if (-1 < iVar10) {

+        param_1[0xa8] = (SC_PACKET)0x4;

+        param_1[0xaa] = (SC_PACKET)0x1;

+        SC_DISPATCH::Dispatch

+                  ((SC_DISPATCH *)this,param_1,

+                   (_SC_OPERATION)CONCAT71((int7)((ulonglong)uVar12 >> 8),0x1a));

+        iVar10 = *(int *)(param_1 + 0xb0);

+      }

+      SIO_RAID::ReleaseRegion((SIO_RAID *)this,param_1);

+LAB_0:

+      uVar9 = 0;

+      pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+      if (*(int *)(pSVar6 + 8) != 0) {

+        do {

+          lVar3 = *(longlong *)((longlong)pvVar7 + (ulonglong)uVar9 * 8);

+          if (lVar3 != 0) {

+            ExFreePoolWithTag(lVar3,0);

+          }

+          uVar9 = uVar9 + 1;

+          pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+        } while (uVar9 < *(uint *)(pSVar6 + 8));

+      }

+      ExFreePoolWithTag(pvVar7,0);

+      *(undefined8 *)(param_1 + 0x80) = 0;

+    }

+  }

+  return iVar10;

+}

+
```

## `SDB_POOL_CONFIG::CreateExtent`  (modified)

```diff
--- SDB_POOL_CONFIG::CreateExtent
+++ SDB_POOL_CONFIG::CreateExtent
@@ -1,2 +1,113 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::CreateExtent : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SDB_POOL_CONFIG::CreateExtent(class SDB_RECORD * __ptr64,class SDB_RECORD *

+   __ptr64,class SDB_EXTENT * __ptr64) __ptr64 */

+

+long __thiscall

+SDB_POOL_CONFIG::CreateExtent

+          (SDB_POOL_CONFIG *this,SDB_RECORD *param_1,SDB_RECORD *param_2,SDB_EXTENT *param_3)

+

+{

+  ushort uVar1;

+  char cVar2;

+  long lVar3;

+  undefined4 uVar4;

+  SDB_OBJECT *pSVar5;

+  SDB_RECORD *pSVar6;

+  SDB_OBJECT *this_00;

+  SDB_OBJECT *pSVar7;

+  SDB_OBJECT *pSVar8;

+  ushort uVar9;

+  SDB_RECORD *this_01;

+  ulonglong uVar10;

+  longlong lVar11;

+  SDB_EXTENT *pSVar12;

+  

+  pSVar6 = param_1;

+  pSVar12 = param_3;

+  pSVar5 = SDB_RECORD::GetObject(param_1);

+  pSVar6 = FindRecordByRecordId

+                     (this,(_SDB_RECORD_TYPE)CONCAT71((int7)((ulonglong)pSVar6 >> 8),2),

+                      *(ulong *)(pSVar12 + 0x3c));

+  lVar3 = SDB_RECORD::PreTouch(pSVar6,(SDB_OBJECT *)0x0);

+  if (-1 < lVar3) {

+    this_00 = SDB_RECORD::GetObject(pSVar6);

+    pSVar7 = SC_ENV::Allocate(0x58,0x65427053,'\x01',0);

+    if (pSVar7 == (SDB_OBJECT *)0x0) {

+      lVar3 = -0x3fffff66;

+    }

+    else {

+      *(undefined4 *)(pSVar7 + 0x48) = 0xffffffff;

+      *(undefined2 *)(pSVar7 + 0x18) = 0;

+      *(undefined8 *)(pSVar7 + 8) = 0;

+      *(undefined8 *)(pSVar7 + 0x10) = 0;

+      *(undefined ***)pSVar7 = &SDB_EXTENT::_vftable_;

+      *(undefined2 *)(pSVar7 + 0x4c) = 0;

+      pSVar7[0x19] = pSVar5[0x19];

+      *(undefined8 *)(pSVar7 + 0x20) = *(undefined8 *)(param_3 + 0x20);

+      *(undefined8 *)(pSVar7 + 0x28) = *(undefined8 *)(param_3 + 0x28);

+      *(undefined8 *)(pSVar7 + 0x30) = *(undefined8 *)(param_3 + 0x30);

+      if (param_2 == (SDB_RECORD *)0x0) {

+        uVar4 = *(undefined4 *)(param_1 + 0x18);

+        uVar9 = 0;

+      }

+      else {

+        uVar9 = 4;

+        *(undefined2 *)(pSVar7 + 0x4c) = 4;

+        uVar4 = *(undefined4 *)(param_2 + 0x18);

+      }

+      *(undefined4 *)(pSVar7 + 0x38) = uVar4;

+      *(undefined4 *)(pSVar7 + 0x3c) = *(undefined4 *)(param_3 + 0x3c);

+      *(undefined4 *)(pSVar7 + 0x40) = *(undefined4 *)(param_3 + 0x40);

+      *(undefined4 *)(pSVar7 + 0x44) = *(undefined4 *)(param_3 + 0x44);

+      uVar1 = *(ushort *)(param_3 + 0x4c);

+      *(ushort *)(pSVar7 + 0x4e) = *(ushort *)(pSVar7 + 0x4e) | 4;

+      *(ushort *)(pSVar7 + 0x4c) = uVar9 | uVar1;

+      pSVar6 = SDB_RECORD::operator_new((ulonglong)(uVar9 | uVar1));

+      if (pSVar6 == (SDB_RECORD *)0x0) {

+        lVar3 = -0x3fffff66;

+      }

+      else {

+        *(ushort *)(pSVar6 + 0x1e) = *(ushort *)(pSVar6 + 0x1e) | 4;

+        *(SDB_POOL_CONFIG **)(pSVar6 + 0x10) = this;

+        pSVar6[0x1c] = (SDB_RECORD)0x4;

+        cVar2 = (**(code **)(*(longlong *)this + 0x50))(this,4);

+        if (cVar2 != '\0') {

+          SDB_CONFIG::NextRecordId((SDB_CONFIG *)this);

+          lVar3 = FUN_14006c264();

+          return lVar3;

+        }

+        *(undefined4 *)(pSVar6 + 0x18) = 0;

+        pSVar8 = pSVar7;

+        lVar3 = SDB_RECORD::PreTouch(pSVar6,pSVar7);

+        if (lVar3 < 0) {

+          SDB_RECORD::_scalar_deleting_destructor_(pSVar6,(uint)pSVar8);

+        }

+        else {

+          this_01 = pSVar6;

+          pSVar8 = SDB_RECORD::GetObject(pSVar6);

+          lVar11 = 0x140074a44;

+          *(SDB_RECORD **)(pSVar8 + 0x10) = pSVar6;

+          uVar10 = (ulonglong)*(uint *)(this + 0x30);

+          pSVar8 = SDB_RECORD::GetObject(this_01);

+          pSVar8[0x18] = *(SDB_OBJECT *)(lVar11 + uVar10 * 8);

+          SDB_RECORD::Touch(pSVar6);

+          lVar3 = SDB_DRIVE::InsertExtentRecord((SDB_DRIVE *)this_00,pSVar6);

+          if ((-1 < lVar3) &&

+             (lVar3 = SDB_SPACE::InsertExtentRecord((SDB_SPACE *)pSVar5,pSVar6), -1 < lVar3)) {

+            pSVar6 = *(SDB_RECORD **)(this + 0x110);

+            lVar3 = SDB_RECORD::PreTouch(pSVar6,(SDB_OBJECT *)0x0);

+            if (-1 < lVar3) {

+              pSVar5 = SDB_RECORD::GetObject(pSVar6);

+              *(longlong *)(pSVar5 + 0xf8) =

+                   *(longlong *)(pSVar5 + 0xf8) + *(longlong *)(pSVar7 + 0x20);

+            }

+          }

+        }

+      }

+      (*(code *)**(undefined8 **)pSVar7)(pSVar7,1);

+    }

+  }

+  return lVar3;

+}

+
```

## `SP_DRIVE::QueryDependentDisk`  (modified)

```diff
--- SP_DRIVE::QueryDependentDisk
+++ SP_DRIVE::QueryDependentDisk
@@ -1,2 +1,36 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_DRIVE::QueryDependentDisk : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SP_DRIVE::QueryDependentDisk(unsigned long,struct

+   _STORAGE_QUERY_DEPENDENT_DISK_RESPONSE * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SP_DRIVE::QueryDependentDisk

+          (SP_DRIVE *this,ulong param_1,_STORAGE_QUERY_DEPENDENT_DISK_RESPONSE **param_2)

+

+{

+  long lVar1;

+  _STORAGE_QUERY_DEPENDENT_DISK_RESPONSE *p_Var2;

+  __uint64 _Var3;

+  ulong local_res10 [2];

+  

+  *param_2 = (_STORAGE_QUERY_DEPENDENT_DISK_RESPONSE *)0x0;

+  _Var3 = 0x10;

+  local_res10[0] = param_1;

+  while( true ) {

+    p_Var2 = SC_ENV::Allocate(_Var3,0x58587053,'\0',0);

+    if (p_Var2 == (_STORAGE_QUERY_DEPENDENT_DISK_RESPONSE *)0x0) {

+      return -0x3fffff66;

+    }

+    lVar1 = SpSendDeviceControl(*(_DEVICE_OBJECT **)(this + 0x288),0x2d118c,local_res10,4,p_Var2,

+                                (ulong)_Var3);

+    if (-1 < lVar1) break;

+    if (lVar1 != -0x7ffffffb) {

+      SC_ENV_ALLOCATOR::operator_delete(p_Var2);

+      return lVar1;

+    }

+    _Var3 = (__uint64)*(uint *)(p_Var2 + 8);

+    SC_ENV_ALLOCATOR::operator_delete(p_Var2);

+  }

+  *param_2 = p_Var2;

+  return lVar1;

+}

+
```

## `SP_CONTROL::InitializeKsrData`  (modified)

```diff
--- SP_CONTROL::InitializeKsrData
+++ SP_CONTROL::InitializeKsrData
@@ -1,2 +1,54 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::InitializeKsrData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl SP_CONTROL::InitializeKsrData(void) __ptr64 */

+

+long __thiscall SP_CONTROL::InitializeKsrData(SP_CONTROL *this)

+

+{

+  uint uVar1;

+  int *_Src;

+  int iVar2;

+  void *_Dst;

+  undefined *puVar3;

+  code *pcVar4;

+  ulong local_res8 [2];

+  void *local_res10;

+  

+  local_res10 = (void *)0x0;

+  local_res8[0] = 0;

+  if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 8) != 0) {

+    McTemplateK0_EtwWriteTransfer(this,&SpacesKsrCompleted);

+  }

+  pcVar4 = SpKSRClaimRuns;

+  puVar3 = &PARTITION_SPACES_GUID;

+  *(undefined4 *)(this + (ulonglong)*(uint *)(this + 0xb98) * 4 + 0xb88) = 2;

+  iVar2 = KsrEnumeratePersistedMemory(&PARTITION_SPACES_GUID,SpKSRClaimRuns);

+  if (-1 < iVar2) {

+    puVar3 = &PARTITION_SPACES_GUID;

+    iVar2 = SC_ENV::GetPd((_GUID *)&PARTITION_SPACES_GUID,

+                          (SC_PD_TYPE)CONCAT71((int7)((ulonglong)pcVar4 >> 8),1),&local_res10,

+                          local_res8);

+    if (-1 < iVar2) {

+      _Src = (int *)((longlong)local_res10 + 0xc);

+      *(undefined4 *)(this + 0xba8) = *(undefined4 *)((longlong)local_res10 + 4);

+      *(undefined4 *)(this + 0xbac) = *(undefined4 *)((longlong)local_res10 + 8);

+      iVar2 = *_Src;

+      if (iVar2 == 0) {

+        return 0;

+      }

+      uVar1 = iVar2 * 0x10 + 4;

+      puVar3 = (undefined *)(ulonglong)uVar1;

+      _Dst = SC_ENV::Allocate((__uint64)puVar3,0x58587053,'\0',0);

+      *(void **)(this + 0xba0) = _Dst;

+      if (_Dst != (void *)0x0) {

+        memmove(_Dst,_Src,(ulonglong)uVar1);

+        return 0;

+      }

+      iVar2 = -0x3fffff66;

+    }

+  }

+  if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 0x10) != 0) {

+    McTemplateK0q_EtwWriteTransfer(puVar3,&SpacesPdInitializeKsrError,0,iVar2);

+  }

+  return 0;

+}

+
```

## `SDB_METADATA::Unformat`  (modified)

```diff
--- SDB_METADATA::Unformat
+++ SDB_METADATA::Unformat
@@ -1,2 +1,36 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_METADATA::Unformat : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl SDB_METADATA::Unformat(class SS_RECORD * __ptr64) __ptr64 */

+

+long __thiscall SDB_METADATA::Unformat(SDB_METADATA *this,SS_RECORD *param_1)

+

+{

+  long lVar1;

+  void *pvVar2;

+  uint uVar3;

+  

+  this[0x18] = *(SDB_METADATA *)(param_1 + 0x11);

+  lVar1 = SS_RECORD::Unformat(param_1,(SC_FIELD *)&DAT_0,2,this);

+  if (-1 < lVar1) {

+    pvVar2 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(this + 0x20) << 4),0x6d427053,'\0',0);

+    *(void **)(this + 0x28) = pvVar2;

+    if (pvVar2 == (void *)0x0) {

+      lVar1 = -0x3fffff66;

+    }

+    else {

+      uVar3 = 0;

+      if (*(int *)(this + 0x20) != 0) {

+        do {

+          lVar1 = SS_RECORD::Unformat(param_1,(SC_FIELD *)&DAT_1,1,

+                                      (void *)((ulonglong)uVar3 * 0x10 + *(longlong *)(this + 0x28))

+                                     );

+          if (lVar1 < 0) {

+            return lVar1;

+          }

+          uVar3 = uVar3 + 1;

+        } while (uVar3 < *(uint *)(this + 0x20));

+      }

+    }

+  }

+  return lVar1;

+}

+
```

## `SDB_SPACE::IntegrityCheck`  (modified)

```diff
--- SDB_SPACE::IntegrityCheck
+++ SDB_SPACE::IntegrityCheck
@@ -1,2 +1,53 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE::IntegrityCheck : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl SDB_SPACE::IntegrityCheck(void) __ptr64 */

+

+long __thiscall SDB_SPACE::IntegrityCheck(SDB_SPACE *this)

+

+{

+  long lVar1;

+  ulong uVar2;

+  SDB_OBJECT *pSVar3;

+  SC_SPARSE *pSVar4;

+  uchar in_R9B;

+  

+  pSVar3 = SDB_RECORD::GetObject

+                     (*(SDB_RECORD **)(*(longlong *)(*(longlong *)(this + 0x10) + 0x10) + 0x110));

+  if ((byte)((char)this[0x42] - 1U) < 0xb) {

+    lVar1 = ScValidateProvisioning

+                      ((_SP_PROVISIONING_INFO *)(this + 0x58),*(__uint64 *)(pSVar3 + 0x58),'\0',

+                       in_R9B);

+    if (lVar1 < 0) {

+      return lVar1;

+    }

+    if ((*(int *)(this + 0xc4) == 0) || (*(longlong *)(this + 200) != 0)) {

+      if ((this[0x42] != (SDB_SPACE)0x1) &&

+         (lVar1 = SP_RESILIENCY_INFO::Validate((SP_RESILIENCY_INFO *)(this + 0x78),'\0'), lVar1 < 0)

+         ) {

+        return lVar1;

+      }

+      lVar1 = ScValidatePerformance((_SP_PERFORMANCE_INFO *)(this + 0x90),'\0');

+      if (lVar1 < 0) {

+        return lVar1;

+      }

+      uVar2 = SP_RESILIENCY_INFO::NumberOfDataColumns((SP_RESILIENCY_INFO *)(this + 0x78));

+      *(ulonglong *)(this + 0x108) = (ulonglong)uVar2 * *(longlong *)(this + 0x60);

+      pSVar4 = SC_ENV::Allocate(0x50,0x61587053,'\0',0);

+      if (pSVar4 == (SC_SPARSE *)0x0) {

+        pSVar4 = (SC_SPARSE *)0x0;

+      }

+      else {

+        pSVar4 = (SC_SPARSE *)SC_SPARSE::SC_SPARSE(pSVar4);

+      }

+      *(SC_SPARSE **)(this + 0xe0) = pSVar4;

+      if (pSVar4 == (SC_SPARSE *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar1 = SC_SPARSE::Initialize

+                        (pSVar4,*(ulonglong *)(this + 0x48) / *(ulonglong *)(this + 0x108) &

+                                0xffffffff);

+      return lVar1;

+    }

+  }

+  return -0x3ffffff3;

+}

+
```

## `SIO_SPACE_DRIVE::InitializeStripeTable`  (modified)

```diff
--- SIO_SPACE_DRIVE::InitializeStripeTable
+++ SIO_SPACE_DRIVE::InitializeStripeTable
@@ -1,2 +1,35 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE_DRIVE::InitializeStripeTable : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_SPACE_DRIVE::InitializeStripeTable(void) __ptr64 */

+

+long __thiscall SIO_SPACE_DRIVE::InitializeStripeTable(SIO_SPACE_DRIVE *this)

+

+{

+  long lVar1;

+  SC_SPARSE *this_00;

+  ulonglong uVar2;

+  bool bVar3;

+  

+  this_00 = SC_ENV::Allocate(0x50,0x61587053,'\0',0);

+  if (this_00 == (SC_SPARSE *)0x0) {

+    lVar1 = -0x3fffff66;

+  }

+  else {

+    SC_SPARSE::SC_SPARSE(this_00);

+    uVar2 = *(ulonglong *)(this + 0x20) >> ((byte)*(undefined4 *)(this + 0x28) & 0x3f);

+    lVar1 = SC_SPARSE::Initialize(this_00,uVar2);

+    if (-1 < lVar1) {

+      LOCK();

+      bVar3 = *(longlong *)(this + 0x30) == 0;

+      if (bVar3) {

+        *(SC_SPARSE **)(this + 0x30) = this_00;

+      }

+      UNLOCK();

+      if (bVar3) {

+        return lVar1;

+      }

+    }

+    SC_SPARSE::_scalar_deleting_destructor_(this_00,(uint)uVar2);

+  }

+  return lVar1;

+}

+
```

## `SDB_SPACE_CONFIG::Load`  (modified)

```diff
--- SDB_SPACE_CONFIG::Load
+++ SDB_SPACE_CONFIG::Load
@@ -1,2 +1,169 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE_CONFIG::Load : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: static long __cdecl SDB_SPACE_CONFIG::Load(class SDB_POOL_CONFIG * __ptr64,class

+   SDB_SPACE * __ptr64,enum _SP_DRIVE_USAGE,struct _SP_IDS * __ptr64,unsigned char,class

+   SDB_SPACE_CONFIG * __ptr64 * __ptr64) */

+

+long __cdecl

+SDB_SPACE_CONFIG::Load

+          (SDB_POOL_CONFIG *param_1,SDB_SPACE *param_2,_SP_DRIVE_USAGE param_3,_SP_IDS *param_4,

+          uchar param_5,SDB_SPACE_CONFIG **param_6)

+

+{

+  uchar uVar1;

+  long lVar2;

+  SS_STORE *pSVar3;

+  SDB_RECORD *pSVar4;

+  SDB_SPACE_CONFIG *pSVar5;

+  SDB_OBJECT *this;

+  ulonglong uVar6;

+  uint uVar7;

+  SC_DRIVE *pSVar8;

+  SC_DRIVE *pSVar9;

+  _GUID *p_Var10;

+  SS_STORE *pSVar11;

+  __uint64 local_58;

+  undefined4 uStack_50;

+  undefined4 uStack_4c;

+  undefined8 *****local_48;

+  undefined8 *****local_40;

+  

+  local_58 = 0;

+  *param_6 = (SDB_SPACE_CONFIG *)0x0;

+  pSVar8 = (SC_DRIVE *)0x73537053;

+  local_40 = &local_48;

+  local_48 = &local_48;

+  pSVar3 = SC_ENV::Allocate(0x150,0x73537053,'\0',0);

+  if ((pSVar3 == (SS_STORE *)0x0) ||

+     (pSVar3 = (SS_STORE *)SS_STORE::SS_STORE(pSVar3), pSVar3 == (SS_STORE *)0x0)) {

+    lVar2 = -0x3fffff66;

+  }

+  else {

+    pSVar4 = (SDB_RECORD *)0x0;

+    while (pSVar4 = SDB_POOL_CONFIG::GetRecordByType

+                              (param_1,(_SDB_RECORD_TYPE)CONCAT71((int7)((ulonglong)pSVar8 >> 8),2),

+                               pSVar4), pSVar4 != (SDB_RECORD *)0x0) {

+      pSVar8 = (SC_DRIVE *)SDB_RECORD::GetObject(pSVar4);

+      pSVar9 = *(SC_DRIVE **)(pSVar8 + 200);

+      if ((pSVar9 != (SC_DRIVE *)0x0) &&

+         ((param_3 == 0 || (*(_SP_DRIVE_USAGE *)(pSVar8 + 0x44) == param_3)))) {

+        if ((param_4 == (_SP_IDS *)0x0) || (*(uint *)param_4 == 0)) {

+LAB_0:

+          lVar2 = SDB_POOL_CONFIG::GetSpaceConfigSlotByDrive

+                            (param_1,*(ulong *)(param_2 + 0x50),pSVar4,&local_58);

+          if (lVar2 < 0) goto LAB_1;

+          SS_STORE::AddPath(pSVar3,pSVar9,local_58,(SDB_PATH **)0x0);

+          pSVar8 = pSVar9;

+        }

+        else {

+          uVar7 = 0;

+          do {

+            if ((*(longlong *)(pSVar8 + 0x20) ==

+                 *(longlong *)(param_4 + (ulonglong)uVar7 * 0x10 + 4)) &&

+               (*(longlong *)(pSVar8 + 0x28) ==

+                *(longlong *)(param_4 + (ulonglong)uVar7 * 0x10 + 0xc))) goto LAB_0;

+            uVar7 = uVar7 + 1;

+          } while (uVar7 < *(uint *)param_4);

+        }

+      }

+    }

+    if (*(int *)(pSVar3 + 0x128) == 0) {

+      lVar2 = -0x3f18fff5;

+    }

+    else {

+      pSVar5 = SC_ENV::Allocate(0x170,0x6e427053,'\0',0);

+      if ((pSVar5 == (SDB_SPACE_CONFIG *)0x0) ||

+         (pSVar5 = (SDB_SPACE_CONFIG *)SDB_SPACE_CONFIG(pSVar5), pSVar5 == (SDB_SPACE_CONFIG *)0x0))

+      {

+        lVar2 = -0x3fffff66;

+      }

+      else {

+        lVar2 = (**(code **)(*(longlong *)pSVar5 + 8))(pSVar5);

+        if (-1 < lVar2) {

+          *(undefined4 *)(pSVar5 + 0x110) = *(undefined4 *)(param_2 + 0x80);

+          *(undefined8 *)(pSVar5 + 0x118) = *(undefined8 *)(param_2 + 0x108);

+          lVar2 = SC_SPARSE::Initialize((SC_SPARSE *)(pSVar5 + 0x120),0x10000000000);

+          if (-1 < lVar2) {

+            local_58 = *(__uint64 *)(param_2 + 0x20);

+            uStack_50 = *(undefined4 *)(param_2 + 0x28);

+            uStack_4c = *(undefined4 *)(param_2 + 0x2c);

+            lVar2 = SDB_CONFIG::Load((SDB_CONFIG *)pSVar5,&local_58,pSVar3);

+            pSVar11 = (SS_STORE *)0x0;

+            pSVar3 = (SS_STORE *)0x0;

+            if ((-1 < lVar2) &&

+               (p_Var10 = (_GUID *)param_1,

+               lVar2 = GetMetadataDrives(pSVar5,param_1,(ulong *)(*(longlong *)(pSVar5 + 8) + 300),

+                                         (_GUID **)0x0), pSVar3 = pSVar11, -1 < lVar2)) {

+              pSVar4 = (SDB_RECORD *)0x0;

+              while( true ) {

+                p_Var10 = (_GUID *)CONCAT71((int7)((ulonglong)p_Var10 >> 8),2);

+                pSVar4 = SDB_POOL_CONFIG::GetRecordByType(param_1,(_SDB_RECORD_TYPE)p_Var10,pSVar4);

+                if (pSVar4 == (SDB_RECORD *)0x0) break;

+                this = SDB_RECORD::GetObject(pSVar4);

+                pSVar8 = SDB_DRIVE::GetDrive((SDB_DRIVE *)this);

+                if (pSVar8 != (SC_DRIVE *)0x0) {

+                  p_Var10 = (_GUID *)(pSVar8 + 500);

+                  uVar1 = HasMetadata(pSVar5,p_Var10);

+                  if (uVar1 == '\0') {

+                    SS_STORE::RemovePath(*(SS_STORE **)(pSVar5 + 8),pSVar8);

+                    p_Var10 = (_GUID *)pSVar8;

+                  }

+                  else {

+                    if ((param_3 != 0) && (*(_SP_DRIVE_USAGE *)(this + 0x44) != param_3)) {

+LAB_2:

+                      lVar2 = -0x3fffffff;

+                      goto LAB_3;

+                    }

+                    if ((param_4 != (_SP_IDS *)0x0) && (*(uint *)param_4 != 0)) {

+                      uVar7 = 0;

+                      while( true ) {

+                        uVar6 = (ulonglong)uVar7;

+                        p_Var10 = (_GUID *)(uVar6 * 2);

+                        if ((*(longlong *)(this + 0x20) == *(longlong *)(param_4 + uVar6 * 0x10 + 4)

+                            ) && (*(longlong *)(this + 0x28) ==

+                                  *(longlong *)(param_4 + uVar6 * 0x10 + 0xc))) break;

+                        uVar7 = uVar7 + 1;

+                        if (*(uint *)param_4 <= uVar7) goto LAB_2;

+                      }

+                    }

+                  }

+                }

+              }

+              SS_STORE::LogPathArrived(*(SS_STORE **)(pSVar5 + 8));

+              uVar6 = Feature_Servicing_RackLevelNestedMirror__private_IsEnabledDeviceUsageNoInline

+                                ();

+              if (((int)uVar6 == 0) &&

+                 (uVar6 = Feature_Servicing_RackLevelNestedMirrorEnable__private_IsEnabledDeviceUsageNoInline

+                                    (), (int)uVar6 == 0)) {

+                *(undefined4 *)(pSVar5 + 0x10) = *(undefined4 *)(param_1 + 0x10);

+                *(undefined4 *)(*(longlong *)(pSVar5 + 8) + 0x130) = *(undefined4 *)(param_1 + 0x10)

+                ;

+              }

+              else {

+                UpdateTolerance(pSVar5,*(_SC_FD_TYPE *)(param_2 + 0x70),

+                                *(ulong *)(*(longlong *)(pSVar5 + 8) + 300),

+                                (_GUID *)(param_2 + 0x20));

+              }

+              uVar1 = SS_STORE::IsQuorate(*(SS_STORE **)(pSVar5 + 8),

+                                          *(ulong *)(*(SS_STORE **)(pSVar5 + 8) + 0x128));

+              if (uVar1 != '\0') {

+                *param_6 = pSVar5;

+                return lVar2;

+              }

+              lVar2 = -0x3fc7ffcb;

+            }

+          }

+        }

+LAB_3:

+        (*(code *)**(undefined8 **)pSVar5)(pSVar5,1);

+        if (pSVar3 == (SS_STORE *)0x0) {

+          return lVar2;

+        }

+      }

+    }

+LAB_1:

+    (*(code *)**(undefined8 **)pSVar3)(pSVar3,1);

+  }

+  return lVar2;

+}

+
```

## `SDB_SPACE::Unformat`  (modified)

```diff
--- SDB_SPACE::Unformat
+++ SDB_SPACE::Unformat
@@ -1,2 +1,101 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE::Unformat : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl SDB_SPACE::Unformat(class SS_RECORD * __ptr64) __ptr64 */

+

+long __thiscall SDB_SPACE::Unformat(SDB_SPACE *this,SS_RECORD *param_1)

+

+{

+  SDB_SPACE SVar1;

+  int iVar2;

+  long lVar3;

+  void *pvVar4;

+  undefined8 uVar5;

+  uint uVar6;

+  

+  SVar1 = *(SDB_SPACE *)(param_1 + 0x11);

+  this[0x18] = SVar1;

+  lVar3 = SS_RECORD::Unformat(param_1,*(SC_FIELD **)(&DAT_0 + (ulonglong)(byte)SVar1 * 0x10)

+                              ,*(ulong *)(&DAT_1 + (ulonglong)(byte)SVar1 * 0x10),this);

+  if (lVar3 < 0) {

+    return lVar3;

+  }

+  if ((((uint)*(ushort *)(this + 0x40) &

+       ~*(uint *)(&DAT_2 + (ulonglong)(byte)this[0x18] * 4)) != 0) ||

+     (*(int *)(this + 0x80) == 0)) {

+    return -0x3ffffff3;

+  }

+  if (*(int *)(this + 0xc4) != 0) {

+    pvVar4 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(this + 0xc4) << 4),0x73427053,'\0',0);

+    *(void **)(this + 200) = pvVar4;

+    if (pvVar4 == (void *)0x0) {

+      return -0x3fffff66;

+    }

+    for (uVar6 = 0; uVar6 < *(uint *)(this + 0xc4); uVar6 = uVar6 + 1) {

+      lVar3 = SS_RECORD::Unformat(param_1,(SC_FIELD *)&DAT_3,1,

+                                  (void *)((ulonglong)uVar6 * 0x10 + *(longlong *)(this + 200)));

+      if (lVar3 < 0) {

+        return lVar3;

+      }

+    }

+  }

+  SVar1 = this[0x18];

+  if ((byte)SVar1 < 3) {

+    uVar5 = 0;

+    if (*(int *)(this + 0x78) == 3) {

+      uVar5 = 0x2000000;

+    }

+    *(undefined8 *)(this + 0x90) = uVar5;

+LAB_4:

+    iVar2 = *(int *)(this + 0x78);

+    if (iVar2 == 1) {

+      *(undefined4 *)(this + 0x7c) = 0;

+    }

+    else if (iVar2 == 2) {

+      *(int *)(this + 0x7c) = *(int *)(this + 0x80) + -1;

+    }

+    else if (iVar2 == 3) {

+      *(undefined4 *)(this + 0x7c) = 1;

+    }

+LAB_5:

+    *(uint *)(this + 0x88) = *(uint *)(this + 0x88) / *(uint *)(this + 0x80);

+LAB_6:

+    *(uint *)(this + 0x74) = (this[0x74] != (SDB_SPACE)0x0) + 1;

+LAB_7:

+    if (*(int *)(this + 0xb4) != 0) {

+      *(undefined4 *)(this + 0x68) = 5;

+    }

+LAB_8:

+    *(undefined4 *)(this + 0xc0) = 1;

+  }

+  else {

+    if ((byte)SVar1 < 4) goto LAB_4;

+    if ((byte)SVar1 < 6) goto LAB_5;

+    if ((byte)SVar1 < 7) goto LAB_6;

+    if ((byte)SVar1 < 9) goto LAB_7;

+    if ((byte)SVar1 < 10) goto LAB_8;

+  }

+  if (*(int *)(this + 0xc4) == 0) {

+    *(undefined4 *)(this + 0xc0) = 0;

+  }

+  if ((byte)SVar1 < 0xb) {

+    *(longlong *)(this + 0x48) = *(longlong *)(this + 0x48) << 0x1c;

+LAB_9:

+    *(undefined8 *)(this + 0xd0) = 0;

+    *(undefined8 *)(this + 0xd8) = 0;

+  }

+  else {

+    if ((byte)SVar1 < 0xf) goto LAB_9;

+    if (0xf < (byte)SVar1) goto LAB_10;

+  }

+  *(undefined8 *)(this + 0x98) = 0;

+  *(undefined4 *)(this + 0xb0) = 1;

+LAB_10:

+  if (this[0x42] == (SDB_SPACE)0x1) {

+    pvVar4 = SC_ENV::Allocate(*(ulonglong *)(this + 0x48) >> 0x19 & 0xffffffff,0x73427053,'\0',0);

+    *(void **)(this + 0x178) = pvVar4;

+    if (pvVar4 == (void *)0x0) {

+      lVar3 = -0x3fffff66;

+    }

+  }

+  return lVar3;

+}

+
```

## `SIO_SPACE::GetRepairWork`  (modified)

```diff
--- SIO_SPACE::GetRepairWork
+++ SIO_SPACE::GetRepairWork
@@ -1,2 +1,51 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::GetRepairWork : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_SPACE::GetRepairWork(enum _SC_REPAIR_PHASE,class SP_REPAIR_WORK *

+   __ptr64 * __ptr64,unsigned long * __ptr64) __ptr64 */

+

+long __thiscall

+SIO_SPACE::GetRepairWork

+          (SIO_SPACE *this,_SC_REPAIR_PHASE param_1,SP_REPAIR_WORK **param_2,ulong *param_3)

+

+{

+  longlong *plVar1;

+  longlong lVar2;

+  undefined8 uVar3;

+  SP_REPAIR_WORK *pSVar4;

+  ulonglong uVar5;

+  long lVar6;

+  uint uVar7;

+  undefined8 *puVar8;

+  

+  lVar6 = 0;

+  *param_2 = (SP_REPAIR_WORK *)0x0;

+  *param_3 = 0;

+  if ((param_1 == 2) || (param_1 == 5)) {

+    lVar2 = *(longlong *)(*(longlong *)(this + 0x148) + 8);

+    uVar7 = *(int *)(lVar2 + 0x128) * 0x10 + 8;

+    pSVar4 = SC_ENV::Allocate((ulonglong)uVar7,0x72587053,'\0',0);

+    if (pSVar4 == (SP_REPAIR_WORK *)0x0) {

+      lVar6 = -0x3fffff66;

+    }

+    else {

+      *(_SC_REPAIR_PHASE *)pSVar4 = param_1;

+      puVar8 = *(undefined8 **)(lVar2 + 0x138);

+      *(_SC_REPAIR_PHASE *)(pSVar4 + 4) = *(_SC_REPAIR_PHASE *)(lVar2 + 0x128);

+      uVar5 = 0;

+      while (puVar8 != (undefined8 *)(lVar2 + 0x138)) {

+        plVar1 = puVar8 + 8;

+        puVar8 = (undefined8 *)*puVar8;

+        uVar3 = *(undefined8 *)(*plVar1 + 0x1fc);

+        *(undefined8 *)(pSVar4 + uVar5 * 0x10 + 8) = *(undefined8 *)(*plVar1 + 500);

+        *(undefined8 *)(pSVar4 + uVar5 * 0x10 + 8 + 8) = uVar3;

+        uVar5 = (ulonglong)((int)uVar5 + 1);

+      }

+      *param_2 = pSVar4;

+      *param_3 = uVar7;

+    }

+  }

+  else {

+    lVar6 = -0x3ffffff3;

+  }

+  return lVar6;

+}

+
```

## `SC_DEVICE::GetStorageProperty`  (modified)

```diff
--- SC_DEVICE::GetStorageProperty
+++ SC_DEVICE::GetStorageProperty
@@ -1,2 +1,61 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_DEVICE::GetStorageProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* public: long __cdecl SC_DEVICE::GetStorageProperty(enum _STORAGE_PROPERTY_ID,struct

+   _STORAGE_DESCRIPTOR_HEADER * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SC_DEVICE::GetStorageProperty

+          (SC_DEVICE *this,_STORAGE_PROPERTY_ID param_1,_STORAGE_DESCRIPTOR_HEADER **param_2)

+

+{

+  uint uVar1;

+  int iVar2;

+  _STORAGE_DESCRIPTOR_HEADER *p_Var3;

+  uint uVar4;

+  undefined1 auStack_98 [32];

+  _STORAGE_DESCRIPTOR_HEADER *local_78;

+  uint local_70;

+  uint local_58;

+  _STORAGE_PROPERTY_ID local_50;

+  undefined4 local_4c;

+  undefined4 local_48;

+  ulonglong local_40;

+  

+  local_40 = __security_cookie ^ (ulonglong)auStack_98;

+  *param_2 = (_STORAGE_DESCRIPTOR_HEADER *)0x0;

+  local_58 = 0;

+  local_48 = 0;

+  iVar2 = (**(code **)(*(longlong *)this + 0x20))();

+  if (-1 < iVar2) {

+    local_4c = 0;

+    uVar4 = local_58;

+    local_50 = param_1;

+    while (p_Var3 = SC_ENV::Allocate((ulonglong)uVar4,0x58587053,'\0',0),

+          p_Var3 != (_STORAGE_DESCRIPTOR_HEADER *)0x0) {

+      local_78 = p_Var3;

+      local_70 = uVar4;

+      iVar2 = (**(code **)(*(longlong *)this + 0x10))(this,0x2d1400);

+      if (((iVar2 + 0x80000000U & 0x80000000) == 0) && (iVar2 != -0x7ffffffb)) {

+LAB_0:

+        ExFreePoolWithTag(p_Var3,0);

+        return iVar2;

+      }

+      uVar1 = *(uint *)(p_Var3 + 4);

+      if (uVar1 <= uVar4) {

+        *(uint *)(p_Var3 + 4) = uVar4;

+        iVar2 = (**(code **)(*(longlong *)this + 0x28))(this,param_1,p_Var3);

+        if (-1 < iVar2) {

+          *param_2 = p_Var3;

+          return iVar2;

+        }

+        goto LAB_0;

+      }

+      ExFreePoolWithTag(p_Var3,0);

+      uVar4 = uVar1;

+    }

+    iVar2 = -0x3fffff66;

+  }

+  return iVar2;

+}

+
```

## `SIO_COUNTERS::Initialize`  (modified)

```diff
--- SIO_COUNTERS::Initialize
+++ SIO_COUNTERS::Initialize
@@ -1,2 +1,32 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_COUNTERS::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_COUNTERS::Initialize(unsigned long,unsigned long) __ptr64 */

+

+long __thiscall SIO_COUNTERS::Initialize(SIO_COUNTERS *this,ulong param_1,ulong param_2)

+

+{

+  uint uVar1;

+  int iVar2;

+  void *pvVar3;

+  ulonglong uVar4;

+  long lVar5;

+  

+  uVar1 = KeGetRecommendedSharedDataAlignment();

+  lVar5 = 0;

+  *(ulong *)(this + 8) = (param_2 - 1) + uVar1 & ~(uVar1 - 1);

+  *(ulong *)(this + 4) = (param_1 - 1) + uVar1 & ~(uVar1 - 1);

+  iVar2 = KeQueryActiveProcessorCountEx(0xffff);

+  *(int *)this = iVar2;

+  pvVar3 = SC_ENV::Allocate((ulonglong)(uVar1 + iVar2 * *(int *)(this + 8) + *(int *)(this + 4)),

+                            0x43497053,'\0',0);

+  *(void **)(this + 0x20) = pvVar3;

+  if (pvVar3 == (void *)0x0) {

+    lVar5 = -0x3fffff66;

+  }

+  else {

+    uVar4 = ((ulonglong)uVar1 - 1) + (longlong)pvVar3 & -(ulonglong)uVar1;

+    *(ulonglong *)(this + 0x10) = uVar4;

+    *(ulonglong *)(this + 0x18) = *(uint *)(this + 4) + uVar4;

+  }

+  return lVar5;

+}

+
```

## `SC_SPARSE::SetObject`  (modified)

```diff
--- SC_SPARSE::SetObject
+++ SC_SPARSE::SetObject
@@ -1,2 +1,82 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_SPARSE::SetObject : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SC_SPARSE::SetObject(unsigned __int64,void * __ptr64) __ptr64 */

+

+long __thiscall SC_SPARSE::SetObject(SC_SPARSE *this,__uint64 param_1,void *param_2)

+

+{

+  int iVar1;

+  SC_SPARSE *pSVar2;

+  longlong lVar3;

+  longlong *plVar4;

+  code *pcVar5;

+  longlong *plVar6;

+  ulonglong uVar7;

+  SC_SPARSE *pSVar8;

+  int iVar9;

+  long lVar10;

+  SC_SPARSE SVar11;

+  

+  lVar10 = 0;

+  if (param_1 < *(ulonglong *)(this + 0x40)) {

+    iVar1 = *(int *)(this + 0x34);

+    SVar11 = this[0x30];

+    pSVar8 = this;

+    for (iVar9 = *(int *)(this + 0x48) - *(int *)(this + 0x38);

+        SVar11 = (SC_SPARSE)((char)SVar11 + -1), -1 < iVar9; iVar9 = iVar9 - *(int *)(this + 0x38))

+    {

+      plVar6 = *(longlong **)pSVar8;

+      if (plVar6 == (longlong *)0x0) {

+        plVar6 = SC_ENV::Allocate((ulonglong)(uint)(iVar1 << 3) + 0x20,0x61587053,'\0',0);

+        if (plVar6 == (longlong *)0x0) {

+          return -0x3fffff66;

+        }

+        if (SVar11 == (SC_SPARSE)0x0) {

+          uVar7 = ~((1L << ((byte)*(undefined4 *)(this + 0x38) & 0x3f)) - 1U) & param_1;

+          plVar6[2] = uVar7;

+          for (pSVar2 = *(SC_SPARSE **)(this + 0x10);

+              (pSVar2 != this + 8 && (uVar7 <= *(ulonglong *)(pSVar2 + 0x10)));

+              pSVar2 = *(SC_SPARSE **)(pSVar2 + 8)) {

+          }

+          lVar3 = *(longlong *)pSVar2;

+          if (*(SC_SPARSE **)(lVar3 + 8) != pSVar2) {

+LAB_0:

+            pcVar5 = (code *)swi(0x29);

+            (*pcVar5)(3);

+            return -0x3fffff66;

+          }

+          *plVar6 = lVar3;

+          plVar6[1] = (longlong)pSVar2;

+          *(longlong **)(lVar3 + 8) = plVar6;

+          *(longlong **)pSVar2 = plVar6;

+        }

+        else {

+          *(SC_SPARSE *)(plVar6 + 2) = SVar11;

+          plVar4 = *(longlong **)(this + 0x20);

+          if ((SC_SPARSE *)*plVar4 != this + 0x18) goto LAB_0;

+          *plVar6 = (longlong)(this + 0x18);

+          plVar6[1] = (longlong)plVar4;

+          *plVar4 = (longlong)plVar6;

+          *(longlong **)(this + 0x20) = plVar6;

+        }

+        *(longlong **)pSVar8 = plVar6;

+      }

+      pSVar8 = (SC_SPARSE *)

+               (plVar6 + ((ulonglong)(*(int *)(this + 0x34) - 1) & param_1 >> ((byte)iVar9 & 0x3f))

+                         + 3);

+    }

+    if (param_2 == (void *)0x0) {

+      if (*(longlong *)pSVar8 != 0) {

+        *(longlong *)(this + 0x28) = *(longlong *)(this + 0x28) + -1;

+      }

+    }

+    else if (*(longlong *)pSVar8 == 0) {

+      *(longlong *)(this + 0x28) = *(longlong *)(this + 0x28) + 1;

+    }

+    *(void **)pSVar8 = param_2;

+  }

+  else {

+    lVar10 = -0x3ffffff3;

+  }

+  return lVar10;

+}

+
```

## `SS_BUFFER::AllocateBlock`  (modified)

```diff
--- SS_BUFFER::AllocateBlock
+++ SS_BUFFER::AllocateBlock
@@ -1,2 +1,31 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_BUFFER::AllocateBlock : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: unsigned char * __ptr64 __cdecl SS_BUFFER::AllocateBlock(unsigned long) __ptr64 */

+

+uchar * __thiscall SS_BUFFER::AllocateBlock(SS_BUFFER *this,ulong param_1)

+

+{

+  void *pvVar1;

+  uchar *_Dst;

+  uchar *_Src;

+  

+  pvVar1 = *(void **)(this + 8);

+  if (pvVar1 == (void *)0x0) {

+    pvVar1 = SC_ENV::Allocate((ulonglong)*(uint *)(this + 4) << 3,0x62537053,'\0',0);

+    *(void **)(this + 8) = pvVar1;

+    if (pvVar1 == (void *)0x0) {

+      return (uchar *)0x0;

+    }

+  }

+  _Dst = *(uchar **)((longlong)pvVar1 + (ulonglong)param_1 * 8);

+  if ((_Dst == (uchar *)0x0) &&

+     (_Dst = SC_ENV::Allocate(1L << ((byte)*(undefined4 *)this & 0x3f) & 0xffffffff,0x62537053,'\0',

+                              0), _Dst != (uchar *)0x0)) {

+    _Src = GetBlock(this,param_1);

+    if (_Src != (uchar *)0x0) {

+      memmove(_Dst,_Src,(ulonglong)(uint)(1 << ((byte)*(undefined4 *)this & 0x3f)));

+    }

+    *(uchar **)(*(longlong *)(this + 8) + (ulonglong)param_1 * 8) = _Dst;

+  }

+  return _Dst;

+}

+
```

## `SP_CONTROL::GetPoolIds`  (modified)

```diff
--- SP_CONTROL::GetPoolIds
+++ SP_CONTROL::GetPoolIds
@@ -1,2 +1,57 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::GetPoolIds : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SP_CONTROL::GetPoolIds(struct _GUID * __ptr64 * __ptr64,unsigned long *

+   __ptr64) __ptr64 */

+

+long __thiscall SP_CONTROL::GetPoolIds(SP_CONTROL *this,_GUID **param_1,ulong *param_2)

+

+{

+  SP_CONTROL *pSVar1;

+  undefined8 uVar2;

+  SP_CONTROL *pSVar3;

+  _GUID *p_Var4;

+  uint uVar5;

+  long lVar6;

+  uint uVar7;

+  SP_CONTROL *pSVar9;

+  ulonglong uVar8;

+  

+  lVar6 = 0;

+  *param_1 = (_GUID *)0x0;

+  uVar5 = 0;

+  *param_2 = 0;

+  SpAcquireResourceShared((_ERESOURCE *)(this + 0x60),'\0');

+  pSVar9 = this + 0xd0;

+  pSVar3 = *(SP_CONTROL **)pSVar9;

+  uVar8 = 0;

+  if (pSVar3 != pSVar9) {

+    do {

+      pSVar3 = *(SP_CONTROL **)pSVar3;

+      uVar7 = (int)uVar8 + 1;

+      uVar8 = (ulonglong)uVar7;

+    } while (pSVar3 != pSVar9);

+    if (uVar7 != 0) {

+      p_Var4 = SC_ENV::Allocate(uVar8 << 4,0x58587053,'\0',0);

+      if (p_Var4 == (_GUID *)0x0) {

+        lVar6 = -0x3fffff66;

+      }

+      else {

+        pSVar3 = *(SP_CONTROL **)pSVar9;

+        uVar8 = 0;

+        while (pSVar3 != pSVar9) {

+          pSVar1 = pSVar3 + 0x6c;

+          uVar2 = *(undefined8 *)(pSVar3 + 0x74);

+          pSVar3 = *(SP_CONTROL **)pSVar3;

+          uVar5 = (int)uVar8 + 1;

+          *(undefined8 *)(p_Var4 + uVar8 * 0x10) = *(undefined8 *)pSVar1;

+          *(undefined8 *)(p_Var4 + uVar8 * 0x10 + 8) = uVar2;

+          uVar8 = (ulonglong)uVar5;

+        }

+        *param_2 = uVar5;

+        *param_1 = p_Var4;

+      }

+    }

+  }

+  SpReleaseResourceShared((_ERESOURCE *)(this + 0x60));

+  return lVar6;

+}

+
```

## `SS_STORE::GetRecord`  (modified)

```diff
--- SS_STORE::GetRecord
+++ SS_STORE::GetRecord
@@ -1,2 +1,38 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE::GetRecord : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SS_STORE::GetRecord(unsigned long,class SS_RECORD_HEADER * __ptr64,class

+   SS_RECORD * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SS_STORE::GetRecord(SS_STORE *this,ulong param_1,SS_RECORD_HEADER *param_2,SS_RECORD **param_3)

+

+{

+  long lVar1;

+  SS_RECORD *pSVar2;

+  

+  if ((ushort)(*(ushort *)(param_2 + 4) - 1) < 0x4000) {

+    pSVar2 = SC_ENV::Allocate((ulonglong)*(ushort *)(param_2 + 4) + 0x20,0x72537053,'\0',0);

+    if (pSVar2 == (SS_RECORD *)0x0) {

+      lVar1 = -0x3fffff66;

+    }

+    else {

+      *(undefined2 *)(pSVar2 + 0x10) = 0;

+      *(undefined4 *)(pSVar2 + 0x12) = 0;

+      *(undefined4 *)(pSVar2 + 0x18) = 0xffffffff;

+      *(undefined4 *)(pSVar2 + 0x10) = *(undefined4 *)param_2;

+      *(undefined2 *)(pSVar2 + 0x14) = *(undefined2 *)(param_2 + 4);

+      *(ulong *)(pSVar2 + 0x18) = param_1;

+      lVar1 = SC_SPARSE::SetObject((SC_SPARSE *)(this + 0xd8),(ulonglong)param_1,pSVar2);

+      if (lVar1 < 0) {

+        ExFreePoolWithTag(pSVar2,0);

+      }

+      else {

+        *param_3 = pSVar2;

+      }

+    }

+  }

+  else {

+    lVar1 = -0x3fffffff;

+  }

+  return lVar1;

+}

+
```

## `SDB_EXTENT::Clone`  (modified)

```diff
--- SDB_EXTENT::Clone
+++ SDB_EXTENT::Clone
@@ -1,2 +1,40 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_EXTENT::Clone : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual class SDB_OBJECT * __ptr64 __cdecl SDB_EXTENT::Clone(void) __ptr64 */

+

+SDB_OBJECT * __thiscall SDB_EXTENT::Clone(SDB_EXTENT *this)

+

+{

+  undefined8 uVar1;

+  SDB_OBJECT *pSVar2;

+  SDB_OBJECT *pSVar3;

+  

+  pSVar2 = SC_ENV::Allocate(0x58,0x65427053,'\x01',0);

+  pSVar3 = (SDB_OBJECT *)0x0;

+  if (pSVar2 != (SDB_OBJECT *)0x0) {

+    *(undefined8 *)(pSVar2 + 8) = 0;

+    *(undefined ***)pSVar2 = &_vftable_;

+    *(undefined8 *)(pSVar2 + 0x10) = 0;

+    *(undefined2 *)(pSVar2 + 0x18) = 0;

+    *(undefined4 *)(pSVar2 + 0x48) = 0xffffffff;

+    *(undefined2 *)(pSVar2 + 0x4c) = 0;

+    uVar1 = *(undefined8 *)(this + 8);

+    *(undefined8 *)pSVar2 = *(undefined8 *)this;

+    *(undefined8 *)(pSVar2 + 8) = uVar1;

+    uVar1 = *(undefined8 *)(this + 0x18);

+    *(undefined8 *)(pSVar2 + 0x10) = *(undefined8 *)(this + 0x10);

+    *(undefined8 *)(pSVar2 + 0x18) = uVar1;

+    uVar1 = *(undefined8 *)(this + 0x28);

+    *(undefined8 *)(pSVar2 + 0x20) = *(undefined8 *)(this + 0x20);

+    *(undefined8 *)(pSVar2 + 0x28) = uVar1;

+    uVar1 = *(undefined8 *)(this + 0x38);

+    *(undefined8 *)(pSVar2 + 0x30) = *(undefined8 *)(this + 0x30);

+    *(undefined8 *)(pSVar2 + 0x38) = uVar1;

+    uVar1 = *(undefined8 *)(this + 0x48);

+    *(undefined8 *)(pSVar2 + 0x40) = *(undefined8 *)(this + 0x40);

+    *(undefined8 *)(pSVar2 + 0x48) = uVar1;

+    *(undefined8 *)(pSVar2 + 0x50) = *(undefined8 *)(this + 0x50);

+    pSVar3 = pSVar2;

+  }

+  return pSVar3;

+}

+
```

## `SIO_SPACE::BuildParity`  (modified)

```diff
--- SIO_SPACE::BuildParity
+++ SIO_SPACE::BuildParity
@@ -1,2 +1,66 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildParity : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl SIO_SPACE::BuildParity(class SDB_SPACE * __ptr64) __ptr64 */

+

+long __thiscall SIO_SPACE::BuildParity(SIO_SPACE *this,SDB_SPACE *param_1)

+

+{

+  ulong uVar1;

+  ulong uVar2;

+  long lVar3;

+  SIO_TIER *pSVar4;

+  SC_PARITY *pSVar5;

+  SC_PARITY *pSVar6;

+  int iVar7;

+  SIO_TIER *this_00;

+  ulong uVar8;

+  SIO_TIER *pSVar9;

+  ulong uVar10;

+  

+  pSVar6 = (SC_PARITY *)0x0;

+  lVar3 = 0;

+  iVar7 = 3;

+  pSVar4 = SIO_TIERS::FindTier((SIO_TIERS *)(this + 0x150),3);

+  this_00 = pSVar4 + 0x58;

+  if (pSVar4 == (SIO_TIER *)0x0) {

+    this_00 = (SIO_TIER *)(param_1 + 0x78);

+  }

+  if ((param_1[0x42] == (SDB_SPACE)0x2) && (*(int *)this_00 == iVar7)) {

+    pSVar5 = SC_ENV::Allocate(0x70,0x73497053,'\0',0);

+    if (pSVar5 != (SC_PARITY *)0x0) {

+      *(undefined8 *)pSVar5 = 0;

+      *(undefined8 *)(pSVar5 + 8) = 0;

+      *(undefined8 *)(pSVar5 + 0x10) = 0;

+      *(undefined8 *)(pSVar5 + 0x18) = 0;

+      *(undefined8 *)(pSVar5 + 0x20) = 0;

+      *(undefined8 *)(pSVar5 + 0x40) = 0;

+      *(undefined8 *)(pSVar5 + 0x48) = 0;

+      *(undefined8 *)(pSVar5 + 0x50) = 0;

+      *(undefined8 *)(pSVar5 + 0x28) = 0;

+      *(undefined8 *)(pSVar5 + 0x30) = 0;

+      *(undefined8 *)(pSVar5 + 0x58) = 0;

+      pSVar6 = pSVar5 + 0x60;

+      *(SC_PARITY **)(pSVar5 + 0x68) = pSVar6;

+      *(SC_PARITY **)pSVar6 = pSVar6;

+      pSVar6 = pSVar5;

+    }

+    *(SC_PARITY **)(this + 0x180) = pSVar6;

+    if (pSVar6 == (SC_PARITY *)0x0) {

+      lVar3 = -0x3fffff66;

+    }

+    else {

+      uVar10 = *(ulong *)(this_00 + 0xc);

+      pSVar9 = pSVar4 + 0x40;

+      if (pSVar4 == (SIO_TIER *)0x0) {

+        pSVar9 = (SIO_TIER *)(param_1 + 0x60);

+      }

+      uVar1 = (ulong)(*(ulonglong *)(param_1 + 0x108) / *(ulonglong *)pSVar9);

+      uVar8 = *(int *)(this_00 + 0x10) - uVar1;

+      uVar2 = SP_RESILIENCY_INFO::NumberOfLogicalCopies((SP_RESILIENCY_INFO *)this_00);

+      lVar3 = SC_PARITY::Initialize

+                        (pSVar6,uVar1,uVar8,uVar10,uVar2 - *(int *)(this + 0x68),

+                         *(ulong *)(this + 0x84));

+    }

+  }

+  return lVar3;

+}

+
```

## `SC_DRIVE::WriteHeader`  (modified)

```diff
--- SC_DRIVE::WriteHeader
+++ SC_DRIVE::WriteHeader
@@ -1,2 +1,45 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_DRIVE::WriteHeader : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SC_DRIVE::WriteHeader(class SC_DRIVE_HEADER * __ptr64) __ptr64 */

+

+long __thiscall SC_DRIVE::WriteHeader(SC_DRIVE *this,SC_DRIVE_HEADER *param_1)

+

+{

+  undefined8 uVar1;

+  int iVar2;

+  uchar *puVar3;

+  uint uVar4;

+  ulong uVar5;

+  uchar *local_res8;

+  

+  uVar4 = 1 << ((byte)*(undefined4 *)(this + 0xf0) & 0x1f);

+  uVar5 = 0;

+  puVar3 = SC_ENV::Allocate((ulonglong)uVar4,0x58587053,'\0',1);

+  if (puVar3 == (uchar *)0x0) {

+    iVar2 = -0x3fffff66;

+  }

+  else {

+    local_res8 = puVar3;

+    SC_DRIVE_HEADER::Format(param_1,&local_res8,uVar5);

+    iVar2 = (**(code **)(*(longlong *)this + 0x40))(this,*(undefined8 *)(this + 0x1c0),uVar4,puVar3)

+    ;

+    if (-1 < iVar2) {

+      uVar1 = *(undefined8 *)(param_1 + 8);

+      *(undefined8 *)(this + 0x1e0) = *(undefined8 *)param_1;

+      *(undefined8 *)(this + 0x1e8) = uVar1;

+      uVar1 = *(undefined8 *)(param_1 + 0x18);

+      *(undefined8 *)(this + 0x1f0) = *(undefined8 *)(param_1 + 0x10);

+      *(undefined8 *)(this + 0x1f8) = uVar1;

+      uVar1 = *(undefined8 *)(param_1 + 0x28);

+      *(undefined8 *)(this + 0x200) = *(undefined8 *)(param_1 + 0x20);

+      *(undefined8 *)(this + 0x208) = uVar1;

+      uVar1 = *(undefined8 *)(param_1 + 0x38);

+      *(undefined8 *)(this + 0x210) = *(undefined8 *)(param_1 + 0x30);

+      *(undefined8 *)(this + 0x218) = uVar1;

+      *(undefined8 *)(this + 0x220) = *(undefined8 *)(param_1 + 0x40);

+    }

+    ExFreePoolWithTag(puVar3,0);

+  }

+  return iVar2;

+}

+
```

## `SDB_METADATA::Clone`  (modified)

```diff
--- SDB_METADATA::Clone
+++ SDB_METADATA::Clone
@@ -1,2 +1,47 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_METADATA::Clone : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: virtual class SDB_OBJECT * __ptr64 __cdecl SDB_METADATA::Clone(void) __ptr64 */

+

+SDB_OBJECT * __thiscall SDB_METADATA::Clone(SDB_METADATA *this)

+

+{

+  int iVar1;

+  undefined8 uVar2;

+  SDB_OBJECT *pSVar3;

+  void *_Dst;

+  SDB_OBJECT *pSVar4;

+  

+  pSVar3 = SC_ENV::Allocate(0x30,0x6d427053,'\x01',0);

+  pSVar4 = (SDB_OBJECT *)0x0;

+  if (pSVar3 != (SDB_OBJECT *)0x0) {

+    *(undefined8 *)(pSVar3 + 8) = 0;

+    *(undefined8 *)(pSVar3 + 0x10) = 0;

+    *(undefined2 *)(pSVar3 + 0x18) = 0;

+    *(undefined ***)pSVar3 = &_vftable_;

+    uVar2 = *(undefined8 *)(this + 8);

+    *(undefined8 *)pSVar3 = *(undefined8 *)this;

+    *(undefined8 *)(pSVar3 + 8) = uVar2;

+    uVar2 = *(undefined8 *)(this + 0x18);

+    *(undefined8 *)(pSVar3 + 0x10) = *(undefined8 *)(this + 0x10);

+    *(undefined8 *)(pSVar3 + 0x18) = uVar2;

+    uVar2 = *(undefined8 *)(this + 0x28);

+    *(undefined8 *)(pSVar3 + 0x20) = *(undefined8 *)(this + 0x20);

+    *(undefined8 *)(pSVar3 + 0x28) = uVar2;

+    *(undefined8 *)(pSVar3 + 0x28) = 0;

+    pSVar4 = pSVar3;

+    if (*(longlong *)(this + 0x28) != 0) {

+      iVar1 = *(int *)(this + 0x20);

+      _Dst = SC_ENV::Allocate((ulonglong)(uint)(iVar1 << 4),0x6d427053,'\0',0);

+      *(void **)(pSVar3 + 0x28) = _Dst;

+      if (_Dst == (void *)0x0) {

+        (*(code *)**(undefined8 **)pSVar3)(pSVar3,1);

+        pSVar4 = (SDB_OBJECT *)0x0;

+      }

+      else {

+        memmove(_Dst,*(void **)(this + 0x28),(ulonglong)(uint)(iVar1 << 4));

+      }

+    }

+  }

+  return pSVar4;

+}

+
```

## `SDB_SPACE::operator_new`  (modified)

```diff
--- SDB_SPACE::operator_new
+++ SDB_SPACE::operator_new
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SDB_SPACE::operator new(unsigned __int64) */

+

+void * __cdecl SDB_SPACE::operator_new(__uint64 param_1)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(0x188,0x73427053,'\x01',0);

+  return pvVar1;

+}

+
```

## `SDB_COLUMN::operator_new`  (modified)

```diff
--- SDB_COLUMN::operator_new
+++ SDB_COLUMN::operator_new
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_COLUMN::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SDB_COLUMN::operator new(unsigned __int64) */

+

+void * __cdecl SDB_COLUMN::operator_new(__uint64 param_1)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(0x48,0x63427053,'\x01',0);

+  return pvVar1;

+}

+
```

## `SDB_DRIVE::ReinitializeBuffers`  (modified)

```diff
--- SDB_DRIVE::ReinitializeBuffers
+++ SDB_DRIVE::ReinitializeBuffers
@@ -1,2 +1,57 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_DRIVE::ReinitializeBuffers : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SDB_DRIVE::ReinitializeBuffers(void) __ptr64 */

+

+long __thiscall SDB_DRIVE::ReinitializeBuffers(SDB_DRIVE *this)

+

+{

+  longlong lVar1;

+  long lVar2;

+  SDB_OBJECT *pSVar3;

+  SC_SPARSE *pSVar4;

+  void *pvVar5;

+  ulonglong uVar6;

+  

+  pSVar3 = SDB_RECORD::GetObject

+                     (*(SDB_RECORD **)(*(longlong *)(*(longlong *)(this + 0x10) + 0x10) + 0x110));

+  uVar6 = *(ulonglong *)(pSVar3 + 0x58);

+  lVar1 = 0x3f;

+  if (uVar6 != 0) {

+    for (; uVar6 >> lVar1 == 0; lVar1 = lVar1 + -1) {

+    }

+  }

+  *(int *)(this + 0xc4) = (int)lVar1;

+  if (*(SC_SPARSE **)(this + 0xa8) != (SC_SPARSE *)0x0) {

+    SC_SPARSE::_scalar_deleting_destructor_(*(SC_SPARSE **)(this + 0xa8),(uint)uVar6);

+  }

+  pSVar4 = SC_ENV::Allocate(0x50,0x61587053,'\0',0);

+  if (pSVar4 == (SC_SPARSE *)0x0) {

+    *(undefined8 *)(this + 0xa8) = 0;

+  }

+  else {

+    pSVar4 = (SC_SPARSE *)SC_SPARSE::SC_SPARSE(pSVar4);

+    *(SC_SPARSE **)(this + 0xa8) = pSVar4;

+    if (pSVar4 != (SC_SPARSE *)0x0) {

+      lVar2 = SC_SPARSE::Initialize

+                        (pSVar4,*(ulonglong *)(this + 0x98) >>

+                                ((byte)*(undefined4 *)(this + 0xc4) & 0x3f) & 0xffffffff);

+      if (lVar2 < 0) {

+        return lVar2;

+      }

+      if (*(longlong *)(this + 0xb8) != 0) {

+        ExFreePoolWithTag(*(longlong *)(this + 0xb8),0);

+        *(undefined8 *)(this + 0xb8) = 0;

+        *(undefined4 *)(this + 0xc0) = 0;

+      }

+      uVar6 = *(ulonglong *)(this + 0x98) >> ((byte)*(undefined4 *)(this + 0xc4) & 0x3f);

+      pvVar5 = SC_ENV::Allocate((ulonglong)((int)uVar6 + 0x1fU >> 3 & 0x1ffffffc),0x64427053,'\x01',

+                                0);

+      if (pvVar5 != (void *)0x0) {

+        RtlInitializeBitMap(this + 0xb0,pvVar5,uVar6 & 0xffffffff);

+        RtlClearAllBits(this + 0xb0);

+        return lVar2;

+      }

+    }

+  }

+  return -0x3fffff66;

+}

+
```

## `SIO_CACHE_VERIFIER::LogMapping`  (modified)

```diff
--- SIO_CACHE_VERIFIER::LogMapping
+++ SIO_CACHE_VERIFIER::LogMapping
@@ -1,2 +1,28 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_CACHE_VERIFIER::LogMapping : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl SIO_CACHE_VERIFIER::LogMapping(unsigned __int64,unsigned __int64) __ptr64 */

+

+void __thiscall

+SIO_CACHE_VERIFIER::LogMapping(SIO_CACHE_VERIFIER *this,__uint64 param_1,__uint64 param_2)

+

+{

+  SIO_CACHE_VERIFIER *pSVar1;

+  ulonglong uVar2;

+  void *pvVar3;

+  

+  pvVar3 = *(void **)(this + 0x10);

+  pSVar1 = this + 0x1c;

+  if (pvVar3 == (void *)0x0) {

+    pvVar3 = SC_ENV::Allocate((ulonglong)*(uint *)pSVar1 << 3,0x58587053,'\0',0);

+    *(void **)(this + 0x10) = pvVar3;

+    if (pvVar3 == (void *)0x0) {

+      return;

+    }

+  }

+  *(undefined8 *)((longlong)pvVar3 + (ulonglong)*(uint *)(this + 0x18) * 8) = 0xffffffffffffffff;

+  uVar2 = (ulonglong)(*(int *)(this + 0x18) + 1) % (ulonglong)*(uint *)pSVar1;

+  *(int *)(this + 0x18) = (int)uVar2;

+  *(__uint64 *)(*(longlong *)(this + 0x10) + uVar2 * 8) = param_2;

+  *(uint *)(this + 0x18) = (*(int *)(this + 0x18) + 1U) % *(uint *)pSVar1;

+  return;

+}

+
```

## `SS_BUFFER::Snapshot`  (modified)

```diff
--- SS_BUFFER::Snapshot
+++ SS_BUFFER::Snapshot
@@ -1,2 +1,44 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_BUFFER::Snapshot : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SS_BUFFER::Snapshot(class SS_BUFFER * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall SS_BUFFER::Snapshot(SS_BUFFER *this,SS_BUFFER **param_1)

+

+{

+  undefined4 uVar1;

+  uint uVar2;

+  int iVar3;

+  SS_BUFFER *pSVar4;

+  uint uVar5;

+  ulonglong uVar6;

+  long lVar7;

+  

+  lVar7 = 0;

+  *param_1 = (SS_BUFFER *)0x0;

+  pSVar4 = SC_ENV::Allocate(0x18,0x62537053,'\0',0);

+  if (pSVar4 == (SS_BUFFER *)0x0) {

+    lVar7 = -0x3fffff66;

+  }

+  else {

+    *(undefined8 *)pSVar4 = 0;

+    *(undefined8 *)(pSVar4 + 8) = 0;

+    *(undefined8 *)(pSVar4 + 0x10) = 0;

+    uVar1 = *(undefined4 *)this;

+    uVar2 = *(uint *)(this + 4);

+    uVar6 = 1L << ((byte)uVar1 & 0x3f);

+    iVar3 = 0x1f;

+    uVar5 = (uint)uVar6;

+    if (uVar5 != 0) {

+      for (; uVar5 >> iVar3 == 0; iVar3 = iVar3 + -1) {

+      }

+    }

+    *(int *)pSVar4 = iVar3;

+    uVar6 = uVar6 & 0xffffffff;

+    *(SS_BUFFER **)(pSVar4 + 0x10) = this;

+    *(int *)(pSVar4 + 4) =

+         (int)((((ulonglong)uVar2 << ((byte)uVar1 & 0x3f)) + -1 + uVar6 & ~(uVar6 - 1)) >>

+              ((byte)*(int *)pSVar4 & 0x3f));

+    *param_1 = pSVar4;

+  }

+  return lVar7;

+}

+
```

## `SC_DISK::UpdateFirmwareInfo`  (modified)

```diff
--- SC_DISK::UpdateFirmwareInfo
+++ SC_DISK::UpdateFirmwareInfo
@@ -1,2 +1,70 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_DISK::UpdateFirmwareInfo : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* public: long __cdecl SC_DISK::UpdateFirmwareInfo(void) __ptr64 */

+

+long __thiscall SC_DISK::UpdateFirmwareInfo(SC_DISK *this)

+

+{

+  int iVar1;

+  int *piVar2;

+  uint uVar3;

+  __uint64 _Var4;

+  ulonglong uVar5;

+  undefined1 auStack_88 [32];

+  int *local_68;

+  uint local_60;

+  undefined4 local_48;

+  undefined4 local_44;

+  ulonglong local_40;

+  undefined8 local_38;

+  undefined8 uStack_30;

+  undefined1 local_28;

+  ulonglong local_20;

+  

+  local_20 = __security_cookie ^ (ulonglong)auStack_88;

+  uVar5 = 0;

+  local_48 = 0x10;

+  local_44 = 0x10;

+  _Var4 = 0x38;

+  local_40 = (ulonglong)(*(int *)(*(longlong *)(this + 0xa0) + 0x1c) == 0x11);

+  while( true ) {

+    uVar3 = (uint)_Var4;

+    piVar2 = SC_ENV::Allocate(_Var4,0x58587053,'\0',0);

+    if (piVar2 == (int *)0x0) {

+      return -0x3fffff66;

+    }

+    local_68 = piVar2;

+    local_60 = uVar3;

+    iVar1 = (**(code **)(*(longlong *)this + 0x10))(this,0x2d1c00);

+    if (((iVar1 + 0x80000000U & 0x80000000) == 0) && (iVar1 != -0x7ffffffb)) break;

+    if (*piVar2 != 0x38) {

+      iVar1 = -0x3ffffffc;

+      break;

+    }

+    if ((uint)piVar2[1] <= uVar3) {

+      piVar2[1] = uVar3;

+      if (*(longlong *)(this + 0x150) != 0) {

+        ExFreePoolWithTag(*(longlong *)(this + 0x150),0);

+      }

+      *(int **)(this + 0x150) = piVar2;

+      local_28 = 0;

+      while( true ) {

+        if ((uint)*(byte *)((longlong)piVar2 + 9) <= (uint)uVar5) {

+          return iVar1;

+        }

+        if ((char)piVar2[uVar5 * 8 + 8] == *(char *)((longlong)piVar2 + 10)) break;

+        uVar5 = (ulonglong)((uint)uVar5 + 1);

+      }

+      local_38 = *(undefined8 *)(piVar2 + uVar5 * 8 + 10);

+      uStack_30 = *(undefined8 *)(piVar2 + uVar5 * 8 + 10 + 2);

+      ScAnsiToUnicodeString((char *)&local_38,(_UNICODE_STRING *)(this + 0x38));

+      return iVar1;

+    }

+    _Var4 = (__uint64)(uint)piVar2[1];

+    ExFreePoolWithTag(piVar2,0);

+  }

+  ExFreePoolWithTag(piVar2,0);

+  return iVar1;

+}

+
```

## `SIO_SPACE::BuildDrt`  (modified)

```diff
--- SIO_SPACE::BuildDrt
+++ SIO_SPACE::BuildDrt
@@ -1,2 +1,49 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildDrt : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl SIO_SPACE::BuildDrt(class SDB_SPACE * __ptr64) __ptr64 */

+

+long __thiscall SIO_SPACE::BuildDrt(SIO_SPACE *this,SDB_SPACE *param_1)

+

+{

+  long lVar1;

+  SIO_TIER *pSVar2;

+  SIO_SPACE *pSVar3;

+  SIO_DRT *this_00;

+  SIO_DRT *this_01;

+  undefined8 uVar4;

+  long lVar5;

+  

+  lVar5 = 0;

+  lVar1 = 0;

+  uVar4 = 0;

+  if (param_1[0x42] == (SDB_SPACE)0x2) {

+    if ((*(int *)(param_1 + 0x78) != 2) &&

+       (lVar5 = 0, pSVar2 = SIO_TIERS::FindTier((SIO_TIERS *)(this + 0x150),2),

+       pSVar2 == (SIO_TIER *)0x0)) {

+      return lVar5;

+    }

+    uVar4 = CONCAT71((int7)((ulonglong)uVar4 >> 8),6);

+    pSVar3 = GetChild(this,(_SC_SPACE_USAGE)uVar4);

+    if ((pSVar3 == (SIO_SPACE *)0x0) &&

+       (pSVar3 = GetChild(this,(_SC_SPACE_USAGE)CONCAT71((int7)((ulonglong)uVar4 >> 8),3)),

+       pSVar3 == (SIO_SPACE *)0x0)) {

+      return lVar5;

+    }

+    this_00 = SC_ENV::Allocate(0x78,0x73497053,'\0',0);

+    this_01 = (SIO_DRT *)0x0;

+    if (this_00 != (SIO_DRT *)0x0) {

+      this_01 = (SIO_DRT *)SIO_DRT::SIO_DRT(this_00);

+    }

+    *(SIO_DRT **)(this + 0x170) = this_01;

+    if (this_01 == (SIO_DRT *)0x0) {

+      lVar1 = -0x3fffff66;

+    }

+    else {

+      lVar1 = SIO_DRT::Initialize(this_01,param_1,this);

+      if (-1 < lVar1) {

+        *(uint *)(this + 0x2c) = *(uint *)(this + 0x2c) | 4;

+      }

+    }

+  }

+  return lVar1;

+}

+
```

## `SIO_RAID::Initialize`  (modified)

```diff
--- SIO_RAID::Initialize
+++ SIO_RAID::Initialize
@@ -1,2 +1,427 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: virtual long __cdecl SIO_RAID::Initialize(class SDB_SPACE * __ptr64,unsigned

+   __int64,class SIO_SPACE * __ptr64,class SIO_TIER * __ptr64) __ptr64 */

+

+long __thiscall

+SIO_RAID::Initialize

+          (SIO_RAID *this,SDB_SPACE *param_1,__uint64 param_2,SIO_SPACE *param_3,SIO_TIER *param_4)

+

+{

+  ulonglong *puVar1;

+  longlong *plVar2;

+  int iVar3;

+  undefined1 auVar4 [16];

+  bool bVar5;

+  undefined1 uVar6;

+  ulong uVar7;

+  ulong uVar8;

+  long lVar9;

+  SP_RESILIENCY_INFO *pSVar10;

+  __uint64 _Var11;

+  void *pvVar12;

+  SIO_COLUMN *pSVar13;

+  SDB_RECORD *pSVar14;

+  SDB_OBJECT *pSVar15;

+  SDB_RECORD *pSVar16;

+  ulonglong uVar17;

+  SDB_OBJECT *pSVar18;

+  SC_DRIVE *pSVar19;

+  SIO_SPACE *pSVar20;

+  ulonglong *puVar21;

+  SIO_LOG_PACKET *pSVar22;

+  undefined8 *puVar23;

+  SC_PACKET *pSVar24;

+  longlong lVar25;

+  ulonglong uVar26;

+  SIO_LOG_TABLE *pSVar27;

+  _SP_PROVISIONING_INFO *p_Var28;

+  SIO_RAID *pSVar29;

+  ushort uVar30;

+  uint uVar31;

+  ulong uVar32;

+  uint uVar33;

+  ulonglong uVar34;

+  _SC_COLUMN_STATE _Var35;

+  undefined8 uVar36;

+  longlong lVar37;

+  undefined7 uVar38;

+  uint uVar39;

+  bool bVar40;

+  uint local_res18;

+  _SC_COLUMN_REASON in_stack_ffffffffffffff98;

+  ulong local_58;

+  

+  bVar5 = false;

+  local_58 = 0;

+  bVar40 = false;

+  *(SIO_SPACE **)(this + 8) = param_3;

+  *(SIO_TIER **)(this + 0x20) = param_4;

+  *(__uint64 *)(this + 0x10) = param_2;

+  lVar25 = *(longlong *)(param_3 + 0xb0);

+  local_res18 = 0xffffffff;

+  if (*(longlong *)(param_3 + 0x178) != 0) {

+    bVar40 = *(longlong *)(*(longlong *)(param_3 + 0x178) + 0x10) != 0;

+  }

+  uVar7 = SDB_SPACE::GetNumberOfCopies(param_1,param_2);

+  this[0x2b] = SUB41(uVar7,0);

+  if (1 < (byte)SUB41(uVar7,0)) {

+    *(uint *)(param_3 + 0x2c) = *(uint *)(param_3 + 0x2c) | 4;

+    uVar7 = (ulong)(byte)this[0x2b];

+  }

+  pSVar10 = Resiliency(this);

+  if (*(uint *)(pSVar10 + 0x10) < 2) {

+    uVar39 = 0x1000000;

+    if (bVar40) {

+      uVar39 = 0x40000;

+    }

+  }

+  else {

+    pSVar10 = Resiliency(this);

+    uVar39 = *(uint *)(pSVar10 + 0x14);

+  }

+  iVar3 = 0x1f;

+  if (uVar39 != 0) {

+    for (; uVar39 >> iVar3 == 0; iVar3 = iVar3 + -1) {

+    }

+  }

+  this[0x2a] = SUB41(iVar3,0);

+  pSVar10 = Resiliency(this);

+  if (*(int *)pSVar10 == 1) {

+    *(ushort *)(this + 0x28) = *(ushort *)(this + 0x28) | 0x20;

+  }

+  if (1 < (byte)uVar7) {

+    *(ushort *)(this + 0x28) = *(ushort *)(this + 0x28) | 2;

+  }

+  pSVar10 = Resiliency(this);

+  auVar4 = ZEXT816(0x20) * ZEXT416((uVar7 & 0xff) * *(int *)(pSVar10 + 0x10));

+  _Var11 = auVar4._0_8_;

+  if (auVar4._8_8_ != 0) {

+    _Var11 = 0xffffffffffffffff;

+  }

+  uVar36 = 0;

+  pvVar12 = SC_ENV::Allocate(_Var11,0x6c497053,'\0',0);

+  *(void **)(this + 0x30) = pvVar12;

+  if (pvVar12 == (void *)0x0) {

+    return -0x3fffff66;

+  }

+  uVar7 = 0;

+  pSVar10 = Resiliency(this);

+  if (*(int *)(pSVar10 + 0x10) != 0) {

+    do {

+      uVar32 = 0;

+      if (this[0x2b] != (SIO_RAID)0x0) {

+        do {

+          uVar36 = CONCAT71((int7)((ulonglong)uVar36 >> 8),7);

+          in_stack_ffffffffffffff98 = in_stack_ffffffffffffff98 & 0xffffff00;

+          SetColumnActiveState(this,uVar7,uVar32,(_SC_COLUMN_STATE)uVar36,in_stack_ffffffffffffff98)

+          ;

+          pSVar29 = this;

+          uVar8 = uVar7;

+          pSVar13 = Get(this,uVar7,uVar32);

+          *(undefined4 *)(pSVar13 + 0x10) = 0xffffffff;

+          pSVar13 = Get(pSVar29,uVar8,uVar32);

+          uVar32 = uVar32 + 1;

+          *(undefined4 *)(pSVar13 + 0x14) = 0xffffffff;

+        } while (uVar32 < (byte)this[0x2b]);

+      }

+      uVar7 = uVar7 + 1;

+      pSVar10 = Resiliency(this);

+    } while (uVar7 < *(uint *)(pSVar10 + 0x10));

+  }

+  pSVar14 = SC_SPARSE::GetObject

+                      (*(SC_SPARSE **)(param_1 + 0xe0),param_2 / *(ulonglong *)(param_1 + 0x108));

+  while (pSVar14 != (SDB_RECORD *)0x0) {

+    pSVar15 = SDB_RECORD::GetObject(pSVar14);

+    if (*(ulong *)(pSVar15 + 0x48) != 0xffffffff) {

+      pSVar16 = SIO_SPACE::FindExtentRecord

+                          (*(SIO_SPACE **)(this + 8),*(__uint64 *)(this + 0x10),

+                           *(ulong *)(pSVar15 + 0x40),*(ulong *)(pSVar15 + 0x48));

+      pSVar15 = SDB_RECORD::GetObject(pSVar16);

+      *(ushort *)(pSVar15 + 0x4e) = *(ushort *)(pSVar15 + 0x4e) | 2;

+    }

+    pSVar15 = SDB_RECORD::GetObject(pSVar14);

+    pSVar14 = *(SDB_RECORD **)(pSVar15 + 0x50);

+  }

+  uVar33 = 0xffffffff;

+  uVar17 = param_2 / *(ulonglong *)(param_1 + 0x108);

+  pSVar14 = SC_SPARSE::GetObject(*(SC_SPARSE **)(param_1 + 0xe0),uVar17);

+  uVar7 = 0;

+  while (pSVar14 != (SDB_RECORD *)0x0) {

+    uVar30 = 0xfffd;

+    pSVar15 = SDB_RECORD::GetObject(pSVar14);

+    uVar31 = *(uint *)(pSVar15 + 0x40);

+    if (uVar31 != uVar33) {

+      uVar7 = 0;

+      pSVar10 = Resiliency(this);

+      uVar30 = 0xfffd;

+      local_58 = *(ulong *)(pSVar10 + 8);

+      uVar33 = uVar31;

+    }

+    if ((*(ushort *)(pSVar15 + 0x4e) & 2) == 0) {

+      uVar8 = uVar7 + 1;

+      uVar32 = uVar7;

+    }

+    else {

+      *(ushort *)(pSVar15 + 0x4e) = *(ushort *)(pSVar15 + 0x4e) & uVar30;

+      pSVar13 = Get(this,uVar33,local_58);

+      *(ushort *)pSVar13 = *(ushort *)pSVar13 | 4;

+      uVar32 = local_58;

+      uVar8 = uVar7;

+      local_58 = local_58 + 1;

+    }

+    uVar17 = (ulonglong)uVar33;

+    pSVar13 = Get(this,uVar33,uVar32);

+    *(undefined4 *)(pSVar13 + 0x10) = *(undefined4 *)(pSVar15 + 0x44);

+    pSVar13 = Get(this,(ulong)uVar17,uVar32);

+    *(undefined4 *)(pSVar13 + 0x14) = *(undefined4 *)(pSVar15 + 0x48);

+    if (((byte)pSVar15[0x4c] & 2) != 0) {

+      pSVar13 = Get(this,(ulong)uVar17,uVar32);

+      *(ushort *)pSVar13 = *(ushort *)pSVar13 | 0x10;

+    }

+    if (((byte)pSVar15[0x4c] & 8) != 0) {

+      uVar17 = (ulonglong)uVar33;

+      pSVar13 = Get(this,uVar33,uVar32);

+      *(ushort *)pSVar13 = *(ushort *)pSVar13 | 0x20;

+    }

+    pSVar16 = SDB_POOL_CONFIG::FindRecordByRecordId

+                        (*(SDB_POOL_CONFIG **)(*(longlong *)(pSVar15 + 0x10) + 0x10),

+                         (_SDB_RECORD_TYPE)CONCAT71((int7)(uVar17 >> 8),2),

+                         *(ulong *)(pSVar15 + 0x3c));

+    pSVar18 = SDB_RECORD::GetObject(pSVar16);

+    pSVar19 = SIO_SPACE::GetDrive(*(SIO_SPACE **)(this + 8),

+                                  *(ulong *)(*(longlong *)(pSVar18 + 0x10) + 0x18));

+    if ((*(int *)(pSVar18 + 0x44) == 5) && (*(int *)(pSVar15 + 0x48) == -1)) {

+      *(longlong *)(lVar25 + 0x170) = *(longlong *)(lVar25 + 0x170) + 1;

+    }

+    uVar7 = ScGetRelativeMediaSpeed(*(_SC_MEDIA_TYPE *)(pSVar18 + 0x6c));

+    if (uVar7 <= local_res18) {

+      local_res18 = uVar7;

+    }

+    lVar37 = *(longlong *)(pSVar18 + 0x10);

+    uVar31 = uVar33;

+    pSVar13 = Get(this,uVar33,uVar32);

+    *(undefined4 *)(pSVar13 + 4) = *(undefined4 *)(lVar37 + 0x18);

+    uVar38 = (undefined7)((ulonglong)lVar37 >> 8);

+    if (((byte)pSVar15[0x4c] & 1) == 0) {

+      if (pSVar19 == (SC_DRIVE *)0x0) {

+        _Var35 = (_SC_COLUMN_STATE)CONCAT71(uVar38,2);

+        uVar6 = 1;

+      }

+      else {

+        _Var35 = (_SC_COLUMN_STATE)CONCAT71(uVar38,1);

+        uVar6 = 0;

+      }

+    }

+    else {

+      _Var35 = (_SC_COLUMN_STATE)CONCAT71(uVar38,3);

+      uVar6 = 7;

+    }

+    in_stack_ffffffffffffff98 = CONCAT31((int3)(in_stack_ffffffffffffff98 >> 8),uVar6);

+    SetColumnActiveState(this,uVar31,uVar32,_Var35,in_stack_ffffffffffffff98);

+    pSVar13 = Get(this,uVar33,uVar32);

+    *(undefined8 *)(pSVar13 + 8) = *(undefined8 *)(pSVar15 + 0x30);

+    if ((pSVar19 != (SC_DRIVE *)0x0) &&

+       (RtlSetBit(*(longlong *)(this + 8) + 0x100,

+                  *(undefined4 *)(*(longlong *)(pSVar18 + 0x10) + 0x18)),

+       pSVar19[0x18b] != (SC_DRIVE)0x0)) {

+      bVar5 = true;

+    }

+    pSVar15 = SDB_RECORD::GetObject(pSVar14);

+    uVar17 = 0xfffd;

+    uVar7 = uVar8;

+    pSVar14 = *(SDB_RECORD **)(pSVar15 + 0x50);

+  }

+  lVar9 = 0;

+  pSVar20 = *(SIO_SPACE **)(this + 8);

+  if ((((*(longlong *)(pSVar20 + 0x178) != 0) &&

+       (lVar25 = *(longlong *)(*(longlong *)(pSVar20 + 0x178) + 0x10), lVar25 != 0)) &&

+      (uVar30 = *(ushort *)(this + 0x28), (uVar30 & 1) == 0)) &&

+     ((uVar7 = ScGetRelativeMediaSpeed(*(_SC_MEDIA_TYPE *)(lVar25 + 0x40)), uVar7 <= local_res18 ||

+      (bVar5)))) {

+    *(ushort *)(this + 0x28) = uVar30 | 8;

+  }

+  pSVar20 = SIO_SPACE::GetChild(pSVar20,(_SC_SPACE_USAGE)CONCAT71((int7)(uVar17 >> 8),0xb));

+  if (((pSVar20 != (SIO_SPACE *)0x0) && (!bVar5)) &&

+     (uVar7 = ScGetRelativeMediaSpeed(*(_SC_MEDIA_TYPE *)(pSVar20 + 0x40)), local_res18 < uVar7)) {

+    *(ushort *)(this + 0x28) = *(ushort *)(this + 0x28) | 0x100;

+  }

+  uVar26 = 0;

+  pSVar10 = Resiliency(this);

+  uVar17 = uVar26;

+  if (*(int *)(pSVar10 + 0x10) != 0) {

+    do {

+      uVar7 = (ulong)uVar17;

+      uVar17 = uVar26;

+      if (this[0x2b] != (SIO_RAID)0x0) {

+        do {

+          pSVar29 = this;

+          uVar32 = uVar7;

+          pSVar13 = Get(this,uVar7,(ulong)uVar17);

+          if (*(ulong *)(pSVar13 + 0x14) != 0xffffffff) {

+            uVar8 = IdToCopy(pSVar29,uVar32,*(ulong *)(pSVar13 + 0x14));

+            *(ulong *)(pSVar13 + 0x14) = uVar8;

+            if ((*(ushort *)pSVar13 & 0x10) != 0) {

+              pSVar13 = Get(this,uVar32,*(ulong *)(pSVar13 + 0x14));

+              *(ushort *)pSVar13 = *(ushort *)pSVar13 | 0x10;

+            }

+          }

+          uVar33 = (ulong)uVar17 + 1;

+          uVar17 = (ulonglong)uVar33;

+        } while (uVar33 < (byte)this[0x2b]);

+      }

+      uVar17 = (ulonglong)(uVar7 + 1);

+      pSVar10 = Resiliency(this);

+    } while (uVar7 + 1 < *(uint *)(pSVar10 + 0x10));

+  }

+  if (((byte)this[0x28] & 2) != 0) {

+    uVar33 = *(uint *)(SpControlExt + 0x254);

+    uVar34 = CONCAT44(0,uVar33);

+    auVar4._8_8_ = 0;

+    auVar4._0_8_ = uVar34;

+    uVar17 = SUB168(ZEXT816(0x18) * auVar4,0);

+    if (SUB168(ZEXT816(0x18) * auVar4,8) != 0) {

+      uVar17 = 0xffffffffffffffff;

+    }

+    _Var11 = uVar17 + 8;

+    if (0xfffffffffffffff7 < uVar17) {

+      _Var11 = 0xffffffffffffffff;

+    }

+    puVar21 = SC_ENV::Allocate(_Var11,0x64497053,'\0',0);

+    if (puVar21 == (ulonglong *)0x0) {

+      *(undefined8 *)(this + 0x38) = 0;

+      return -0x3fffff66;

+    }

+    puVar1 = puVar21 + 1;

+    *puVar21 = uVar34;

+    _vector_constructor_iterator_(puVar1,0x18,(ulonglong)uVar33,SIO_BUCKET::SIO_BUCKET);

+    *(ulonglong **)(this + 0x38) = puVar1;

+    if (puVar1 == (ulonglong *)0x0) {

+      return -0x3fffff66;

+    }

+  }

+  uVar7 = *(uint *)(SpControlExt + 0x1bc);

+  if (uVar39 < *(uint *)(SpControlExt + 0x1bc)) {

+    uVar7 = uVar39;

+  }

+  if (uVar7 != 0) {

+    if (*(longlong *)(*(longlong *)(this + 8) + 0x230) == 0) {

+      pSVar22 = SC_PACKET::operator_new(0x110);

+      if (pSVar22 == (SIO_LOG_PACKET *)0x0) {

+        return -0x3fffff66;

+      }

+      puVar23 = (undefined8 *)SIO_LOG_PACKET::SIO_LOG_PACKET(pSVar22);

+      if (puVar23 == (undefined8 *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar9 = SC_BUFFER::Initialize((SC_BUFFER *)(puVar23 + 0xe),2,(void *)0x0,uVar7);

+      if (lVar9 < 0) goto LAB_0;

+      *(undefined1 *)(*(longlong *)(this + 8) + 0x25c) = 1;

+      *(undefined8 **)(*(longlong *)(this + 8) + 0x230) = puVar23;

+      *(ulong *)(*(longlong *)(this + 8) + 600) = uVar7;

+      pSVar24 = SC_PACKET::operator_new(0xf0);

+      if (pSVar24 == (SC_PACKET *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar25 = SC_PACKET::SC_PACKET(pSVar24);

+      if (lVar25 == 0) {

+        return -0x3fffff66;

+      }

+      *(undefined1 *)(*(longlong *)(this + 8) + 0x2a4) = 1;

+      *(longlong *)(*(longlong *)(this + 8) + 0x278) = lVar25;

+      pSVar24 = SC_PACKET::operator_new(0xf0);

+      if (pSVar24 == (SC_PACKET *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar25 = SC_PACKET::SC_PACKET(pSVar24);

+      if (lVar25 == 0) {

+        return -0x3fffff66;

+      }

+      *(undefined1 *)(*(longlong *)(this + 8) + 0x334) = 1;

+      *(longlong *)(*(longlong *)(this + 8) + 0x308) = lVar25;

+    }

+    lVar9 = 0;

+    if ((*(longlong *)(*(longlong *)(this + 8) + 0x2c0) == 0) && (!bVar40)) {

+      pSVar22 = SC_PACKET::operator_new(0x110);

+      if (pSVar22 == (SIO_LOG_PACKET *)0x0) {

+        return -0x3fffff66;

+      }

+      puVar23 = (undefined8 *)SIO_LOG_PACKET::SIO_LOG_PACKET(pSVar22);

+      if (puVar23 == (undefined8 *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar9 = SC_BUFFER::Initialize((SC_BUFFER *)(puVar23 + 0xe),3,(void *)0x0,uVar7);

+      if (lVar9 < 0) {

+LAB_0:

+        (**(code **)*puVar23)(puVar23,1);

+        return lVar9;

+      }

+      *(undefined1 *)(*(longlong *)(this + 8) + 0x2ec) = 1;

+      lVar9 = SC_BUFFER::Initialize

+                        ((SC_BUFFER *)(*(longlong *)(this + 8) + 0x2c8),2,(void *)0x0,uVar7);

+      if (lVar9 < 0) goto LAB_0;

+      lVar25 = MmAllocateMappingAddress(uVar7 + 0x1fff & 0xfffff000,0x6c4d7053);

+      if (lVar25 == 0) {

+        lVar9 = -0x3fffff66;

+        goto LAB_0;

+      }

+      *(undefined8 **)(*(longlong *)(this + 8) + 0x2c0) = puVar23;

+      *(longlong *)(*(longlong *)(this + 8) + 0x2d8) = lVar25;

+      *(ulong *)(*(longlong *)(this + 8) + 0x2e8) = uVar7;

+    }

+    if (*(longlong *)(*(longlong *)(this + 8) + 0x350) == 0) {

+      pSVar24 = SC_PACKET::operator_new(0xf0);

+      if (pSVar24 == (SC_PACKET *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar25 = SC_PACKET::SC_PACKET(pSVar24);

+      if (lVar25 == 0) {

+        return -0x3fffff66;

+      }

+      *(undefined1 *)(*(longlong *)(this + 8) + 0x37c) = 1;

+      *(longlong *)(*(longlong *)(this + 8) + 0x350) = lVar25;

+      lVar9 = 0;

+    }

+    if (*(longlong *)(*(longlong *)(this + 8) + 0x398) == 0) {

+      pSVar24 = SC_PACKET::operator_new(0xf0);

+      if (pSVar24 == (SC_PACKET *)0x0) {

+        return -0x3fffff66;

+      }

+      lVar25 = SC_PACKET::SC_PACKET(pSVar24);

+      if (lVar25 == 0) {

+        return -0x3fffff66;

+      }

+      *(undefined1 *)(*(longlong *)(this + 8) + 0x3c4) = 1;

+      *(longlong *)(*(longlong *)(this + 8) + 0x398) = lVar25;

+      lVar9 = 0;

+    }

+  }

+  if (*(longlong *)(*(longlong *)(this + 8) + 0x98) != 0) {

+    plVar2 = *(longlong **)(*(longlong *)(*(longlong *)(this + 8) + 0x98) + 0x188);

+    uVar26 = (**(code **)(*plVar2 + 0x68))(plVar2,*(undefined8 *)(this + 0x10));

+  }

+  if (bVar40) {

+    if ((uVar26 != 0) && (*(longlong *)(uVar26 + 0x40) != 0)) {

+      return lVar9;

+    }

+    pSVar27 = SC_ENV::Allocate(0x128,0x64497053,'\0',0);

+    if (pSVar27 == (SIO_LOG_TABLE *)0x0) {

+      *(undefined8 *)(this + 0x40) = 0;

+    }

+    else {

+      pSVar27 = (SIO_LOG_TABLE *)SIO_LOG_TABLE::SIO_LOG_TABLE(pSVar27);

+      *(SIO_LOG_TABLE **)(this + 0x40) = pSVar27;

+      if (pSVar27 != (SIO_LOG_TABLE *)0x0) {

+        pSVar10 = Resiliency(this);

+        uVar7 = *(ulong *)(pSVar10 + 0x10);

+        p_Var28 = Provisioning(this);

+        lVar9 = SIO_LOG_TABLE::Initialize

+                          (pSVar27,*(ulonglong *)(p_Var28 + 8) >> ((byte)this[0x2a] & 0x3f),uVar7);

+        return lVar9;

+      }

+    }

+    return -0x3fffff66;

+  }

+  return lVar9;

+}

+
```

## `SDB_POOL_CONFIG::GetNumberOfFd`  (modified)

```diff
--- SDB_POOL_CONFIG::GetNumberOfFd
+++ SDB_POOL_CONFIG::GetNumberOfFd
@@ -1,2 +1,94 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::GetNumberOfFd : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SDB_POOL_CONFIG::GetNumberOfFd(enum _SC_FD_TYPE,unsigned long * __ptr64)

+   __ptr64 */

+

+long __thiscall

+SDB_POOL_CONFIG::GetNumberOfFd(SDB_POOL_CONFIG *this,_SC_FD_TYPE param_1,ulong *param_2)

+

+{

+  code *pcVar1;

+  undefined4 uVar2;

+  undefined4 uVar3;

+  undefined4 uVar4;

+  SDB_RECORD *this_00;

+  SDB_OBJECT *this_01;

+  _GUID *p_Var5;

+  undefined8 ****ppppuVar6;

+  undefined8 ****ppppuVar7;

+  longlong lVar8;

+  long lVar9;

+  undefined1 *puVar10;

+  undefined1 *puVar11;

+  undefined8 ****ppppuVar12;

+  undefined1 auStack_58 [8];

+  undefined1 auStack_50 [24];

+  undefined8 ***local_38;

+  undefined8 ***local_30;

+  

+  ppppuVar7 = (undefined8 ****)(ulonglong)param_1;

+  puVar10 = auStack_58;

+  lVar9 = 0;

+  local_38 = &local_38;

+  *param_2 = 0;

+  this_00 = (SDB_RECORD *)0x0;

+  ppppuVar12 = (undefined8 ****)local_38;

+  local_30 = &local_38;

+LAB_0:

+  do {

+    this_00 = GetRecordByType(this,(_SDB_RECORD_TYPE)CONCAT71((int7)((ulonglong)ppppuVar7 >> 8),2),

+                              this_00);

+    puVar11 = auStack_58;

+    if (this_00 == (SDB_RECORD *)0x0) {

+LAB_1:

+      *(undefined8 *)(puVar11 + -8) = 0x1400635fe;

+      ScFreeLists((_LIST_ENTRY *)(puVar11 + 0x20));

+      return lVar9;

+    }

+    this_01 = SDB_RECORD::GetObject(this_00);

+    ppppuVar7 = (undefined8 ****)(ulonglong)param_1;

+    p_Var5 = SDB_DRIVE::GetFaultDomainId((SDB_DRIVE *)this_01,param_1);

+  } while ((p_Var5 == (_GUID *)0x0) ||

+          ((ppppuVar6 = ppppuVar12, *(longlong *)(this_01 + 200) == 0 &&

+           (*(int *)(this_01 + 0x44) == 5))));

+  for (; ppppuVar6 != &local_38; ppppuVar6 = (undefined8 ****)*ppppuVar6) {

+    lVar8 = (longlong)ppppuVar6[5] - *(longlong *)p_Var5;

+    if (lVar8 == 0) {

+      lVar8 = (longlong)ppppuVar6[6] - *(longlong *)(p_Var5 + 8);

+    }

+    ppppuVar7 = (undefined8 ****)0x0;

+    if (lVar8 == 0) goto LAB_0;

+  }

+  ppppuVar6 = SC_ENV::Allocate(0x40,0x58587053,'\0',0);

+  if (ppppuVar6 != (undefined8 ****)0x0) {

+    ppppuVar6[1] = ppppuVar6;

+    *ppppuVar6 = ppppuVar6;

+    ppppuVar7 = ppppuVar6 + 2;

+    ppppuVar6[3] = ppppuVar7;

+    *ppppuVar7 = ppppuVar7;

+    *(undefined4 *)(ppppuVar6 + 4) = 0;

+    uVar2 = *(undefined4 *)(p_Var5 + 4);

+    uVar3 = *(undefined4 *)(p_Var5 + 8);

+    uVar4 = *(undefined4 *)(p_Var5 + 0xc);

+    *(undefined4 *)(ppppuVar6 + 5) = *(undefined4 *)p_Var5;

+    *(undefined4 *)((longlong)ppppuVar6 + 0x2c) = uVar2;

+    *(undefined4 *)(ppppuVar6 + 6) = uVar3;

+    *(undefined4 *)((longlong)ppppuVar6 + 0x34) = uVar4;

+    if ((undefined8 ****)*local_30 == &local_38) {

+      *param_2 = *param_2 + 1;

+      ppppuVar7 = &local_38;

+      *ppppuVar6 = ppppuVar7;

+      ppppuVar6[1] = local_30;

+      *local_30 = ppppuVar6;

+      ppppuVar12 = (undefined8 ****)local_38;

+      local_30 = ppppuVar6;

+      goto LAB_0;

+    }

+    pcVar1 = (code *)swi(0x29);

+    (*pcVar1)(3);

+    puVar10 = auStack_50;

+  }

+  lVar9 = -0x3fffff66;

+  puVar11 = puVar10;

+  goto LAB_1;

+}

+
```

## `SDB_POOL_CONFIG::PickDrive`  (modified)

```diff
--- SDB_POOL_CONFIG::PickDrive
+++ SIO_RAID::Initialize
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::PickDrive : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SIO_RAID::Initialize : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SP_ATTRIBUTES::AllocateRoutine`  (modified)

```diff
--- SP_ATTRIBUTES::AllocateRoutine
+++ SP_ATTRIBUTES::AllocateRoutine
@@ -1,2 +1,13 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_ATTRIBUTES::AllocateRoutine : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: static void * __ptr64 __cdecl SP_ATTRIBUTES::AllocateRoutine(struct _RTL_AVL_TABLE *

+   __ptr64,unsigned long) */

+

+void * __cdecl SP_ATTRIBUTES::AllocateRoutine(_RTL_AVL_TABLE *param_1,ulong param_2)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate((ulonglong)param_2,0x74417053,'\0',0);

+  return pvVar1;

+}

+
```

## `SC_PICK_CONTEXT::Reinitialize`  (modified)

```diff
--- SC_PICK_CONTEXT::Reinitialize
+++ SC_PICK_CONTEXT::Reinitialize
@@ -1,2 +1,68 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_PICK_CONTEXT::Reinitialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SC_PICK_CONTEXT::Reinitialize(struct _SP_PROVISIONING_INFO * __ptr64,class

+   SP_RESILIENCY_INFO * __ptr64,unsigned long,unsigned char) __ptr64 */

+

+long __thiscall

+SC_PICK_CONTEXT::Reinitialize

+          (SC_PICK_CONTEXT *this,_SP_PROVISIONING_INFO *param_1,SP_RESILIENCY_INFO *param_2,

+          ulong param_3,uchar param_4)

+

+{

+  undefined8 *puVar1;

+  undefined1 auVar2 [16];

+  long lVar3;

+  ulonglong uVar4;

+  __uint64 _Var5;

+  ulonglong *puVar6;

+  ulonglong uVar7;

+  SDB_EXTENT *pSVar8;

+  SDB_EXTENT *this_00;

+  

+  if (param_3 == 0xffffffff) {

+    param_3 = *(int *)(param_2 + 0x10) * *(int *)(param_2 + 8);

+  }

+  uVar7 = CONCAT44(0,param_3);

+  *(undefined8 *)(this + 8) = *(undefined8 *)(param_1 + 8);

+  this[0x38] = (SC_PICK_CONTEXT)param_4;

+  *(_SP_PROVISIONING_INFO **)(this + 0x18) = param_1;

+  *(SP_RESILIENCY_INFO **)(this + 0x20) = param_2;

+  *(ulong *)(this + 0x28) = param_3;

+  puVar1 = *(undefined8 **)(this + 0x30);

+  if (puVar1 != (undefined8 *)0x0) {

+    if (puVar1[-1] == 0) {

+      ExFreePoolWithTag(puVar1 + -1,0);

+    }

+    else {

+      (**(code **)*puVar1)(puVar1,3);

+    }

+  }

+  auVar2._8_8_ = 0;

+  auVar2._0_8_ = uVar7;

+  uVar4 = SUB168(ZEXT816(0x58) * auVar2,0);

+  if (SUB168(ZEXT816(0x58) * auVar2,8) != 0) {

+    uVar4 = 0xffffffffffffffff;

+  }

+  _Var5 = uVar4 + 8;

+  if (0xfffffffffffffff7 < uVar4) {

+    _Var5 = 0xffffffffffffffff;

+  }

+  puVar6 = SC_ENV::Allocate(_Var5,0x65427053,'\x01',0);

+  pSVar8 = (SDB_EXTENT *)0x0;

+  if (puVar6 != (ulonglong *)0x0) {

+    pSVar8 = (SDB_EXTENT *)(puVar6 + 1);

+    *puVar6 = uVar7;

+    this_00 = pSVar8;

+    for (; uVar7 != 0; uVar7 = uVar7 - 1) {

+      SDB_EXTENT::SDB_EXTENT(this_00);

+      this_00 = this_00 + 0x58;

+    }

+  }

+  *(SDB_EXTENT **)(this + 0x30) = pSVar8;

+  lVar3 = -0x3fffff66;

+  if (pSVar8 != (SDB_EXTENT *)0x0) {

+    lVar3 = 0;

+  }

+  return lVar3;

+}

+
```

## `SDB_SPACE::Unformat`  (modified)

```diff
--- SDB_SPACE::Unformat
+++ SDB_TIER::Unformat
@@ -1,101 +1,65 @@
 

-/* public: virtual long __cdecl SDB_SPACE::Unformat(class SS_RECORD * __ptr64) __ptr64 */

+/* public: virtual long __cdecl SDB_TIER::Unformat(class SS_RECORD * __ptr64) __ptr64 */

 

-long __thiscall SDB_SPACE::Unformat(SDB_SPACE *this,SS_RECORD *param_1)

+long __thiscall SDB_TIER::Unformat(SDB_TIER *this,SS_RECORD *param_1)

 

 {

-  SDB_SPACE SVar1;

-  int iVar2;

-  long lVar3;

-  void *pvVar4;

-  undefined8 uVar5;

-  uint uVar6;

+  SDB_TIER SVar1;

+  long lVar2;

+  void *pvVar3;

+  ulonglong uVar4;

+  ulonglong uVar5;

   

-  SVar1 = *(SDB_SPACE *)(param_1 + 0x11);

+  SVar1 = *(SDB_TIER *)(param_1 + 0x11);

   this[0x18] = SVar1;

-  lVar3 = SS_RECORD::Unformat(param_1,*(SC_FIELD **)(&DAT_0 + (ulonglong)(byte)SVar1 * 0x10)

+  lVar2 = SS_RECORD::Unformat(param_1,*(SC_FIELD **)(&DAT_0 + (ulonglong)(byte)SVar1 * 0x10)

                               ,*(ulong *)(&DAT_1 + (ulonglong)(byte)SVar1 * 0x10),this);

-  if (lVar3 < 0) {

-    return lVar3;

+  uVar5 = 0;

+  if (lVar2 < 0) {

+    return lVar2;

   }

-  if ((((uint)*(ushort *)(this + 0x40) &

-       ~*(uint *)(&DAT_2 + (ulonglong)(byte)this[0x18] * 4)) != 0) ||

-     (*(int *)(this + 0x80) == 0)) {

+  if (*(short *)(this + 0x40) != 0) {

     return -0x3ffffff3;

   }

-  if (*(int *)(this + 0xc4) != 0) {

-    pvVar4 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(this + 0xc4) << 4),0x73427053,'\0',0);

-    *(void **)(this + 200) = pvVar4;

-    if (pvVar4 == (void *)0x0) {

-      return -0x3fffff66;

-    }

-    for (uVar6 = 0; uVar6 < *(uint *)(this + 0xc4); uVar6 = uVar6 + 1) {

-      lVar3 = SS_RECORD::Unformat(param_1,(SC_FIELD *)&DAT_3,1,

-                                  (void *)((ulonglong)uVar6 * 0x10 + *(longlong *)(this + 200)));

-      if (lVar3 < 0) {

-        return lVar3;

+  if (*(int *)(this + 0x90) == 0) {

+LAB_2:

+    *(undefined8 *)(this + 200) = 0;

+    if (*(int *)(this + 0x88) != 0) {

+      pvVar3 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(this + 0x88) << 4),0x69427053,'\0',0);

+      *(void **)(this + 0xa0) = pvVar3;

+      if (pvVar3 == (void *)0x0) goto LAB_3;

+      for (; (uint)uVar5 < *(uint *)(this + 0x88); uVar5 = (ulonglong)((uint)uVar5 + 1)) {

+        lVar2 = SS_RECORD::Unformat(param_1,(SC_FIELD *)&DAT_4,2,

+                                    (void *)((longlong)pvVar3 + uVar5 * 0x10));

+        if (lVar2 < 0) {

+          return lVar2;

+        }

+        pvVar3 = *(void **)(this + 0xa0);

+        *(longlong *)(this + 200) =

+             *(longlong *)(this + 200) + *(longlong *)((longlong)pvVar3 + uVar5 * 0x10 + 8);

       }

     }

-  }

-  SVar1 = this[0x18];

-  if ((byte)SVar1 < 3) {

-    uVar5 = 0;

-    if (*(int *)(this + 0x78) == 3) {

-      uVar5 = 0x2000000;

+    if (((byte)this[0x18] < 3) && (*(int *)(this + 0x90) != 0)) {

+      *(undefined4 *)(this + 0x8c) = 1;

     }

-    *(undefined8 *)(this + 0x90) = uVar5;

-LAB_4:

-    iVar2 = *(int *)(this + 0x78);

-    if (iVar2 == 1) {

-      *(undefined4 *)(this + 0x7c) = 0;

-    }

-    else if (iVar2 == 2) {

-      *(int *)(this + 0x7c) = *(int *)(this + 0x80) + -1;

-    }

-    else if (iVar2 == 3) {

-      *(undefined4 *)(this + 0x7c) = 1;

-    }

-LAB_5:

-    *(uint *)(this + 0x88) = *(uint *)(this + 0x88) / *(uint *)(this + 0x80);

-LAB_6:

-    *(uint *)(this + 0x74) = (this[0x74] != (SDB_SPACE)0x0) + 1;

-LAB_7:

-    if (*(int *)(this + 0xb4) != 0) {

-      *(undefined4 *)(this + 0x68) = 5;

-    }

-LAB_8:

-    *(undefined4 *)(this + 0xc0) = 1;

   }

   else {

-    if ((byte)SVar1 < 4) goto LAB_4;

-    if ((byte)SVar1 < 6) goto LAB_5;

-    if ((byte)SVar1 < 7) goto LAB_6;

-    if ((byte)SVar1 < 9) goto LAB_7;

-    if ((byte)SVar1 < 10) goto LAB_8;

+    pvVar3 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(this + 0x90) << 4),0x69427053,'\0',0);

+    *(void **)(this + 0x98) = pvVar3;

+    uVar4 = uVar5;

+    if (pvVar3 != (void *)0x0) {

+      for (; (uint)uVar4 < *(uint *)(this + 0x90); uVar4 = (ulonglong)((uint)uVar4 + 1)) {

+        lVar2 = SS_RECORD::Unformat(param_1,(SC_FIELD *)&DAT_5,1,

+                                    (void *)(uVar4 * 0x10 + *(longlong *)(this + 0x98)));

+        if (lVar2 < 0) {

+          return lVar2;

+        }

+      }

+      goto LAB_2;

+    }

+LAB_3:

+    lVar2 = -0x3fffff66;

   }

-  if (*(int *)(this + 0xc4) == 0) {

-    *(undefined4 *)(this + 0xc0) = 0;

-  }

-  if ((byte)SVar1 < 0xb) {

-    *(longlong *)(this + 0x48) = *(longlong *)(this + 0x48) << 0x1c;

-LAB_9:

-    *(undefined8 *)(this + 0xd0) = 0;

-    *(undefined8 *)(this + 0xd8) = 0;

-  }

-  else {

-    if ((byte)SVar1 < 0xf) goto LAB_9;

-    if (0xf < (byte)SVar1) goto LAB_10;

-  }

-  *(undefined8 *)(this + 0x98) = 0;

-  *(undefined4 *)(this + 0xb0) = 1;

-LAB_10:

-  if (this[0x42] == (SDB_SPACE)0x1) {

-    pvVar4 = SC_ENV::Allocate(*(ulonglong *)(this + 0x48) >> 0x19 & 0xffffffff,0x73427053,'\0',0);

-    *(void **)(this + 0x178) = pvVar4;

-    if (pvVar4 == (void *)0x0) {

-      lVar3 = -0x3fffff66;

-    }

-  }

-  return lVar3;

+  return lVar2;

 }
```

## `SDB_TIER::AppendRegion`  (modified)

```diff
--- SDB_TIER::AppendRegion
+++ SDB_TIER::AppendRegion
@@ -1,2 +1,50 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_TIER::AppendRegion : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SDB_TIER::AppendRegion(unsigned __int64,unsigned __int64) __ptr64 */

+

+long __thiscall SDB_TIER::AppendRegion(SDB_TIER *this,__uint64 param_1,__uint64 param_2)

+

+{

+  SDB_TIER *pSVar1;

+  uint uVar2;

+  longlong lVar3;

+  void *pvVar4;

+  undefined8 *puVar5;

+  long lVar6;

+  ulonglong uVar7;

+  uint uVar8;

+  

+  lVar6 = 0;

+  pvVar4 = SC_ENV::Allocate((ulonglong)(uint)((*(int *)(this + 0x88) + 1) * 0x10),0x69427053,'\0',0)

+  ;

+  if (pvVar4 == (void *)0x0) {

+    lVar6 = -0x3fffff66;

+  }

+  else {

+    uVar2 = *(uint *)(this + 0x88);

+    pSVar1 = this + 0xa0;

+    uVar8 = 0;

+    if (uVar2 != 0) {

+      lVar3 = *(longlong *)pSVar1;

+      puVar5 = (undefined8 *)((longlong)pvVar4 + 8);

+      uVar7 = (ulonglong)uVar2;

+      do {

+        puVar5[-1] = *(undefined8 *)((lVar3 - (longlong)pvVar4) + -8 + (longlong)puVar5);

+        *puVar5 = *(undefined8 *)((lVar3 - (longlong)pvVar4) + (longlong)puVar5);

+        puVar5 = puVar5 + 2;

+        uVar7 = uVar7 - 1;

+        uVar8 = uVar2;

+      } while (uVar7 != 0);

+    }

+    *(__uint64 *)(this + 200) = *(longlong *)(this + 200) + param_2;

+    lVar3 = *(longlong *)pSVar1;

+    *(__uint64 *)((longlong)pvVar4 + (ulonglong)uVar8 * 0x10) = param_1;

+    *(__uint64 *)((longlong)pvVar4 + (ulonglong)uVar8 * 0x10 + 8) = param_2;

+    *(uint *)(this + 0x88) = uVar2 + 1;

+    if (lVar3 != 0) {

+      ExFreePoolWithTag(lVar3,0);

+    }

+    *(void **)pSVar1 = pvVar4;

+  }

+  return lVar6;

+}

+
```

## `SIO_CACHE::GetDestageMapRanges`  (modified)

```diff
--- SIO_CACHE::GetDestageMapRanges
+++ SIO_CACHE::GetDestageMapRanges
@@ -1,2 +1,59 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_CACHE::GetDestageMapRanges : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_CACHE::GetDestageMapRanges(class SIO_CACHE_PACKET * __ptr64,class

+   SDB_RANGES * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SIO_CACHE::GetDestageMapRanges(SIO_CACHE *this,SIO_CACHE_PACKET *param_1,SDB_RANGES **param_2)

+

+{

+  SIO_CACHE_PACKET *pSVar1;

+  SIO_CACHE_PACKET *pSVar2;

+  longlong lVar3;

+  SDB_RANGES *pSVar4;

+  uint uVar5;

+  SIO_CACHE_PACKET *pSVar6;

+  long lVar7;

+  ulonglong uVar8;

+  uint uVar9;

+  ulonglong uVar10;

+  longlong lVar11;

+  

+  uVar8 = 0;

+  lVar7 = 0;

+  pSVar2 = param_1 + 0x100;

+  pSVar6 = *(SIO_CACHE_PACKET **)pSVar2;

+  *param_2 = (SDB_RANGES *)0x0;

+  uVar10 = uVar8;

+  while (uVar9 = (uint)uVar10, pSVar6 != pSVar2) {

+    pSVar1 = pSVar6 + -0x40;

+    pSVar6 = *(SIO_CACHE_PACKET **)pSVar6;

+    uVar5 = uVar9 + 1;

+    if (*(int *)pSVar1 != -0x3f18ffec) {

+      uVar5 = uVar9;

+    }

+    uVar10 = (ulonglong)uVar5;

+  }

+  pSVar4 = SC_ENV::Allocate((ulonglong)(uVar9 << 5) + 0x28,0x58587053,'\x01',0);

+  if (pSVar4 == (SDB_RANGES *)0x0) {

+    lVar7 = -0x3fffff66;

+  }

+  else {

+    *pSVar4 = (SDB_RANGES)0x1;

+    *(uint *)(pSVar4 + 4) = uVar9;

+    for (pSVar6 = *(SIO_CACHE_PACKET **)pSVar2; pSVar6 != pSVar2;

+        pSVar6 = *(SIO_CACHE_PACKET **)pSVar6) {

+      if (*(int *)(pSVar6 + -0x40) == -0x3f18ffec) {

+        lVar3 = *(longlong *)(pSVar6 + -0x70);

+        lVar11 = uVar8 * 0x20;

+        *(undefined8 *)(pSVar4 + lVar11 + 8) = *(undefined8 *)(lVar3 + 0x20);

+        *(ulonglong *)(pSVar4 + lVar11 + 0x10) =

+             (ulonglong)*(uint *)(this + 0x1d8) + *(longlong *)(lVar3 + 0x20);

+        uVar8 = (ulonglong)((int)uVar8 + 1);

+        *(undefined4 *)(pSVar4 + lVar11 + 0x20) = 0;

+      }

+    }

+    *param_2 = pSVar4;

+  }

+  return lVar7;

+}

+
```

## `SDB_POOL_CONFIG::ZeroExtent`  (modified)

```diff
--- SDB_POOL_CONFIG::ZeroExtent
+++ SDB_POOL_CONFIG::ZeroExtent
@@ -1,2 +1,50 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::ZeroExtent : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SDB_POOL_CONFIG::ZeroExtent(class SDB_RECORD * __ptr64) __ptr64 */

+

+long __thiscall SDB_POOL_CONFIG::ZeroExtent(SDB_POOL_CONFIG *this,SDB_RECORD *param_1)

+

+{

+  longlong *plVar1;

+  int iVar2;

+  SDB_OBJECT *pSVar3;

+  SDB_RECORD *this_00;

+  SDB_OBJECT *this_01;

+  void *pvVar4;

+  __uint64 _Var5;

+  ulonglong uVar6;

+  ulonglong uVar7;

+  code *pcVar8;

+  

+  iVar2 = 0;

+  pSVar3 = SDB_RECORD::GetObject(*(SDB_RECORD **)(this + 0x110));

+  if (((byte)pSVar3[0x40] & 1) != 0) {

+    pSVar3 = SDB_RECORD::GetObject(param_1);

+    this_00 = FindRecordByRecordId

+                        (*(SDB_POOL_CONFIG **)(*(longlong *)(pSVar3 + 0x10) + 0x10),

+                         (_SDB_RECORD_TYPE)CONCAT71((int7)((ulonglong)param_1 >> 8),2),

+                         *(ulong *)(pSVar3 + 0x3c));

+    this_01 = SDB_RECORD::GetObject(this_00);

+    plVar1 = *(longlong **)(this_01 + 200);

+    if (plVar1 != (longlong *)0x0) {

+      pvVar4 = SC_ENV::Allocate(0x100000,0x58587053,'\0',0);

+      if (pvVar4 == (void *)0x0) {

+        iVar2 = -0x3fffff66;

+      }

+      else {

+        uVar6 = *(ulonglong *)(pSVar3 + 0x30);

+        uVar7 = *(longlong *)(pSVar3 + 0x20) + uVar6;

+        iVar2 = 0;

+        for (; uVar6 < uVar7; uVar6 = uVar6 + 0x100000) {

+          pcVar8 = *(code **)(*plVar1 + 0x40);

+          _Var5 = SDB_DRIVE::GetDataOffset((SDB_DRIVE *)this_01);

+          iVar2 = (*pcVar8)(plVar1,uVar6 + _Var5,0x100000,pvVar4);

+          if (iVar2 < 0) break;

+        }

+        ExFreePoolWithTag(pvVar4,0);

+      }

+    }

+  }

+  return iVar2;

+}

+
```

## `SIO_CACHE::GetPendingUnmapRanges`  (modified)

```diff
--- SIO_CACHE::GetPendingUnmapRanges
+++ SIO_CACHE::GetPendingUnmapRanges
@@ -1,2 +1,45 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_CACHE::GetPendingUnmapRanges : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SIO_CACHE::GetPendingUnmapRanges(class SDB_RANGES * __ptr64 * __ptr64)

+   __ptr64 */

+

+long __thiscall SIO_CACHE::GetPendingUnmapRanges(SIO_CACHE *this,SDB_RANGES **param_1)

+

+{

+  SIO_CACHE SVar1;

+  longlong lVar2;

+  undefined1 uVar3;

+  SDB_RANGES *pSVar4;

+  SIO_SPACE *pSVar5;

+  undefined8 uVar6;

+  long lVar7;

+  ulonglong uVar8;

+  

+  pSVar5 = (SIO_SPACE *)(**(code **)(**(longlong **)(this + 8) + 0x50))();

+  lVar7 = 0;

+  *param_1 = (SDB_RANGES *)0x0;

+  uVar3 = ExAcquireSpinLockShared(this + 0x158);

+  SVar1 = this[0x200];

+  ExReleaseSpinLockShared(this + 0x158,uVar3);

+  if (SVar1 != (SIO_CACHE)0x0) {

+    uVar6 = 0x58587053;

+    pSVar4 = SC_ENV::Allocate(0x48,0x58587053,'\x01',0);

+    if (pSVar4 == (SDB_RANGES *)0x0) {

+      lVar7 = -0x3fffff66;

+    }

+    else {

+      *pSVar4 = (SDB_RANGES)0x1;

+      *(undefined4 *)(pSVar4 + 4) = 1;

+      pSVar5 = SIO_SPACE::GetChild(pSVar5,(_SC_SPACE_USAGE)

+                                          CONCAT71((int7)((ulonglong)uVar6 >> 8),0xb));

+      lVar2 = *(longlong *)(this + 0x1e8);

+      *param_1 = pSVar4;

+      uVar8 = lVar2 + -1 + *(ulonglong *)(pSVar5 + 0x78);

+      *(ulonglong *)(pSVar4 + 8) = uVar8 - uVar8 % *(ulonglong *)(pSVar5 + 0x78);

+      *(undefined8 *)(pSVar4 + 0x10) = *(undefined8 *)(pSVar5 + 0x70);

+      *(undefined4 *)(pSVar4 + 0x20) = 0;

+    }

+  }

+  return lVar7;

+}

+
```

## `SIO_SPACE::BuildDrives`  (modified)

```diff
--- SIO_SPACE::BuildDrives
+++ SIO_SPACE::BuildDrt
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildDrives : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildDrt : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SC_DISK::GetStoragePropertyPost`  (modified)

```diff
--- SC_DISK::GetStoragePropertyPost
+++ SC_DISK::GetStoragePropertyPost
@@ -1,2 +1,46 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_DISK::GetStoragePropertyPost : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: virtual long __cdecl SC_DISK::GetStoragePropertyPost(enum _STORAGE_PROPERTY_ID,struct

+   _STORAGE_DESCRIPTOR_HEADER * __ptr64) __ptr64 */

+

+long __thiscall

+SC_DISK::GetStoragePropertyPost

+          (SC_DISK *this,_STORAGE_PROPERTY_ID param_1,_STORAGE_DESCRIPTOR_HEADER *param_2)

+

+{

+  uint uVar1;

+  long lVar2;

+  char *_Dst;

+  long lVar3;

+  

+  lVar3 = 0;

+  lVar2 = lVar3;

+  if ((int)param_1 < 0xf) {

+    lVar2 = 0;

+    if ((((param_1 != 0xe) && (lVar2 = lVar3, param_1 != 4)) && (param_1 == 6)) &&

+       (((uVar1 = *(uint *)(this + 0xec), *(uint *)(param_2 + 0x10) != uVar1 ||

+         (*(uint *)(param_2 + 0x14) < uVar1)) || (*(uint *)(param_2 + 0x14) % uVar1 != 0)))) {

+      lVar2 = -0x3ffff6f5;

+    }

+  }

+  else if ((param_1 != 0x15) && (param_1 != 0x39)) {

+    if (param_1 == 0x3a) {

+      if ((*(uint *)(param_2 + 0x20) < *(uint *)param_2) ||

+         (*(int *)(param_2 + 4) - 1U < *(uint *)(param_2 + 0x20))) {

+        *(undefined4 *)(param_2 + 0x20) = 0;

+      }

+    }

+    else if ((param_1 != 0x3c) && (param_1 == 0x41)) {

+      _Dst = SC_ENV::Allocate((ulonglong)(*(int *)(param_2 + 8) + 1),0x58587053,'\0',0);

+      if (_Dst == (char *)0x0) {

+        lVar2 = -0x3fffff66;

+      }

+      else {

+        memmove(_Dst,param_2 + 0xc,(ulonglong)*(uint *)(param_2 + 8));

+        lVar2 = ScAnsiToUnicodeString(_Dst,(_UNICODE_STRING *)(this + 0x120));

+        ExFreePoolWithTag(_Dst,0);

+      }

+    }

+  }

+  return lVar2;

+}

+
```

## `SDB_TIER::Clone`  (modified)

```diff
--- SDB_TIER::Clone
+++ SDB_TIER::Clone
@@ -1,2 +1,91 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_TIER::Clone : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: virtual class SDB_OBJECT * __ptr64 __cdecl SDB_TIER::Clone(void) __ptr64 */

+

+SDB_OBJECT * __thiscall SDB_TIER::Clone(SDB_TIER *this)

+

+{

+  SDB_TIER *pSVar1;

+  int iVar2;

+  undefined8 uVar3;

+  long lVar4;

+  SDB_OBJECT *pSVar5;

+  SDB_OBJECT *pSVar6;

+  void *pvVar7;

+  SDB_TIER *pSVar8;

+  longlong lVar9;

+  

+  pSVar5 = SC_ENV::Allocate(0x100,0x69427053,'\x01',0);

+  if (pSVar5 == (SDB_OBJECT *)0x0) {

+    return (SDB_OBJECT *)0x0;

+  }

+  *(undefined8 *)(pSVar5 + 8) = 0;

+  lVar9 = 2;

+  *(undefined8 *)(pSVar5 + 0x10) = 0;

+  *(undefined2 *)(pSVar5 + 0x18) = 0;

+  *(undefined ***)pSVar5 = &_vftable_;

+  pSVar6 = pSVar5;

+  pSVar8 = this;

+  do {

+    uVar3 = *(undefined8 *)(pSVar8 + 8);

+    *(undefined8 *)pSVar6 = *(undefined8 *)pSVar8;

+    *(undefined8 *)(pSVar6 + 8) = uVar3;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x18);

+    *(undefined8 *)(pSVar6 + 0x10) = *(undefined8 *)(pSVar8 + 0x10);

+    *(undefined8 *)(pSVar6 + 0x18) = uVar3;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x28);

+    *(undefined8 *)(pSVar6 + 0x20) = *(undefined8 *)(pSVar8 + 0x20);

+    *(undefined8 *)(pSVar6 + 0x28) = uVar3;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x38);

+    *(undefined8 *)(pSVar6 + 0x30) = *(undefined8 *)(pSVar8 + 0x30);

+    *(undefined8 *)(pSVar6 + 0x38) = uVar3;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x48);

+    *(undefined8 *)(pSVar6 + 0x40) = *(undefined8 *)(pSVar8 + 0x40);

+    *(undefined8 *)(pSVar6 + 0x48) = uVar3;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x58);

+    *(undefined8 *)(pSVar6 + 0x50) = *(undefined8 *)(pSVar8 + 0x50);

+    *(undefined8 *)(pSVar6 + 0x58) = uVar3;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x68);

+    *(undefined8 *)(pSVar6 + 0x60) = *(undefined8 *)(pSVar8 + 0x60);

+    *(undefined8 *)(pSVar6 + 0x68) = uVar3;

+    pSVar1 = pSVar8 + 0x70;

+    uVar3 = *(undefined8 *)(pSVar8 + 0x78);

+    pSVar8 = pSVar8 + 0x80;

+    *(undefined8 *)(pSVar6 + 0x70) = *(undefined8 *)pSVar1;

+    *(undefined8 *)(pSVar6 + 0x78) = uVar3;

+    lVar9 = lVar9 + -1;

+    pSVar6 = pSVar6 + 0x80;

+  } while (lVar9 != 0);

+  *(undefined8 *)(pSVar5 + 0x38) = 0;

+  *(ushort **)(pSVar5 + 0x30) = (ushort *)0x0;

+  *(undefined8 *)(pSVar5 + 0x98) = 0;

+  *(undefined8 *)(pSVar5 + 0xa0) = 0;

+  if (((*(ushort **)(this + 0x30) == (ushort *)0x0) ||

+      (lVar4 = SpStringCchCopyHelper(*(ushort **)(this + 0x30),0x100,(ushort **)(pSVar5 + 0x30)),

+      -1 < lVar4)) &&

+     ((*(ushort **)(this + 0x38) == (ushort *)0x0 ||

+      (lVar4 = SpStringCchCopyHelper(*(ushort **)(this + 0x38),0x400,(ushort **)(pSVar5 + 0x38)),

+      -1 < lVar4)))) {

+    if (*(longlong *)(this + 0x98) != 0) {

+      iVar2 = *(int *)(pSVar5 + 0x90);

+      pvVar7 = SC_ENV::Allocate((ulonglong)(uint)(iVar2 << 4),0x69427053,'\0',0);

+      *(void **)(pSVar5 + 0x98) = pvVar7;

+      if (pvVar7 == (void *)0x0) goto LAB_0;

+      memmove(pvVar7,*(void **)(this + 0x98),(ulonglong)(uint)(iVar2 << 4));

+    }

+    if (*(longlong *)(this + 0xa0) == 0) {

+      return pSVar5;

+    }

+    iVar2 = *(int *)(pSVar5 + 0x88);

+    pvVar7 = SC_ENV::Allocate((ulonglong)(uint)(iVar2 << 4),0x69427053,'\0',0);

+    *(void **)(pSVar5 + 0xa0) = pvVar7;

+    if (pvVar7 != (void *)0x0) {

+      memmove(pvVar7,*(void **)(this + 0xa0),(ulonglong)(uint)(iVar2 << 4));

+      return pSVar5;

+    }

+  }

+LAB_0:

+  (*(code *)**(undefined8 **)pSVar5)(pSVar5,1);

+  return (SDB_OBJECT *)0x0;

+}

+
```

## `SP_WORK::ScopeRegeneration`  (modified)

```diff
--- SP_WORK::ScopeRegeneration
+++ SP_WORK::ScopeRegeneration
@@ -1,2 +1,64 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_WORK::ScopeRegeneration : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SP_WORK::ScopeRegeneration(struct _SP_ID * __ptr64) __ptr64 */

+

+long __thiscall SP_WORK::ScopeRegeneration(SP_WORK *this,_SP_ID *param_1)

+

+{

+  longlong lVar1;

+  undefined8 uVar2;

+  SP_CONTROL *pSVar3;

+  long lVar4;

+  undefined4 *puVar5;

+  char *pcVar6;

+  

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 1) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x29])) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x49,

+            &WPP_62e395074fc23b8bb3d7fc1ecbe71e8c_Traceguids);

+  }

+  puVar5 = SC_ENV::Allocate(0x60,0x6b577053,'\0',0);

+  *(undefined4 **)(this + 0x10) = puVar5;

+  pSVar3 = SpControlExt;

+  if (puVar5 == (undefined4 *)0x0) {

+    lVar4 = -0x3fffff66;

+  }

+  else {

+    *puVar5 = 0x60;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 4) = 0x60;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 0xc) = 4;

+    lVar1 = *(longlong *)(this + 0x10);

+    uVar2 = *(undefined8 *)(param_1 + 8);

+    *(undefined8 *)(lVar1 + 0x30) = *(undefined8 *)param_1;

+    *(undefined8 *)(lVar1 + 0x38) = uVar2;

+    uVar2 = *(undefined8 *)(param_1 + 0x18);

+    *(undefined8 *)(lVar1 + 0x40) = *(undefined8 *)(param_1 + 0x10);

+    *(undefined8 *)(lVar1 + 0x48) = uVar2;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 0x50) = 0;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 0x54) = 0;

+    lVar4 = SP_CONTROL_WORK::Run((SP_CONTROL_WORK *)(pSVar3 + 0x268),this);

+  }

+  if (*(longlong *)(this + 0x10) != 0) {

+    ExFreePoolWithTag(*(longlong *)(this + 0x10),0);

+    *(undefined8 *)(this + 0x10) = 0;

+  }

+  if (((lVar4 < 0) && (lVar4 != -0x7ffffffb)) && (lVar4 != -0x3fffffdd)) {

+    if (SP_TL_DEFAULT != 1) {

+      SP_TL_DEFAULT = 1;

+    }

+    pcVar6 = "Error";

+  }

+  else {

+    if (SP_TL_DEFAULT != 3) {

+      SP_TL_DEFAULT = 3;

+    }

+    pcVar6 = "Exit ";

+  }

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 1) != 0)) &&

+     (SP_TL_DEFAULT <= (byte)WPP_GLOBAL_Control[0x29])) {

+    WPP_SF_sd(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x4a,

+              &WPP_62e395074fc23b8bb3d7fc1ecbe71e8c_Traceguids,pcVar6);

+  }

+  return lVar4;

+}

+
```

## `SDB_DRIVE::Clone`  (modified)

```diff
--- SDB_DRIVE::Clone
+++ SDB_DRIVE::Clone
@@ -1,2 +1,23 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_DRIVE::Clone : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual class SDB_OBJECT * __ptr64 __cdecl SDB_DRIVE::Clone(void) __ptr64 */

+

+SDB_OBJECT * __thiscall SDB_DRIVE::Clone(SDB_DRIVE *this)

+

+{

+  undefined8 *puVar1;

+  SDB_OBJECT *pSVar2;

+  

+  puVar1 = SC_ENV::Allocate(0x100,0x64427053,'\x01',0);

+  if (puVar1 == (undefined8 *)0x0) {

+    return (SDB_OBJECT *)0x0;

+  }

+  puVar1[1] = 0;

+  puVar1[2] = 0;

+  *(undefined2 *)(puVar1 + 3) = 0;

+  *puVar1 = &_vftable_;

+  *(undefined4 *)(puVar1 + 0x1a) = 0xffffffff;

+  puVar1[0x12] = 0xffffffffffffffff;

+  pSVar2 = (SDB_OBJECT *)FUN_14001c0e0((undefined8 *)this,2);

+  return pSVar2;

+}

+
```

## `SDB_POOL_CONFIG::GetMinNumberOfFdInFd`  (modified)

```diff
--- SDB_POOL_CONFIG::GetMinNumberOfFdInFd
+++ SDB_POOL_CONFIG::GetNumberOfFd
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::GetMinNumberOfFdInFd : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::GetNumberOfFd : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SDB_POOL_CONFIG::operator_new`  (modified)

```diff
--- SDB_POOL_CONFIG::operator_new
+++ SDB_POOL_CONFIG::operator_new
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SDB_POOL_CONFIG::operator new(unsigned __int64) */

+

+void * __cdecl SDB_POOL_CONFIG::operator_new(__uint64 param_1)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(0x160,0x67427053,'\0',0);

+  return pvVar1;

+}

+
```

## `SIO_CACHE::AllocateLineObject`  (modified)

```diff
--- SIO_CACHE::AllocateLineObject
+++ SIO_CACHE::AllocateLineObject
@@ -1,2 +1,33 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_CACHE::AllocateLineObject : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: long __cdecl SIO_CACHE::AllocateLineObject(class SIO_CACHE_LINE * __ptr64 * __ptr64)

+   __ptr64 */

+

+long __thiscall SIO_CACHE::AllocateLineObject(SIO_CACHE *this,SIO_CACHE_LINE **param_1)

+

+{

+  SC_SLAB_ALLOCATOR *this_00;

+  SIO_CACHE_LINE *_Dst;

+  long lVar1;

+  

+  lVar1 = 0;

+  this_00 = (SC_SLAB_ALLOCATOR *)(this + 0x70);

+  if (*(int *)this_00 == 0) {

+    _Dst = SC_ENV::Allocate((ulonglong)*(uint *)(this + 0xa8),0x58587053,'\0',0);

+    lVar1 = 0;

+    if (_Dst == (SIO_CACHE_LINE *)0x0) {

+      lVar1 = -0x3fffff66;

+    }

+  }

+  else {

+    _Dst = SC_SLAB_ALLOCATOR::AllocateObject(this_00);

+    if (_Dst == (SIO_CACHE_LINE *)0x0) {

+      lVar1 = -0x3fffff66;

+    }

+    else {

+      memset(_Dst,0,(ulonglong)*(uint *)this_00);

+    }

+  }

+  *param_1 = _Dst;

+  return lVar1;

+}

+
```

## `SDB_POOL_CONFIG::Initialize`  (modified)

```diff
--- SDB_POOL_CONFIG::Initialize
+++ SDB_POOL_CONFIG::Initialize
@@ -1,2 +1,25 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl SDB_POOL_CONFIG::Initialize(void) __ptr64 */

+

+long __thiscall SDB_POOL_CONFIG::Initialize(SDB_POOL_CONFIG *this)

+

+{

+  long lVar1;

+  SC_SPARSE *this_00;

+  SC_SPARSE *this_01;

+  

+  this_00 = SC_ENV::Allocate(0x50,0x61587053,'\0',0);

+  this_01 = (SC_SPARSE *)0x0;

+  if (this_00 != (SC_SPARSE *)0x0) {

+    this_01 = (SC_SPARSE *)SC_SPARSE::SC_SPARSE(this_00);

+  }

+  *(SC_SPARSE **)(this + 0x158) = this_01;

+  if (this_01 == (SC_SPARSE *)0x0) {

+    lVar1 = -0x3fffff66;

+  }

+  else {

+    lVar1 = SC_SPARSE::Initialize(this_01,0x40);

+  }

+  return lVar1;

+}

+
```

## `SIO_CACHE::GetPendingMapRanges`  (modified)

```diff
--- SIO_CACHE::GetPendingMapRanges
+++ SIO_CACHE::GetPendingMapRanges
@@ -1,2 +1,52 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_CACHE::GetPendingMapRanges : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_CACHE::GetPendingMapRanges(class SDB_RANGES * __ptr64 * __ptr64) __ptr64

+    */

+

+long __thiscall SIO_CACHE::GetPendingMapRanges(SIO_CACHE *this,SDB_RANGES **param_1)

+

+{

+  SIO_CACHE *pSVar1;

+  undefined1 uVar2;

+  SIO_CACHE *pSVar3;

+  SDB_RANGES *pSVar4;

+  longlong lVar5;

+  long lVar6;

+  uint uVar8;

+  ulonglong uVar7;

+  ulonglong uVar9;

+  

+  uVar7 = 0;

+  lVar6 = 0;

+  *param_1 = (SDB_RANGES *)0x0;

+  uVar2 = ExAcquireSpinLockShared(this + 0x158);

+  pSVar1 = this + 0x180;

+  pSVar3 = *(SIO_CACHE **)pSVar1;

+  uVar9 = uVar7;

+  if (pSVar3 != pSVar1) {

+    do {

+      pSVar3 = *(SIO_CACHE **)pSVar3;

+      uVar8 = (int)uVar9 + 1;

+      uVar9 = (ulonglong)uVar8;

+    } while (pSVar3 != pSVar1);

+    pSVar4 = SC_ENV::Allocate((ulonglong)(uVar8 * 0x20) + 0x28,0x58587053,'\x01',0);

+    if (pSVar4 == (SDB_RANGES *)0x0) {

+      lVar6 = -0x3fffff66;

+    }

+    else {

+      *pSVar4 = (SDB_RANGES)0x1;

+      *(uint *)(pSVar4 + 4) = uVar8;

+      for (pSVar3 = *(SIO_CACHE **)pSVar1; pSVar3 != pSVar1; pSVar3 = *(SIO_CACHE **)pSVar3) {

+        lVar5 = uVar7 * 0x20;

+        *(longlong *)(pSVar4 + lVar5 + 8) = *(longlong *)(pSVar3 + 0x28);

+        *(ulonglong *)(pSVar4 + lVar5 + 0x10) =

+             (ulonglong)*(uint *)(this + 0x1d8) + *(longlong *)(pSVar3 + 0x28);

+        uVar7 = (ulonglong)((int)uVar7 + 1);

+        *(undefined4 *)(pSVar4 + lVar5 + 0x20) = 0;

+      }

+      *param_1 = pSVar4;

+    }

+  }

+  ExReleaseSpinLockShared(this + 0x158,uVar2);

+  return lVar6;

+}

+
```

## `SC_ENV_ALLOCATOR::operator_new`  (modified)

```diff
--- SC_ENV_ALLOCATOR::operator_new
+++ SC_ENV_ALLOCATOR::operator_new
@@ -1,2 +1,14 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_ENV_ALLOCATOR::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SC_ENV_ALLOCATOR::operator new(unsigned __int64,unsigned

+   long,unsigned char,unsigned __int64) */

+

+void * __cdecl

+SC_ENV_ALLOCATOR::operator_new(__uint64 param_1,ulong param_2,uchar param_3,__uint64 param_4)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(param_1 + param_4,param_2,param_3,0);

+  return pvVar1;

+}

+
```

## `SP_CONTROL::InitializeBootData`  (modified)

```diff
--- SP_CONTROL::InitializeBootData
+++ SP_CONTROL::InitializeBootData
@@ -1,2 +1,45 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::InitializeBootData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl SP_CONTROL::InitializeBootData(void) __ptr64 */

+

+long __thiscall SP_CONTROL::InitializeBootData(SP_CONTROL *this)

+

+{

+  int iVar1;

+  SC_PERSISTED_DATA_V2 *pSVar2;

+  uint local_res8 [2];

+  

+  local_res8[0] = 0;

+  *(undefined4 *)(this + (ulonglong)*(uint *)(this + 0xb98) * 4 + 0xb88) = 1;

+  iVar1 = ZwQuerySystemInformation(0xd6,0);

+  if (iVar1 < 0) {

+    return iVar1;

+  }

+  if (local_res8[0] == 0) {

+    return iVar1;

+  }

+  pSVar2 = SC_ENV::Allocate((ulonglong)local_res8[0],0x58587053,'\0',0);

+  if (pSVar2 == (SC_PERSISTED_DATA_V2 *)0x0) {

+    return -0x3fffff66;

+  }

+  iVar1 = ZwQuerySystemInformation(0xd6,pSVar2,local_res8[0],local_res8);

+  if (-1 < iVar1) {

+    if (*(int *)pSVar2 == 1) {

+      iVar1 = InitializeBootDataV1(this,(SC_PERSISTED_DATA_V1 *)pSVar2);

+    }

+    else {

+      if (*(int *)pSVar2 != 2) {

+        iVar1 = -0x3fffff45;

+        goto LAB_0;

+      }

+      iVar1 = InitializeBootDataV2(this,pSVar2);

+    }

+    if (-1 < iVar1) {

+      *(undefined4 *)(this + 0xba8) = *(undefined4 *)pSVar2;

+      *(undefined4 *)(this + 0xbac) = *(undefined4 *)(pSVar2 + 4);

+    }

+  }

+LAB_0:

+  ExFreePoolWithTag(pSVar2,0);

+  return iVar1;

+}

+
```

## `SIO_SPACE::BuildDrt`  (modified)

```diff
--- SIO_SPACE::BuildDrt
+++ SIO_SPACE::BuildLog
@@ -1,49 +1,2 @@
-

-/* private: long __cdecl SIO_SPACE::BuildDrt(class SDB_SPACE * __ptr64) __ptr64 */

-

-long __thiscall SIO_SPACE::BuildDrt(SIO_SPACE *this,SDB_SPACE *param_1)

-

-{

-  long lVar1;

-  SIO_TIER *pSVar2;

-  SIO_SPACE *pSVar3;

-  SIO_DRT *this_00;

-  SIO_DRT *this_01;

-  undefined8 uVar4;

-  long lVar5;

-  

-  lVar5 = 0;

-  lVar1 = 0;

-  uVar4 = 0;

-  if (param_1[0x42] == (SDB_SPACE)0x2) {

-    if ((*(int *)(param_1 + 0x78) != 2) &&

-       (lVar5 = 0, pSVar2 = SIO_TIERS::FindTier((SIO_TIERS *)(this + 0x150),2),

-       pSVar2 == (SIO_TIER *)0x0)) {

-      return lVar5;

-    }

-    uVar4 = CONCAT71((int7)((ulonglong)uVar4 >> 8),6);

-    pSVar3 = GetChild(this,(_SC_SPACE_USAGE)uVar4);

-    if ((pSVar3 == (SIO_SPACE *)0x0) &&

-       (pSVar3 = GetChild(this,(_SC_SPACE_USAGE)CONCAT71((int7)((ulonglong)uVar4 >> 8),3)),

-       pSVar3 == (SIO_SPACE *)0x0)) {

-      return lVar5;

-    }

-    this_00 = SC_ENV::Allocate(0x78,0x73497053,'\0',0);

-    this_01 = (SIO_DRT *)0x0;

-    if (this_00 != (SIO_DRT *)0x0) {

-      this_01 = (SIO_DRT *)SIO_DRT::SIO_DRT(this_00);

-    }

-    *(SIO_DRT **)(this + 0x170) = this_01;

-    if (this_01 == (SIO_DRT *)0x0) {

-      lVar1 = -0x3fffff66;

-    }

-    else {

-      lVar1 = SIO_DRT::Initialize(this_01,param_1,this);

-      if (-1 < lVar1) {

-        *(uint *)(this + 0x2c) = *(uint *)(this + 0x2c) | 4;

-      }

-    }

-  }

-  return lVar1;

-}

-

+Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildLog : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `SS_STORE_CACHE::operator_new`  (modified)

```diff
--- SS_STORE_CACHE::operator_new
+++ SS_STORE_CACHE::operator_new
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE_CACHE::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SS_STORE_CACHE::operator new(unsigned __int64) */

+

+void * __cdecl SS_STORE_CACHE::operator_new(__uint64 param_1)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(0x18,0x63537053,'\0',0);

+  return pvVar1;

+}

+
```

## `SIO_SPACE::BuildLog`  (modified)

```diff
--- SIO_SPACE::BuildLog
+++ SIO_SPACE::BuildParity
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildLog : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::BuildParity : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SP_ENCLOSURE::InitializeControlPage`  (modified)

```diff
--- SP_ENCLOSURE::InitializeControlPage
+++ SP_ENCLOSURE::InitializeControlPage
@@ -1,2 +1,49 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_ENCLOSURE::InitializeControlPage : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SP_ENCLOSURE::InitializeControlPage(struct _SES_CONTROL_DIAGNOSTIC_PAGE *

+   __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SP_ENCLOSURE::InitializeControlPage(SP_ENCLOSURE *this,_SES_CONTROL_DIAGNOSTIC_PAGE **param_1)

+

+{

+  _SES_CONTROL_DIAGNOSTIC_PAGE _Var1;

+  longlong lVar2;

+  _SES_CONTROL_DIAGNOSTIC_PAGE *p_Var3;

+  longlong lVar4;

+  _SES_CONTROL_DIAGNOSTIC_PAGE *p_Var5;

+  longlong lVar6;

+  long lVar7;

+  

+  lVar2 = *(longlong *)(this + 0xb8);

+  lVar6 = 0;

+  lVar7 = 0;

+  *param_1 = (_SES_CONTROL_DIAGNOSTIC_PAGE *)0x0;

+  p_Var3 = SC_ENV::Allocate((ulonglong)

+                            (ushort)(*(ushort *)(lVar2 + 2) >> 8 | *(ushort *)(lVar2 + 2) << 8) + 4,

+                            0x4c457053,'\0',0);

+  if (p_Var3 == (_SES_CONTROL_DIAGNOSTIC_PAGE *)0x0) {

+    lVar7 = -0x3fffff66;

+  }

+  else {

+    lVar2 = *(longlong *)(this + 0xb8);

+    *p_Var3 = (_SES_CONTROL_DIAGNOSTIC_PAGE)0x2;

+    p_Var5 = (_SES_CONTROL_DIAGNOSTIC_PAGE *)(lVar2 + 2);

+    lVar4 = lVar6;

+    do {

+      _Var1 = *p_Var5;

+      p_Var5 = p_Var5 + 1;

+      p_Var3[lVar4 + 2] = _Var1;

+      lVar4 = lVar4 + 1;

+    } while (lVar4 < 2);

+    p_Var5 = (_SES_CONTROL_DIAGNOSTIC_PAGE *)(lVar2 + 4);

+    do {

+      _Var1 = *p_Var5;

+      p_Var5 = p_Var5 + 1;

+      p_Var3[lVar6 + 4] = _Var1;

+      lVar6 = lVar6 + 1;

+    } while (lVar6 < 4);

+    *param_1 = p_Var3;

+  }

+  return lVar7;

+}

+
```

## `SDB_DRIVE::operator_new`  (modified)

```diff
--- SDB_DRIVE::operator_new
+++ SDB_DRIVE::operator_new
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_DRIVE::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SDB_DRIVE::operator new(unsigned __int64) */

+

+void * __cdecl SDB_DRIVE::operator_new(__uint64 param_1)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(0x100,0x64427053,'\x01',0);

+  return pvVar1;

+}

+
```

## `SP_CONTROL::GetSmbiosStrings`  (modified)

```diff
--- SP_CONTROL::GetSmbiosStrings
+++ SP_CONTROL::GetSmbiosStrings
@@ -1,2 +1,24 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::GetSmbiosStrings : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Removing unreachable block (ram,0x0001400a61ee) */

+/* WARNING: Removing unreachable block (ram,0x0001400a6212) */

+/* WARNING: Removing unreachable block (ram,0x0001400a6235) */

+/* WARNING: Removing unreachable block (ram,0x0001400a624b) */

+/* WARNING: Removing unreachable block (ram,0x0001400a626e) */

+/* WARNING: Removing unreachable block (ram,0x0001400a6273) */

+/* WARNING: Removing unreachable block (ram,0x0001400a627d) */

+/* WARNING: Removing unreachable block (ram,0x0001400a628d) */

+/* WARNING: Removing unreachable block (ram,0x0001400a6244) */

+/* WARNING: Removing unreachable block (ram,0x0001400a629a) */

+/* WARNING: Removing unreachable block (ram,0x0001400a6208) */

+/* public: long __cdecl SP_CONTROL::GetSmbiosStrings(void) __ptr64 */

+

+long __thiscall SP_CONTROL::GetSmbiosStrings(SP_CONTROL *this)

+

+{

+  long lVar1;

+  

+  lVar1 = ExGetSystemFirmwareTable(0x52534d42,0);

+  return lVar1;

+}

+
```

## `SC_MATRIX::Initialize`  (modified)

```diff
--- SC_MATRIX::Initialize
+++ SC_MATRIX::Initialize
@@ -1,2 +1,18 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_MATRIX::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SC_MATRIX::Initialize(class SC_FINITE_FIELD * __ptr64,unsigned long,unsigned

+   long) __ptr64 */

+

+long __thiscall

+SC_MATRIX::Initialize(SC_MATRIX *this,SC_FINITE_FIELD *param_1,ulong param_2,ulong param_3)

+

+{

+  void *pvVar1;

+  

+  *(ulong *)(this + 8) = param_2;

+  *(SC_FINITE_FIELD **)this = param_1;

+  *(ulong *)(this + 0xc) = param_3;

+  pvVar1 = SC_ENV::Allocate((ulonglong)(param_2 * param_3 * 4),0x58587053,'\0',0);

+  *(void **)(this + 0x10) = pvVar1;

+  return ~-(uint)(pvVar1 != (void *)0x0) & 0xc000009a;

+}

+
```

## `SP_ENCLOSURE::ReceiveDiagnostic`  (modified)

```diff
--- SP_ENCLOSURE::ReceiveDiagnostic
+++ SP_ENCLOSURE::ReceiveDiagnostic
@@ -1,2 +1,70 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_ENCLOSURE::ReceiveDiagnostic : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* public: long __cdecl SP_ENCLOSURE::ReceiveDiagnostic(unsigned char,struct _SES_DIAGNOSTIC_PAGE *

+   __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SP_ENCLOSURE::ReceiveDiagnostic(SP_ENCLOSURE *this,uchar param_1,_SES_DIAGNOSTIC_PAGE **param_2)

+

+{

+  long lVar1;

+  _SES_DIAGNOSTIC_PAGE *p_Var2;

+  uint uVar3;

+  __uint64 _Var4;

+  uint uVar5;

+  undefined1 auStack_d8 [32];

+  undefined4 local_b8;

+  _SCSI_REQUEST_BLOCK local_a8 [10];

+  undefined1 local_9e;

+  undefined4 local_9c;

+  uint local_98;

+  _SES_DIAGNOSTIC_PAGE *local_90;

+  undefined1 local_60;

+  byte local_5f;

+  uchar local_5e;

+  undefined1 local_5d;

+  undefined1 local_5c;

+  ulonglong local_48;

+  

+  local_48 = __security_cookie ^ (ulonglong)auStack_d8;

+  memset(local_a8,0,0x58);

+  lVar1 = 0;

+  _Var4 = 0x1000;

+  *param_2 = (_SES_DIAGNOSTIC_PAGE *)0x0;

+  local_b8 = 0x1000;

+  for (uVar5 = 0; uVar5 < 2; uVar5 = uVar5 + 1) {

+    uVar3 = (uint)_Var4;

+    p_Var2 = SC_ENV::Allocate(_Var4,0x58587053,'\0',0);

+    if (p_Var2 == (_SES_DIAGNOSTIC_PAGE *)0x0) {

+      return -0x3fffff66;

+    }

+    local_5f = local_5f | 1;

+    local_5d = local_b8._1_1_;

+    local_9c = 0x148;

+    local_9e = 6;

+    local_60 = 0x1c;

+    local_5c = (undefined1)_Var4;

+    local_98 = uVar3;

+    local_90 = p_Var2;

+    local_5e = param_1;

+    lVar1 = SendScsiRequest(this,local_a8);

+    if (lVar1 < 0) {

+      SC_ENV_ALLOCATOR::operator_delete(p_Var2);

+      return lVar1;

+    }

+    local_b8 = (ushort)(*(ushort *)(p_Var2 + 2) >> 8 | *(ushort *)(p_Var2 + 2) << 8) + 4;

+    _Var4 = (__uint64)local_b8;

+    if (local_b8 <= uVar3) goto LAB_0;

+    SC_ENV_ALLOCATOR::operator_delete(p_Var2);

+  }

+  p_Var2 = (_SES_DIAGNOSTIC_PAGE *)0x0;

+  if (uVar5 == 2) {

+    lVar1 = -0x3ffffff3;

+  }

+  else {

+LAB_0:

+    *param_2 = p_Var2;

+  }

+  return lVar1;

+}

+
```

## `SP_POOL::PrepareCommit`  (modified)

```diff
--- SP_POOL::PrepareCommit
+++ SP_POOL::PrepareCommit
@@ -1,2 +1,313 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_POOL::PrepareCommit : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* private: long __cdecl SP_POOL::PrepareCommit(unsigned char * __ptr64,struct _SP_DEVICE_CHANGE *

+   __ptr64 * __ptr64,unsigned long * __ptr64) __ptr64 */

+

+long __thiscall

+SP_POOL::PrepareCommit(SP_POOL *this,uchar *param_1,_SP_DEVICE_CHANGE **param_2,ulong *param_3)

+

+{

+  undefined4 uVar1;

+  longlong lVar2;

+  bool bVar3;

+  SP_DEVICE *this_00;

+  uchar uVar4;

+  long lVar5;

+  SDB_RECORD *pSVar6;

+  ulonglong uVar7;

+  SDB_OBJECT *pSVar8;

+  SDB_RECORD *this_01;

+  SIO_LOG *pSVar9;

+  _SP_DEVICE_CHANGE *p_Var10;

+  SDB_OBJECT *this_02;

+  SP_SPACE *pSVar11;

+  SDB_OBJECT *this_03;

+  undefined8 uVar12;

+  uint uVar13;

+  ulong uVar14;

+  SP_POOL *pSVar15;

+  SDB_POOL_CONFIG *pSVar16;

+  uint uVar17;

+  _SP_DEVICE_CHANGE *p_Var18;

+  ulong uVar19;

+  __uint64 in_stack_ffffffffffffff60;

+  undefined4 uVar20;

+  undefined8 in_stack_ffffffffffffff68;

+  undefined4 uVar21;

+  SP_DEVICE *local_78;

+  undefined4 uStack_70;

+  undefined4 uStack_6c;

+  undefined4 local_68;

+  undefined4 uStack_64;

+  undefined4 uStack_60;

+  undefined4 uStack_5c;

+  undefined4 local_58;

+  undefined4 uStack_54;

+  undefined4 uStack_50;

+  undefined4 uStack_4c;

+  

+  pSVar16 = *(SDB_POOL_CONFIG **)(this + 0x30);

+  lVar5 = 0;

+  *param_2 = (_SP_DEVICE_CHANGE *)0x0;

+  *param_3 = 0;

+  *param_1 = '\0';

+  if ((*(byte *)(*(longlong *)(pSVar16 + 0x110) + 0x1e) & 0x40) != 0) {

+    *param_1 = '\x01';

+  }

+  uVar12 = CONCAT71((int7)((ulonglong)param_1 >> 8),3);

+  for (pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,(SDB_RECORD *)0x0)

+      ; pSVar6 != (SDB_RECORD *)0x0;

+      pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,pSVar6)) {

+    pSVar8 = SDB_RECORD::GetObject(pSVar6);

+    if (((char)pSVar6[0x1e] < '\0') && (pSVar8[0x42] == (SDB_OBJECT)0x7)) {

+      pSVar11 = SIO_SPACE::operator_new(0x4e0);

+      if ((pSVar11 == (SP_SPACE *)0x0) ||

+         (pSVar11 = (SP_SPACE *)SP_SPACE::SP_SPACE(pSVar11), pSVar11 == (SP_SPACE *)0x0))

+      goto LAB_0;

+      lVar5 = SP_SPACE::Initialize(pSVar11,(SDB_SPACE *)pSVar8,(SIO_SPACE *)0x0);

+      if (-1 < lVar5) {

+        pSVar9 = SC_ENV_ALLOCATOR::operator_new(0x148,0x58587053,'\0',0);

+        if ((pSVar9 == (SIO_LOG *)0x0) ||

+           (pSVar9 = (SIO_LOG *)SIO_LOG::SIO_LOG(pSVar9), pSVar9 == (SIO_LOG *)0x0)) {

+          lVar5 = -0x3fffff66;

+        }

+        else {

+          in_stack_ffffffffffffff60 = *(__uint64 *)(pSVar11 + 0x70);

+          in_stack_ffffffffffffff68 = 0;

+          lVar5 = SIO_LOG::Initialize(pSVar9,2,(SIO_SPACE *)pSVar11,'\x01','\0',

+                                      in_stack_ffffffffffffff60,0);

+          if (-1 < lVar5) {

+            (*(code *)**(undefined8 **)pSVar9)(pSVar9,1);

+            uVar12 = 0;

+            (*(code *)**(undefined8 **)pSVar11)(pSVar11,1);

+            *(ushort *)(pSVar6 + 0x1e) = *(ushort *)(pSVar6 + 0x1e) & 0xff7f;

+            break;

+          }

+          (*(code *)**(undefined8 **)pSVar9)(pSVar9,1);

+        }

+      }

+      (*(code *)**(undefined8 **)pSVar11)(pSVar11,1);

+      return lVar5;

+    }

+    uVar12 = CONCAT71((int7)((ulonglong)uVar12 >> 8),3);

+  }

+  uVar7 = Feature_PrepareCommit_Fixes__private_IsEnabledDeviceUsageNoInline();

+  pSVar16 = *(SDB_POOL_CONFIG **)(this + 0x30);

+  uVar12 = CONCAT71((int7)((ulonglong)uVar12 >> 8),3);

+  pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,(SDB_RECORD *)0x0);

+  if ((int)uVar7 == 0) {

+    for (; pSVar6 != (SDB_RECORD *)0x0;

+        pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,pSVar6)) {

+      uVar7 = (ulonglong)*(ushort *)(pSVar6 + 0x1e);

+      if (((*(ushort *)(pSVar6 + 0x1e) & 0x10) != 0) &&

+         (pSVar8 = SDB_RECORD::GetObject(pSVar6), *(int *)(pSVar8 + 0xb4) != 0)) {

+        *(ushort *)(pSVar6 + 0x1e) = (ushort)uVar7 & 0xffef;

+        pSVar6 = SDB_POOL_CONFIG::FindRecordByRecordId

+                           (*(SDB_POOL_CONFIG **)(this + 0x30),

+                            (_SDB_RECORD_TYPE)CONCAT71((int7)(uVar7 >> 8),3),

+                            *(ulong *)(pSVar8 + 0xb4));

+        uVar7 = 0;

+        lVar5 = SDB_RECORD::PreTouch(pSVar6,(SDB_OBJECT *)0x0);

+        if (lVar5 < 0) {

+          return lVar5;

+        }

+        *(ushort *)(pSVar6 + 0x1e) = *(ushort *)(pSVar6 + 0x1e) | 0x10;

+      }

+      pSVar16 = *(SDB_POOL_CONFIG **)(this + 0x30);

+      uVar12 = CONCAT71((int7)(uVar7 >> 8),3);

+    }

+  }

+  else {

+    for (; pSVar6 != (SDB_RECORD *)0x0;

+        pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,pSVar6)) {

+      uVar7 = (ulonglong)*(ushort *)(pSVar6 + 0x1e);

+      if (((*(ushort *)(pSVar6 + 0x1e) & 0x10) != 0) &&

+         (pSVar8 = SDB_RECORD::GetObject(pSVar6), *(int *)(pSVar8 + 0xb4) != 0)) {

+        *(ushort *)(pSVar6 + 0x1e) = (ushort)uVar7 & 0xffef;

+        this_01 = SDB_POOL_CONFIG::FindRecordByRecordId

+                            (*(SDB_POOL_CONFIG **)(this + 0x30),

+                             (_SDB_RECORD_TYPE)CONCAT71((int7)(uVar7 >> 8),3),

+                             *(ulong *)(pSVar8 + 0xb4));

+        uVar7 = 0;

+        lVar5 = SDB_RECORD::PreTouch(this_01,(SDB_OBJECT *)0x0);

+        if (lVar5 < 0) {

+          return lVar5;

+        }

+        *(ushort *)(this_01 + 0x1e) = *(ushort *)(this_01 + 0x1e) | 0x10;

+      }

+      pSVar16 = *(SDB_POOL_CONFIG **)(this + 0x30);

+      uVar12 = CONCAT71((int7)(uVar7 >> 8),3);

+    }

+  }

+  uVar12 = CONCAT71((int7)((ulonglong)uVar12 >> 8),3);

+  pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,(SDB_RECORD *)0x0);

+  uVar17 = 0;

+  if (pSVar6 != (SDB_RECORD *)0x0) {

+    do {

+      uVar12 = CONCAT71((int7)((ulonglong)uVar12 >> 8),3);

+      uVar13 = uVar17 + 1;

+      if (((byte)pSVar6[0x1e] & 0x10) == 0) {

+        uVar13 = uVar17;

+      }

+      pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)uVar12,pSVar6);

+      uVar17 = uVar13;

+    } while (pSVar6 != (SDB_RECORD *)0x0);

+    if (uVar13 != 0) {

+      uVar7 = Feature_PrepareCommit_Fixes__private_IsEnabledDeviceUsageNoInline();

+      pSVar8 = (SDB_OBJECT *)0x58587053;

+      uVar17 = 0;

+      if ((int)uVar7 == 0) {

+        uVar17 = uVar13;

+      }

+      p_Var10 = SC_ENV::Allocate((ulonglong)(uVar13 << 5),0x58587053,'\0',0);

+      if (p_Var10 == (_SP_DEVICE_CHANGE *)0x0) {

+LAB_0:

+        lVar5 = -0x3fffff66;

+      }

+      else {

+        uVar7 = Feature_PrepareCommit_Fixes__private_IsEnabledDeviceUsageNoInline();

+        pSVar16 = *(SDB_POOL_CONFIG **)(this + 0x30);

+        uVar19 = -(uint)((int)uVar7 != 0) & uVar17;

+        pSVar6 = (SDB_RECORD *)0x0;

+        while( true ) {

+          pSVar8 = (SDB_OBJECT *)CONCAT71((int7)((ulonglong)pSVar8 >> 8),3);

+          pSVar6 = SDB_POOL_CONFIG::GetRecordByType(pSVar16,(_SDB_RECORD_TYPE)pSVar8,pSVar6);

+          if (pSVar6 == (SDB_RECORD *)0x0) break;

+          if ((((byte)pSVar6[0x1e] & 0x10) != 0) &&

+             (this_02 = SDB_RECORD::GetObject(pSVar6), ((byte)this_02[0x40] & 1) == 0)) {

+            local_78 = *(SP_DEVICE **)(this_02 + 0x20);

+            uStack_70 = *(undefined4 *)(this_02 + 0x28);

+            uStack_6c = *(undefined4 *)(this_02 + 0x2c);

+            bVar3 = false;

+            local_78 = SpAcquireReference(&local_78);

+            if (local_78 == (SP_DEVICE *)0x0) {

+              pSVar15 = this;

+              pSVar8 = this_02;

+              uVar4 = IsSpaceSystem(this,(SDB_SPACE *)this_02);

+              if (uVar4 == '\0') {

+                if (((byte)this_02[0x130] & 1) != 0) goto LAB_1;

+              }

+              else {

+                uVar4 = IsSpaceCritical(pSVar15,(SDB_SPACE *)pSVar8);

+                if (uVar4 == '\0') {

+LAB_1:

+                  if (*(uint *)(this_02 + 0x100) < 2) {

+                    *(undefined4 *)(this_02 + 0x100) = 2;

+                  }

+                  uVar4 = SDB_SPACE::NeedsInit((SDB_SPACE *)this_02);

+                  if (uVar4 == '\0') goto LAB_2;

+                  bVar3 = true;

+                }

+              }

+              local_68 = *(undefined4 *)(this_02 + 0x20);

+              uStack_64 = *(undefined4 *)(this_02 + 0x24);

+              uStack_60 = *(undefined4 *)(this_02 + 0x28);

+              uStack_5c = *(undefined4 *)(this_02 + 0x2c);

+              local_58 = *(undefined4 *)(this + 0x6c);

+              uStack_54 = *(undefined4 *)(this + 0x70);

+              uStack_50 = *(undefined4 *)(this + 0x74);

+              uStack_4c = *(undefined4 *)(this + 0x78);

+              pSVar8 = (SDB_OBJECT *)&local_68;

+              pSVar15 = (SP_POOL *)&local_58;

+              lVar5 = SpCreateDevice(pSVar15,pSVar8,0,&local_78);

+              if (lVar5 < 0) goto LAB_3;

+            }

+            this_00 = local_78;

+            SP_DEVICE::AcquireMutex(local_78);

+            uVar7 = (ulonglong)uVar19;

+            uVar19 = uVar19 + 1;

+            p_Var18 = p_Var10 + uVar7 * 0x20;

+            *(SP_DEVICE **)p_Var18 = this_00;

+            lVar2 = *(longlong *)(this_00 + 0xc90);

+            *(longlong *)(p_Var18 + 0x10) = lVar2;

+            if (((byte)pSVar6[0x1e] & 8) == 0) {

+              if (lVar2 == 0) {

+                pSVar15 = (SP_POOL *)this_00;

+                pSVar8 = (SDB_OBJECT *)this;

+                lVar5 = SP_DEVICE::Initialize(this_00,this,(SDB_SPACE *)this_02);

+                this_03 = *(SDB_OBJECT **)(this_00 + 0xc98);

+              }

+              else {

+                pSVar15 = (SP_POOL *)0x4e0;

+                pSVar11 = SIO_SPACE::operator_new(0x4e0);

+                if ((pSVar11 == (SP_SPACE *)0x0) ||

+                   (this_03 = (SDB_OBJECT *)SP_SPACE::SP_SPACE(pSVar11),

+                   pSVar15 = (SP_POOL *)pSVar11, this_03 == (SDB_OBJECT *)0x0)) {

+                  lVar5 = -0x3fffff66;

+                  goto LAB_3;

+                }

+                *(SP_DEVICE **)(this_03 + 0x480) = this_00;

+                *(SP_POOL **)(this_03 + 0x488) = this;

+                pSVar15 = (SP_POOL *)this_03;

+                pSVar8 = this_02;

+                lVar5 = SP_SPACE::Initialize

+                                  ((SP_SPACE *)this_03,(SDB_SPACE *)this_02,

+                                   *(SIO_SPACE **)(p_Var18 + 0x10));

+              }

+              uVar20 = (undefined4)(in_stack_ffffffffffffff60 >> 0x20);

+              uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);

+              if (lVar5 < 0) {

+                if (this_03 != (SDB_OBJECT *)0x0) {

+                  (*(code *)**(undefined8 **)this_03)(this_03,1);

+                  pSVar15 = (SP_POOL *)this_03;

+                }

+                uVar7 = Feature_PrepareCommit_Fixes__private_IsEnabledDeviceUsageNoInline();

+                if ((int)uVar7 == 0) {

+                  if (lVar5 == -0x3fffff66) {

+LAB_3:

+                    AbortDevices(pSVar15,p_Var10,uVar19);

+                    SC_ENV_ALLOCATOR::operator_delete(p_Var10);

+                    return lVar5;

+                  }

+                }

+                else if ((lVar5 == -0x3fffff66) ||

+                        (pSVar15 = (SP_POOL *)this_02,

+                        uVar4 = SDB_SPACE::NeedsInit((SDB_SPACE *)this_02), uVar4 != '\0'))

+                goto LAB_3;

+                if ((*(int *)(this_02 + 0x100) < 2) &&

+                   ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 1) != 0)) {

+                  McTemplateK0jq_EtwWriteTransfer(pSVar15,&SpaceDetached,0,this_02 + 0x20);

+                }

+                uVar1 = *(undefined4 *)(this_02 + 0x100);

+                if (*(int *)(this_00 + 0xc38) == -1) {

+                  uVar12 = KeQueryUnbiasedInterruptTime();

+                  uVar14 = 0x405;

+                }

+                else {

+                  uVar12 = KeQueryUnbiasedInterruptTime();

+                  uVar14 = 0x3fe;

+                }

+                pSVar8 = (SDB_OBJECT *)(this + 0x6c);

+                in_stack_ffffffffffffff68 = CONCAT44(uVar21,lVar5);

+                in_stack_ffffffffffffff60 = CONCAT44(uVar20,uVar1);

+                SC_ENV::EventWrite(uVar14,pSVar8,this_02 + 0x20,*(undefined8 *)(this_00 + 0xcc8),

+                                   uVar12,in_stack_ffffffffffffff60,in_stack_ffffffffffffff68);

+                lVar5 = 0;

+              }

+              else if (bVar3) {

+                if (this_03 != (SDB_OBJECT *)0x0) {

+                  pSVar8 = (SDB_OBJECT *)0x0;

+                  (*(code *)**(undefined8 **)this_03)(this_03,1);

+                }

+              }

+              else {

+                *(undefined4 *)(this_02 + 0x100) = 1;

+                *(SDB_OBJECT **)(p_Var18 + 8) = this_03;

+              }

+            }

+            else {

+              p_Var18[0x18] = (_SP_DEVICE_CHANGE)0x1;

+            }

+          }

+LAB_2:

+          pSVar16 = *(SDB_POOL_CONFIG **)(this + 0x30);

+        }

+        *param_1 = '\x01';

+        *param_2 = p_Var10;

+        *param_3 = uVar19;

+      }

+    }

+  }

+  return lVar5;

+}

+
```

## `SIO_TIERS::Initialize`  (modified)

```diff
--- SIO_TIERS::Initialize
+++ SIO_SPACE_DRIVE::InitializeStripeTable
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_TIERS::Initialize : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE_DRIVE::InitializeStripeTable : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SDB_POOL_CONFIG::SnapshotSpaceTransaction`  (modified)

```diff
--- SDB_POOL_CONFIG::SnapshotSpaceTransaction
+++ SDB_POOL_CONFIG::SnapshotSpaceTransaction
@@ -1,2 +1,92 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::SnapshotSpaceTransaction : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SDB_POOL_CONFIG::SnapshotSpaceTransaction(struct _GUID * __ptr64,struct

+   _GUID * __ptr64) __ptr64 */

+

+long __thiscall

+SDB_POOL_CONFIG::SnapshotSpaceTransaction(SDB_POOL_CONFIG *this,_GUID *param_1,_GUID *param_2)

+

+{

+  undefined8 uVar1;

+  long lVar2;

+  SDB_RECORD *this_00;

+  SDB_OBJECT *pSVar3;

+  SDB_OBJECT *pSVar4;

+  SC_SPARSE *this_01;

+  SC_SPARSE *this_02;

+  SDB_SPACE_CONFIG *pSVar5;

+  SDB_RECORD *this_03;

+  undefined8 uVar6;

+  SDB_RECORD *local_res20;

+  SDB_SPACE_CONFIG *local_38 [2];

+  

+  local_res20 = (SDB_RECORD *)0x0;

+  local_38[0] = (SDB_SPACE_CONFIG *)0x0;

+  this_00 = FindSpaceById(this,param_1);

+  if (this_00 == (SDB_RECORD *)0x0) {

+    return -0x3fc7ffba;

+  }

+  uVar6 = 0;

+  lVar2 = SDB_RECORD::PreTouch(this_00,(SDB_OBJECT *)0x0);

+  if (lVar2 < 0) {

+    return lVar2;

+  }

+  this_03 = this_00;

+  pSVar3 = SDB_RECORD::GetObject(this_00);

+  SDB_RECORD::Touch(this_03);

+  uVar1 = *(undefined8 *)(pSVar3 + 0xe0);

+  *(undefined8 *)(pSVar3 + 0xe0) = 0;

+  lVar2 = SDB_CONFIG::CreateRecord

+                    ((SDB_CONFIG *)this,(_SDB_RECORD_TYPE)CONCAT71((int7)((ulonglong)uVar6 >> 8),3),

+                     pSVar3,&local_res20);

+  *(undefined8 *)(pSVar3 + 0xe0) = uVar1;

+  if (lVar2 < 0) goto LAB_0;

+  pSVar4 = SDB_RECORD::GetObject(local_res20);

+  this_01 = SC_ENV::Allocate(0x50,0x61587053,'\0',0);

+  this_02 = (SC_SPARSE *)0x0;

+  if (this_01 != (SC_SPARSE *)0x0) {

+    this_02 = (SC_SPARSE *)SC_SPARSE::SC_SPARSE(this_01);

+  }

+  *(SC_SPARSE **)(pSVar4 + 0xe0) = this_02;

+  if (this_02 != (SC_SPARSE *)0x0) {

+    lVar2 = SC_SPARSE::Initialize(this_02,0x10000000000);

+    if ((lVar2 < 0) ||

+       (lVar2 = SDB_SPACE_CONFIG::Load(this,(SDB_SPACE *)pSVar3,local_38), pSVar5 = local_38[0],

+       lVar2 < 0)) goto LAB_0;

+    lVar2 = SDB_SPACE_CONFIG::GetMetadataDrives

+                      (local_38[0],this,(ulong *)(pSVar3 + 0x148),(_GUID **)(pSVar3 + 0x150));

+    if (pSVar5 != (SDB_SPACE_CONFIG *)0x0) {

+      (*(code *)**(undefined8 **)pSVar5)(pSVar5,1);

+    }

+    if ((lVar2 < 0) || (lVar2 = SC_ENV::CreateGuid((_GUID *)(pSVar3 + 0x20)), lVar2 < 0))

+    goto LAB_0;

+    pSVar3[0x42] = (SDB_OBJECT)0x8;

+    *(ushort *)(pSVar3 + 0x40) = *(ushort *)(pSVar3 + 0x40) & 0xffc1 | 1;

+    lVar2 = AllocateConfigSpaceSlot(this,(ulong *)(pSVar3 + 0x50));

+    if (lVar2 < 0) goto LAB_0;

+    pSVar5 = SC_ENV::Allocate(0x170,0x6e427053,'\0',0);

+    if ((pSVar5 != (SDB_SPACE_CONFIG *)0x0) &&

+       (pSVar5 = (SDB_SPACE_CONFIG *)SDB_SPACE_CONFIG::SDB_SPACE_CONFIG(pSVar5),

+       pSVar5 != (SDB_SPACE_CONFIG *)0x0)) {

+      lVar2 = SDB_SPACE_CONFIG::Create(pSVar5,this,(SDB_SPACE *)pSVar3);

+      (*(code *)**(undefined8 **)pSVar5)(pSVar5,1);

+      if ((-1 < lVar2) &&

+         (*(undefined4 *)(pSVar4 + 0xb8) = *(undefined4 *)(this_00 + 0x18), param_2 != (_GUID *)0x0)

+         ) {

+        uVar6 = *(undefined8 *)(pSVar3 + 0x28);

+        *(undefined8 *)param_2 = *(undefined8 *)(pSVar3 + 0x20);

+        *(undefined8 *)(param_2 + 8) = uVar6;

+      }

+      goto LAB_0;

+    }

+  }

+  lVar2 = -0x3fffff66;

+LAB_0:

+  if (*(longlong *)(pSVar3 + 0x150) != 0) {

+    *(undefined4 *)(pSVar3 + 0x148) = 0;

+    ExFreePoolWithTag(*(longlong *)(pSVar3 + 0x150),0);

+    *(undefined8 *)(pSVar3 + 0x150) = 0;

+  }

+  return lVar2;

+}

+
```

## `SDB_COLUMN::Clone`  (modified)

```diff
--- SDB_COLUMN::Clone
+++ SDB_METADATA::Clone
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_COLUMN::Clone : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SDB_METADATA::Clone : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SDB_SPACE::Clone`  (modified)

```diff
--- SDB_SPACE::Clone
+++ SDB_TIER::Clone
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE::Clone : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SDB_TIER::Clone : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SP_ATTRIBUTES::AllocateRoutine`  (modified)

```diff
--- SP_ATTRIBUTES::AllocateRoutine
+++ SP_WORK::AttachSpace
@@ -1,13 +1,86 @@
 

-/* private: static void * __ptr64 __cdecl SP_ATTRIBUTES::AllocateRoutine(struct _RTL_AVL_TABLE *

-   __ptr64,unsigned long) */

+/* public: long __cdecl SP_WORK::AttachSpace(struct _SP_ATTACH_SPACE_INFO * __ptr64,unsigned

+   long,unsigned short * __ptr64) __ptr64 */

 

-void * __cdecl SP_ATTRIBUTES::AllocateRoutine(_RTL_AVL_TABLE *param_1,ulong param_2)

+long __thiscall

+SP_WORK::AttachSpace(SP_WORK *this,_SP_ATTACH_SPACE_INFO *param_1,ulong param_2,ushort *param_3)

 

 {

-  void *pvVar1;

+  undefined8 *puVar1;

+  longlong lVar2;

+  undefined8 uVar3;

+  long lVar4;

+  undefined4 *puVar5;

+  ulonglong uVar6;

+  char *pcVar7;

   

-  pvVar1 = SC_ENV::Allocate((ulonglong)param_2,0x74417053,'\0',0);

-  return pvVar1;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 1) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x29])) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x4d,

+            &WPP_62e395074fc23b8bb3d7fc1ecbe71e8c_Traceguids);

+  }

+  *(undefined8 *)(this + 0x18) = 0xfffffffc81ee2a00;

+  puVar5 = SC_ENV::Allocate(0x160,0x6b577053,'\0',0);

+  *(undefined4 **)(this + 0x10) = puVar5;

+  if (puVar5 == (undefined4 *)0x0) {

+    lVar4 = -0x3fffff66;

+  }

+  else {

+    *puVar5 = 0x60;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 4) = 0x160;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 0xc) = 6;

+    lVar2 = *(longlong *)(this + 0x10);

+    uVar3 = *(undefined8 *)(param_1 + 8);

+    *(undefined8 *)(lVar2 + 0x30) = *(undefined8 *)param_1;

+    *(undefined8 *)(lVar2 + 0x38) = uVar3;

+    uVar3 = *(undefined8 *)(param_1 + 0x18);

+    *(undefined8 *)(lVar2 + 0x40) = *(undefined8 *)(param_1 + 0x10);

+    *(undefined8 *)(lVar2 + 0x48) = uVar3;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 0x50) = 0x100;

+    *(undefined4 *)(*(longlong *)(this + 0x10) + 0x54) = 0x60;

+    lVar2 = *(longlong *)(this + 0x10);

+    uVar3 = *(undefined8 *)(param_1 + 8);

+    uVar6 = (ulonglong)*(uint *)(lVar2 + 0x54);

+    *(undefined8 *)(uVar6 + lVar2) = *(undefined8 *)param_1;

+    ((undefined8 *)(uVar6 + lVar2))[1] = uVar3;

+    uVar3 = *(undefined8 *)(param_1 + 0x18);

+    puVar1 = (undefined8 *)(uVar6 + 0x10 + lVar2);

+    *puVar1 = *(undefined8 *)(param_1 + 0x10);

+    puVar1[1] = uVar3;

+    uVar3 = *(undefined8 *)(param_1 + 0x28);

+    puVar1 = (undefined8 *)(uVar6 + 0x20 + lVar2);

+    *puVar1 = *(undefined8 *)(param_1 + 0x20);

+    puVar1[1] = uVar3;

+    *(undefined4 *)(uVar6 + 0x30 + lVar2) = *(undefined4 *)(param_1 + 0x30);

+    lVar4 = SP_CONTROL_WORK::Run((SP_CONTROL_WORK *)(SpControlExt + 0x268),this);

+    if (-1 < lVar4) {

+      lVar2 = *(longlong *)(this + 0x10);

+      memmove(param_3,(void *)((ulonglong)*(uint *)(lVar2 + 0x54) + lVar2),

+              (ulonglong)*(uint *)(lVar2 + 0x5c));

+    }

+  }

+  if (*(void **)(this + 0x10) != (void *)0x0) {

+    SC_ENV_ALLOCATOR::operator_delete(*(void **)(this + 0x10));

+    *(undefined8 *)(this + 0x10) = 0;

+  }

+  if (((lVar4 < 0) && (lVar4 != -0x7ffffffb)) && (lVar4 != -0x3fffffdd)) {

+    if (SP_TL_DEFAULT != 1) {

+      SP_TL_DEFAULT = 1;

+    }

+    pcVar7 = "Error";

+  }

+  else {

+    if (SP_TL_DEFAULT != 3) {

+      SP_TL_DEFAULT = 3;

+    }

+    pcVar7 = "Exit ";

+  }

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 1) != 0)) &&

+     (SP_TL_DEFAULT <= (byte)WPP_GLOBAL_Control[0x29])) {

+    WPP_SF_sd(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x4e,

+              &WPP_62e395074fc23b8bb3d7fc1ecbe71e8c_Traceguids,pcVar7);

+  }

+  return lVar4;

 }
```

## `SS_STORE::LogStoreLoadFailed`  (modified)

```diff
--- SS_STORE::LogStoreLoadFailed
+++ SS_STORE::LogStoreLoadFailed
@@ -1,2 +1,63 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE::LogStoreLoadFailed : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: void __cdecl SS_STORE::LogStoreLoadFailed(long) __ptr64 */

+

+void __thiscall SS_STORE::LogStoreLoadFailed(SS_STORE *this,long param_1)

+

+{

+  SS_STORE *pSVar1;

+  uint uVar2;

+  void *pvVar3;

+  void *pvVar4;

+  void *pvVar5;

+  __uint64 _Var6;

+  undefined8 uVar7;

+  ulonglong uVar8;

+  SS_STORE *pSVar9;

+  SS_STORE *pSVar10;

+  

+  uVar8 = 0;

+  pvVar3 = (void *)0x0;

+  pvVar4 = (void *)0x0;

+  pvVar5 = (void *)0x0;

+  if (*(uint *)(this + 0x128) == 0) {

+LAB_0:

+    uVar2 = *(uint *)(this + 0x128);

+    uVar7 = (**(code **)(*(longlong *)this + 0x10))(this);

+    SC_ENV::EventWrite(0x44d,uVar7,(ulonglong)(uint)param_1,(ulonglong)uVar2,pvVar3,pvVar4,pvVar5);

+    if (pvVar3 == (void *)0x0) goto LAB_1;

+  }

+  else {

+    pvVar3 = SC_ENV::Allocate((ulonglong)*(uint *)(this + 0x128) << 2,0x58587053,'\0',0);

+    if (pvVar3 == (void *)0x0) {

+      return;

+    }

+    pvVar4 = SC_ENV::Allocate((ulonglong)*(uint *)(this + 0x128) << 3,0x58587053,'\0',0);

+    if ((pvVar4 != (void *)0x0) &&

+       (pvVar5 = SC_ENV::Allocate((ulonglong)*(uint *)(this + 0x128) * 2,0x58587053,'\0',0),

+       pvVar5 != (void *)0x0)) {

+      pSVar10 = this + 0x138;

+      pSVar9 = *(SS_STORE **)pSVar10;

+      while (pSVar9 != pSVar10) {

+        *(undefined4 *)((longlong)pvVar3 + uVar8 * 4) = *(undefined4 *)(pSVar9 + 0x38);

+        _Var6 = SS_PATH::Sequence((SS_PATH *)(pSVar9 + -8));

+        *(__uint64 *)((longlong)pvVar4 + uVar8 * 8) = _Var6;

+        pSVar1 = pSVar9 + 0x3c;

+        pSVar9 = *(SS_STORE **)pSVar9;

+        *(undefined2 *)((longlong)pvVar5 + uVar8 * 2) = *(undefined2 *)pSVar1;

+        uVar8 = (ulonglong)((int)uVar8 + 1);

+      }

+      goto LAB_0;

+    }

+  }

+  ExFreePoolWithTag(pvVar3,0);

+LAB_1:

+  if (pvVar4 != (void *)0x0) {

+    ExFreePoolWithTag(pvVar4,0);

+  }

+  if (pvVar5 != (void *)0x0) {

+    ExFreePoolWithTag(pvVar5,0);

+  }

+  return;

+}

+
```

## `SS_STORE_HEADER::Initialize`  (modified)

```diff
--- SS_STORE_HEADER::Initialize
+++ SS_STORE_HEADER::Initialize
@@ -1,2 +1,26 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE_HEADER::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SS_STORE_HEADER::Initialize(class SS_PATH * __ptr64) __ptr64 */

+

+long __thiscall SS_STORE_HEADER::Initialize(SS_STORE_HEADER *this,SS_PATH *param_1)

+

+{

+  uint uVar1;

+  int iVar2;

+  uchar *puVar3;

+  

+  uVar1 = (**(code **)(*(longlong *)param_1 + 0x10))(param_1);

+  puVar3 = SC_ENV::Allocate((ulonglong)uVar1,0x58587053,'\0',0);

+  if (puVar3 == (uchar *)0x0) {

+    iVar2 = -0x3fffff66;

+  }

+  else {

+    iVar2 = (**(code **)(*(longlong *)param_1 + 0x18))(param_1,0,uVar1,puVar3);

+    if (-1 < iVar2) {

+      iVar2 = Unformat(this,puVar3,uVar1);

+    }

+    ExFreePoolWithTag(puVar3,0);

+  }

+  return iVar2;

+}

+
```

## `SS_RECORD::operator_new`  (modified)

```diff
--- SS_RECORD::operator_new
+++ SS_RECORD::operator_new
@@ -1,13 +1,13 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* public: static void * __ptr64 __cdecl SS_RECORD::operator new(unsigned __int64,unsigned __int64)

+    */

 

-void * __cdecl SDB_CONFIG::operator_new(__uint64 param_1,__uint64 param_2)

+void * __cdecl SS_RECORD::operator_new(__uint64 param_1,__uint64 param_2)

 

 {

-  longlong in_RAX;

+  void *pvVar1;

   

-  *(char *)(in_RAX + -0x73) = *(char *)(in_RAX + -0x73) - (char)param_1;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  pvVar1 = SC_ENV::Allocate(param_2 + 0x20,0x72537053,'\0',0);

+  return pvVar1;

 }
```

## `SC_DRIVE::ReadHeader`  (modified)

```diff
--- SC_DRIVE::ReadHeader
+++ SC_DRIVE::ReadHeader
@@ -1,2 +1,51 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_DRIVE::ReadHeader : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SC_DRIVE::ReadHeader(void) __ptr64 */

+

+long __thiscall SC_DRIVE::ReadHeader(SC_DRIVE *this)

+

+{

+  _GUID *p_Var1;

+  uchar uVar2;

+  long lVar3;

+  uint uVar4;

+  int iVar5;

+  uchar *puVar6;

+  ulong local_res10 [2];

+  uchar *local_res18 [2];

+  

+  local_res18[0] = (uchar *)0x0;

+  local_res10[0] = 0;

+  uVar2 = SC_ENV::PersistedData();

+  if (uVar2 != '\0') {

+    p_Var1 = (_GUID *)(this + 0x1d0);

+    lVar3 = GetDrivePd(p_Var1,*(__uint64 *)(this + 0x1c0),local_res18,local_res10);

+    if (-1 < lVar3) {

+      lVar3 = UnformatHeader(this,local_res18[0],local_res10[0]);

+    }

+    if (-1 < lVar3) {

+      return lVar3;

+    }

+    if (lVar3 == -0x3f18ffdf) {

+      SC_ENV::EventWrite(0x1ff,p_Var1);

+    }

+    else {

+      SC_ENV::EventWrite(0x1fc,p_Var1);

+    }

+  }

+  uVar4 = 1 << ((byte)*(undefined4 *)(this + 0xf0) & 0x1f);

+  puVar6 = SC_ENV::Allocate((ulonglong)uVar4,0x58587053,'\0',1);

+  if (puVar6 == (uchar *)0x0) {

+    iVar5 = -0x3fffff66;

+  }

+  else {

+    iVar5 = (**(code **)(*(longlong *)this + 0x38))(this,*(undefined8 *)(this + 0x1c0),uVar4,puVar6)

+    ;

+    if (-1 < iVar5) {

+      iVar5 = UnformatHeader(this,puVar6,uVar4);

+    }

+    ExFreePoolWithTag(puVar6,0);

+  }

+  return iVar5;

+}

+
```

## `SDB_DRIVE::Clone`  (modified)

```diff
--- SDB_DRIVE::Clone
+++ SDB_EXTENT::operator_new
@@ -1,23 +1,12 @@
 

-/* public: virtual class SDB_OBJECT * __ptr64 __cdecl SDB_DRIVE::Clone(void) __ptr64 */

+/* public: static void * __ptr64 __cdecl SDB_EXTENT::operator new(unsigned __int64) */

 

-SDB_OBJECT * __thiscall SDB_DRIVE::Clone(SDB_DRIVE *this)

+void * __cdecl SDB_EXTENT::operator_new(__uint64 param_1)

 

 {

-  undefined8 *puVar1;

-  SDB_OBJECT *pSVar2;

+  void *pvVar1;

   

-  puVar1 = SC_ENV::Allocate(0x100,0x64427053,'\x01',0);

-  if (puVar1 == (undefined8 *)0x0) {

-    return (SDB_OBJECT *)0x0;

-  }

-  puVar1[1] = 0;

-  puVar1[2] = 0;

-  *(undefined2 *)(puVar1 + 3) = 0;

-  *puVar1 = &_vftable_;

-  *(undefined4 *)(puVar1 + 0x1a) = 0xffffffff;

-  puVar1[0x12] = 0xffffffffffffffff;

-  pSVar2 = (SDB_OBJECT *)FUN_14001c0e0((undefined8 *)this,2);

-  return pSVar2;

+  pvVar1 = SC_ENV::Allocate(0x58,0x65427053,'\x01',0);

+  return pvVar1;

 }
```

## `SP_CONTROL::InitializeBootData`  (modified)

```diff
--- SP_CONTROL::InitializeBootData
+++ SP_CONTROL::InitializeBootDataV2
@@ -1,45 +1,2 @@
-

-/* private: long __cdecl SP_CONTROL::InitializeBootData(void) __ptr64 */

-

-long __thiscall SP_CONTROL::InitializeBootData(SP_CONTROL *this)

-

-{

-  int iVar1;

-  SC_PERSISTED_DATA_V2 *pSVar2;

-  uint local_res8 [2];

-  

-  local_res8[0] = 0;

-  *(undefined4 *)(this + (ulonglong)*(uint *)(this + 0xb98) * 4 + 0xb88) = 1;

-  iVar1 = ZwQuerySystemInformation(0xd6,0);

-  if (iVar1 < 0) {

-    return iVar1;

-  }

-  if (local_res8[0] == 0) {

-    return iVar1;

-  }

-  pSVar2 = SC_ENV::Allocate((ulonglong)local_res8[0],0x58587053,'\0',0);

-  if (pSVar2 == (SC_PERSISTED_DATA_V2 *)0x0) {

-    return -0x3fffff66;

-  }

-  iVar1 = ZwQuerySystemInformation(0xd6,pSVar2,local_res8[0],local_res8);

-  if (-1 < iVar1) {

-    if (*(int *)pSVar2 == 1) {

-      iVar1 = InitializeBootDataV1(this,(SC_PERSISTED_DATA_V1 *)pSVar2);

-    }

-    else {

-      if (*(int *)pSVar2 != 2) {

-        iVar1 = -0x3fffff45;

-        goto LAB_0;

-      }

-      iVar1 = InitializeBootDataV2(this,pSVar2);

-    }

-    if (-1 < iVar1) {

-      *(undefined4 *)(this + 0xba8) = *(undefined4 *)pSVar2;

-      *(undefined4 *)(this + 0xbac) = *(undefined4 *)(pSVar2 + 4);

-    }

-  }

-LAB_0:

-  ExFreePoolWithTag(pSVar2,0);

-  return iVar1;

-}

-

+Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::InitializeBootDataV2 : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `SP_CONTROL::InitializeBootDataV2`  (modified)

```diff
--- SP_CONTROL::InitializeBootDataV2
+++ SP_CONTROL::InitializeKsrData
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::InitializeBootDataV2 : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SP_CONTROL::InitializeKsrData : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SIO_RAID5::BuildChildPacketsScrub`  (modified)

```diff
--- SIO_RAID5::BuildChildPacketsScrub
+++ SIO_RAID5::BuildChildPacketsScrub
@@ -1,2 +1,105 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID5::BuildChildPacketsScrub : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SIO_RAID5::BuildChildPacketsScrub(class SC_PACKET * __ptr64,class

+   SC_SEQUENTIAL * __ptr64) __ptr64 */

+

+long __thiscall

+SIO_RAID5::BuildChildPacketsScrub(SIO_RAID5 *this,SC_PACKET *param_1,SC_SEQUENTIAL *param_2)

+

+{

+  undefined4 uVar1;

+  int iVar2;

+  longlong lVar3;

+  uchar uVar4;

+  long lVar5;

+  SP_RESILIENCY_INFO *pSVar6;

+  void *pvVar7;

+  SC_PARITY_CONTEXT *pSVar8;

+  SC_PACKET *pSVar9;

+  long lVar10;

+  uint uVar11;

+  ulonglong uVar12;

+  uint uVar13;

+  

+  lVar5 = 0;

+  uVar1 = *(undefined4 *)(*(longlong *)(*(longlong *)(this + 8) + 0x180) + 0x28);

+  if (param_2 == (SC_SEQUENTIAL *)0x0) {

+    uVar12 = *(ulonglong *)(param_1 + 0x88) >> ((byte)this[0x2a] & 0x3f);

+    uVar4 = IsRowValid(this,uVar12,(__uint64 *)0x0);

+    lVar10 = lVar5;

+    if (((uVar4 != '\0') && (uVar4 = IsRowStable(this,uVar12), lVar10 = 0, uVar4 != '\0')) &&

+       (uVar4 = AreAllColumnsFullyReadable(this), uVar4 != '\0')) {

+      pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+      iVar2 = *(int *)(pSVar6 + 0x10);

+      pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+      pvVar7 = SC_ENV::Allocate((ulonglong)*(uint *)(pSVar6 + 8) << 3,0x58587053,'\0',0);

+      if (pvVar7 == (void *)0x0) {

+        lVar10 = -0x3fffff66;

+      }

+      else {

+        uVar12 = 0;

+        while( true ) {

+          pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+          if (*(uint *)(pSVar6 + 8) <= (uint)uVar12) break;

+          pSVar8 = SC_ENV::Allocate((ulonglong)(uint)(iVar2 << 3) + 0x18,0x70587053,'\0',0);

+          *(SC_PARITY_CONTEXT **)((longlong)pvVar7 + uVar12 * 8) = pSVar8;

+          if (pSVar8 == (SC_PARITY_CONTEXT *)0x0) {

+LAB_0:

+            lVar5 = -0x3fffff66;

+LAB_1:

+            uVar12 = 0;

+            pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+            if (*(int *)(pSVar6 + 8) != 0) {

+              do {

+                lVar3 = *(longlong *)((longlong)pvVar7 + uVar12 * 8);

+                if (lVar3 != 0) {

+                  ExFreePoolWithTag(lVar3,0);

+                }

+                uVar11 = (int)uVar12 + 1;

+                uVar12 = (ulonglong)uVar11;

+                pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this);

+              } while (uVar11 < *(uint *)(pSVar6 + 8));

+            }

+            ExFreePoolWithTag(pvVar7,0);

+            return lVar5;

+          }

+          SC_PARITY::InitializeContext

+                    (*(SC_PARITY **)(*(longlong *)(this + 8) + 0x180),

+                     (1 << ((byte)uVar1 & 0x1f)) - 1,pSVar8);

+          uVar12 = (ulonglong)((uint)uVar12 + 1);

+        }

+        for (uVar11 = 0; pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this),

+            uVar11 < *(uint *)(pSVar6 + 8); uVar11 = uVar11 + 1) {

+          for (uVar13 = 0; pSVar6 = SIO_RAID::Resiliency((SIO_RAID *)this),

+              uVar13 < *(uint *)(pSVar6 + 0x10); uVar13 = uVar13 + 1) {

+            pSVar9 = SC_PACKET::operator_new(0xf0);

+            if ((pSVar9 == (SC_PACKET *)0x0) ||

+               (pSVar9 = (SC_PACKET *)SC_PACKET::SC_PACKET(pSVar9), pSVar9 == (SC_PACKET *)0x0))

+            goto LAB_0;

+            lVar5 = SC_BUFFER::Initialize

+                              ((SC_BUFFER *)(pSVar9 + 0x70),3,(void *)0x0,

+                               (ulong)(1L << ((byte)this[0x2a] & 0x3f)));

+            if (lVar5 < 0) {

+              (*(code *)**(undefined8 **)pSVar9)(pSVar9,1);

+              goto LAB_1;

+            }

+            *(undefined8 *)(pSVar9 + 0x88) = *(undefined8 *)(param_1 + 0x88);

+            *(undefined4 *)(pSVar9 + 0x90) = *(undefined4 *)(param_1 + 0x90);

+            *(uint *)(pSVar9 + 0x94) = uVar13;

+            *(uint *)(pSVar9 + 0x98) = uVar11;

+            pSVar9[0xa8] = (SC_PACKET)0x3;

+            *(SIO_RAID5 **)(pSVar9 + 0xe8) = this;

+            SC_PACKET::Attach(param_1,pSVar9,'\0');

+          }

+        }

+        *(void **)(param_1 + 0xb8) = pvVar7;

+        lVar10 = lVar5;

+      }

+    }

+  }

+  else {

+    lVar10 = -0x3ffffffe;

+  }

+  return lVar10;

+}

+
```

## `SIO_RAID::CreateColumnRecord`  (modified)

```diff
--- SIO_RAID::CreateColumnRecord
+++ SIO_RAID::CreateColumnRecord
@@ -1,2 +1,61 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID::CreateColumnRecord : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* private: long __cdecl SIO_RAID::CreateColumnRecord(unsigned long,unsigned long) __ptr64 */

+

+long __thiscall SIO_RAID::CreateColumnRecord(SIO_RAID *this,ulong param_1,ulong param_2)

+

+{

+  ulong uVar1;

+  SDB_OBJECT SVar2;

+  long lVar3;

+  SIO_COLUMN *pSVar4;

+  SDB_RECORD *this_00;

+  SDB_OBJECT *pSVar5;

+  SDB_OBJECT *pSVar6;

+  SIO_RAID *pSVar7;

+  ulong uVar8;

+  ulonglong uVar9;

+  SDB_RECORD *local_res8;

+  

+  pSVar7 = this;

+  uVar8 = param_1;

+  pSVar4 = Get(this,param_1,param_2);

+  uVar1 = *(ulong *)(pSVar4 + 0x10);

+  this_00 = SIO_SPACE::FindExtentRecord

+                      (*(SIO_SPACE **)(pSVar7 + 8),*(__uint64 *)(pSVar7 + 0x10),uVar8,uVar1);

+  pSVar5 = SDB_RECORD::GetObject(this_00);

+  uVar9 = 0x63427053;

+  pSVar6 = SC_ENV::Allocate(0x48,0x63427053,'\x01',0);

+  local_res8 = (SDB_RECORD *)0x0;

+  if (pSVar6 == (SDB_OBJECT *)0x0) {

+    lVar3 = -0x3fffff66;

+  }

+  else {

+    *(undefined8 *)(pSVar6 + 8) = 0;

+    *(undefined8 *)(pSVar6 + 0x10) = 0;

+    *(undefined2 *)(pSVar6 + 0x18) = 0;

+    *(undefined ***)pSVar6 = &SDB_COLUMN::_vftable_;

+    *(undefined8 *)(pSVar6 + 0x20) = *(undefined8 *)(this + 0x10);

+    *(ulong *)(pSVar6 + 0x28) = param_1;

+    *(ulong *)(pSVar6 + 0x2c) = uVar1;

+    *(undefined8 *)(pSVar6 + 0x30) = *(undefined8 *)(pSVar5 + 8);

+    if (((byte)this[0x28] & 0x40) == 0) {

+      uVar9 = (ulonglong)param_1;

+      pSVar4 = Get(this,param_1,param_2);

+      pSVar6[0x38] = (SDB_OBJECT)((byte)pSVar4[3] & 0xf);

+      pSVar4 = Get(this,(ulong)uVar9,param_2);

+      SVar2 = (SDB_OBJECT)((byte)pSVar4[3] >> 4);

+    }

+    else {

+      pSVar6[0x38] = (SDB_OBJECT)0x8;

+      SVar2 = (SDB_OBJECT)0x6;

+    }

+    pSVar6[0x39] = SVar2;

+    lVar3 = SDB_CONFIG::CreateRecord

+                      (*(SDB_CONFIG **)(*(longlong *)(this + 8) + 0x148),

+                       (_SDB_RECORD_TYPE)CONCAT71((int7)(uVar9 >> 8),5),pSVar6,&local_res8);

+    (*(code *)**(undefined8 **)pSVar6)(pSVar6,1);

+  }

+  return lVar3;

+}

+
```

## `SP_ENCLOSURE::ReportTimestamp`  (modified)

```diff
--- SP_ENCLOSURE::ReportTimestamp
+++ SP_ENCLOSURE::ReportTimestamp
@@ -1,2 +1,54 @@
-Failed to decompile spaceport.sys - .ProgramDB SP_ENCLOSURE::ReportTimestamp : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* public: long __cdecl SP_ENCLOSURE::ReportTimestamp(unsigned __int64 * __ptr64) __ptr64 */

+

+long __thiscall SP_ENCLOSURE::ReportTimestamp(SP_ENCLOSURE *this,__uint64 *param_1)

+

+{

+  long lVar1;

+  ushort *puVar2;

+  undefined1 auStack_a8 [32];

+  _SCSI_REQUEST_BLOCK local_88 [10];

+  undefined1 local_7e;

+  undefined4 local_7c;

+  undefined4 local_78;

+  ushort *local_70;

+  undefined1 local_40;

+  byte local_3f;

+  undefined4 local_3a;

+  ulonglong local_28;

+  

+  local_28 = __security_cookie ^ (ulonglong)auStack_a8;

+  memset(local_88,0,0x58);

+  *param_1 = 0;

+  puVar2 = SC_ENV::Allocate(0xc,0x58587053,'\0',0);

+  if (puVar2 == (ushort *)0x0) {

+    lVar1 = -0x3fffff66;

+  }

+  else {

+    local_7c = 0x148;

+    local_3f = local_3f & 0xef | 0xf;

+    local_78 = 0xc;

+    local_7e = 0xc;

+    local_40 = 0xa3;

+    local_3a = 0xc000000;

+    local_70 = puVar2;

+    lVar1 = SendScsiRequest(this,local_88);

+    if (-1 < lVar1) {

+      if ((ushort)(*puVar2 >> 8 | *puVar2 << 8) == 10) {

+        *(char *)((longlong)param_1 + 5) = (char)puVar2[2];

+        *(undefined1 *)((longlong)param_1 + 4) = *(undefined1 *)((longlong)puVar2 + 5);

+        *(char *)((longlong)param_1 + 3) = (char)puVar2[3];

+        *(undefined1 *)((longlong)param_1 + 2) = *(undefined1 *)((longlong)puVar2 + 7);

+        *(char *)((longlong)param_1 + 1) = (char)puVar2[4];

+        *(undefined1 *)param_1 = *(undefined1 *)((longlong)puVar2 + 9);

+      }

+      else {

+        lVar1 = -0x3fffff45;

+      }

+    }

+    SC_ENV_ALLOCATOR::operator_delete(puVar2);

+  }

+  return lVar1;

+}

+
```

## `SDB_POOL_CONFIG::CreateConfigSpaceTransaction`  (modified)

```diff
--- SDB_POOL_CONFIG::CreateConfigSpaceTransaction
+++ SDB_SPACE_CONFIG::CreateMetadataRecord
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_POOL_CONFIG::CreateConfigSpaceTransaction : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE_CONFIG::CreateMetadataRecord : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SS_STORE::GetAdditionalKeys`  (modified)

```diff
--- SS_STORE::GetAdditionalKeys
+++ SS_STORE::GetAdditionalKeys
@@ -1,2 +1,109 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE::GetAdditionalKeys : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SS_STORE::GetAdditionalKeys(unsigned long * __ptr64 * __ptr64,unsigned long

+   * __ptr64) __ptr64 */

+

+long __thiscall SS_STORE::GetAdditionalKeys(SS_STORE *this,ulong **param_1,ulong *param_2)

+

+{

+  SS_STORE *pSVar1;

+  uint uVar2;

+  uint uVar3;

+  ulong uVar4;

+  void *pvVar5;

+  ulong *puVar6;

+  SS_BLOCK *pSVar7;

+  ulonglong uVar8;

+  uint uVar9;

+  uint uVar10;

+  uint uVar11;

+  uint uVar12;

+  bool bVar13;

+  ulong local_58;

+  __uint64 local_50 [2];

+  

+  *param_1 = (ulong *)0x0;

+  *param_2 = 0;

+  uVar3 = *(uint *)(this + 0xa0);

+  local_50[0] = 0;

+  local_58 = 0;

+  uVar3 = (-uVar3 & *(int *)(this + 0x4c) + -1 + uVar3) / uVar3;

+  pvVar5 = SC_ENV::Allocate((ulonglong)(uVar3 + 0x1f >> 3 & 0x1ffffffc),0x73537053,'\0',0);

+  if (pvVar5 != (void *)0x0) {

+    pSVar1 = this + 0xb8;

+    RtlInitializeBitMap(pSVar1,pvVar5);

+    pvVar5 = SC_SPARSE::FindFirstObject((SC_SPARSE *)(this + 0xd8),local_50);

+    while (pvVar5 != (void *)0x0) {

+      uVar12 = *(uint *)((longlong)pvVar5 + 0x18);

+      while (uVar12 != 0xffffffff) {

+        if ((*(byte *)(*(longlong *)(this + 0xc0) +

+                      ((longlong)((ulonglong)uVar12 / (ulonglong)*(uint *)(this + 0xa0)) >> 3)) >>

+             ((ulonglong)uVar12 / (ulonglong)*(uint *)(this + 0xa0) & 7) & 1) == 0) {

+          RtlSetBits(pSVar1);

+          *(int *)(this + 0xb4) = *(int *)(this + 0xb4) + 1;

+        }

+        pSVar7 = GetBlock(this,uVar12);

+        uVar12 = *(uint *)(pSVar7 + 4);

+      }

+      pvVar5 = SC_SPARSE::FindNextObject((SC_SPARSE *)(this + 0xd8),local_50);

+    }

+    bVar13 = (**(ulonglong **)(this + 0xc0) & 1) == 0;

+    if (bVar13) {

+      RtlSetBits(pSVar1);

+      *(int *)(this + 0xb4) = *(int *)(this + 0xb4) + 1;

+    }

+    puVar6 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(this + 0xb4) * *(int *)(this + 0xa0) * 4),

+                              0x58587053,'\0',0);

+    if (puVar6 != (ulong *)0x0) {

+      uVar4 = 0;

+      if (uVar3 != 0) {

+        local_50[0] = 0;

+        uVar12 = 0;

+        do {

+          if (((*(byte *)(*(longlong *)(this + 0xc0) + ((longlong)local_50[0] >> 3)) >>

+                (local_50[0] & 7) & 1) != 0) &&

+             (uVar9 = *(uint *)(this + 0xa0), uVar11 = 0, uVar9 != 0)) {

+            do {

+              uVar4 = uVar9 * uVar12 + uVar11;

+              pSVar7 = GetBlock(this,uVar4);

+              if (pSVar7 != (SS_BLOCK *)0x0) {

+                uVar2 = *(uint *)pSVar7;

+                pvVar5 = SC_SPARSE::GetObject((SC_SPARSE *)(this + 0xd8),(ulonglong)uVar2);

+                if (pvVar5 == (void *)0x0) {

+                  pSVar7 = GetBlock(this,uVar2);

+                  uVar10 = uVar2;

+                  if (*(int *)(pSVar7 + 4) != -1) {

+                    while (uVar10 != uVar4) {

+                      if ((*(byte *)(*(longlong *)(this + 0xc0) +

+                                    ((longlong)((ulonglong)uVar10 / (ulonglong)uVar9) >> 3)) >>

+                           ((ulonglong)uVar10 / (ulonglong)uVar9 & 7) & 1) != 0) goto LAB_0;

+                      pSVar7 = GetBlock(this,uVar10);

+                      uVar10 = *(uint *)(pSVar7 + 4);

+                    }

+                  }

+                  uVar8 = (ulonglong)local_58;

+                  local_58 = local_58 + 1;

+                  puVar6[uVar8] = uVar2;

+                }

+              }

+LAB_0:

+              uVar9 = *(uint *)(this + 0xa0);

+              uVar11 = uVar11 + 1;

+            } while (uVar11 < uVar9);

+          }

+          local_50[0] = local_50[0] + 1;

+          uVar12 = uVar12 + 1;

+          uVar4 = local_58;

+        } while (uVar12 < uVar3);

+      }

+      if (bVar13) {

+        RtlClearBit(this + 0xb8,0);

+        *(int *)(this + 0xb4) = *(int *)(this + 0xb4) + -1;

+      }

+      *param_1 = puVar6;

+      *param_2 = uVar4;

+      return 0;

+    }

+  }

+  return -0x3fffff66;

+}

+
```

## `SIO_VDT::AllocateGroup`  (modified)

```diff
--- SIO_VDT::AllocateGroup
+++ SIO_VDT::AllocateGroup
@@ -1,2 +1,56 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_VDT::AllocateGroup : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: long __cdecl SIO_VDT::AllocateGroup(unsigned __int64,class SIO_VDT_GROUP * __ptr64 *

+   __ptr64) __ptr64 */

+

+long __thiscall SIO_VDT::AllocateGroup(SIO_VDT *this,__uint64 param_1,SIO_VDT_GROUP **param_2)

+

+{

+  SC_SLAB_ALLOCATOR *this_00;

+  undefined1 uVar1;

+  long lVar2;

+  SIO_VDT_GROUP *pSVar3;

+  SIO_VDT_GROUP *this_01;

+  __uint64 _Var4;

+  

+  _Var4 = param_1 - param_1 % *(ulonglong *)(this + 0x140);

+  lVar2 = 0;

+  uVar1 = ExAcquireSpinLockExclusive(this + 0xb8);

+  pSVar3 = GetGroup(this,_Var4,(__uint64 *)0x0);

+  this_01 = pSVar3;

+  if (pSVar3 < (SIO_VDT_GROUP *)0x2) {

+    this_00 = (SC_SLAB_ALLOCATOR *)(this + 0x78);

+    if (*(int *)this_00 == 0) {

+      this_01 = SC_ENV::Allocate((ulonglong)*(uint *)(this + 0xb0),0x58587053,'\0',0);

+      if (this_01 != (SIO_VDT_GROUP *)0x0) goto LAB_0;

+    }

+    else {

+      this_01 = SC_SLAB_ALLOCATOR::AllocateObject(this_00);

+      if (this_01 != (SIO_VDT_GROUP *)0x0) {

+        memset(this_01,0,(ulonglong)*(uint *)this_00);

+LAB_0:

+        SIO_VDT_GROUP::Initialize(this_01,_Var4,*(ulong *)(this + 0x148));

+        if (pSVar3 == (SIO_VDT_GROUP *)0x1) {

+          RtlSetAllBits(this_01 + 0x30);

+        }

+        QueueGroup(this,this_01);

+        lVar2 = SetGroup(this,_Var4,this_01);

+        if (lVar2 < 0) {

+          if (this_01 != (SIO_VDT_GROUP *)0x0) {

+            FreeGroup(this,this_01);

+          }

+          goto LAB_1;

+        }

+        goto LAB_2;

+      }

+    }

+    lVar2 = -0x3fffff66;

+  }

+  else {

+LAB_2:

+    *param_2 = this_01;

+  }

+LAB_1:

+  ExReleaseSpinLockExclusive(this + 0xb8,uVar1);

+  return lVar2;

+}

+
```

## `SC_SPARSE::Copy`  (modified)

```diff
--- SC_SPARSE::Copy
+++ SC_SPARSE::Copy
@@ -1,2 +1,111 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_SPARSE::Copy : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SC_SPARSE::Copy(class SC_SPARSE * __ptr64) __ptr64 */

+

+long __thiscall SC_SPARSE::Copy(SC_SPARSE *this,SC_SPARSE *param_1)

+

+{

+  int iVar1;

+  longlong lVar2;

+  SC_SPARSE *pSVar3;

+  longlong lVar4;

+  longlong *plVar5;

+  code *pcVar6;

+  long lVar7;

+  longlong *plVar8;

+  uint uVar9;

+  ulonglong uVar10;

+  int iVar11;

+  undefined1 *puVar12;

+  ulonglong uVar13;

+  SC_SPARSE *pSVar14;

+  ulonglong uVar15;

+  SC_SPARSE *pSVar16;

+  SC_SPARSE SVar17;

+  undefined8 local_res8;

+  uint local_res18 [4];

+  undefined8 uStack_60;

+  undefined1 auStack_58 [32];

+  

+  puVar12 = auStack_58;

+  pSVar16 = *(SC_SPARSE **)(this + 8);

+  lVar7 = 0;

+  do {

+    if (pSVar16 == this + 8) {

+      return lVar7;

+    }

+    for (uVar13 = 0; (uint)uVar13 < *(uint *)(this + 0x34); uVar13 = (ulonglong)((uint)uVar13 + 1))

+    {

+      lVar2 = *(longlong *)(pSVar16 + uVar13 * 8 + 0x18);

+      if (lVar2 != 0) {

+        uVar15 = *(longlong *)(pSVar16 + 0x10) + uVar13;

+        if (*(ulonglong *)(param_1 + 0x40) <= uVar15) {

+          return -0x3ffffff3;

+        }

+        iVar11 = *(int *)(param_1 + 0x48);

+        iVar1 = *(int *)(param_1 + 0x38);

+        SVar17 = param_1[0x30];

+        uVar9 = *(int *)(param_1 + 0x34) << 3;

+        *(uint *)(puVar12 + 0x70) = uVar9;

+        pSVar14 = param_1;

+        iVar11 = iVar11 - iVar1;

+        while( true ) {

+          SVar17 = (SC_SPARSE)((char)SVar17 + -1);

+          if (iVar11 < 0) break;

+          plVar8 = *(longlong **)pSVar14;

+          if (plVar8 == (longlong *)0x0) {

+            *(undefined8 *)(puVar12 + -8) = 0x140019ec2;

+            plVar8 = SC_ENV::Allocate((ulonglong)uVar9 + 0x20,0x61587053,'\0',0);

+            if (plVar8 == (longlong *)0x0) {

+              return -0x3fffff66;

+            }

+            if (SVar17 == (SC_SPARSE)0x0) {

+              uVar10 = ~((1L << ((byte)*(undefined4 *)(param_1 + 0x38) & 0x3f)) - 1U) & uVar15;

+              plVar8[2] = uVar10;

+              for (pSVar3 = *(SC_SPARSE **)(param_1 + 0x10);

+                  (pSVar3 != param_1 + 8 && (uVar10 <= *(ulonglong *)(pSVar3 + 0x10)));

+                  pSVar3 = *(SC_SPARSE **)(pSVar3 + 8)) {

+              }

+              lVar4 = *(longlong *)pSVar3;

+              if (*(SC_SPARSE **)(lVar4 + 8) != pSVar3) {

+LAB_0:

+                this = (SC_SPARSE *)0x3;

+                pcVar6 = (code *)swi(0x29);

+                lVar7 = (*pcVar6)();

+                puVar12 = puVar12 + 8;

+                goto LAB_1;

+              }

+              *plVar8 = lVar4;

+              plVar8[1] = (longlong)pSVar3;

+              *(longlong **)(lVar4 + 8) = plVar8;

+              *(longlong **)pSVar3 = plVar8;

+            }

+            else {

+              *(SC_SPARSE *)(plVar8 + 2) = SVar17;

+              plVar5 = *(longlong **)(param_1 + 0x20);

+              if ((SC_SPARSE *)*plVar5 != param_1 + 0x18) goto LAB_0;

+              *plVar8 = (longlong)(param_1 + 0x18);

+              plVar8[1] = (longlong)plVar5;

+              *plVar5 = (longlong)plVar8;

+              *(longlong **)(param_1 + 0x20) = plVar8;

+            }

+            *(longlong **)pSVar14 = plVar8;

+          }

+          uVar9 = *(uint *)(puVar12 + 0x70);

+          pSVar14 = (SC_SPARSE *)

+                    (plVar8 + (uVar15 >> ((byte)iVar11 & 0x3f) &

+                              (ulonglong)(*(int *)(param_1 + 0x34) - 1)) + 3);

+          iVar11 = iVar11 - *(int *)(param_1 + 0x38);

+        }

+        if (*(longlong *)pSVar14 == 0) {

+          *(longlong *)(param_1 + 0x28) = *(longlong *)(param_1 + 0x28) + 1;

+        }

+        *(longlong *)pSVar14 = lVar2;

+        lVar7 = 0;

+      }

+      this = *(SC_SPARSE **)(puVar12 + 0x60);

+    }

+LAB_1:

+    pSVar16 = *(SC_SPARSE **)pSVar16;

+  } while( true );

+}

+
```

## `SIO_RAID::Create`  (modified)

```diff
--- SIO_RAID::Create
+++ SIO_RAID::CreateColumnRecord
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID::Create : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SIO_RAID::CreateColumnRecord : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SIO_LOG::WriteBitMaps`  (modified)

```diff
--- SIO_LOG::WriteBitMaps
+++ SIO_LOG::WriteBitMaps
@@ -1,2 +1,116 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_LOG::WriteBitMaps : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SIO_LOG::WriteBitMaps(unsigned long,unsigned char,union _SL_LSN * __ptr64)

+   __ptr64 */

+

+long __thiscall SIO_LOG::WriteBitMaps(SIO_LOG *this,ulong param_1,uchar param_2,_SL_LSN *param_3)

+

+{

+  uchar *puVar1;

+  long lVar2;

+  ulong uVar3;

+  ulong uVar4;

+  __uint64 _Var5;

+  SC_SPARSE *this_00;

+  SIO_SPACE_DRIVE *this_01;

+  uchar *puVar6;

+  uint uVar7;

+  void *local_160;

+  undefined8 local_158;

+  ulonglong uStack_150;

+  __uint64 local_148 [2];

+  SIO_LOG_PACKET local_138 [76];

+  uint local_ec;

+  SC_BUFFER local_c8 [32];

+  uint local_a8;

+  undefined1 local_90;

+  undefined1 local_8e;

+  SIO_LOG *local_58;

+  SIO_LOG *local_50;

+  undefined8 local_48;

+  ulong local_38;

+  undefined4 local_34;

+  ulong local_30;

+  

+  local_158 = 0;

+  uStack_150 = 0;

+  SIO_LOG_PACKET::SIO_LOG_PACKET(local_138);

+  _Var5 = SC_ENV::QueryPerformanceCounter((__uint64 *)0x0);

+  local_ec = local_ec | 8;

+  *(undefined8 *)param_3 = 0;

+  local_160 = SC_ENV::Allocate(0x1000,0x58587053,'\0',0);

+  lVar2 = 0;

+  if (local_160 == (void *)0x0) {

+    lVar2 = -0x3fffff66;

+    goto LAB_0;

+  }

+  local_158 = 0x1000;

+  if (param_2 == '\0') {

+    if (param_1 == 1) {

+      lVar2 = (**(code **)(**(longlong **)(*(longlong *)(this + 8) + 0x188) + 0x60))();

+    }

+    else {

+      if (param_1 != 2) goto LAB_1;

+      this_00 = SIO_SPACE::GetDrives(*(SIO_SPACE **)(this + 8));

+      local_148[0] = 0;

+      this_01 = SC_SPARSE::FindFirstObject(this_00,local_148);

+      while ((this_01 != (SIO_SPACE_DRIVE *)0x0 &&

+             (lVar2 = SIO_SPACE_DRIVE::GetBitMaps(this_01,(SIO_LOG_GET_BITMAP *)&local_160),

+             -1 < lVar2))) {

+        this_01 = SC_SPARSE::FindNextObject(this_00,local_148);

+      }

+    }

+    if (lVar2 < 0) goto LAB_0;

+  }

+LAB_1:

+  uVar7 = local_158._4_4_ + -1 +

+          *(uint *)(*(longlong *)(this + (ulonglong)param_1 * 8 + 0x10) + 0x84);

+  uVar7 = uVar7 - uVar7 % *(uint *)(*(longlong *)(this + (ulonglong)param_1 * 8 + 0x10) + 0x84);

+  uVar3 = SlLogGetLogRecordHeaderLength(*(void **)(this + (ulonglong)param_1 * 8 + 0x28),0x10,uVar7)

+  ;

+  lVar2 = SC_BUFFER::Initialize(local_c8,3,(void *)0x0,uVar3 + uVar7 + 0x10);

+  if (-1 < lVar2) {

+    puVar6 = SC_BUFFER::VirtualAddress(local_c8);

+    puVar6 = puVar6 + uVar3;

+    if (uVar7 != 0) {

+      memmove(puVar6,local_160,(ulonglong)uVar7);

+    }

+    puVar1 = puVar6 + uVar7;

+    puVar1[0] = '\x03';

+    puVar1[1] = '\0';

+    puVar1[2] = '\0';

+    puVar1[3] = '\0';

+    *(ulong *)(puVar6 + (ulonglong)uVar7 + 4) = uVar3;

+    *(uint *)(puVar6 + (ulonglong)uVar7 + 8) = uVar7;

+    *(undefined4 *)(puVar6 + (ulonglong)uVar7 + 0xc) = (undefined4)uStack_150;

+    local_90 = 4;

+    local_8e = 0xf;

+    local_34 = 0x10;

+    local_a8 = uVar7;

+    local_58 = this;

+    local_50 = this;

+    local_38 = uVar3;

+    local_30 = param_1;

+    lVar2 = WriteSynchronous(this,local_138);

+    if (-1 < lVar2) {

+      uVar4 = ToBitMapIndex(param_1);

+      *(undefined8 *)(this + (ulonglong)uVar4 * 8 + 0xe0) = local_48;

+      *(ulong *)(this + (ulonglong)uVar4 * 4 + 0xf0) = uVar3 + uVar7;

+      *(undefined8 *)param_3 = local_48;

+      if (param_1 == 2) {

+        SC_ENV::EventWrite(0x416,*(longlong *)(this + 8) + 0x18,uStack_150 & 0xffffffff,

+                           local_158 >> 0x20,local_160);

+      }

+    }

+  }

+LAB_0:

+  if (local_160 != (void *)0x0) {

+    SC_ENV_ALLOCATOR::operator_delete(local_160);

+  }

+  if (param_1 == 1) {

+    UpdateCountersWriteVdt(this,_Var5);

+  }

+  SC_PACKET::~SC_PACKET((SC_PACKET *)local_138);

+  return lVar2;

+}

+
```

## `SIO_VDT_VERIFIER::Shutdown`  (modified)

```diff
--- SIO_VDT_VERIFIER::Shutdown
+++ SIO_VDT_VERIFIER::Shutdown
@@ -1,2 +1,57 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_VDT_VERIFIER::Shutdown : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl SIO_VDT_VERIFIER::Shutdown(class SIO_VDT * __ptr64,long) __ptr64 */

+

+void __thiscall SIO_VDT_VERIFIER::Shutdown(SIO_VDT_VERIFIER *this,SIO_VDT *param_1,long param_2)

+

+{

+  longlong lVar1;

+  undefined8 uVar2;

+  SIO_VDT_GROUP *pSVar3;

+  SIO_VDT_GROUP *this_00;

+  undefined4 uVar4;

+  undefined4 uVar5;

+  undefined4 uVar6;

+  undefined4 uVar7;

+  __uint64 local_res8;

+  

+  local_res8 = 0;

+  if (*(longlong *)this != 0) {

+    FreeGroups(this);

+    if (param_2 < 0) {

+      uVar4 = 0;

+      uVar5 = 0;

+      uVar6 = 0;

+      uVar7 = 0;

+    }

+    else {

+      pSVar3 = SC_SPARSE::FindFirstObject((SC_SPARSE *)(param_1 + 0xc0),&local_res8);

+      while (pSVar3 != (SIO_VDT_GROUP *)0x0) {

+        if ((SIO_VDT_GROUP *)0x1 < pSVar3 + -1) {

+          this_00 = SC_ENV::Allocate((ulonglong)*(uint *)(param_1 + 0xb0),0x58587053,'\0',0);

+          SIO_VDT_GROUP::Initialize

+                    (this_00,*(__uint64 *)(pSVar3 + 0x10),*(ulong *)(param_1 + 0x148));

+          *(undefined4 *)(this_00 + 0x28) = *(undefined4 *)(pSVar3 + 0x28);

+          uVar2 = *(undefined8 *)(pSVar3 + 0x20);

+          *(undefined8 *)(this_00 + 0x18) = *(undefined8 *)(pSVar3 + 0x18);

+          *(undefined8 *)(this_00 + 0x20) = uVar2;

+          memmove(*(void **)(this_00 + 0x38),*(void **)(pSVar3 + 0x38),

+                  (ulonglong)(*(int *)(param_1 + 0x148) + 0x1fU >> 3 & 0x1ffffffc));

+          pSVar3 = this_00;

+        }

+        SC_SPARSE::SetObject(*(SC_SPARSE **)this,local_res8,pSVar3);

+        pSVar3 = SC_SPARSE::FindNextObject((SC_SPARSE *)(param_1 + 0xc0),&local_res8);

+      }

+      lVar1 = *(longlong *)(param_1 + 8);

+      uVar4 = *(undefined4 *)(lVar1 + 0x28);

+      uVar5 = *(undefined4 *)(lVar1 + 0x2c);

+      uVar6 = *(undefined4 *)(lVar1 + 0x30);

+      uVar7 = *(undefined4 *)(lVar1 + 0x34);

+    }

+    *(undefined4 *)(this + 8) = uVar4;

+    *(undefined4 *)(this + 0xc) = uVar5;

+    *(undefined4 *)(this + 0x10) = uVar6;

+    *(undefined4 *)(this + 0x14) = uVar7;

+  }

+  return;

+}

+
```

## `SS_STORE::NewPath`  (modified)

```diff
--- SS_STORE::NewPath
+++ SS_STORE::NewPath
@@ -1,2 +1,53 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE::NewPath : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SS_STORE::NewPath(class SC_DRIVE * __ptr64,unsigned __int64) __ptr64 */

+

+long __thiscall SS_STORE::NewPath(SS_STORE *this,SC_DRIVE *param_1,__uint64 param_2)

+

+{

+  code *pcVar1;

+  long lVar2;

+  SDB_PATH *this_00;

+  SS_STORE *pSVar3;

+  longlong *plVar4;

+  SDB_PATH *pSVar5;

+  

+  this_00 = SC_ENV::Allocate(0x58,0x74427053,'\0',0);

+  if (this_00 == (SDB_PATH *)0x0) {

+    lVar2 = -0x3fffff66;

+  }

+  else {

+    *(undefined4 *)(this_00 + 0x20) = 0;

+    pSVar5 = this_00 + 8;

+    *(undefined8 *)(this_00 + 0x28) = 0;

+    *(SDB_PATH **)(this_00 + 0x10) = pSVar5;

+    *(SDB_PATH **)pSVar5 = pSVar5;

+    *(undefined4 *)(this_00 + 0x18) = 0;

+    *(undefined8 *)(this_00 + 0x48) = 0;

+    *(undefined8 *)(this_00 + 0x50) = 0;

+    *(undefined ***)this_00 = &SDB_PATH::_vftable_;

+    lVar2 = SDB_PATH::Initialize(this_00,param_1,param_2);

+    if (-1 < lVar2) {

+      *(uint *)(this_00 + 0x18) = *(uint *)(this_00 + 0x18) | 2;

+      lVar2 = Synchronize(this,this_00);

+      if (-1 < lVar2) {

+        pSVar3 = this + 0x138;

+        pSVar5 = this_00 + 8;

+        plVar4 = *(longlong **)(this + 0x140);

+        if ((SS_STORE *)*plVar4 != pSVar3) {

+          plVar4 = (longlong *)0x3;

+          pcVar1 = (code *)swi(0x29);

+          pSVar3 = (SS_STORE *)(*pcVar1)();

+        }

+        *(SS_STORE **)pSVar5 = pSVar3;

+        *(longlong **)(this_00 + 0x10) = plVar4;

+        *plVar4 = (longlong)pSVar5;

+        *(SDB_PATH **)(pSVar3 + 8) = pSVar5;

+        return lVar2;

+      }

+    }

+    (*(code *)**(undefined8 **)this_00)(this_00,1);

+  }

+  return lVar2;

+}

+
```

## `SpIdsCopyHelper`  (modified)

```diff
--- SpIdsCopyHelper
+++ SpIdsToString
@@ -1,2 +1,115 @@
-Failed to decompile spaceport.sys - .ProgramDB SpIdsCopyHelper : Error: Decompile error: 
-Low-level Error: DuplicateFunctionError, but could not recover original symbol+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+

+ushort * __cdecl SpIdsToString(_SP_IDS_EX *param_1)

+

+{

+  ulong uVar1;

+  _KSR_MEMORY_RUN *p_Var2;

+  code *pcVar3;

+  undefined4 uVar4;

+  undefined4 uVar5;

+  undefined4 uVar6;

+  SP_CONTROL *pSVar7;

+  uint uVar8;

+  _KSR_MEMORY_RUN *in_RAX;

+  SP_CONTROL *pSVar9;

+  _KSR_MEMORY_RUN *p_Var10;

+  _KSR_MEMORY_RUN *p_Var11;

+  undefined8 *puVar12;

+  longlong unaff_RBP;

+  _KSR_MEMORY_RUN *unaff_RSI;

+  _KSR_MEMORY_RUN *unaff_RDI;

+  _KSR_MEMORY_RUN *p_Var13;

+  undefined4 unaff_R13D;

+  undefined8 unaff_R14;

+  undefined4 auStackX_20 [2];

+  undefined8 uStack_8;

+  

+  do {

+    *(undefined4 *)(in_RAX + 0x28) = 0;

+    *(longlong *)(in_RAX + 0x30) = 0;

+    *(longlong *)((longlong)register0x00000020 + 0x28) = unaff_RBP + -0x50;

+    *(undefined4 *)((longlong)register0x00000020 + 0x20) = 1;

+    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002ddc7;

+    p_Var13 = unaff_RSI;

+    uVar8 = KsrClaimPersistedMemory();

+    if ((int)uVar8 < 0) {

+LAB_0:

+      p_Var10 = (_KSR_MEMORY_RUN *)0x0;

+      *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002de69;

+      ExFreePoolWithTag();

+      goto LAB_1;

+    }

+    uVar1 = *(ulong *)(unaff_RBP + -0x50);

+    p_Var13 = (_KSR_MEMORY_RUN *)(unaff_RBP + -0x48);

+    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002dde8;

+    p_Var10 = unaff_RSI;

+    uVar8 = SpMapKsrRuns(uVar1,unaff_RSI,(_MDL **)p_Var13);

+    p_Var11 = (_KSR_MEMORY_RUN *)(ulonglong)uVar8;

+    if ((int)uVar8 < 0) goto LAB_0;

+    uVar4 = *(undefined4 *)(unaff_RBP + -0x3c);

+    uVar5 = *(undefined4 *)(unaff_RBP + -0x38);

+    uVar6 = *(undefined4 *)(unaff_RBP + -0x34);

+    *(undefined4 *)(unaff_RDI + 0x10) = *(undefined4 *)(unaff_RBP + -0x40);

+    *(undefined4 *)(unaff_RDI + 0x14) = uVar4;

+    *(undefined4 *)(unaff_RDI + 0x18) = uVar5;

+    *(undefined4 *)(unaff_RDI + 0x1c) = uVar6;

+    *(undefined4 *)(unaff_RDI + 0x20) = *(undefined4 *)(unaff_RBP + -0x30);

+    *(longlong *)(unaff_RDI + 0x30) = *(longlong *)(unaff_RBP + -0x48);

+    pSVar7 = SpControlExt;

+    pSVar9 = SpControlExt + 3000;

+    *(undefined4 *)(unaff_RDI + 0x28) = unaff_R13D;

+    p_Var2 = *(_KSR_MEMORY_RUN **)(pSVar7 + 0xbc0);

+    if (*(SP_CONTROL **)p_Var2 == pSVar9) {

+      *(SP_CONTROL **)unaff_RDI = pSVar9;

+      *(_KSR_MEMORY_RUN **)(unaff_RDI + 8) = p_Var2;

+      *(_KSR_MEMORY_RUN **)p_Var2 = unaff_RDI;

+      *(_KSR_MEMORY_RUN **)(pSVar7 + 0xbc0) = unaff_RDI;

+      unaff_RDI = p_Var2;

+      goto LAB_1;

+    }

+    pcVar3 = (code *)swi(0x29);

+    (*pcVar3)(3);

+    puVar12 = (undefined8 *)((longlong)register0x00000020 + 8);

+    unaff_RDI = (_KSR_MEMORY_RUN *)((ulonglong)*(ushort *)(unaff_RBP + -0x2a) << 3);

+    p_Var13 = (_KSR_MEMORY_RUN *)0x0;

+    *(undefined8 *)register0x00000020 = 0x14002de3d;

+    p_Var10 = p_Var11;

+    unaff_RSI = SC_ENV::Allocate((__uint64)unaff_RDI,uVar8,'\0',0);

+    if (unaff_RSI == (_KSR_MEMORY_RUN *)0x0) {

+      uVar8 = 0xc000009a;

+      register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);

+      goto LAB_2;

+    }

+    p_Var13 = (_KSR_MEMORY_RUN *)0x0;

+    p_Var10 = (_KSR_MEMORY_RUN *)0x38;

+    *(undefined8 *)register0x00000020 = 0x14002dd8c;

+    in_RAX = SC_ENV::Allocate(0x38,uVar8,'\0',0);

+    register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);

+    unaff_RDI = in_RAX;

+  } while (in_RAX != (_KSR_MEMORY_RUN *)0x0);

+  uVar8 = 0xc000009a;

+  unaff_RDI = p_Var10;

+  p_Var10 = p_Var11;

+  register0x00000020 = (BADSPACEBASE *)puVar12;

+LAB_1:

+  if ((unaff_RSI != (_KSR_MEMORY_RUN *)0x0) && (unaff_RSI != (_KSR_MEMORY_RUN *)(unaff_RBP + -0x28))

+     ) {

+    p_Var10 = (_KSR_MEMORY_RUN *)0x0;

+    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002de8f;

+    ExFreePoolWithTag();

+    unaff_RDI = unaff_RSI;

+  }

+  if ((int)uVar8 < 0) {

+LAB_2:

+    if ((Microsoft_Windows_StorageSpaces_DriverEnableBits & 0x10) != 0) {

+      *(uint *)((longlong)register0x00000020 + 0x20) = uVar8;

+      *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002dead;

+      McTemplateK0xq_EtwWriteTransfer(unaff_RDI,p_Var10,p_Var13,unaff_R14);

+    }

+  }

+  *(undefined8 *)((longlong)register0x00000020 + -8) = 0x14002debb;

+  return (ushort *)0x0;

+}

+
```

## `SDB_DRIVE::operator_new`  (modified)

```diff
--- SDB_DRIVE::operator_new
+++ SS_STORE::operator_new
@@ -1,12 +1,12 @@
 

-/* public: static void * __ptr64 __cdecl SDB_DRIVE::operator new(unsigned __int64) */

+/* public: static void * __ptr64 __cdecl SS_STORE::operator new(unsigned __int64) */

 

-void * __cdecl SDB_DRIVE::operator_new(__uint64 param_1)

+void * __cdecl SS_STORE::operator_new(__uint64 param_1)

 

 {

   void *pvVar1;

   

-  pvVar1 = SC_ENV::Allocate(0x100,0x64427053,'\x01',0);

+  pvVar1 = SC_ENV::Allocate(0x150,0x73537053,'\0',0);

   return pvVar1;

 }
```

## `SP_PRM::Notify`  (modified)

```diff
--- SP_PRM::Notify
+++ SP_PRM::SendMessage
@@ -1,85 +1,96 @@
 

-/* public: long __cdecl SP_PRM::Notify(struct _GUID,struct _GUID,enum _PRM_NOTIFICATION_TYPE,class

-   SP_DRIVE * __ptr64) __ptr64 */

+/* public: long __cdecl SP_PRM::SendMessage(struct _SP_NOTIFICATION_INFO * __ptr64,void * __ptr64)

+   __ptr64 */

 

-long __thiscall

-SP_PRM::Notify(undefined8 param_1,undefined8 *param_2,_GUID *param_3,int param_4,longlong param_5)

+long __thiscall SP_PRM::SendMessage(SP_PRM *this,_SP_NOTIFICATION_INFO *param_1,void *param_2)

 

 {

-  undefined8 uVar1;

-  SDB_POOL_CONFIG *this;

+  int iVar1;

   undefined8 uVar2;

   undefined8 uVar3;

   undefined8 uVar4;

+  _STORAGE_IDENTIFIER *_Src;

   _LIST_ENTRY *p_Var5;

-  SDB_RECORD *this_00;

-  SDB_OBJECT *pSVar6;

+  longlong lVar6;

+  uint uVar7;

+  _STORAGE_IDENTIFIER *p_Var8;

+  long lVar9;

   

-  if (param_4 == 1) {

-LAB_0:

-    if (*(char *)(param_5 + 0x22f) != '\0') {

+  _Src = (_STORAGE_IDENTIFIER *)0x0;

+  lVar9 = 0;

+  p_Var8 = (_STORAGE_IDENTIFIER *)0x0;

+  lVar6 = *(longlong *)param_1 - *(longlong *)(SpControlExt + 0x168);

+  if (lVar6 == 0) {

+    lVar6 = *(longlong *)(param_1 + 8) - *(longlong *)(SpControlExt + 0x170);

+  }

+  if (lVar6 == 0) {

+    return 0;

+  }

+  iVar1 = *(int *)(param_1 + 0x20);

+  uVar7 = 0x58;

+  if (10 < iVar1) {

+    _Src = p_Var8;

+    if ((((iVar1 != 0xb) && (iVar1 != 0xc)) && (iVar1 != 0xd)) &&

+       ((iVar1 != 0xe && (iVar1 != 0x12)))) {

+      return 0;

+    }

+    goto LAB_0;

+  }

+  if ((iVar1 == 10) || (iVar1 == 1)) {

+LAB_1:

+    if ((*(uint *)(param_1 + 0x24) & 0x10) == 0) {

       return 0;

     }

   }

   else {

-    if ((param_4 != 2) && (param_4 != 3)) {

-      if (param_4 == 4) goto LAB_0;

-      if (param_4 != 5) {

-        return -0x3ffffff3;

+    if (iVar1 != 2) {

+      if (iVar1 == 3) {

+        return 0;

+      }

+      if (iVar1 == 7) goto LAB_1;

+      if (iVar1 != 8) {

+        return 0;

       }

     }

-    if (*(char *)(param_5 + 0x22f) == '\0') {

+    if (*(_STORAGE_DEVICE_ID_DESCRIPTOR **)((longlong)param_2 + 0xb8) ==

+        (_STORAGE_DEVICE_ID_DESCRIPTOR *)0x0) {

       return 0;

     }

+    _Src = SpFindStorageId(*(_STORAGE_DEVICE_ID_DESCRIPTOR **)((longlong)param_2 + 0xb8));

+    if (_Src == (_STORAGE_IDENTIFIER *)0x0) {

+      return 0;

+    }

+    uVar7 = *(ushort *)(_Src + 10) + 0x40;

   }

-  p_Var5 = SC_ENV::Allocate(0x58,0x6d507053,'\0',0);

+LAB_0:

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x400) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x29])

+     ) {

+    WPP_SF_L_guid__guid_

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0xf,param_2,iVar1,param_1 + 0x10,param_1);

+  }

+  p_Var5 = SC_ENV::Allocate((ulonglong)uVar7,0x6d507053,'\0',0);

   if (p_Var5 == (_LIST_ENTRY *)0x0) {

-    return -0x3fffff66;

-  }

-  uVar1 = *(undefined8 *)(param_5 + 0x280);

-  *(_LIST_ENTRY **)(p_Var5 + 8) = p_Var5;

-  *(_LIST_ENTRY **)p_Var5 = p_Var5;

-  *(undefined4 *)(p_Var5 + 0x10) = 1;

-  ObfReferenceObject(uVar1);

-  uVar1 = *param_2;

-  uVar2 = param_2[1];

-  uVar3 = *(undefined8 *)param_3;

-  uVar4 = *(undefined8 *)(param_3 + 8);

-  *(undefined8 *)(p_Var5 + 0x18) = *(undefined8 *)(param_5 + 0x280);

-  *(undefined8 *)(p_Var5 + 0x20) = uVar1;

-  *(undefined8 *)(p_Var5 + 0x28) = uVar2;

-  *(int *)(p_Var5 + 0x40) = param_4;

-  *(undefined8 *)(p_Var5 + 0x30) = uVar3;

-  *(undefined8 *)(p_Var5 + 0x38) = uVar4;

-  if (*(int *)(param_5 + 0x228) == 0) {

-    *(ulonglong *)(p_Var5 + 0x48) = *(ulonglong *)(p_Var5 + 0x48) | 1;

-  }

-  this = *(SDB_POOL_CONFIG **)(*(longlong *)(param_5 + 600) + 0x30);

-  if ((this == (SDB_POOL_CONFIG *)0x0) ||

-     (((this_00 = SDB_POOL_CONFIG::FindDriveById(this,param_3), this_00 != (SDB_RECORD *)0x0 &&

-       (pSVar6 = SDB_RECORD::GetObject(this_00), pSVar6 != (SDB_OBJECT *)0x0)) &&

-      (((byte)pSVar6[0x40] & 2) != 0)))) {

-    *(ulonglong *)(p_Var5 + 0x48) = *(ulonglong *)(p_Var5 + 0x48) | 2;

-  }

-  if (param_4 == 1) {

-LAB_1:

-    if (*(char *)(param_5 + 0x188) == '\0') {

-      *(undefined4 *)(param_5 + 0x228) = 1;

-    }

-    *(undefined1 *)(param_5 + 0x22f) = 1;

+    lVar9 = -0x3fffff66;

   }

   else {

-    if (param_4 != 2) {

-      if (param_4 == 4) goto LAB_1;

-      if (param_4 != 5) goto LAB_2;

+    *(_LIST_ENTRY **)(p_Var5 + 8) = p_Var5;

+    *(_LIST_ENTRY **)p_Var5 = p_Var5;

+    *(undefined4 *)(p_Var5 + 0x10) = 2;

+    *(uint *)(p_Var5 + 0x18) = uVar7 - 0x18;

+    *(undefined4 *)(p_Var5 + 0x3c) = *(undefined4 *)(param_1 + 0x20);

+    uVar2 = *(undefined8 *)(param_1 + 8);

+    uVar3 = *(undefined8 *)(param_1 + 0x10);

+    uVar4 = *(undefined8 *)(param_1 + 0x18);

+    *(undefined8 *)(p_Var5 + 0x1c) = *(undefined8 *)param_1;

+    *(undefined8 *)(p_Var5 + 0x24) = uVar2;

+    *(undefined8 *)(p_Var5 + 0x2c) = uVar3;

+    *(undefined8 *)(p_Var5 + 0x34) = uVar4;

+    if (_Src != (_STORAGE_IDENTIFIER *)0x0) {

+      memmove(p_Var5 + 0x40,_Src,(ulonglong)*(ushort *)(_Src + 10));

     }

-    if (*(char *)(param_5 + 0x188) == '\0') {

-      *(undefined4 *)(param_5 + 0x228) = 0;

-    }

-    *(undefined1 *)(param_5 + 0x22f) = 0;

+    SP_WORKITEM::Insert((SP_WORKITEM *)(SpControlExt + 0x7e8),p_Var5,0,'\0');

   }

-LAB_2:

-  SP_WORKITEM::Insert((SP_WORKITEM *)(SpControlExt + 0x7e8),p_Var5,0,'\0');

-  return 0;

+  return lVar9;

 }
```

## `SIO_SPACE::operator_new`  (modified)

```diff
--- SIO_SPACE::operator_new
+++ SIO_SPACE::operator_new
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::operator_new : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SIO_SPACE::operator new(unsigned __int64) */

+

+void * __cdecl SIO_SPACE::operator_new(__uint64 param_1)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(param_1,0x73497053,'\0',0);

+  return pvVar1;

+}

+
```

## `SIO_SPACE::LoadDiagnostics`  (modified)

```diff
--- SIO_SPACE::LoadDiagnostics
+++ SIO_SPACE::LoadDiagnostics
@@ -1,2 +1,12 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::LoadDiagnostics : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void __cdecl SIO_SPACE::LoadDiagnostics(void) */

+

+void __cdecl SIO_SPACE::LoadDiagnostics(void)

+

+{

+  if (_Diagnostics == (SIO_SPACE_DIAGNOSTICS *)0x0) {

+    _Diagnostics = SC_ENV::Allocate(0x10,0x58587053,'\0',0);

+  }

+  return;

+}

+
```

## `SC_DISK::ReadPartitionTableControl`  (modified)

```diff
--- SC_DISK::ReadPartitionTableControl
+++ SC_DISK::ReadPartitionTableControl
@@ -1,2 +1,33 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_DISK::ReadPartitionTableControl : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SC_DISK::ReadPartitionTableControl(class SC_DISK_LAYOUT * __ptr64 * __ptr64)

+   __ptr64 */

+

+long __thiscall SC_DISK::ReadPartitionTableControl(SC_DISK *this,SC_DISK_LAYOUT **param_1)

+

+{

+  int iVar1;

+  SC_DISK_LAYOUT *this_00;

+  __uint64 _Var2;

+  

+  *param_1 = (SC_DISK_LAYOUT *)0x0;

+  _Var2 = 0x1000;

+  while( true ) {

+    this_00 = SC_ENV::Allocate(_Var2,0x58587053,'\0',1);

+    if (this_00 == (SC_DISK_LAYOUT *)0x0) {

+      return -0x3fffff66;

+    }

+    iVar1 = (**(code **)(*(longlong *)this + 0x10))(this,0x70050,0,0,this_00,(int)_Var2);

+    if (-1 < iVar1) break;

+    if (iVar1 != -0x3fffffdd) {

+      ExFreePoolWithTag(this_00,0);

+      return iVar1;

+    }

+    _Var2 = (__uint64)(uint)((int)_Var2 * 2);

+    ExFreePoolWithTag();

+  }

+  SC_DISK_LAYOUT::Sort(this_00);

+  *param_1 = this_00;

+  return iVar1;

+}

+
```

## `SIO_RAID5::Initialize`  (modified)

```diff
--- SIO_RAID5::Initialize
+++ SIO_RAID5::Initialize
@@ -1,2 +1,119 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID5::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: virtual long __cdecl SIO_RAID5::Initialize(class SDB_SPACE * __ptr64,unsigned

+   __int64,class SIO_SPACE * __ptr64,class SIO_TIER * __ptr64) __ptr64 */

+

+long __thiscall

+SIO_RAID5::Initialize

+          (SIO_RAID5 *this,SDB_SPACE *param_1,__uint64 param_2,SIO_SPACE *param_3,SIO_TIER *param_4)

+

+{

+  uint uVar1;

+  longlong *plVar2;

+  long lVar3;

+  SC_PACKET *pSVar4;

+  longlong lVar5;

+  undefined8 *puVar6;

+  SP_RESILIENCY_INFO *pSVar7;

+  void *pvVar8;

+  _SP_PROVISIONING_INFO *p_Var9;

+  ulonglong uVar10;

+  SC_PACKET local_108 [76];

+  uint local_bc;

+  SC_BUFFER local_98 [8];

+  longlong local_90;

+  undefined8 local_80;

+  uint local_78;

+  undefined4 local_74;

+  int local_6c;

+  undefined1 local_60;

+  undefined1 local_5e;

+  SIO_RAID5 *local_28;

+  SIO_RAID5 *local_20;

+  

+  SC_PACKET::SC_PACKET(local_108);

+  lVar3 = SIO_RAID::Initialize((SIO_RAID *)this,param_1,param_2,param_3,param_4);

+  if (lVar3 < 0) goto LAB_0;

+  *(uint *)(*(longlong *)(this + 8) + 0x2c) = *(uint *)(*(longlong *)(this + 8) + 0x2c) | 4;

+  if (*(longlong *)(*(longlong *)(this + 8) + 0x3e0) == 0) {

+    pSVar4 = SC_PACKET::operator_new(0xf0);

+    if (pSVar4 != (SC_PACKET *)0x0) {

+      lVar5 = SC_PACKET::SC_PACKET(pSVar4);

+      if (lVar5 != 0) {

+        *(undefined1 *)(*(longlong *)(this + 8) + 0x40c) = 1;

+        *(longlong *)(*(longlong *)(this + 8) + 0x3e0) = lVar5;

+        pSVar4 = SC_PACKET::operator_new(0xf0);

+        if (pSVar4 != (SC_PACKET *)0x0) {

+          puVar6 = (undefined8 *)SC_PACKET::SC_PACKET(pSVar4);

+          if (puVar6 != (undefined8 *)0x0) {

+            lVar3 = SC_BUFFER::Initialize

+                              ((SC_BUFFER *)(puVar6 + 0xe),3,(void *)0x0,

+                               (ulong)(1L << ((byte)this[0x2a] & 0x3f)));

+            if (-1 < lVar3) {

+              pSVar7 = SIO_RAID::Resiliency((SIO_RAID *)this);

+              pvVar8 = SC_ENV::Allocate((ulonglong)(uint)(*(int *)(pSVar7 + 0x10) << 3) + 0x18,

+                                        0x70587053,'\0',0);

+              if (pvVar8 != (void *)0x0) {

+                lVar3 = 0;

+                *(undefined1 *)(*(longlong *)(this + 8) + 0x454) = 1;

+                *(undefined8 **)(*(longlong *)(this + 8) + 0x428) = puVar6;

+                *(void **)(*(longlong *)(this + 8) + 0x448) = pvVar8;

+                *(int *)(*(longlong *)(this + 8) + 0x450) = (int)(1L << ((byte)this[0x2a] & 0x3f));

+                goto LAB_1;

+              }

+              lVar3 = -0x3fffff66;

+            }

+            (**(code **)*puVar6)(puVar6,1);

+            goto LAB_0;

+          }

+        }

+      }

+    }

+LAB_2:

+    lVar3 = -0x3fffff66;

+  }

+  else {

+LAB_1:

+    if (*(longlong *)(*(longlong *)(this + 8) + 0x98) != 0) {

+      plVar2 = *(longlong **)(*(longlong *)(*(longlong *)(this + 8) + 0x98) + 0x188);

+      lVar5 = (**(code **)(*plVar2 + 0x68))(plVar2,*(undefined8 *)(this + 0x10));

+      if (lVar5 != 0) goto LAB_0;

+    }

+    if (*(longlong *)(this + 0x40) != 0) {

+      p_Var9 = SIO_RAID::Provisioning((SIO_RAID *)this);

+      uVar10 = (*(ulonglong *)(p_Var9 + 8) >> ((byte)this[0x2a] & 0x3f)) + 0x1f >> 3 & 0xfffffffc;

+      pvVar8 = SC_ENV::Allocate(uVar10,0x64497053,'\0',0);

+      if (pvVar8 == (void *)0x0) goto LAB_2;

+      if (SpControlExt[0x1ac] != (SP_CONTROL)0x0) {

+        memset(pvVar8,-1,uVar10);

+      }

+      RtlInitializeBitMap(this + 0x50,pvVar8);

+      if (*(longlong *)(this + 0x40) != 0) goto LAB_0;

+    }

+    if ((*(char *)(*(longlong *)(param_1 + 0x10) + 0x1e) < '\0') &&

+       (*(longlong *)(this + 0x10) == 0)) {

+      uVar1 = *(uint *)(*(longlong *)(this + 8) + 0x84);

+      lVar3 = SC_BUFFER::Initialize(local_98,3,(void *)0x0,uVar1);

+      if (-1 < lVar3) {

+        uVar10 = (ulonglong)uVar1;

+        memset((void *)((ulonglong)*(uint *)(local_90 + 0x2c) + *(longlong *)(local_90 + 0x20)),0,

+               uVar10);

+        local_bc = local_bc | 0x20000008;

+        local_80 = 0;

+        local_74 = 0;

+        local_6c = (1 << ((byte)this[0x2b] & 0x1f)) + -1;

+        local_60 = 4;

+        local_5e = 6;

+        local_78 = uVar1;

+        local_28 = this;

+        local_20 = this;

+        SC_DISPATCH::Dispatch

+                  ((SC_DISPATCH *)this,local_108,(_SC_OPERATION)CONCAT71((int7)(uVar10 >> 8),10));

+      }

+    }

+  }

+LAB_0:

+  SC_PACKET::~SC_PACKET(local_108);

+  return lVar3;

+}

+
```

## `SC_FINITE_FIELD::Initialize`  (modified)

```diff
--- SC_FINITE_FIELD::Initialize
+++ SC_MATRIX::Initialize
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_FINITE_FIELD::Initialize : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SC_MATRIX::Initialize : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SDB_METADATA::Clone`  (modified)

```diff
--- SDB_METADATA::Clone
+++ SDB_SPACE::Clone
@@ -1,47 +1,2 @@
-

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

-/* public: virtual class SDB_OBJECT * __ptr64 __cdecl SDB_METADATA::Clone(void) __ptr64 */

-

-SDB_OBJECT * __thiscall SDB_METADATA::Clone(SDB_METADATA *this)

-

-{

-  int iVar1;

-  undefined8 uVar2;

-  SDB_OBJECT *pSVar3;

-  void *_Dst;

-  SDB_OBJECT *pSVar4;

-  

-  pSVar3 = SC_ENV::Allocate(0x30,0x6d427053,'\x01',0);

-  pSVar4 = (SDB_OBJECT *)0x0;

-  if (pSVar3 != (SDB_OBJECT *)0x0) {

-    *(undefined8 *)(pSVar3 + 8) = 0;

-    *(undefined8 *)(pSVar3 + 0x10) = 0;

-    *(undefined2 *)(pSVar3 + 0x18) = 0;

-    *(undefined ***)pSVar3 = &_vftable_;

-    uVar2 = *(undefined8 *)(this + 8);

-    *(undefined8 *)pSVar3 = *(undefined8 *)this;

-    *(undefined8 *)(pSVar3 + 8) = uVar2;

-    uVar2 = *(undefined8 *)(this + 0x18);

-    *(undefined8 *)(pSVar3 + 0x10) = *(undefined8 *)(this + 0x10);

-    *(undefined8 *)(pSVar3 + 0x18) = uVar2;

-    uVar2 = *(undefined8 *)(this + 0x28);

-    *(undefined8 *)(pSVar3 + 0x20) = *(undefined8 *)(this + 0x20);

-    *(undefined8 *)(pSVar3 + 0x28) = uVar2;

-    *(undefined8 *)(pSVar3 + 0x28) = 0;

-    pSVar4 = pSVar3;

-    if (*(longlong *)(this + 0x28) != 0) {

-      iVar1 = *(int *)(this + 0x20);

-      _Dst = SC_ENV::Allocate((ulonglong)(uint)(iVar1 << 4),0x6d427053,'\0',0);

-      *(void **)(pSVar3 + 0x28) = _Dst;

-      if (_Dst == (void *)0x0) {

-        (*(code *)**(undefined8 **)pSVar3)(pSVar3,1);

-        pSVar4 = (SDB_OBJECT *)0x0;

-      }

-      else {

-        memmove(_Dst,*(void **)(this + 0x28),(ulonglong)(uint)(iVar1 << 4));

-      }

-    }

-  }

-  return pSVar4;

-}

-

+Failed to decompile spaceport.sys - .ProgramDB SDB_SPACE::Clone : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `SS_STORE::Load`  (modified)

```diff
--- SS_STORE::Load
+++ SS_STORE::LogStoreLoadFailed
@@ -1,272 +1,2 @@
-

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

-/* public: long __cdecl SS_STORE::Load(struct _GUID,struct _LIST_ENTRY * __ptr64) __ptr64 */

-

-long __thiscall SS_STORE::Load(SS_STORE *this,_GUID *param_2,_LIST_ENTRY *param_3)

-

-{

-  uint uVar1;

-  longlong *plVar2;

-  longlong *plVar3;

-  code *pcVar4;

-  undefined1 auVar5 [16];

-  _LIST_ENTRY *p_Var6;

-  uchar uVar7;

-  long lVar8;

-  longlong lVar9;

-  void *pvVar10;

-  __uint64 _Var11;

-  __uint64 _Var12;

-  ulonglong uVar13;

-  undefined8 uVar14;

-  longlong *plVar15;

-  uint uVar16;

-  _GUID *p_Var17;

-  undefined1 *puVar18;

-  undefined1 *puVar19;

-  undefined1 *puVar20;

-  uchar *puVar21;

-  int iVar22;

-  ulonglong uVar23;

-  undefined8 uVar24;

-  undefined8 *puVar25;

-  undefined8 *puVar26;

-  short sVar27;

-  uchar *puVar28;

-  longlong *plVar29;

-  SS_STORE_HEADER *pSVar30;

-  undefined8 uStackY_c0;

-  undefined1 auStackY_b8 [32];

-  ulong local_78 [2];

-  __uint64 local_70;

-  uchar *local_68;

-  undefined4 uStack_60;

-  undefined4 uStack_5c;

-  _GUID *local_58;

-  longlong local_50;

-  ulonglong local_48;

-  _LIST_ENTRY *local_40;

-  

-  puVar18 = auStackY_b8;

-  puVar20 = auStackY_b8;

-  puVar21 = (uchar *)0x0;

-  local_68 = (uchar *)0x0;

-  local_48 = 0;

-  local_70 = 0;

-  local_78[0] = 0;

-  p_Var17 = param_2;

-  local_58 = param_2;

-  local_40 = param_3;

-  lVar9 = KeQueryPerformanceCounter(&local_48);

-  *(_LIST_ENTRY **)(param_3 + 8) = param_3;

-  *(_LIST_ENTRY **)param_3 = param_3;

-  local_50 = lVar9;

-  uVar7 = SC_ENV::PersistedData();

-  if (uVar7 == '\0') {

-LAB_0:

-    uVar13 = CONCAT44(0,*(uint *)(this + 0x128));

-    if (*(uint *)(this + 0x128) == 0) {

-      lVar8 = -0x3f18fff5;

-      puVar20 = auStackY_b8;

-    }

-    else {

-      auVar5._8_8_ = 0;

-      auVar5._0_8_ = uVar13;

-      _Var11 = SUB168(ZEXT816(0x40) * auVar5,0);

-      if (SUB168(ZEXT816(0x40) * auVar5,8) != 0) {

-        _Var11 = 0xffffffffffffffff;

-      }

-      pvVar10 = SC_ENV::Allocate(_Var11,0x73537053,'\0',0);

-      uVar23 = 0;

-      if (pvVar10 == (void *)0x0) {

-        lVar8 = -0x3fffff66;

-      }

-      else {

-        _vector_constructor_iterator_(pvVar10,0x40,uVar13,SS_STORE_HEADER::SS_STORE_HEADER);

-        uVar24 = 0x200;

-        lVar8 = Read(this,0,0x200,'\x01',(SS_PATH *)0x0);

-        p_Var17 = local_58;

-        puVar28 = (uchar *)0x0;

-        if (-1 < lVar8) {

-          plVar29 = *(longlong **)(this + 0x138);

-          puVar18 = auStackY_b8;

-          puVar20 = auStackY_b8;

-          if (*(int *)(this + 0x128) != 0) {

-            do {

-              puVar18 = puVar20;

-              iVar22 = (int)uVar23;

-              plVar2 = (longlong *)*plVar29;

-              if (*(char *)(plVar29[8] + 0x230) == (char)puVar28) {

-                if ((int)puVar28 <= (int)plVar29[7]) goto LAB_1;

-                plVar3 = (longlong *)plVar2[1];

-                lVar9 = *plVar3;

-                if ((*(longlong **)(lVar9 + 8) != plVar3) ||

-                   (plVar15 = (longlong *)plVar3[1], (longlong *)*plVar15 != plVar3)) {

-                  do {

-                    pcVar4 = (code *)swi(0x29);

-                    (*pcVar4)(3);

-                    puVar18 = puVar18 + 8;

-LAB_1:

-                    pSVar30 = (SS_STORE_HEADER *)(uVar23 * 0x40 + (longlong)pvVar10);

-                    uVar16 = *(uint *)(plVar29[4] + 0x2c);

-                    lVar9 = *(longlong *)(plVar29[4] + 0x20);

-                    *(undefined8 *)(puVar18 + -8) = 0x14005c451;

-                    lVar8 = SS_STORE_HEADER::Unformat

-                                      (pSVar30,(uchar *)((ulonglong)uVar16 + lVar9),(ulong)uVar24);

-                    puVar28 = (uchar *)0x0;

-                    *(undefined2 *)((longlong)plVar29 + 0x3c) = *(undefined2 *)(pSVar30 + 0x20);

-                    plVar29[5] = *(longlong *)(pSVar30 + 0x28);

-                    plVar29[6] = *(longlong *)(pSVar30 + 0x30);

-                    if (-1 < lVar8) {

-                      lVar9 = *(longlong *)p_Var17 - *(longlong *)pSVar30;

-                      if (lVar9 == 0) {

-                        lVar9 = *(longlong *)(p_Var17 + 8) - *(longlong *)(pSVar30 + 8);

-                      }

-                      if ((lVar9 == 0) && (*(short *)(pSVar30 + 0x20) != 0)) {

-                        *(undefined8 *)(puVar18 + -8) = 0x14005c49b;

-                        _Var11 = SS_STORE_HEADER::Sequence(pSVar30);

-                        if (local_70 < _Var11) {

-                          *(undefined8 *)(puVar18 + -8) = 0x14005c4a6;

-                          local_70 = SS_STORE_HEADER::Sequence(pSVar30);

-                        }

-                        goto LAB_2;

-                      }

-                    }

-                    plVar3 = (longlong *)plVar2[1];

-                    lVar9 = *plVar3;

-                  } while ((*(longlong **)(lVar9 + 8) != plVar3) ||

-                          (plVar15 = (longlong *)plVar3[1], (longlong *)*plVar15 != plVar3));

-                }

-                *plVar15 = lVar9;

-                iVar22 = iVar22 + -1;

-                *(longlong **)(lVar9 + 8) = plVar15;

-                pcVar4 = *(code **)plVar29[-1];

-                *(undefined8 *)(puVar18 + -8) = 0x14005c4f0;

-                (*pcVar4)(plVar29 + -1);

-                *(int *)(this + 0x128) = *(int *)(this + 0x128) + -1;

-                puVar28 = (uchar *)0x0;

-              }

-LAB_2:

-              uVar23 = (ulonglong)(iVar22 + 1U);

-              puVar20 = puVar18;

-              plVar29 = plVar2;

-            } while (iVar22 + 1U < *(uint *)(this + 0x128));

-          }

-          lVar8 = -0x3f18ffea;

-          puVar25 = *(undefined8 **)(this + 0x138);

-          for (uVar13 = (ulonglong)puVar28 & 0xffffffff; (uint)uVar13 < *(uint *)(this + 0x128);

-              uVar13 = (ulonglong)((uint)uVar13 + 1)) {

-            puVar26 = (undefined8 *)*puVar25;

-            if ((*(char *)(puVar25[8] + 0x230) == (char)puVar28) &&

-               (pSVar30 = (SS_STORE_HEADER *)(uVar13 * 0x40 + (longlong)pvVar10),

-               *(short *)(pSVar30 + 0x20) != 5)) {

-              *(undefined8 *)(puVar18 + -8) = 0x14005c559;

-              _Var11 = SS_STORE_HEADER::Sequence(pSVar30);

-              if (_Var11 == local_70) {

-                uVar24 = *(undefined8 *)(pSVar30 + 8);

-                *(undefined8 *)(this + 8) = *(undefined8 *)pSVar30;

-                *(undefined8 *)(this + 0x10) = uVar24;

-                uVar24 = *(undefined8 *)(pSVar30 + 0x18);

-                *(undefined8 *)(this + 0x18) = *(undefined8 *)(pSVar30 + 0x10);

-                *(undefined8 *)(this + 0x20) = uVar24;

-                uVar24 = *(undefined8 *)(pSVar30 + 0x28);

-                *(undefined8 *)(this + 0x28) = *(undefined8 *)(pSVar30 + 0x20);

-                *(undefined8 *)(this + 0x30) = uVar24;

-                uVar24 = *(undefined8 *)(pSVar30 + 0x38);

-                *(undefined8 *)(this + 0x38) = *(undefined8 *)(pSVar30 + 0x30);

-                *(undefined8 *)(this + 0x40) = uVar24;

-                *(undefined8 *)(puVar18 + -8) = 0x14005c58a;

-                Initialize(this);

-                p_Var6 = local_40;

-                *(undefined8 *)(puVar18 + -8) = 0x14005c599;

-                lVar8 = Load(this,(SS_PATH *)(puVar25 + -1),p_Var6);

-                puVar28 = (uchar *)0x0;

-                if (-1 < lVar8) {

-                  local_68 = (uchar *)(puVar25[8] + 500);

-                  goto LAB_3;

-                }

-                *(undefined2 *)(pSVar30 + 0x20) = 5;

-                *(undefined2 *)((longlong)puVar25 + 0x3c) = 5;

-              }

-            }

-            puVar25 = puVar26;

-          }

-          local_68 = puVar28;

-          puVar21 = puVar28;

-          lVar9 = local_50;

-          if (-1 < lVar8) {

-LAB_3:

-            _Var11 = local_70;

-            uVar13 = (ulonglong)puVar28 & 0xffffffff;

-            if ((uint)puVar28 < *(uint *)(this + 0x128)) {

-              uVar24 = 1;

-              puVar25 = *(undefined8 **)(this + 0x138);

-              do {

-                iVar22 = (int)uVar13;

-                puVar26 = (undefined8 *)*puVar25;

-                if (*(char *)(puVar25[8] + 0x230) == (char)puVar28) {

-                  pSVar30 = (SS_STORE_HEADER *)(uVar13 * 0x40 + (longlong)pvVar10);

-                  sVar27 = *(short *)(pSVar30 + 0x20);

-                  if (sVar27 != 5) {

-                    *(undefined8 *)(puVar18 + -8) = 0x14005c62a;

-                    _Var12 = SS_STORE_HEADER::Sequence(pSVar30);

-                    if ((_Var12 == _Var11) && (sVar27 == (short)uVar24)) {

-                      *(uint *)(puVar25 + 2) = *(uint *)(puVar25 + 2) | (uint)uVar24;

-                    }

-                  }

-                  puVar28 = (uchar *)0x0;

-                }

-                uVar16 = iVar22 + (int)uVar24;

-                uVar13 = (ulonglong)uVar16;

-                puVar25 = puVar26;

-              } while (uVar16 < *(uint *)(this + 0x128));

-            }

-            puVar21 = local_68;

-            *(undefined8 *)(puVar18 + -8) = 0x14005c655;

-            lVar9 = KeQueryPerformanceCounter(0);

-            lVar9 = lVar9 - local_50;

-          }

-        }

-        *(undefined8 *)(puVar18 + -8) = 0x14005c673;

-        ExFreePoolWithTag(pvVar10);

-        puVar19 = puVar18;

-        puVar20 = puVar18;

-        if (-1 < lVar8) goto LAB_4;

-      }

-    }

-    *(undefined8 *)(puVar20 + -8) = 0x14005c6e3;

-    LogStoreLoadFailed(this,lVar8);

-  }

-  else {

-    lVar8 = SC_ENV::GetPd(param_2,(SC_PD_TYPE)CONCAT71((int7)((ulonglong)p_Var17 >> 8),3),&local_68,

-                          local_78);

-    if ((lVar8 < 0) ||

-       (lVar8 = Load(this,local_68,local_78[0],param_3), puVar19 = auStackY_b8, lVar8 < 0)) {

-      local_68 = *(uchar **)param_2;

-      uStack_60 = *(undefined4 *)(param_2 + 8);

-      uStack_5c = *(undefined4 *)(param_2 + 0xc);

-      if (lVar8 == -0x3f18ffdf) {

-        SC_ENV::EventWrite(0x200,&local_68);

-      }

-      else {

-        SC_ENV::EventWrite(0x1fd,&local_68);

-      }

-      goto LAB_0;

-    }

-LAB_4:

-    uVar24 = *(undefined8 *)(this + 0x38);

-    uVar16 = *(uint *)(this + 0x128);

-    uVar1 = *(uint *)(this + 300);

-    uVar13 = (ulonglong)(lVar9 * 1000000) / local_48;

-    pcVar4 = *(code **)(*(longlong *)this + 0x10);

-    *(undefined8 *)(puVar19 + -8) = 0x14005c6ae;

-    uVar14 = (*pcVar4)(this);

-    *(ulonglong *)(puVar19 + 0x30) = uVar13;

-    *(uchar **)(puVar19 + 0x28) = puVar21;

-    *(undefined8 *)(puVar19 + 0x20) = uVar24;

-    *(undefined8 *)(puVar19 + -8) = 0x14005c6d0;

-    SC_ENV::EventWrite(0x44c,uVar14,(ulonglong)uVar1,(ulonglong)uVar16);

-  }

-  return lVar8;

-}

-

+Failed to decompile spaceport.sys - .ProgramDB SS_STORE::LogStoreLoadFailed : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `SC_ENV_ALLOCATOR::operator_new[]`  (modified)

```diff
--- SC_ENV_ALLOCATOR::operator_new[]
+++ SC_ENV_ALLOCATOR::operator_new[]
@@ -1,2 +1,13 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_ENV_ALLOCATOR::operator_new[] : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static void * __ptr64 __cdecl SC_ENV_ALLOCATOR::operator new[](unsigned __int64,unsigned

+   long,unsigned char) */

+

+void * __cdecl SC_ENV_ALLOCATOR::operator_new__(__uint64 param_1,ulong param_2,uchar param_3)

+

+{

+  void *pvVar1;

+  

+  pvVar1 = SC_ENV::Allocate(param_1,param_2,param_3,0);

+  return pvVar1;

+}

+
```

## `SIO_SPACE::Allocate`  (modified)

```diff
--- SIO_SPACE::Allocate
+++ SIO_SPACE::Allocate
@@ -1,2 +1,17 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_SPACE::Allocate : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual class SIO_SPACE * __ptr64 __cdecl SIO_SPACE::Allocate(void) __ptr64 */

+

+SIO_SPACE * __thiscall SIO_SPACE::Allocate(SIO_SPACE *this)

+

+{

+  SIO_SPACE *this_00;

+  SIO_SPACE *pSVar1;

+  

+  this_00 = SC_ENV::Allocate(0x470,0x73497053,'\0',0);

+  pSVar1 = (SIO_SPACE *)0x0;

+  if (this_00 != (SIO_SPACE *)0x0) {

+    pSVar1 = (SIO_SPACE *)SIO_SPACE(this_00);

+  }

+  return pSVar1;

+}

+
```

## `SIO_RAID1::DrtSet`  (modified)

```diff
--- SIO_RAID1::DrtSet
+++ SIO_RAID1::DrtSet
@@ -1,2 +1,31 @@
-Failed to decompile spaceport.sys - .ProgramDB SIO_RAID1::DrtSet : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SIO_RAID1::DrtSet(void) __ptr64 */

+

+long __thiscall SIO_RAID1::DrtSet(SIO_RAID1 *this)

+

+{

+  undefined1 uVar1;

+  void *pvVar2;

+  long lVar3;

+  ulonglong uVar4;

+  

+  lVar3 = 0;

+  if (((uint)((ulonglong)*(undefined8 *)(this + 0x48) >> 0x20) & 0xe0000000) == 0x80000000) {

+    lVar3 = -0x3ffffddb;

+  }

+  else {

+    UpdateDrt(this,*(undefined8 *)(this + 0x48));

+    if (SpControlExt[0x1e5] != (SP_CONTROL)0x0) {

+      uVar4 = *(ulonglong *)(*(longlong *)(this + 8) + 0x78) >> 0xc;

+      pvVar2 = SC_ENV::Allocate((ulonglong)((int)uVar4 + 0x1fU >> 3 & 0x1ffffffc),0x64497053,'\0',0)

+      ;

+      uVar1 = ExAcquireSpinLockExclusive(this + 0x18);

+      if (pvVar2 != (void *)0x0) {

+        RtlInitializeBitMap(this + 0x50,pvVar2,uVar4 & 0xffffffff);

+      }

+      ExReleaseSpinLockExclusive(this + 0x18,uVar1);

+    }

+  }

+  return lVar3;

+}

+
```

## `SDB_DRIVE::operator_new[]`  (modified)

```diff
--- SDB_DRIVE::operator_new[]
+++ SDB_TIER::AppendRegion
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_DRIVE::operator_new[] : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SDB_TIER::AppendRegion : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `SS_STORE::AllocateBlock`  (modified)

```diff
--- SS_STORE::AllocateBlock
+++ SpStringCchCopyHelper
@@ -1,2 +1,10 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE::AllocateBlock : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Control flow encountered bad instruction data */

+

+long __cdecl SpStringCchCopyHelper(ushort *param_1,ulong param_2,ushort **param_3)

+

+{

+                    /* WARNING: Bad instruction - Truncating control flow here */

+  halt_baddata();

+}

+
```

## `SS_STORE::AddPath`  (modified)

```diff
--- SS_STORE::AddPath
+++ SS_STORE::AddPath
@@ -1,2 +1,55 @@
-Failed to decompile spaceport.sys - .ProgramDB SS_STORE::AddPath : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl SS_STORE::AddPath(class SC_DRIVE * __ptr64,unsigned __int64,class SDB_PATH *

+   __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+SS_STORE::AddPath(SS_STORE *this,SC_DRIVE *param_1,__uint64 param_2,SDB_PATH **param_3)

+

+{

+  code *pcVar1;

+  long lVar2;

+  SDB_PATH *this_00;

+  SDB_PATH *pSVar3;

+  SS_STORE *pSVar4;

+  longlong *plVar5;

+  

+  if (param_3 != (SDB_PATH **)0x0) {

+    *param_3 = (SDB_PATH *)0x0;

+  }

+  this_00 = SC_ENV::Allocate(0x58,0x74427053,'\0',0);

+  if (this_00 == (SDB_PATH *)0x0) {

+    lVar2 = -0x3fffff66;

+  }

+  else {

+    *(undefined4 *)(this_00 + 0x20) = 0;

+    pSVar3 = this_00 + 8;

+    *(undefined8 *)(this_00 + 0x28) = 0;

+    *(SDB_PATH **)(this_00 + 0x10) = pSVar3;

+    *(SDB_PATH **)pSVar3 = pSVar3;

+    *(undefined4 *)(this_00 + 0x18) = 0;

+    *(undefined8 *)(this_00 + 0x48) = 0;

+    *(undefined8 *)(this_00 + 0x50) = 0;

+    *(undefined ***)this_00 = &SDB_PATH::_vftable_;

+    lVar2 = SDB_PATH::Initialize(this_00,param_1,param_2);

+    if (-1 < lVar2) {

+      pSVar4 = this + 0x138;

+      plVar5 = *(longlong **)(this + 0x140);

+      pSVar3 = this_00 + 8;

+      if ((SS_STORE *)*plVar5 != pSVar4) {

+        pSVar3 = (SDB_PATH *)0x3;

+        pcVar1 = (code *)swi(0x29);

+        lVar2 = (*pcVar1)();

+      }

+      *(SS_STORE **)pSVar3 = pSVar4;

+      *(longlong **)(pSVar3 + 8) = plVar5;

+      *plVar5 = (longlong)pSVar3;

+      *(SDB_PATH **)(pSVar4 + 8) = pSVar3;

+      *(int *)(this + 0x128) = *(int *)(this + 0x128) + 1;

+      if (param_3 != (SDB_PATH **)0x0) {

+        *param_3 = this_00;

+      }

+    }

+  }

+  return lVar2;

+}

+
```

## `SDB_CONFIG::Create`  (modified)

```diff
--- SDB_CONFIG::Create
+++ SDB_CONFIG::Create
@@ -1,2 +1,53 @@
-Failed to decompile spaceport.sys - .ProgramDB SDB_CONFIG::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl SDB_CONFIG::Create(enum _SC_VERSION,struct _GUID,unsigned long) __ptr64 */

+

+long __thiscall

+SDB_CONFIG::Create(SDB_CONFIG *this,undefined4 param_1,undefined8 *param_3,uint param_4)

+

+{

+  undefined8 uVar1;

+  undefined8 uVar2;

+  long lVar3;

+  SS_STORE *pSVar4;

+  

+  *(undefined4 *)(this + 0x30) = param_1;

+  pSVar4 = SC_ENV::Allocate(0x150,0x73537053,'\0',0);

+  if ((pSVar4 != (SS_STORE *)0x0) &&

+     (pSVar4 = (SS_STORE *)SS_STORE::SS_STORE(pSVar4), pSVar4 != (SS_STORE *)0x0)) {

+    uVar1 = *param_3;

+    uVar2 = param_3[1];

+    *(undefined2 *)(pSVar4 + 0x28) = 1;

+    *(undefined8 *)(pSVar4 + 8) = uVar1;

+    *(undefined8 *)(pSVar4 + 0x10) = uVar2;

+    *(undefined4 *)(pSVar4 + 0x1c) = 0x40;

+    *(uint *)(pSVar4 + 0x18) = param_4 >> 6;

+    *(undefined4 *)(pSVar4 + 0x20) = 8;

+    if ((param_4 >> 6) << 6 == param_4) {

+      lVar3 = SS_STORE::Initialize(pSVar4);

+      if (-1 < lVar3) {

+        *(SS_STORE **)(this + 8) = pSVar4;

+        lVar3 = SC_SPARSE::Initialize

+                          ((SC_SPARSE *)(this + 0x70),

+                           (ulonglong)

+                           ((uint)(*(int *)(pSVar4 + 0x18) * *(int *)(pSVar4 + 0x1c)) >> 6));

+        if (lVar3 < 0) {

+          return lVar3;

+        }

+        lVar3 = SC_SPARSE::Initialize

+                          ((SC_SPARSE *)(this + 0xc0),

+                           (ulonglong)

+                           ((uint)(*(int *)(*(longlong *)(this + 8) + 0x1c) *

+                                  *(int *)(*(longlong *)(this + 8) + 0x18)) >> 6));

+        return lVar3;

+      }

+    }

+    else {

+      lVar3 = -0x3ffffff3;

+    }

+    (*(code *)**(undefined8 **)pSVar4)(pSVar4,1);

+    return lVar3;

+  }

+  return -0x3fffff66;

+}

+
```

## `SC_ENV_ALLOCATOR::operator_new[]`  (modified)

```diff
--- SC_ENV_ALLOCATOR::operator_new[]
+++ SS_STORE::GetRecord
@@ -1,2 +1,2 @@
-Failed to decompile spaceport.sys - .ProgramDB SC_ENV_ALLOCATOR::operator_new[] : Error: Decompile error: 
+Failed to decompile spaceport.sys - .ProgramDB SS_STORE::GetRecord : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `NTOSKRNL.EXE::ExAllocatePool2`  (modified)

```diff
--- NTOSKRNL.EXE::ExAllocatePool2 calling
+++ NTOSKRNL.EXE::ExAllocatePool2 calling
@@ -1,2 +0,0 @@
-FUN_14001aa31
-LogCoreWriteDataRecord
@@ -7 +5 @@
-SC_DISK::UpdateFirmwareInfo
+SC_ENV::Allocate
@@ -9,3 +6,0 @@
-SC_ENV_ALLOCATOR::operator_new
-SC_ENV_ALLOCATOR::operator_new[]
-SC_PICK_CONTEXT::Reinitialize
@@ -13,11 +7,0 @@
-SC_SPARSE::Copy
-SC_SPARSE::SetObject
-SC_SPARSE::operator_new
-SDB_COLUMN::operator_new
-SDB_CONFIG::Create
-SDB_DRIVE::Clone
-SDB_DRIVE::operator_new
-SDB_EXTENT::Clone
-SDB_EXTENT::operator_new
-SDB_POOL_CONFIG::CreateExtent
-SDB_POOL_CONFIG::PickDrive
@@ -26 +9,0 @@
-SIO_RAID::Initialize
@@ -30,4 +12,0 @@
-SS_RECORD::operator_new
-SS_STORE::GetRecord
-SS_STORE::UnformatRecords
-SS_STORE::operator_new
```
