# CVE-2026-62790 — srv2.sys patch diff

`srv2.sys` 10.0.26100.8875 -> 10.0.26100.9168 (ghidriff).

## `Smb2ReadHashFileV2`  (modified)

```diff
--- Smb2ReadHashFileV2
+++ Smb2ReadHashFileV2
@@ -1,46 +1,171 @@
 

-int Smb2ReadHashFileV2(longlong *param_1,longlong *param_2)

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

+

+int Smb2ReadHashFileV2(longlong *param_1,undefined8 param_2)

 

 {

-  uint in_EAX;

-  int iVar1;

-  ulonglong uVar2;

-  longlong *plVar3;

-  longlong unaff_RBP;

-  longlong unaff_RSI;

-  ulonglong *unaff_RDI;

-  ushort *in_R8;

-  ulonglong *in_R9;

-  undefined2 unaff_R14W;

-  bool in_ZF;

+  ushort uVar1;

+  uint uVar2;

+  uint uVar3;

+  longlong lVar4;

+  longlong lVar5;

+  int iVar6;

+  undefined8 uVar7;

+  ulonglong uVar8;

+  undefined **ppuVar9;

+  undefined **ppuVar10;

+  size_t _Size;

+  uint uVar11;

+  undefined **_Dst;

+  undefined1 auStackY_108 [32];

+  undefined8 in_stack_ffffffffffffff38;

+  undefined4 local_a8 [2];

+  longlong local_a0;

+  undefined8 local_98;

+  undefined **local_90;

+  longlong local_88;

+  longlong local_80;

+  longlong local_78;

+  undefined *local_70;

+  undefined8 uStack_68;

+  undefined8 local_60;

+  undefined8 uStack_58;

+  undefined8 local_50;

+  ulonglong local_48;

   

-  if (in_ZF) {

-    if ((uint)param_2 <= in_EAX) {

-      in_EAX = (uint)param_2;

-    }

-    if (in_EAX == 0x28) {

-      plVar3 = *(longlong **)(*(longlong *)(unaff_RSI + 0x48) + 0x58);

-      iVar1 = Smb2GenerateV2HashHeader(unaff_RDI,plVar3,in_R8,in_R9);

-      goto LAB_0;

+  local_48 = __security_cookie ^ (ulonglong)auStackY_108;

+  lVar4 = param_1[0x46];

+  local_a0 = 0;

+  local_a8[0] = 0;

+  local_98 = param_2;

+  uVar7 = IoGetRelatedDeviceObject(*(undefined8 *)(*(longlong *)(lVar4 + 0x48) + 0x60));

+  local_50 = 0;

+  local_70 = (undefined *)0x0;

+  uStack_68 = 0;

+  local_60 = 0;

+  uStack_58 = 0;

+  Smb2ReferenceClient(param_1);

+  local_78 = IoAllocateWorkItem(uVar7);

+  ppuVar9 = &WPP_GLOBAL_Control;

+  if (local_78 == 0) {

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

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

+       (WPP_GLOBAL_Control[0x29] != '\0')) {

+      ppuVar9 = (undefined **)0x24;

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x24,

+              &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids);

     }

   }

-  in_R8 = (ushort *)(unaff_RBP + -0x10);

-  plVar3 = *(longlong **)(*(longlong *)(unaff_RSI + 0x48) + 0x58);

-  uVar2 = Smb2ReadHashFromDeDupe((longlong *)unaff_RDI,plVar3,in_R8);

-  iVar1 = (int)uVar2;

+  else {

+    *(longlong *)(lVar4 + 0x148) = local_78;

+    uVar11 = *(int *)(lVar4 + 0xc0) - 0x18;

+    local_80 = *(longlong *)(lVar4 + 0xd0);

+    *(undefined8 *)(lVar4 + 0x150) = 0;

+    *(undefined8 *)(lVar4 + 0x158) = 0;

+    *(undefined1 *)(lVar4 + 0x160) = 0;

+    *(undefined8 *)(lVar4 + 0x168) = param_2;

+    lVar5 = *(longlong *)(local_80 + 0x10);

+    uVar2 = *(uint *)(local_80 + 0xc);

+    lVar4 = *(longlong *)(lVar4 + 0xd8);

+    _Dst = (undefined **)(lVar4 + 0x18);

+    local_88 = lVar4;

+    uVar8 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

+    ppuVar10 = &local_70;

+    if ((int)uVar8 == 0) {

+      ppuVar10 = _Dst;

+    }

+    iVar6 = Smb2ReadFile(param_2,ppuVar10,0x28,&local_a0,local_a8);

+    if (iVar6 < 0) {

+      ppuVar9 = ppuVar10;

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

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

+         (WPP_GLOBAL_Control[0x29] != '\0')) {

+        ppuVar9 = (undefined **)0x25;

 LAB_0:

-  if (*(longlong *)(unaff_RBP + -8) != 0) {

-    plVar3 = (longlong *)0x0;

-    ExFreePoolWithTag();

-    *(undefined2 *)(unaff_RBP + -0x10) = unaff_R14W;

+        uVar7 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+LAB_1:

+        WPP_SF_qL(uVar7,(short)ppuVar9,&WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,param_1);

+      }

+    }

+    else {

+      uVar8 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

+      uVar3 = uStack_58._4_4_;

+      if ((int)uVar8 == 0) {

+        uVar3 = *(uint *)(lVar4 + 0x34);

+      }

+      ppuVar9 = (undefined **)(ulonglong)uVar3;

+      if (lVar5 == 0) {

+        local_a0 = 0x24;

+        uVar8 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

+        uVar1 = local_50._2_2_;

+        if ((int)uVar8 == 0) {

+          uVar1 = *(ushort *)(lVar4 + 0x3a);

+        }

+        local_90 = (undefined **)(local_a0 + (longlong)_Dst);

+        uVar8 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

+        if ((int)uVar8 != 0) {

+          _Size = (size_t)uVar11;

+          if (0x27 < uVar11) {

+            _Size = 0x28;

+          }

+          ppuVar10 = &local_70;

+          memmove(_Dst,ppuVar10,_Size);

+        }

+        if (((longlong)((ulonglong)uVar1 + local_a0) < (longlong)(ulonglong)uVar11) &&

+           (ppuVar9 < (undefined **)(ulonglong)uVar11)) {

+          ppuVar10 = local_90;

+          iVar6 = Smb2ReadFile(local_98,local_90,(uint)uVar1,&local_a0,local_a8);

+          if (-1 < iVar6) {

+            *(undefined4 *)(lVar4 + 0x30) = 0;

+            _Dst = (undefined **)((longlong)_Dst + (longlong)ppuVar9);

+            uVar11 = uVar11 - uVar3;

+            *(uint *)(local_88 + 0x10) = uVar3;

+            goto LAB_2;

+          }

+          ppuVar9 = ppuVar10;

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

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

+             (WPP_GLOBAL_Control[0x29] != '\0')) {

+            uVar7 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+            ppuVar9 = (undefined **)0x27;

+            goto LAB_1;

+          }

+        }

+        else {

+          if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) goto LAB_3;

+          ppuVar9 = ppuVar10;

+          if (((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20000000) != 0) &&

+             (WPP_GLOBAL_Control[0x29] != '\0')) {

+            ppuVar9 = (undefined **)0x26;

+            goto LAB_0;

+          }

+        }

+      }

+      else {

+LAB_2:

+        uVar7 = PeerDistRetrieveHashBlobFromHashFile

+                          (local_98,ppuVar9,(uint)*(byte *)(local_80 + 4) << 8,lVar5,

+                           (ulonglong)uVar2,uVar11,(longlong)_Dst,(longlong)param_1,

+                           in_stack_ffffffffffffff38,(longlong)param_1);

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

+          return (int)uVar7;

+        }

+      }

+    }

   }

-  if (iVar1 < 0) {

-    if (*(longlong *)(unaff_RBP + 0x28) != 0) {

-      ZwClose();

-    }

-    *(int *)(unaff_RDI[0xf] + 0x30) = iVar1;

-    Smb2CompleteRetrieveHashData(unaff_RDI,(longlong)plVar3,in_R8,in_R9);

+  ppuVar10 = ppuVar9;

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

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

+     (WPP_GLOBAL_Control[0x29] != '\0')) {

+    ppuVar10 = (undefined **)0x28;

+    WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x28,

+              &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,param_1);

   }

-  return iVar1;

+LAB_3:

+  if (local_78 != 0) {

+    IoFreeWorkItem();

+  }

+  Srv2DereferenceWorkItem(param_1,(longlong *)ppuVar10);

+  return -0x3fff5eff;

 }
```

## `Smb2ExecuteNegotiateReal`  (modified)

```diff
--- Smb2ExecuteNegotiateReal
+++ Smb2ExecuteNegotiateReal
@@ -1,559 +1,944 @@
 

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

 /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

 

 void Smb2ExecuteNegotiateReal(ulonglong *param_1)

 

 {

   byte bVar1;

-  undefined4 uVar2;

+  short sVar2;

+  int iVar3;

+  int iVar4;

+  longlong lVar5;

+  ulonglong uVar6;

   undefined4 *_Dst;

-  longlong lVar3;

-  undefined4 uVar4;

-  undefined4 uVar5;

-  char cVar6;

-  char cVar7;

-  uint uVar8;

-  char *in_RAX;

-  undefined8 uVar9;

-  ulonglong uVar10;

-  uint uVar11;

-  undefined2 uVar12;

-  uint in_EDX;

-  uint uVar13;

-  uint uVar14;

-  longlong unaff_RBX;

-  ulonglong *puVar15;

-  longlong *unaff_RBP;

-  int unaff_ESI;

-  longlong unaff_RDI;

-  int in_R8D;

+  undefined2 *puVar7;

+  code *pcVar8;

+  undefined4 uVar9;

+  undefined4 uVar10;

+  char cVar11;

+  undefined1 uVar12;

+  char cVar13;

+  undefined4 uVar14;

+  uint uVar15;

+  undefined8 uVar16;

+  longlong lVar17;

+  ulonglong uVar18;

+  byte bVar19;

+  uint uVar20;

+  undefined2 uVar21;

+  uint uVar22;

+  uint uVar23;

+  uint uVar24;

+  ulonglong *puVar25;

+  undefined1 *puVar26;

+  undefined1 *puVar27;

+  ulonglong uVar28;

   char *_Size;

-  int in_R9D;

-  char *pcVar16;

-  longlong lVar17;

-  ushort unaff_R12W;

-  char *unaff_R13;

-  ulonglong *unaff_R14;

-  undefined *unaff_R15;

-  char in_stack_00000050;

-  char in_stack_00000051;

-  char in_stack_00000052;

-  char cStack0000000000000053;

-  char in_stack_00000054;

-  undefined1 in_stack_00000055;

-  char in_stack_00000056;

-  byte in_stack_00000057;

-  byte in_stack_00000058;

-  byte in_stack_00000059;

-  ushort in_stack_0000005c;

-  undefined4 *in_stack_00000060;

-  ushort in_stack_00000068;

-  undefined2 in_stack_0000006c;

-  undefined2 in_stack_00000070;

-  undefined4 in_stack_00000074;

-  byte bStack0000000000000078;

-  uint in_stack_0000007c;

+  ushort *puVar29;

+  ushort uVar30;

+  char *pcVar31;

+  ulonglong uVar32;

+  undefined1 auStackY_1d8 [8];

+  undefined1 auStackY_1d0 [24];

+  ushort local_17c [2];

+  ulonglong local_178;

+  undefined2 local_170;

+  undefined4 uStack_16c;

+  uint local_168 [6];

+  undefined4 local_150 [2];

+  void *local_148;

+  ushort local_140 [4];

+  undefined8 local_138;

+  undefined8 local_130;

+  undefined4 local_128;

+  undefined1 local_118 [32];

+  undefined8 *local_f8;

+  undefined8 local_f0;

+  undefined1 *local_e8;

+  undefined8 local_e0;

+  undefined1 *local_d8;

+  undefined8 local_d0;

+  undefined1 *local_c8;

+  undefined8 local_c0;

+  undefined1 *local_b8;

+  undefined8 local_b0;

+  undefined1 *local_a8;

+  undefined8 local_a0;

+  undefined1 *local_98;

+  undefined8 local_90;

+  undefined1 *local_88;

+  undefined8 local_80;

+  uint *local_78;

+  undefined8 local_70;

+  undefined4 *local_68;

+  undefined8 local_60;

+  undefined1 *local_58;

+  undefined8 local_50;

+  undefined1 *local_48;

+  undefined8 local_40;

+  ulonglong local_38;

   

-  *in_RAX = *in_RAX + (char)in_RAX;

-  uVar8 = (int)in_RAX << ((byte)param_1 & 0x1f);

-  if ((in_EDX & uVar8) == 0) {

-    in_EDX = uVar8 | in_EDX;

-    *(uint *)(unaff_RDI + 0x98) = in_EDX;

-  }

-  uVar8 = in_R9D << ((char)in_R8D - 1U & 0x1f);

-  if ((in_EDX & uVar8) == 0) {

-    *(uint *)(unaff_RDI + 0x98) = uVar8 | in_EDX;

-  }

-  if ((unaff_ESI == 0) && (in_R8D == 0)) {

-    _bStack0000000000000078 = _bStack0000000000000078 & 0xffffff00;

-  }

-  *(byte *)(unaff_RDI + 0x31) = *(byte *)(unaff_RDI + 0x31) & 0xef | bStack0000000000000078;

-  cStack0000000000000053 = '\x01';

-  *(byte *)(unaff_RDI + 0x31) =

-       (*(char *)(unaff_RBX + 0x101) << 5 ^ *(byte *)(unaff_RDI + 0x31)) & 0x20 ^

-       *(byte *)(unaff_RDI + 0x31);

-  uVar8 = *(uint *)(unaff_RDI + 0x6c) & 0xffffffef;

-  if (*(char *)unaff_R14[8] == '\0') {

-    uVar8 = *(uint *)(unaff_RDI + 0x6c);

-  }

-  *(uint *)(unaff_RDI + 0x6c) = uVar8;

-  if (((WPP_GLOBAL_Control != unaff_R15) && ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) != 0)

-      ) && (1 < (byte)WPP_GLOBAL_Control[0x29])) {

-    WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x23,unaff_R13,unaff_R14);

-  }

-  uVar8 = *(uint *)(*(longlong *)(unaff_R14[0xc] + 0x1e8) + 0x124);

-  *(uint *)(unaff_RDI + 0x24) = uVar8;

-  if (*(ushort *)(unaff_RDI + 0x2c) < 0x210) {

-    uVar13 = 0x10000;

-    if (uVar8 < 0x10000) {

-      uVar13 = uVar8;

-    }

-    *(uint *)(unaff_RDI + 0x24) = uVar13;

+  puVar26 = auStackY_1d8;

+  puVar27 = auStackY_1d8;

+  local_38 = __security_cookie ^ (ulonglong)auStackY_1d8;

+  uVar18 = param_1[0x46];

+  local_148 = (void *)0x0;

+  lVar5 = *(longlong *)(param_1[0xc] + 0x1f0);

+  sVar2 = *(short *)(uVar18 + 0xfe);

+  local_168[3] = 0;

+  local_170 = 0;

+  local_168[0] = 0;

+  local_17c[0] = 0;

+  local_168[4] = 0;

+  uStack_16c = 0;

+  local_168[1] = 0;

+  *(short *)(lVar5 + 0x2c) = sVar2;

+  if ((sVar2 == 0x202) || (sVar2 == 0x210)) {

+    *(undefined4 *)(lVar5 + 0x20) = 0;

 LAB_0:

-    if (*(char *)(unaff_RBX + 0x100) == '\0') {

-      *(undefined4 *)(unaff_RDI + 0x84) = 1;

-      lVar17 = *(longlong *)(unaff_RBX + 0xb8);

-      pcVar16 = (char *)(ulonglong)*(ushort *)(lVar17 + 4);

+    *(undefined1 *)(lVar5 + 0x30) = 0;

+    *(undefined4 *)(lVar5 + 0x28) = 1;

+LAB_1:

+    *(undefined2 *)(lVar5 + 0x2e) = 0;

+  }

+  else {

+    if (sVar2 == 0x300) {

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

+      goto LAB_0;

+    }

+    if (sVar2 == 0x302) {

+      *(undefined4 *)(lVar5 + 0x20) = 2;

+      *(undefined4 *)(lVar5 + 0x28) = 3;

+      *(undefined1 *)(lVar5 + 0x30) = 1;

+      goto LAB_1;

+    }

+    if (sVar2 == 0x311) {

+      *(undefined4 *)(lVar5 + 0x20) = 3;

+      *(undefined4 *)(lVar5 + 0x28) = 3;

+      *(undefined1 *)(lVar5 + 0x30) = 3;

+      *(undefined2 *)(lVar5 + 0x2e) = 7;

+    }

+  }

+  *(undefined2 *)(lVar5 + 0x74) = 1;

+  local_178 = uVar18;

+  uVar14 = Srv2IsSigningRequiredForInstance(param_1[8]);

+  if (((char)uVar14 != '\0') ||

+     ((Smb2SigningRequiredForLoopback != '\0' &&

+      (cVar11 = SrvNetIsConnectionLoopback(*(undefined8 *)(*(longlong *)(lVar5 + 0x38) + 0x1e0)),

+      cVar11 != '\0')))) {

+    *(ushort *)(lVar5 + 0x74) = *(ushort *)(lVar5 + 0x74) | 2;

+    *(byte *)(lVar5 + 0x31) = *(byte *)(lVar5 + 0x31) | 1;

+  }

+  uVar30 = *(ushort *)(lVar5 + 0x2c);

+  pcVar31 = (char *)0x300;

+  uVar32 = 1;

+  *(uint *)(lVar5 + 0x8c) = (uint)(0x2ff < uVar30);

+  *(undefined4 *)(lVar5 + 0x6c) = 1;

+  if (0x20f < uVar30) {

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

+      *(undefined4 *)(lVar5 + 0x6c) = 3;

+      uVar32 = 3;

+    }

+    if (*(char *)(*(longlong *)(param_1[0xc] + 0x1e8) + 0x121) == '\0') {

+      uVar22 = (uint)uVar32 | 4;

+      uVar32 = (ulonglong)uVar22;

+      *(byte *)(lVar5 + 0x31) = *(byte *)(lVar5 + 0x31) | 2;

+      *(uint *)(lVar5 + 0x6c) = uVar22;

+    }

+  }

+  local_168[2] = 0x10;

+  if (0x2ff < uVar30) {

+    uVar28 = uVar32;

+    if ((Smb2IsRkfInstalled != '\0') && ((*(uint *)(uVar18 + 0xf0) & 0x10) != 0)) {

+      *(byte *)(lVar5 + 0x31) = *(byte *)(lVar5 + 0x31) | 4;

+      uVar22 = (uint)uVar32 | 0x10;

+      uVar28 = (ulonglong)uVar22;

+      *(uint *)(lVar5 + 0x6c) = uVar22;

+    }

+    uVar22 = (uint)uVar28;

+    if ((Smb2MultiChannelEnabled != '\0') && ((*(uint *)(uVar18 + 0xf0) & 8) != 0)) {

+      uVar22 = uVar22 | 8;

+      *(uint *)(lVar5 + 0x6c) = uVar22;

+    }

+    if ((Smb2DirLeasingEnabled != '\0') && ((*(uint *)(uVar18 + 0xf0) & 0x20) != 0)) {

+      *(uint *)(lVar5 + 0x6c) = uVar22 | 0x20;

+    }

+    if ((((Smb2EncryptionEnabled != '\0') && ((*(uint *)(uVar18 + 0xf0) & 0x40) != 0)) &&

+        (*(ushort *)(lVar5 + 0x2c) < 0x311)) &&

+       (Smb2SelectCommonCipherForConnection((longlong)param_1), (*(byte *)(lVar5 + 0x31) & 8) != 0))

+    {

+      *(uint *)(lVar5 + 0x6c) = *(uint *)(lVar5 + 0x6c) | 0x40;

+    }

+    if ((((*(uint *)(uVar18 + 0xf0) & 0x40) == 0) && (*(ushort *)(lVar5 + 0x2c) < 0x311)) &&

+       ((AuditClientDoesNotSupportEncryption != '\0' && ((DAT_2 & 8) != 0)))) {

+      uVar6 = param_1[0xc];

+      uVar30 = *(ushort *)(uVar6 + 0x168) >> 1;

+      pcVar31 = (char *)(ulonglong)uVar30;

+      McTemplateK0hzr0tq_EtwWriteTransfer(uVar6,uVar32,uVar28,uVar30,*(undefined8 *)(uVar6 + 0x170))

+      ;

+    }

+    if ((Smb2NotificationsEnabled != '\0') && ((*(uint *)(uVar18 + 0xf0) & 0x80) != 0)) {

+      *(byte *)(lVar5 + 0x31) = *(byte *)(lVar5 + 0x31) | 0x40;

+      *(uint *)(lVar5 + 0x6c) = *(uint *)(lVar5 + 0x6c) | 0x80;

+    }

+  }

+  if (0x310 < *(ushort *)(lVar5 + 0x2c)) {

+    _Size = (char *)(lVar5 + 0x84);

+    uVar16 = Smb2SelectPreauthIntegrityHashAlgorithm

+                       (*(longlong *)(uVar18 + 200),(uint)*(ushort *)(uVar18 + 0xf4),(uint *)_Size);

+    if ((int)uVar16 < 0) {

+      uVar22 = 0xc05d0000;

+      puVar27 = auStackY_1d8;

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

+          (puVar27 = auStackY_1d8, (*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) != 0)) &&

+         (puVar27 = auStackY_1d8, WPP_GLOBAL_Control[0x29] != '\0')) {

+        _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+        pcVar31 = (char *)param_1;

+        WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x17,

+                 &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+        puVar27 = auStackY_1d8;

+      }

+      goto LAB_3;

+    }

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

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

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

+      pcVar31 = (char *)param_1;

+      WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x18,

+                &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+    }

+    _Size = (char *)0x1;

+    uVar22 = SmbCryptoHashCreate(uVar18 + 0xc0);

+    if ((int)uVar22 < 0) {

+      puVar27 = auStackY_1d8;

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

+          (puVar27 = auStackY_1d8, (*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+         (puVar27 = auStackY_1d8, WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+      uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+      uVar21 = 0x19;

+      puVar27 = auStackY_1d8;

+    }

+    else {

+      uVar14 = SmbCryptoHashGetOutputLength(*(undefined8 *)(uVar18 + 0xc0));

+      _Size = (char *)0x6332534c;

+      *(undefined4 *)(lVar5 + 0x80) = uVar14;

+      lVar17 = ExAllocatePool2(0x100);

+      *(longlong *)(lVar5 + 0x78) = lVar17;

+      if (lVar17 != 0) {

+        _Size = (char *)(ulonglong)*(uint *)(lVar5 + 0x80);

+        pcVar31 = *(char **)(param_1[0x26] + 0x18);

+        uVar22 = SmbCryptoUpdatePreauthIntegrityHashValue(*(undefined8 *)(uVar18 + 0xc0));

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

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

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

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

+            WPP_SF_DDq(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x1c,_Size,

+                       **(undefined4 **)(lVar5 + 0x78));

+          }

+          if ((((Smb2EncryptionEnabled != '\0') && (*(short *)(uVar18 + 0xf6) != 0)) &&

+              (Smb2SelectCommonCipherForConnection((longlong)param_1),

+              Smb2DisableSmbEncryptDataOnSecureConnection != '\0')) &&

+             (*(char *)(uVar18 + 0x102) != '\0')) {

+            local_168[4] = 1;

+            uVar12 = SrvNetIsConnectionTransportLevelEncrypted

+                               (*(undefined8 *)(*(longlong *)(lVar5 + 0x38) + 0x1e0));

+            *(undefined1 *)(*(longlong *)(lVar5 + 0x38) + 0x1ff) = uVar12;

+          }

+          if (((*(short *)(uVar18 + 0xf6) == 0) && (AuditClientDoesNotSupportEncryption != '\0')) &&

+             ((DAT_2 & 8) != 0)) {

+            uVar32 = param_1[0xc];

+            McTemplateK0hzr0tq_EtwWriteTransfer

+                      (uVar32,1,_Size,*(ushort *)(uVar32 + 0x168) >> 1,

+                       *(undefined8 *)(uVar32 + 0x170));

+          }

+          if (*(ushort *)(uVar18 + 0xfa) != 0) {

+            uVar16 = Smb2SelectSigningAlgorithm

+                               (*(longlong *)(uVar18 + 0xd8),(uint)*(ushort *)(uVar18 + 0xfa),

+                                local_168);

+            uVar22 = local_168[0];

+            if ((int)uVar16 < 0) {

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

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

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

+                WPP_SF_qdD(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x1e,

+                           &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+              }

+            }

+            else {

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

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

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

+                WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x1d,

+                          &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+              }

+              *(uint *)(lVar5 + 0x8c) = uVar22;

+            }

+          }

+          puVar27 = auStackY_1d8;

+          if (*(ushort *)(uVar18 + 0xf8) != 0) {

+            Smb2SelectRdmaTransforms

+                      (*(longlong *)(uVar18 + 0xe0),*(ushort *)(uVar18 + 0xf8),(longlong)local_140,

+                       local_17c);

+            uVar30 = local_17c[0];

+            uVar32 = (ulonglong)local_17c[0];

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

+              puVar26 = auStackY_1d8;

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

+                  (puVar26 = auStackY_1d8, (*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) != 0))

+                 && (puVar26 = auStackY_1d8, WPP_GLOBAL_Control[0x29] != '\0')) {

+                WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x20,

+                         &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+                puVar26 = auStackY_1d8;

+              }

+            }

+            else {

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

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

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

+                WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x1f,

+                          &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+              }

+              if (1 < uVar30 - 1) {

+                pcVar8 = (code *)swi(0x2c);

+                (*pcVar8)();

+                puVar26 = auStackY_1d0;

+              }

+              if ((int)uVar32 != 0) {

+                puVar29 = local_140;

+                do {

+                  if ((*(uint *)(lVar5 + 0x9c) & (uint)*puVar29) == 0) {

+                    *(uint *)(lVar5 + 0x9c) =

+                         1 << ((char)*puVar29 - 1U & 0x1f) | *(uint *)(lVar5 + 0x9c);

+                  }

+                  puVar29 = puVar29 + 2;

+                  uVar32 = uVar32 - 1;

+                } while (uVar32 != 0);

+              }

+            }

+            puVar26[0x52] = 1;

+            puVar27 = puVar26;

+          }

+          if ((Smb2CompressionDisabled == '\0') &&

+             (uVar30 = *(ushort *)(uVar18 + 0xfc), uVar30 != 0)) {

+            lVar17 = *(longlong *)(uVar18 + 0xe8);

+            *(undefined8 *)(puVar27 + -8) = 0x14008cac1;

+            uVar22 = Smb2SelectCompressionAlgorithms

+                               (lVar17,(uint)uVar30,(uint *)(puVar27 + 0x6c),

+                                (undefined4 *)(puVar27 + 0x74));

+            if ((int)uVar22 < 0) {

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

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

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

+                uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+                *(undefined8 *)(puVar27 + -8) = 0x14008cb96;

+                WPP_SF_q(uVar16,0x22,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+              }

+            }

+            else {

+              iVar3 = *(int *)(puVar27 + 0x6c);

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

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

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

+                uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+                *(int *)(puVar27 + 0x20) = iVar3;

+                *(undefined8 *)(puVar27 + -8) = 0x14008cafe;

+                WPP_SF_qL(uVar16,0x21,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+              }

+              iVar4 = *(int *)(puVar27 + 0x74);

+              *(int *)(lVar5 + 0x90) = iVar3;

+              *(int *)(lVar5 + 0x94) = iVar4;

+              uVar22 = *(uint *)(lVar5 + 0x98);

+              uVar15 = 1 << ((char)iVar3 - 1U & 0x1f);

+              if ((uVar22 & uVar15) == 0) {

+                uVar22 = uVar15 | uVar22;

+                *(uint *)(lVar5 + 0x98) = uVar22;

+              }

+              uVar15 = 1 << ((char)iVar4 - 1U & 0x1f);

+              if ((uVar22 & uVar15) == 0) {

+                *(uint *)(lVar5 + 0x98) = uVar15 | uVar22;

+              }

+              if ((iVar3 == 0) && (iVar4 == 0)) {

+                puVar27[0x78] = 0;

+              }

+              *(byte *)(lVar5 + 0x31) = *(byte *)(lVar5 + 0x31) & 0xef | puVar27[0x78];

+            }

+            bVar1 = *(byte *)(lVar5 + 0x31);

+            cVar11 = *(char *)(uVar18 + 0x101);

+            puVar27[0x53] = 1;

+            *(byte *)(lVar5 + 0x31) = (cVar11 << 5 ^ bVar1) & 0x20 ^ bVar1;

+          }

+          goto LAB_4;

+        }

+        puVar27 = auStackY_1d8;

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

+            (puVar27 = auStackY_1d8, (*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+           (puVar27 = auStackY_1d8, WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+        uVar21 = 0x1b;

+        puVar27 = auStackY_1d8;

+        goto LAB_5;

+      }

+      uVar22 = 0xc000009a;

+      puVar27 = auStackY_1d8;

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

+          (puVar27 = auStackY_1d8, (*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+         (puVar27 = auStackY_1d8, WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+      uVar21 = 0x1a;

+      puVar27 = auStackY_1d8;

+      uVar22 = 0xc000009a;

+LAB_6:

+      uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+    }

+    _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+    *(undefined4 *)(puVar27 + 0x20) = *(undefined4 *)(lVar5 + 0x84);

+    *(undefined8 *)(puVar27 + -8) = 0x14008c732;

+    pcVar31 = (char *)param_1;

+    WPP_SF_qdD(uVar16,uVar21,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+    goto LAB_3;

+  }

+LAB_4:

+  uVar22 = *(uint *)(lVar5 + 0x6c) & 0xffffffef;

+  if (*(char *)param_1[8] == '\0') {

+    uVar22 = *(uint *)(lVar5 + 0x6c);

+  }

+  *(uint *)(lVar5 + 0x6c) = uVar22;

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

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

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

+    uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+    *(uint *)(puVar27 + 0x20) = uVar22;

+    *(undefined8 *)(puVar27 + -8) = 0x14008cbfc;

+    WPP_SF_qL(uVar16,0x23,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+  }

+  uVar22 = *(uint *)(*(longlong *)(param_1[0xc] + 0x1e8) + 0x124);

+  *(uint *)(lVar5 + 0x24) = uVar22;

+  if (*(ushort *)(lVar5 + 0x2c) < 0x210) {

+    uVar15 = 0x10000;

+    if (uVar22 < 0x10000) {

+      uVar15 = uVar22;

+    }

+    *(uint *)(lVar5 + 0x24) = uVar15;

+LAB_7:

+    if (*(char *)(uVar18 + 0x100) == '\0') {

+      *(undefined4 *)(puVar27 + 0x40) = 0x6332534c;

+      *(longlong *)(puVar27 + 0x38) = lVar5 + 0x80;

+      *(longlong *)(puVar27 + 0x30) = lVar5 + 0x78;

+      *(undefined4 *)(lVar5 + 0x84) = 1;

+      lVar17 = *(longlong *)(uVar18 + 0xb8);

+      uVar30 = *(ushort *)(lVar17 + 4);

+      pcVar31 = (char *)(ulonglong)uVar30;

       _Size = (char *)(lVar17 + 0xc);

-      uVar8 = Smb2ComputeValidateNegotiateInfoHash

-                        (1,*(undefined4 *)(lVar17 + 8),_Size,*(ushort *)(lVar17 + 4),lVar17 + 0x24,

-                         *(ushort *)(lVar17 + 2),(longlong *)(unaff_RDI + 0x78),

-                         (undefined4 *)(unaff_RDI + 0x80),0x6332534c);

-      if ((int)uVar8 < 0) {

-        if (((WPP_GLOBAL_Control != unaff_R15) &&

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

-           (WPP_GLOBAL_Control[0x29] != '\0')) {

-          pcVar16 = (char *)unaff_R14;

-          WPP_SF_qdD(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x24,unaff_R13,unaff_R14);

-          _Size = unaff_R13;

-        }

-        goto LAB_1;

-      }

-    }

-  }

-  else if (*(ushort *)(unaff_RDI + 0x2c) < unaff_R12W) goto LAB_0;

-  Srv2SetResponseBufferToReceiveBuffer((longlong)unaff_R14);

-  SRV2_PERF_ENTER_EX((longlong)(unaff_R14 + 0x49),7,0x59d,"Smb2ExecuteNegotiateReal",'\x01');

-  uVar9 = Smb2GetNegotiateSecurityInfo(unaff_RBP + -0xe,(int *)&stack0x0000007c);

-  pcVar16 = "Smb2ExecuteNegotiateReal";

+      *(undefined2 *)(puVar27 + 0x28) = *(undefined2 *)(lVar17 + 2);

+      *(longlong *)(puVar27 + 0x20) = lVar17 + 0x24;

+      uVar14 = *(undefined4 *)(lVar17 + 8);

+      *(undefined8 *)(puVar27 + -8) = 0x14008cc9d;

+      uVar22 = Smb2ComputeValidateNegotiateInfoHash

+                         (1,uVar14,_Size,uVar30,*(undefined8 *)(puVar27 + 0x20),

+                          *(ushort *)(puVar27 + 0x28),*(longlong **)(puVar27 + 0x30),

+                          *(undefined4 **)(puVar27 + 0x38),*(undefined4 *)(puVar27 + 0x40));

+      if ((int)uVar22 < 0) {

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+           (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+        uVar21 = 0x24;

+LAB_5:

+        *(uint *)(puVar27 + 0x28) = uVar22;

+        goto LAB_6;

+      }

+    }

+  }

+  else if (*(ushort *)(lVar5 + 0x2c) < 0x311) goto LAB_7;

+  *(undefined8 *)(puVar27 + -8) = 0x14008ccdc;

+  Srv2SetResponseBufferToReceiveBuffer((longlong)param_1);

+  puVar27[0x20] = 1;

+  *(undefined8 *)(puVar27 + -8) = 0x14008ccff;

+  SRV2_PERF_ENTER_EX((longlong)(param_1 + 0x49),7,0x59d,"Smb2ExecuteNegotiateReal",puVar27[0x20]);

+  *(undefined8 *)(puVar27 + -8) = 0x14008cd0d;

+  uVar16 = Smb2GetNegotiateSecurityInfo(&local_148,(int *)(puVar27 + 0x7c));

+  pcVar31 = "Smb2ExecuteNegotiateReal";

+  puVar27[0x20] = 1;

   _Size = (char *)0x5a3;

-  uVar8 = (uint)uVar9;

-  SRV2_PERF_ENTER_EX((longlong)(unaff_R14 + 0x49),0,0x5a3,"Smb2ExecuteNegotiateReal",'\x01');

-  if ((int)uVar8 < 0) {

-    if (((WPP_GLOBAL_Control == unaff_R15) ||

+  uVar22 = (uint)uVar16;

+  *(undefined8 *)(puVar27 + -8) = 0x14008cd2b;

+  SRV2_PERF_ENTER_EX((longlong)(param_1 + 0x49),0,0x5a3,"Smb2ExecuteNegotiateReal",puVar27[0x20]);

+  if ((int)uVar22 < 0) {

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

         ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-       (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-    uVar12 = 0x25;

-    goto LAB_2;

-  }

-  if (in_stack_0000007c < 0x10000) {

-    uVar8 = in_stack_0000007c + 0x80;

-    if (in_stack_0000007c + 0x80 < 0x81) {

-      uVar8 = 0x81;

-    }

-    puVar15 = (ulonglong *)(ulonglong)uVar8;

-    if (*(ushort *)(unaff_RDI + 0x2c) < unaff_R12W) {

-LAB_3:

-      if (*(uint *)(unaff_R14[0x27] + 0x20) < uVar8) {

-        _Size = (char *)unaff_R14[0x26];

-        uVar9 = Srv2AllocateResponseBuffer((longlong)unaff_R14,uVar8,_Size);

-        uVar8 = (uint)uVar9;

-        if ((int)uVar8 < 0) {

-          if (((WPP_GLOBAL_Control == unaff_R15) ||

-              ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-             (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-          uVar12 = 0x28;

-          goto LAB_2;

-        }

-      }

-      _Dst = *(undefined4 **)(unaff_R14[0x27] + 0x18);

-      if (*(char *)(in_stack_00000060 + 0x40) != '\0') {

-        memset(_Dst,0,0x40);

-        *_Dst = 0x424d53fe;

-        *(undefined2 *)(_Dst + 1) = 0x40;

-      }

-      _Dst[4] = _Dst[4] | 1;

-      _Size = (char *)((ulonglong)*(uint *)(unaff_R14[0x27] + 0x20) - 0x40);

-      memset(_Dst + 0x10,0,(size_t)_Size);

-      *(undefined2 *)(_Dst + 0x10) = 0x41;

-      *(undefined2 *)((longlong)_Dst + 0x42) = *(undefined2 *)(unaff_RDI + 0x74);

-      *(undefined2 *)(_Dst + 0x11) = *(undefined2 *)(unaff_RDI + 0x2c);

-      uVar5 = uRam00000001400561e4;

-      uVar4 = uRam00000001400561e0;

-      uVar2 = uRam00000001400561dc;

-      _Dst[0x12] = _Smb2Guid;

-      _Dst[0x13] = uVar2;

-      _Dst[0x14] = uVar4;

-      _Dst[0x15] = uVar5;

-      _Dst[0x16] = *(undefined4 *)(unaff_RDI + 0x6c);

-      _Dst[0x17] = *(undefined4 *)(unaff_RDI + 0x24);

-      _Dst[0x18] = *(undefined4 *)(unaff_RDI + 0x24);

-      _Dst[0x19] = *(undefined4 *)(unaff_RDI + 0x24);

-      *(undefined8 *)(_Dst + 0x1a) = _DAT_4;

-      *(undefined8 *)(_Dst + 0x1c) = 0;

-      *(undefined8 *)(_Dst + 0x1e) = 0;

-      *(undefined2 *)((longlong)_Dst + 0x46) = 0;

-      cVar6 = SrvNetIsRdmaConnection();

-      _bStack0000000000000078 = 0xc;

-      unaff_RBP[-0xb] = 0;

-      *(undefined4 *)(unaff_RBP + -10) = 0;

-      if (cVar6 != '\0') {

-        _Size = (char *)&stack0x00000078;

-        uVar8 = SrvNetGetRdmaNicInfo();

-        if (((((int)uVar8 < 0) && (WPP_GLOBAL_Control != unaff_R15)) &&

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

-           (WPP_GLOBAL_Control[0x29] != '\0')) {

-          pcVar16 = (char *)(ulonglong)uVar8;

-          _Size = unaff_R13;

-          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x29,unaff_R13,uVar8);

-        }

-      }

-      lVar17 = 1;

-      if ((5 < DAT_5) && (cVar7 = _tlgKeywordOn(0x1400563a0,0x400000000000), cVar7 != '\0'))

-      {

-        unaff_RBP[-0xc] = lVar17;

-        unaff_RBP[-4] = (longlong)(unaff_RBP + -0xc);

-        in_stack_0000006c = *(undefined2 *)(unaff_RDI + 0x2c);

-        pcVar16 = (char *)0xe;

-        unaff_RBP[-2] = (longlong)&stack0x0000006c;

-        uVar10 = unaff_R14[0xc];

-        unaff_RBP[-3] = 8;

-        unaff_RBP[-1] = 2;

-        lVar3 = *(longlong *)(uVar10 + 0x1e8);

-        in_stack_00000055 = *(undefined1 *)(lVar3 + 0x121);

-        bVar1 = *(byte *)(unaff_RDI + 0x31);

-        *unaff_RBP = (longlong)&stack0x00000055;

-        unaff_RBP[2] = (longlong)&stack0x00000056;

-        in_stack_00000059 = (byte)lVar17;

-        in_stack_00000057 = bVar1 & in_stack_00000059;

-        unaff_RBP[1] = 1;

-        unaff_RBP[4] = (longlong)&stack0x00000057;

-        in_stack_00000058 = bVar1 >> 2 & in_stack_00000059;

-        in_stack_00000059 = bVar1 >> 3 & in_stack_00000059;

-        unaff_RBP[6] = (longlong)&stack0x00000058;

-        unaff_RBP[8] = (longlong)&stack0x00000059;

-        in_stack_00000074 = *(undefined4 *)(unaff_RDI + 0x20);

-        unaff_RBP[10] = (longlong)&stack0x00000074;

-        *(int *)((longlong)unaff_RBP + -0x7c) = (int)unaff_RBP[-0xb];

-        unaff_RBP[0xc] = (longlong)unaff_RBP + -0x7c;

-        *(undefined4 *)(unaff_RBP + -0xf) = *(undefined4 *)((longlong)unaff_RBP + -0x54);

-        unaff_RBP[0xe] = (longlong)(unaff_RBP + -0xf);

-        in_stack_00000060 = (undefined4 *)CONCAT44(in_stack_00000060._4_4_,(int)unaff_RBP[-10]);

-        unaff_RBP[0x10] = (longlong)&stack0x00000060;

-        in_stack_00000070 = *(undefined2 *)(unaff_RDI + 0x8c);

-        unaff_RBP[0x12] = (longlong)&stack0x00000070;

-        unaff_RBP[3] = 1;

-        unaff_RBP[5] = 1;

-        unaff_RBP[7] = 1;

-        unaff_RBP[9] = 1;

-        unaff_RBP[0xb] = 4;

-        unaff_RBP[0xd] = 4;

-        unaff_RBP[0xf] = 4;

-        unaff_RBP[0x11] = 4;

-        unaff_RBP[0x13] = 2;

-        in_stack_00000056 = cVar6;

-        _tlgWriteAgg(CONCAT71((int7)((ulonglong)lVar3 >> 8),in_stack_00000059),&DAT_6,_Size,

-                     0xe,unaff_RBP + -8);

-      }

-      *(undefined4 *)(unaff_R14[0x27] + 0x24) = 0x81;

-      if (in_stack_0000007c != 0) {

-        _Size = (char *)(ulonglong)in_stack_0000007c;

-        memmove(_Dst + 0x20,(void *)unaff_RBP[-0xe],(size_t)_Size);

-        *(undefined2 *)(_Dst + 0x1e) = 0x80;

-        *(short *)((longlong)_Dst + 0x7a) = (short)in_stack_0000007c;

-        *(uint *)(unaff_R14[0x27] + 0x24) = in_stack_0000007c + 0x80;

-      }

-      if (unaff_R12W <= *(ushort *)(unaff_RDI + 0x2c)) {

-        _Size = (char *)(ulonglong)in_stack_00000068;

-        uVar10 = Smb2AddPreauthIntegrityCapabilitiesToResponse

-                           ((longlong)unaff_R14,(short)*(undefined4 *)(unaff_RDI + 0x84),

-                            in_stack_00000068);

-        uVar8 = (uint)uVar10;

-        if ((int)uVar8 < 0) {

-          if (((WPP_GLOBAL_Control == unaff_R15) ||

-              ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-             (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-          uVar12 = 0x2a;

-LAB_2:

-          pcVar16 = (char *)unaff_R14;

-          WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),uVar12,unaff_R13,unaff_R14);

-          _Size = unaff_R13;

-          goto LAB_1;

-        }

-        if (in_stack_00000050 != '\0') {

-          uVar9 = Smb2AddEncryptionCapabilitiesToResponse

-                            ((longlong)unaff_R14,(short)*(undefined4 *)(unaff_RDI + 0x88));

-          uVar8 = (uint)uVar9;

-          if ((int)uVar8 < 0) {

-            if (((WPP_GLOBAL_Control == unaff_R15) ||

+       (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+    uVar21 = 0x25;

+    goto LAB_8;

+  }

+  uVar22 = *(uint *)(puVar27 + 0x7c);

+  if (uVar22 < 0x10000) {

+    uVar15 = uVar22 + 0x80;

+    if (uVar22 + 0x80 < 0x81) {

+      uVar15 = 0x81;

+    }

+    puVar25 = (ulonglong *)(ulonglong)uVar15;

+    if (*(ushort *)(lVar5 + 0x2c) < 0x311) {

+LAB_9:

+      if (*(uint *)(param_1[0x27] + 0x20) < uVar15) {

+        _Size = (char *)param_1[0x26];

+        *(undefined8 *)(puVar27 + -8) = 0x14008d0b2;

+        uVar16 = Srv2AllocateResponseBuffer((longlong)param_1,uVar15,_Size);

+        uVar22 = (uint)uVar16;

+        if (-1 < (int)uVar22) goto LAB_10;

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+           (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+        uVar21 = 0x28;

+        *(uint *)(puVar27 + 0x20) = uVar15;

+LAB_11:

+        uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+        _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+        *(undefined8 *)(puVar27 + -8) = 0x14008cd6e;

+        pcVar31 = (char *)param_1;

+        WPP_SF_qL(uVar16,uVar21,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+      }

+      else {

+LAB_10:

+        _Dst = *(undefined4 **)(param_1[0x27] + 0x18);

+        if (*(char *)(*(longlong *)(puVar27 + 0x60) + 0x100) != '\0') {

+          *(undefined8 *)(puVar27 + -8) = 0x14008d116;

+          memset(_Dst,0,0x40);

+          *_Dst = 0x424d53fe;

+          *(undefined2 *)(_Dst + 1) = 0x40;

+        }

+        _Dst[4] = _Dst[4] | 1;

+        _Size = (char *)((ulonglong)*(uint *)(param_1[0x27] + 0x20) - 0x40);

+        *(undefined8 *)(puVar27 + -8) = 0x14008d144;

+        memset(_Dst + 0x10,0,(size_t)_Size);

+        *(undefined2 *)(_Dst + 0x10) = 0x41;

+        *(undefined2 *)((longlong)_Dst + 0x42) = *(undefined2 *)(lVar5 + 0x74);

+        *(undefined2 *)(_Dst + 0x11) = *(undefined2 *)(lVar5 + 0x2c);

+        uVar10 = uRam00000001400561e4;

+        uVar9 = uRam00000001400561e0;

+        uVar14 = uRam00000001400561dc;

+        _Dst[0x12] = _Smb2Guid;

+        _Dst[0x13] = uVar14;

+        _Dst[0x14] = uVar9;

+        _Dst[0x15] = uVar10;

+        _Dst[0x16] = *(undefined4 *)(lVar5 + 0x6c);

+        _Dst[0x17] = *(undefined4 *)(lVar5 + 0x24);

+        _Dst[0x18] = *(undefined4 *)(lVar5 + 0x24);

+        _Dst[0x19] = *(undefined4 *)(lVar5 + 0x24);

+        *(undefined8 *)(_Dst + 0x1a) = _DAT_12;

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

+        *(undefined8 *)(_Dst + 0x1e) = 0;

+        *(undefined2 *)((longlong)_Dst + 0x46) = 0;

+        *(undefined8 *)(puVar27 + -8) = 0x14008d1aa;

+        cVar11 = SrvNetIsRdmaConnection();

+        *(undefined4 *)(puVar27 + 0x78) = 0xc;

+        local_130 = 0;

+        local_128 = 0;

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

+          _Size = puVar27 + 0x78;

+          *(undefined8 *)(puVar27 + -8) = 0x14008d1e3;

+          uVar22 = SrvNetGetRdmaNicInfo();

+          if (((((int)uVar22 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

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

+             (WPP_GLOBAL_Control[0x29] != '\0')) {

+            uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+            pcVar31 = (char *)(ulonglong)uVar22;

+            _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+            *(undefined8 *)(puVar27 + -8) = 0x14008d21e;

+            WPP_SF_D(uVar16,0x29,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,uVar22);

+          }

+        }

+        uVar16 = 1;

+        if (5 < DAT_13) {

+          *(undefined8 *)(puVar27 + -8) = 0x14008d247;

+          cVar13 = _tlgKeywordOn(0x1400563a0,0x400000000000);

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

+            local_138 = uVar16;

+            local_f8 = &local_138;

+            pcVar31 = (char *)0xe;

+            *(undefined2 *)(puVar27 + 0x6c) = *(undefined2 *)(lVar5 + 0x2c);

+            local_e8 = puVar27 + 0x6c;

+            local_f0 = 8;

+            local_e0 = 2;

+            lVar17 = *(longlong *)(param_1[0xc] + 0x1e8);

+            bVar1 = *(byte *)(lVar5 + 0x31);

+            puVar27[0x55] = *(undefined1 *)(lVar17 + 0x121);

+            local_d8 = puVar27 + 0x55;

+            local_c8 = puVar27 + 0x56;

+            bVar19 = (byte)uVar16;

+            local_d0 = 1;

+            puVar27[0x57] = bVar1 & bVar19;

+            local_b8 = puVar27 + 0x57;

+            puVar27[0x58] = bVar1 >> 2 & bVar19;

+            bVar19 = bVar1 >> 3 & bVar19;

+            puVar27[0x56] = cVar11;

+            local_a8 = puVar27 + 0x58;

+            local_98 = puVar27 + 0x59;

+            *(undefined4 *)(puVar27 + 0x74) = *(undefined4 *)(lVar5 + 0x20);

+            local_88 = puVar27 + 0x74;

+            local_168[5] = (undefined4)local_130;

+            local_78 = local_168 + 5;

+            local_150[0] = local_130._4_4_;

+            local_68 = local_150;

+            *(undefined4 *)(puVar27 + 0x60) = local_128;

+            local_58 = puVar27 + 0x60;

+            *(undefined2 *)(puVar27 + 0x70) = *(undefined2 *)(lVar5 + 0x8c);

+            local_48 = puVar27 + 0x70;

+            *(undefined1 **)(puVar27 + 0x20) = local_118;

+            local_c0 = 1;

+            local_b0 = 1;

+            local_a0 = 1;

+            puVar27[0x59] = bVar19;

+            local_90 = 1;

+            local_80 = 4;

+            local_70 = 4;

+            local_60 = 4;

+            local_50 = 4;

+            local_40 = 2;

+            *(undefined8 *)(puVar27 + -8) = 0x14008d3ae;

+            _tlgWriteAgg(CONCAT71((int7)((ulonglong)lVar17 >> 8),bVar19),&DAT_14,_Size,0xe,

+                         *(undefined8 **)(puVar27 + 0x20));

+          }

+        }

+        uVar22 = *(uint *)(puVar27 + 0x7c);

+        *(undefined4 *)(param_1[0x27] + 0x24) = 0x81;

+        if (uVar22 != 0) {

+          _Size = (char *)(ulonglong)uVar22;

+          *(undefined8 *)(puVar27 + -8) = 0x14008d3d7;

+          memmove(_Dst + 0x20,local_148,(size_t)_Size);

+          *(undefined2 *)(_Dst + 0x1e) = 0x80;

+          *(short *)((longlong)_Dst + 0x7a) = (short)uVar22;

+          *(uint *)(param_1[0x27] + 0x24) = uVar22 + 0x80;

+        }

+        if (0x310 < *(ushort *)(lVar5 + 0x2c)) {

+          _Size = (char *)(ulonglong)*(ushort *)(puVar27 + 0x68);

+          uVar14 = *(undefined4 *)(lVar5 + 0x84);

+          *(undefined8 *)(puVar27 + -8) = 0x14008d413;

+          uVar18 = Smb2AddPreauthIntegrityCapabilitiesToResponse

+                             ((longlong)param_1,(short)uVar14,*(ushort *)(puVar27 + 0x68));

+          uVar22 = (uint)uVar18;

+          if ((int)uVar22 < 0) {

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

                 ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-               (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-            uVar12 = 0x2b;

-            goto LAB_2;

-          }

-        }

-        if (in_stack_00000051 != '\0') {

-          uVar2 = *(undefined4 *)(unaff_RDI + 0x8c);

-          pcVar16 = (char *)&stack0x00000060;

-          in_stack_00000060 = (undefined4 *)0x0;

-          _Size = (char *)0x4;

-          uVar9 = Smb2AddNegotiateContextToResponse((longlong)unaff_R14,8,4,(longlong *)pcVar16);

-          uVar8 = (uint)uVar9;

-          if ((int)uVar8 < 0) {

-            if (((WPP_GLOBAL_Control == unaff_R15) ||

-                ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-               (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-            uVar12 = 0x2c;

-            goto LAB_2;

-          }

-          *(undefined2 *)in_stack_00000060 = 1;

-          *(short *)((longlong)in_stack_00000060 + 2) = (short)uVar2;

-        }

-        if (in_stack_00000052 != '\0') {

-          _Size = (char *)(ulonglong)in_stack_0000005c;

-          uVar9 = Smb2AddRdmaTransformCapabilitiesToResponse

-                            ((longlong)unaff_R14,(ushort *)(unaff_RBP + -0xd),in_stack_0000005c);

-          uVar8 = (uint)uVar9;

-          if ((int)uVar8 < 0) {

-            if (((WPP_GLOBAL_Control == unaff_R15) ||

-                ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-               (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-            uVar12 = 0x2d;

-            goto LAB_2;

-          }

-        }

-        if (cStack0000000000000053 != '\0') {

-          _Size = (char *)(ulonglong)*(uint *)(unaff_RDI + 0x94);

-          uVar10 = Smb2AddCompressionCapabilitiesToResponse

-                             ((longlong)unaff_R14,*(int *)(unaff_RDI + 0x90),

-                              *(uint *)(unaff_RDI + 0x94));

-          uVar8 = (uint)uVar10;

-          if ((int)uVar8 < 0) {

-            if (((WPP_GLOBAL_Control == unaff_R15) ||

-                ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

-               (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_1;

-            uVar12 = 0x2e;

-            goto LAB_2;

-          }

-        }

-        if (in_stack_00000054 != '\0') {

-          in_stack_00000060 = (undefined4 *)0x0;

-          pcVar16 = (char *)&stack0x00000060;

-          _Size = (char *)0x4;

-          uVar9 = Smb2AddNegotiateContextToResponse((longlong)unaff_R14,6,4,(longlong *)pcVar16);

-          uVar8 = (uint)uVar9;

-          if ((int)uVar8 < 0) {

-            if (((WPP_GLOBAL_Control != unaff_R15) &&

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

-               (WPP_GLOBAL_Control[0x29] != '\0')) {

-              pcVar16 = (char *)unaff_R14;

-              WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x2f,unaff_R13,unaff_R14);

-              _Size = unaff_R13;

-            }

-            goto LAB_1;

-          }

-          *in_stack_00000060 = (int)unaff_RBP[-0x10];

-        }

-      }

-      if (unaff_R12W <= *(ushort *)(unaff_RDI + 0x2c)) {

-        unaff_R14[0x43] = (ulonglong)Smb2UpdatePreauthIntegrityHashForResponse;

-      }

-      uVar8 = 0;

-      goto LAB_1;

-    }

-    if ((uVar8 & 7) == 0) {

-LAB_7:

-      uVar13 = uVar8 + 8;

-      _Size = (char *)(ulonglong)uVar8;

-      puVar15 = (ulonglong *)0xffffffff;

-      if (uVar8 <= uVar13) {

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-      }

-      uVar11 = -(uint)(uVar13 < uVar8) & 0xc0000095;

-      if (uVar8 <= uVar13) {

-        uVar8 = (uint)puVar15;

-        uVar14 = uVar8 + 6;

-        uVar13 = 0xffffffff;

-        if (uVar8 <= uVar14) {

-          uVar13 = uVar14;

-        }

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-        uVar11 = -(uint)(uVar14 < uVar8) & 0xc0000095;

-        if (uVar8 <= uVar14) {

-          in_stack_00000068 =

-               SmbCryptoHashGetRecommendedSaltSize(*(undefined8 *)(in_stack_00000060 + 0x30));

-          _Size = (char *)(ulonglong)uVar13;

-          uVar11 = in_stack_00000068 + uVar13;

-          uVar8 = 0xffffffff;

-          if (uVar13 <= uVar11) {

-            uVar8 = uVar11;

-          }

-          puVar15 = (ulonglong *)(ulonglong)uVar8;

-          uVar11 = -(uint)(uVar11 < uVar13) & 0xc0000095;

+               (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+            uVar21 = 0x2a;

+LAB_8:

+            *(uint *)(puVar27 + 0x20) = uVar22;

+            goto LAB_11;

+          }

+          if (puVar27[0x50] != '\0') {

+            uVar14 = *(undefined4 *)(lVar5 + 0x88);

+            *(undefined8 *)(puVar27 + -8) = 0x14008d460;

+            uVar16 = Smb2AddEncryptionCapabilitiesToResponse((longlong)param_1,(short)uVar14);

+            uVar22 = (uint)uVar16;

+            if ((int)uVar22 < 0) {

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

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+                 (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+              uVar21 = 0x2b;

+              goto LAB_8;

+            }

+          }

+          if (puVar27[0x51] != '\0') {

+            uVar14 = *(undefined4 *)(lVar5 + 0x8c);

+            pcVar31 = puVar27 + 0x60;

+            *(undefined8 *)(puVar27 + 0x60) = 0;

+            _Size = (char *)0x4;

+            *(undefined8 *)(puVar27 + -8) = 0x14008d4c0;

+            uVar16 = Smb2AddNegotiateContextToResponse((longlong)param_1,8,4,(longlong *)pcVar31);

+            uVar22 = (uint)uVar16;

+            if ((int)uVar22 < 0) {

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

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+                 (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+              uVar21 = 0x2c;

+              goto LAB_8;

+            }

+            puVar7 = *(undefined2 **)(puVar27 + 0x60);

+            *puVar7 = 1;

+            puVar7[1] = (short)uVar14;

+          }

+          if (puVar27[0x52] != '\0') {

+            _Size = (char *)(ulonglong)*(ushort *)(puVar27 + 0x5c);

+            *(undefined8 *)(puVar27 + -8) = 0x14008d522;

+            uVar16 = Smb2AddRdmaTransformCapabilitiesToResponse

+                               ((longlong)param_1,local_140,*(ushort *)(puVar27 + 0x5c));

+            uVar22 = (uint)uVar16;

+            if ((int)uVar22 < 0) {

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

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+                 (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+              uVar21 = 0x2d;

+              goto LAB_8;

+            }

+          }

+          if (puVar27[0x53] != '\0') {

+            uVar22 = *(uint *)(lVar5 + 0x94);

+            _Size = (char *)(ulonglong)uVar22;

+            iVar3 = *(int *)(lVar5 + 0x90);

+            *(undefined8 *)(puVar27 + -8) = 0x14008d576;

+            uVar18 = Smb2AddCompressionCapabilitiesToResponse((longlong)param_1,iVar3,uVar22);

+            uVar22 = (uint)uVar18;

+            if ((int)uVar22 < 0) {

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

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0xf & 1) == 0)) ||

+                 (WPP_GLOBAL_Control[0x29] == '\0')) goto LAB_3;

+              uVar21 = 0x2e;

+              goto LAB_8;

+            }

+          }

+          if (puVar27[0x54] != '\0') {

+            *(undefined8 *)(puVar27 + 0x60) = 0;

+            pcVar31 = puVar27 + 0x60;

+            _Size = (char *)0x4;

+            *(undefined8 *)(puVar27 + -8) = 0x14008d5d0;

+            uVar16 = Smb2AddNegotiateContextToResponse((longlong)param_1,6,4,(longlong *)pcVar31);

+            uVar22 = (uint)uVar16;

+            if ((int)uVar22 < 0) {

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

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

+                 (WPP_GLOBAL_Control[0x29] != '\0')) {

+                uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+                *(uint *)(puVar27 + 0x20) = uVar22;

+                _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+                *(undefined8 *)(puVar27 + -8) = 0x14008d609;

+                pcVar31 = (char *)param_1;

+                WPP_SF_qL(uVar16,0x2f,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+              }

+              goto LAB_3;

+            }

+            **(undefined4 **)(puVar27 + 0x60) = local_168[4];

+          }

+        }

+        if (0x310 < *(ushort *)(lVar5 + 0x2c)) {

+          param_1[0x43] = (ulonglong)Smb2UpdatePreauthIntegrityHashForResponse;

+        }

+        uVar22 = 0;

+      }

+      goto LAB_3;

+    }

+    if ((uVar15 & 7) == 0) {

+LAB_15:

+      uVar22 = uVar15 + 8;

+      _Size = (char *)(ulonglong)uVar15;

+      puVar25 = (ulonglong *)0xffffffff;

+      if (uVar15 <= uVar22) {

+        puVar25 = (ulonglong *)(ulonglong)uVar22;

+      }

+      uVar20 = -(uint)(uVar22 < uVar15) & 0xc0000095;

+      if (uVar15 <= uVar22) {

+        uVar22 = (uint)puVar25;

+        uVar23 = uVar22 + 6;

+        uVar15 = 0xffffffff;

+        if (uVar22 <= uVar23) {

+          uVar15 = uVar23;

+        }

+        puVar25 = (ulonglong *)(ulonglong)uVar15;

+        uVar20 = -(uint)(uVar23 < uVar22) & 0xc0000095;

+        if (uVar22 <= uVar23) {

+          uVar16 = *(undefined8 *)(*(longlong *)(puVar27 + 0x60) + 0xc0);

+          *(undefined8 *)(puVar27 + -8) = 0x14008ce45;

+          uVar30 = SmbCryptoHashGetRecommendedSaltSize(uVar16);

+          _Size = (char *)(ulonglong)uVar15;

+          uVar20 = uVar30 + uVar15;

+          *(ushort *)(puVar27 + 0x68) = uVar30;

+          uVar22 = 0xffffffff;

+          if (uVar15 <= uVar20) {

+            uVar22 = uVar20;

+          }

+          puVar25 = (ulonglong *)(ulonglong)uVar22;

+          uVar20 = -(uint)(uVar20 < uVar15) & 0xc0000095;

         }

       }

     }

     else {

-      if (uVar8 <= uVar8 + 7) {

-        uVar8 = uVar8 + 7 & 0xfffffff8;

-        goto LAB_7;

-      }

-      uVar11 = 0xc0000095;

-    }

-    pcVar16 = (char *)0xffffffff;

-    uVar8 = (uint)puVar15;

-    if ((in_stack_00000050 != '\0') && (-1 < (int)uVar11)) {

-      if (((ulonglong)puVar15 & 7) != 0) {

-        if (uVar8 + 7 < uVar8) {

-          uVar11 = 0xc0000095;

-          goto LAB_8;

-        }

-        uVar8 = uVar8 + 7 & 0xfffffff8;

-      }

-      uVar13 = uVar8 + 8;

-      _Size = (char *)(ulonglong)uVar8;

-      puVar15 = (ulonglong *)0xffffffff;

-      if (uVar8 <= uVar13) {

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-      }

-      uVar11 = -(uint)(uVar13 < uVar8) & 0xc0000095;

-      if (uVar8 <= uVar13) {

-        uVar8 = (uint)puVar15;

-        uVar11 = uVar8 + 4;

-        uVar13 = 0xffffffff;

-        if (uVar8 <= uVar11) {

-          uVar13 = uVar11;

-        }

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-        uVar11 = -(uint)(uVar11 < uVar8) & 0xc0000095;

-      }

-    }

-LAB_8:

-    uVar8 = (uint)puVar15;

-    if ((cStack0000000000000053 != '\0') && (-1 < (int)uVar11)) {

-      if (((ulonglong)puVar15 & 7) != 0) {

-        uVar11 = 0xc0000095;

-        if (uVar8 + 7 < uVar8) goto LAB_9;

-        uVar8 = uVar8 + 7 & 0xfffffff8;

-      }

-      uVar14 = uVar8 + 8;

-      _Size = (char *)(ulonglong)uVar8;

-      uVar13 = 0xffffffff;

-      if (uVar8 <= uVar14) {

-        uVar13 = uVar14;

-      }

-      puVar15 = (ulonglong *)(ulonglong)uVar13;

-      uVar11 = -(uint)(uVar14 < uVar8) & 0xc0000095;

-      if (uVar8 <= uVar14) {

+      if (uVar15 <= uVar15 + 7) {

+        uVar15 = uVar15 + 7 & 0xfffffff8;

+        goto LAB_15;

+      }

+      uVar20 = 0xc0000095;

+    }

+    pcVar31 = (char *)0xffffffff;

+    uVar22 = (uint)puVar25;

+    uVar15 = 0xc0000095;

+    if ((puVar27[0x50] != '\0') && (-1 < (int)uVar20)) {

+      if (((ulonglong)puVar25 & 7) != 0) {

+        uVar20 = uVar15;

+        if (uVar22 + 7 < uVar22) goto LAB_16;

+        uVar22 = uVar22 + 7 & 0xfffffff8;

+      }

+      uVar23 = uVar22 + 8;

+      _Size = (char *)(ulonglong)uVar22;

+      puVar25 = (ulonglong *)0xffffffff;

+      if (uVar22 <= uVar23) {

+        puVar25 = (ulonglong *)(ulonglong)uVar23;

+      }

+      uVar20 = -(uint)(uVar23 < uVar22) & 0xc0000095;

+      if (uVar22 <= uVar23) {

+        uVar22 = (uint)puVar25;

+        uVar23 = uVar22 + 4;

+        uVar20 = 0xffffffff;

+        if (uVar22 <= uVar23) {

+          uVar20 = uVar23;

+        }

+        puVar25 = (ulonglong *)(ulonglong)uVar20;

+        uVar20 = -(uint)(uVar23 < uVar22) & 0xc0000095;

+      }

+    }

+LAB_16:

+    uVar22 = (uint)puVar25;

+    if ((puVar27[0x53] == '\0') || ((int)uVar20 < 0)) {

+LAB_17:

+      lVar17 = *(longlong *)(puVar27 + 0x60);

+    }

+    else {

+      if (((ulonglong)puVar25 & 7) != 0) {

+        uVar20 = uVar15;

+        if (uVar22 + 7 < uVar22) goto LAB_17;

+        uVar22 = uVar22 + 7 & 0xfffffff8;

+      }

+      lVar17 = *(longlong *)(puVar27 + 0x60);

+      uVar24 = uVar22 + 8;

+      _Size = (char *)(ulonglong)uVar22;

+      uVar23 = 0xffffffff;

+      if (uVar22 <= uVar24) {

+        uVar23 = uVar24;

+      }

+      puVar25 = (ulonglong *)(ulonglong)uVar23;

+      uVar20 = -(uint)(uVar24 < uVar22) & 0xc0000095;

+      if (uVar22 <= uVar24) {

         _Size = (char *)0xffffffff;

-        uVar8 = (uint)*(ushort *)(in_stack_00000060 + 0x3f) * 2 + 8;

-        if (uVar8 >= 8) {

-          _Size = (char *)(ulonglong)uVar8;

-        }

-        uVar11 = -(uint)(uVar8 < 8) & 0xc0000095;

-        if (7 < uVar8) {

-          uVar11 = (int)_Size + uVar13;

-          uVar8 = 0xffffffff;

-          if (uVar13 <= uVar11) {

-            uVar8 = uVar11;

-          }

-          puVar15 = (ulonglong *)(ulonglong)uVar8;

-          uVar11 = -(uint)(uVar11 < uVar13) & 0xc0000095;

-        }

-      }

-    }

-LAB_9:

-    uVar8 = (uint)puVar15;

-    if ((in_stack_00000052 != '\0') && (-1 < (int)uVar11)) {

-      if (((ulonglong)puVar15 & 7) != 0) {

-        if (uVar8 + 7 < uVar8) {

-          uVar11 = 0xc0000095;

-          goto LAB_10;

-        }

-        uVar8 = uVar8 + 7 & 0xfffffff8;

-      }

-      uVar14 = uVar8 + 8;

-      _Size = (char *)(ulonglong)uVar8;

-      uVar13 = 0xffffffff;

-      if (uVar8 <= uVar14) {

-        uVar13 = uVar14;

-      }

-      puVar15 = (ulonglong *)(ulonglong)uVar13;

-      uVar11 = -(uint)(uVar14 < uVar8) & 0xc0000095;

-      if (uVar8 <= uVar14) {

+        uVar22 = (uint)*(ushort *)(lVar17 + 0xfc) * 2 + 8;

+        if (uVar22 >= 8) {

+          _Size = (char *)(ulonglong)uVar22;

+        }

+        uVar20 = -(uint)(uVar22 < 8) & 0xc0000095;

+        if (7 < uVar22) {

+          uVar20 = (int)_Size + uVar23;

+          uVar22 = 0xffffffff;

+          if (uVar23 <= uVar20) {

+            uVar22 = uVar20;

+          }

+          puVar25 = (ulonglong *)(ulonglong)uVar22;

+          uVar20 = -(uint)(uVar20 < uVar23) & 0xc0000095;

+        }

+      }

+    }

+    uVar22 = (uint)puVar25;

+    if ((puVar27[0x52] != '\0') && (-1 < (int)uVar20)) {

+      if (((ulonglong)puVar25 & 7) != 0) {

+        if (uVar22 + 7 < uVar22) {

+          uVar20 = 0xc0000095;

+          goto LAB_18;

+        }

+        uVar22 = uVar22 + 7 & 0xfffffff8;

+      }

+      uVar24 = uVar22 + 8;

+      _Size = (char *)(ulonglong)uVar22;

+      uVar23 = 0xffffffff;

+      if (uVar22 <= uVar24) {

+        uVar23 = uVar24;

+      }

+      puVar25 = (ulonglong *)(ulonglong)uVar23;

+      uVar20 = -(uint)(uVar24 < uVar22) & 0xc0000095;

+      if (uVar22 <= uVar24) {

         _Size = (char *)0xffffffff;

-        uVar8 = (uint)*(ushort *)(in_stack_00000060 + 0x3e) * 2 + 8;

-        if (uVar8 >= 8) {

-          _Size = (char *)(ulonglong)uVar8;

-        }

-        uVar11 = -(uint)(uVar8 < 8) & 0xc0000095;

-        if (7 < uVar8) {

-          uVar11 = (int)_Size + uVar13;

-          uVar8 = 0xffffffff;

-          if (uVar13 <= uVar11) {

-            uVar8 = uVar11;

-          }

-          puVar15 = (ulonglong *)(ulonglong)uVar8;

-          uVar11 = -(uint)(uVar11 < uVar13) & 0xc0000095;

-        }

-      }

-    }

-LAB_10:

-    uVar8 = (uint)puVar15;

-    if ((in_stack_00000051 != '\0') && (-1 < (int)uVar11)) {

-      if (((ulonglong)puVar15 & 7) != 0) {

-        if (uVar8 + 7 < uVar8) {

-          uVar11 = 0xc0000095;

-          goto LAB_11;

-        }

-        uVar8 = uVar8 + 7 & 0xfffffff8;

-      }

-      uVar13 = uVar8 + 8;

-      _Size = (char *)(ulonglong)uVar8;

-      puVar15 = (ulonglong *)0xffffffff;

-      if (uVar8 <= uVar13) {

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-      }

-      uVar11 = -(uint)(uVar13 < uVar8) & 0xc0000095;

-      if (uVar8 <= uVar13) {

-        uVar8 = (uint)puVar15;

-        uVar11 = uVar8 + 4;

-        uVar13 = 0xffffffff;

-        if (uVar8 <= uVar11) {

-          uVar13 = uVar11;

-        }

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-        uVar11 = -(uint)(uVar11 < uVar8) & 0xc0000095;

-      }

-    }

-LAB_11:

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

-LAB_12:

-      uVar8 = (uint)puVar15;

-      if (-1 < (int)uVar11) goto LAB_3;

-    }

-    else if (-1 < (int)uVar11) {

-      uVar8 = (uint)puVar15;

-      uVar13 = uVar8 + 4;

-      puVar15 = (ulonglong *)pcVar16;

-      if (uVar8 <= uVar13) {

-        puVar15 = (ulonglong *)(ulonglong)uVar13;

-      }

-      uVar11 = -(uint)(uVar13 < uVar8) & 0xc0000095;

-      pcVar16 = (char *)puVar15;

-      goto LAB_12;

-    }

-    if (((WPP_GLOBAL_Control != unaff_R15) &&

+        uVar22 = (uint)*(ushort *)(lVar17 + 0xf8) * 2 + 8;

+        if (uVar22 >= 8) {

+          _Size = (char *)(ulonglong)uVar22;

+        }

+        uVar20 = -(uint)(uVar22 < 8) & 0xc0000095;

+        if (7 < uVar22) {

+          uVar20 = (int)_Size + uVar23;

+          uVar22 = 0xffffffff;

+          if (uVar23 <= uVar20) {

+            uVar22 = uVar20;

+          }

+          puVar25 = (ulonglong *)(ulonglong)uVar22;

+          uVar20 = -(uint)(uVar20 < uVar23) & 0xc0000095;

+        }

+      }

+    }

+LAB_18:

+    uVar22 = (uint)puVar25;

+    if ((puVar27[0x51] != '\0') && (-1 < (int)uVar20)) {

+      if (((ulonglong)puVar25 & 7) != 0) {

+        uVar20 = uVar15;

+        if (uVar22 + 7 < uVar22) goto LAB_19;

+        uVar22 = uVar22 + 7 & 0xfffffff8;

+      }

+      uVar15 = uVar22 + 8;

+      _Size = (char *)(ulonglong)uVar22;

+      puVar25 = (ulonglong *)0xffffffff;

+      if (uVar22 <= uVar15) {

+        puVar25 = (ulonglong *)(ulonglong)uVar15;

+      }

+      uVar20 = -(uint)(uVar15 < uVar22) & 0xc0000095;

+      if (uVar22 <= uVar15) {

+        uVar22 = (uint)puVar25;

+        uVar20 = uVar22 + 4;

+        uVar15 = 0xffffffff;

+        if (uVar22 <= uVar20) {

+          uVar15 = uVar20;

+        }

+        puVar25 = (ulonglong *)(ulonglong)uVar15;

+        uVar20 = -(uint)(uVar20 < uVar22) & 0xc0000095;

+      }

+    }

+LAB_19:

+    if (puVar27[0x54] == '\0') {

+LAB_20:

+      uVar15 = (uint)puVar25;

+      if (-1 < (int)uVar20) goto LAB_9;

+    }

+    else if (-1 < (int)uVar20) {

+      uVar22 = (uint)puVar25;

+      uVar15 = uVar22 + 4;

+      puVar25 = (ulonglong *)pcVar31;

+      if (uVar22 <= uVar15) {

+        puVar25 = (ulonglong *)(ulonglong)uVar15;

+      }

+      uVar20 = -(uint)(uVar15 < uVar22) & 0xc0000095;

+      pcVar31 = (char *)puVar25;

+      goto LAB_20;

+    }

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

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

        (WPP_GLOBAL_Control[0x29] != '\0')) {

-      pcVar16 = (char *)unaff_R14;

-      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x27,unaff_R13,unaff_R14);

-      _Size = unaff_R13;

-    }

-  }

-  else if (((WPP_GLOBAL_Control != unaff_R15) &&

+      uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+      _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+      *(undefined8 *)(puVar27 + -8) = 0x14008d085;

+      pcVar31 = (char *)param_1;

+      WPP_SF_q(uVar16,0x27,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+    }

+  }

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

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

           (WPP_GLOBAL_Control[0x29] != '\0')) {

-    pcVar16 = (char *)unaff_R14;

-    WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x26,unaff_R13,unaff_R14);

-    _Size = unaff_R13;

-  }

-  uVar8 = 0xc00000e5;

-LAB_1:

-  if (unaff_RBP[-0xe] != 0) {

+    uVar16 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+    *(uint *)(puVar27 + 0x20) = uVar22;

+    _Size = &WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids;

+    *(undefined8 *)(puVar27 + -8) = 0x14008cdb2;

+    pcVar31 = (char *)param_1;

+    WPP_SF_qL(uVar16,0x26,&WPP_239d045f5f95307bd9b817af8ca46a48_Traceguids,param_1);

+  }

+  uVar22 = 0xc00000e5;

+LAB_3:

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

+    *(undefined8 *)(puVar27 + -8) = 0x14008d63d;

     FreeContextBuffer();

   }

-  if ((int)uVar8 < 0) {

-    pcVar16 = (char *)0x7db;

+  if ((int)uVar22 < 0) {

+    pcVar31 = (char *)0x7db;

     _Size = "onecore\\base\\fs\\remotefs\\smb\\srv\\srv.v2\\smb2\\negotiate.c";

-    _Smb2SetError((longlong)unaff_R14,uVar8,

+    *(undefined8 *)(puVar27 + -8) = 0x14008d666;

+    _Smb2SetError((longlong)param_1,uVar22,

                   "onecore\\base\\fs\\remotefs\\smb\\srv\\srv.v2\\smb2\\negotiate.c");

   }

   else {

-    Smb2SetSuccess((longlong)unaff_R14,0);

-  }

-  Srv2CompleteWorkItem(unaff_R14,0,_Size,(ulonglong *)pcVar16);

+    *(undefined8 *)(puVar27 + -8) = 0x14008d650;

+    Smb2SetSuccess((longlong)param_1,0);

+  }

+  *(undefined8 *)(puVar27 + -8) = 0x14008d670;

+  Srv2CompleteWorkItem(param_1,0,_Size,(ulonglong *)pcVar31);

+  *(undefined8 *)(puVar27 + -8) = 0x14008d67f;

   return;

 }
```

## `Srv2ProcessFsctl`  (modified)

```diff
--- Srv2ProcessFsctl
+++ Srv2ProcessFsctl
@@ -1,29 +1,285 @@
 

 uint Srv2ProcessFsctl(longlong param_1,undefined8 param_2,wchar_t *param_3,wchar_t *param_4,

                      int *param_5,uint param_6,uint param_7,uint *param_8,undefined8 param_9,

                      longlong param_10)

 

 {

-  uint uVar1;

-  uint in_EAX;

-  int iVar2;

-  uint uVar3;

-  uint uVar4;

+  char cVar1;

+  uint uVar2;

+  undefined8 uVar3;

+  longlong lVar4;

+  ulonglong *puVar5;

+  undefined2 uVar6;

+  wchar_t *pwVar7;

+  longlong *plVar8;

+  wchar_t *pwVar9;

+  bool bVar10;

   

-  uVar4 = 0;

-  if (*(int *)(param_1 + 0x100) != 0) {

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

-    uVar3 = uVar1;

-    do {

-      if (*(longlong *)(param_1 + (ulonglong)uVar3 * 8) != 0) {

-        iVar2 = FlushLookUpTableBucket(param_1,uVar3);

-        uVar4 = uVar4 + iVar2;

-      }

-      uVar3 = uVar3 + 1 & 0x1f;

-    } while ((uVar3 != uVar1) && (uVar4 < 0x10));

-    *(uint *)(param_1 + 0x104) = uVar3;

-    in_EAX = UpdateInternalStatsOnFlush(param_1,uVar4);

-  }

-  return in_EAX;

+  if (param_10 == 0) {

+    return 0xc00000bb;

+  }

+  param_8[2] = 0;

+  param_8[3] = 0;

+  pwVar9 = param_4;

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

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 2) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x29])) {

+    param_2 = 0x10;

+    pwVar9 = (wchar_t *)(ulonglong)param_7;

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x10,

+             &WPP_2eb7f2ea1cef30a03127f175d3f499fc_Traceguids,param_7);

+  }

+  plVar8 = (longlong *)&WPP_2eb7f2ea1cef30a03127f175d3f499fc_Traceguids;

+  uVar2 = (uint)param_4;

+  if (*(char *)(param_10 + 0x40) != '\x01') {

+    if (param_7 < 0x228018) {

+      if (param_7 == 0x228017) {

+        lVar4 = IoGetRequestorProcess(param_10);

+        bVar10 = lVar4 != Srv2ServerProcess;

+        if (bVar10) {

+          KeAttachProcess();

+        }

+        if (uVar2 < 0xf0) goto LAB_0;

+        uVar3 = Smb2DeleteShare((longlong)param_3);

+        uVar2 = (uint)uVar3;

+      }

+      else {

+        if (param_7 == 0x144003) goto LAB_1;

+        param_2 = 4;

+        if (param_7 == 0x144007) goto LAB_2;

+        if (param_7 == 0x148090) {

+          if (*(char *)(param_10 + 0x40) != '\0') goto LAB_3;

+          Smb2DfsInitialize();

+          goto LAB_4;

+        }

+        if (param_7 == 0x228007) {

+          lVar4 = IoGetRequestorProcess(param_10);

+          bVar10 = lVar4 != Srv2ServerProcess;

+          if (bVar10) {

+            KeAttachProcess();

+          }

+          uVar3 = Smb2AdmFileClose(uVar2,(longlong)param_3);

+          uVar2 = (uint)uVar3;

+        }

+        else if (param_7 == 0x22800b) {

+          lVar4 = IoGetRequestorProcess(param_10);

+          bVar10 = lVar4 != Srv2ServerProcess;

+          if (bVar10) {

+            KeAttachProcess();

+          }

+          uVar2 = Smb2AdmSessionClose(uVar2,(longlong)param_3,plVar8,(ulonglong *)pwVar9);

+        }

+        else if (param_7 == 0x22800f) {

+          lVar4 = IoGetRequestorProcess(param_10);

+          bVar10 = lVar4 != Srv2ServerProcess;

+          if (bVar10) {

+            KeAttachProcess();

+          }

+          if (uVar2 < 0xf0) {

+LAB_0:

+            uVar2 = 0xc000000d;

+          }

+          else {

+            uVar2 = Smb2AddShare((undefined4 *)param_3);

+          }

+        }

+        else {

+          if (param_7 != 0x228013) goto LAB_5;

+          lVar4 = IoGetRequestorProcess(param_10);

+          bVar10 = lVar4 != Srv2ServerProcess;

+          if (bVar10) {

+            KeAttachProcess();

+          }

+          if (uVar2 < 0xf0) goto LAB_0;

+          uVar3 = Smb2ModifyShare((longlong)param_3);

+          uVar2 = (uint)uVar3;

+        }

+      }

+    }

+    else if (param_7 == 0x22801b) {

+      lVar4 = IoGetRequestorProcess(param_10);

+      bVar10 = lVar4 != Srv2ServerProcess;

+      lVar4 = Srv2ServerProcess;

+      if (bVar10) {

+        KeAttachProcess();

+      }

+      uVar3 = Smb2AdmSessionEnlist(lVar4,param_2,param_6,param_5);

+      uVar2 = (uint)uVar3;

+    }

+    else if (param_7 == 0x22801f) {

+      lVar4 = IoGetRequestorProcess(param_10);

+      bVar10 = lVar4 != Srv2ServerProcess;

+      if (bVar10) {

+        KeAttachProcess();

+      }

+      uVar3 = Smb2AdmSessionsInvComplete

+                        (uVar2,(longlong *)param_3,(char *)plVar8,(ulonglong *)pwVar9);

+      uVar2 = (uint)uVar3;

+    }

+    else if (param_7 == 0x228023) {

+      lVar4 = IoGetRequestorProcess(param_10);

+      bVar10 = lVar4 != Srv2ServerProcess;

+      if (bVar10) {

+        KeAttachProcess();

+      }

+      uVar3 = Smb2AdmFilesInvComplete(uVar2,(longlong *)param_3,(char *)plVar8,pwVar9);

+      uVar2 = (uint)uVar3;

+    }

+    else {

+      if (param_7 != 0x228027) {

+        if (param_7 == 0x22802b) {

+          if (uVar2 == 0) {

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

+              return 0xc000000d;

+            }

+            if ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 4) == 0) {

+              return 0xc000000d;

+            }

+            if (WPP_GLOBAL_Control[0x29] == '\0') {

+              return 0xc000000d;

+            }

+            uVar6 = 0x11;

+LAB_6:

+            WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),uVar6,

+                     &WPP_2eb7f2ea1cef30a03127f175d3f499fc_Traceguids,param_3);

+            return 0xc000000d;

+          }

+          pwVar7 = param_3;

+          if (((uVar2 < 0x10) &&

+              (pwVar7 = (wchar_t *)0x0, (undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

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

+              (pwVar7 = (wchar_t *)0x0, WPP_GLOBAL_Control[0x29] != '\0')))) {

+            pwVar9 = param_3;

+            WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x12,

+                      &WPP_2eb7f2ea1cef30a03127f175d3f499fc_Traceguids,param_3);

+          }

+          puVar5 = Srv2StartInstanceEx((byte)*param_3,(longlong)pwVar7,plVar8,(ulonglong *)pwVar9);

+          uVar2 = (uint)puVar5;

+          goto LAB_7;

+        }

+        if (param_7 == 0x22802f) {

+          if (uVar2 == 0) {

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

+              return 0xc000000d;

+            }

+            if ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 4) == 0) {

+              return 0xc000000d;

+            }

+            if (WPP_GLOBAL_Control[0x29] == '\0') {

+              return 0xc000000d;

+            }

+            uVar6 = 0x13;

+            goto LAB_6;

+          }

+          uVar3 = Srv2StopInstance((uint)(byte)*param_3,4,

+                                   &WPP_2eb7f2ea1cef30a03127f175d3f499fc_Traceguids,

+                                   (ulonglong *)pwVar9);

+          uVar2 = (uint)uVar3;

+          goto LAB_7;

+        }

+        if (param_7 == 0x228033) {

+          if (uVar2 < 0x10) {

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

+              return 0xc000000d;

+            }

+            if ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 4) == 0) {

+              return 0xc000000d;

+            }

+            if (WPP_GLOBAL_Control[0x29] == '\0') {

+              return 0xc000000d;

+            }

+            uVar6 = 0x14;

+            goto LAB_6;

+          }

+          uVar3 = Srv2SetInstanceProperties

+                            ((byte *)param_3,4,&WPP_2eb7f2ea1cef30a03127f175d3f499fc_Traceguids);

+          uVar2 = (uint)uVar3;

+          goto LAB_7;

+        }

+        goto LAB_5;

+      }

+      lVar4 = IoGetRequestorProcess(param_10);

+      bVar10 = lVar4 != Srv2ServerProcess;

+      if (bVar10) {

+        KeAttachProcess();

+      }

+      uVar2 = Smb2AdmFileNotifyClose(uVar2,(longlong)param_3);

+    }

+    if (bVar10) {

+      KeDetachProcess();

+    }

+    goto LAB_7;

+  }

+  if (param_7 == 0x144003) {

+LAB_1:

+    KeEnterCriticalRegion();

+    lVar4 = IoGetRequestorProcess(param_10);

+    if (lVar4 == Srv2ServerProcess) {

+      uVar2 = Srv2StartDriver(Srv2ServerProcess,param_2,plVar8,(ulonglong *)pwVar9);

+    }

+    else {

+      lVar4 = Srv2ServerProcess;

+      KeAttachProcess();

+      uVar2 = Srv2StartDriver(lVar4,param_2,plVar8,(ulonglong *)pwVar9);

+      KeDetachProcess();

+    }

+    KeLeaveCriticalRegion();

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

+      *(undefined8 *)(param_1 + 0x20) = 1;

+    }

+    goto LAB_7;

+  }

+  if (param_7 == 0x144007) {

+LAB_2:

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

+      KeEnterCriticalRegion();

+      lVar4 = IoGetRequestorProcess(param_10);

+      bVar10 = lVar4 != Srv2ServerProcess;

+      if (bVar10) {

+        KeAttachProcess();

+      }

+      Srv2ShutdownDriver('\0',param_2,(undefined *)plVar8,(ulonglong *)pwVar9);

+      if (bVar10) {

+        KeDetachProcess();

+      }

+      KeLeaveCriticalRegion();

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

+LAB_4:

+      uVar2 = 0;

+      goto LAB_7;

+    }

+LAB_3:

+    uVar2 = 0xc0000010;

+  }

+  else {

+    if (((param_7 != 0x144038) && (param_7 != 0x14807c)) &&

+       ((param_7 != 0x14405c && (param_7 != 0x1440a8)))) {

+      if (param_7 == 0x148090) goto LAB_3;

+      if ((((param_7 != 0x144047) &&

+           ((0x38 < param_7 - 0x14406c ||

+            ((0x110000000000001U >> ((ulonglong)(param_7 - 0x14406c) & 0x3f) & 1) == 0)))) &&

+          ((0x34 < param_7 - 0x148194 ||

+           ((0x11000000010111U >> ((ulonglong)(param_7 - 0x148194) & 0x3f) & 1) == 0)))) &&

+         ((((param_7 != 0x144190 && (param_7 != 0x148074)) && (param_7 != 0x1401bc)) &&

+          ((param_7 != 0x1401c0 && (param_7 != 0x1400ac)))))) {

+        return 0xc0000022;

+      }

+    }

+LAB_5:

+    uVar2 = 0xc0000184;

+    KeEnterCriticalRegion();

+    cVar1 = ExAcquireResourceSharedLite(&Srv2StartupShutdownLock,0);

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

+      if ((Srv2DriverState == 2) || (uVar2 = 0xc0000184, param_7 == 0x148074)) {

+        uVar2 = Smb2ProviderDispatchFsctl

+                          (param_1,1,(uint *)param_3,(char *)((ulonglong)param_4 & 0xffffffff),

+                           param_5,param_6,param_7,(longlong)param_8,param_9,param_10);

+      }

+      ExReleaseResourceLite(&Srv2StartupShutdownLock);

+    }

+    KeLeaveCriticalRegion();

+  }

+LAB_7:

+  *param_8 = uVar2;

+  return uVar2;

 }
```

## `Smb2WriteHashFileHeader`  (modified)

```diff
--- Smb2WriteHashFileHeader
+++ Smb2WriteHashFileHeader
@@ -1,93 +1,98 @@
 

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

 

 int Smb2WriteHashFileHeader

               (undefined8 param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,

-              undefined8 param_5,ushort *param_6,uint *param_7,undefined8 *param_8)

+              uint param_5,ushort *param_6,uint *param_7,undefined8 *param_8)

 

 {

   undefined8 uVar1;

-  undefined8 uVar2;

-  undefined8 uVar3;

-  int iVar4;

-  ulonglong uVar5;

-  uint uVar6;

-  longlong unaff_RBP;

-  uint uVar7;

-  ushort *unaff_RDI;

-  uint *unaff_R12;

-  undefined4 unaff_R13D;

-  undefined8 *unaff_R14;

-  ushort unaff_R15W;

-  undefined4 in_XMM0_Da;

-  undefined4 in_XMM0_Db;

-  undefined4 in_XMM0_Dc;

-  undefined4 in_XMM0_Dd;

+  int iVar2;

+  ulonglong uVar3;

+  uint uVar4;

+  uint uVar5;

+  undefined1 auStack_b8 [32];

+  uint local_98;

+  undefined4 local_88;

+  undefined4 local_80;

+  undefined4 uStack_7c;

+  undefined8 uStack_78;

+  undefined8 local_70;

+  undefined4 uStack_68;

+  uint uStack_64;

+  undefined2 local_60;

+  undefined2 uStack_5e;

+  undefined4 uStack_5c;

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  undefined8 local_38;

+  ulonglong local_30;

   

-  uVar7 = (uint)unaff_R15W;

-  *(undefined4 *)(unaff_RBP + -9) = in_XMM0_Da;

-  *(undefined4 *)(unaff_RBP + -5) = in_XMM0_Db;

-  *(undefined4 *)(unaff_RBP + -1) = in_XMM0_Dc;

-  *(undefined4 *)(unaff_RBP + 3) = in_XMM0_Dd;

-  *(undefined4 *)(unaff_RBP + -0x19) = in_XMM0_Da;

-  *(undefined4 *)(unaff_RBP + -0x15) = in_XMM0_Db;

-  *(undefined4 *)(unaff_RBP + -0x11) = in_XMM0_Dc;

-  *(undefined4 *)(unaff_RBP + -0xd) = in_XMM0_Dd;

-  iVar4 = ZwQueryInformationFile();

-  if (iVar4 == 0) {

-    uVar1 = *(undefined8 *)(unaff_RBP + -1);

-    if (unaff_RDI == (ushort *)0x0) {

-      uVar6 = 0x28;

+  local_30 = __security_cookie ^ (ulonglong)auStack_b8;

+  uStack_5c = 0;

+  local_38 = 0;

+  *param_7 = 0;

+  uVar5 = 0;

+  local_98 = 5;

+  local_48 = 0;

+  uStack_40 = 0;

+  local_58 = 0;

+  uStack_50 = 0;

+  local_88 = param_2;

+  iVar2 = ZwQueryInformationFile(0,&local_58,&local_48,0x18);

+  uVar1 = uStack_40;

+  if (iVar2 == 0) {

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

+      uVar4 = 0x28;

     }

     else {

-      uVar7 = (uint)*unaff_RDI;

-      uVar6 = uVar7 + 0x24;

-      uVar5 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

-      if ((int)uVar5 == 0) {

-        uVar6 = uVar6 & 0xffff;

+      uVar5 = (uint)*param_6;

+      uVar4 = uVar5 + 0x24;

+      uVar3 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

+      if ((int)uVar3 == 0) {

+        uVar4 = uVar4 & 0xffff;

       }

     }

-    uVar5 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

-    if (((int)uVar5 == 0) || (uVar6 <= *(uint *)(unaff_RBP + 0x67))) {

-      *(undefined4 *)(unaff_RBP + -0x41) = *(undefined4 *)(unaff_RBP + -0x49);

-      *(undefined4 *)(unaff_RBP + -0x3d) = unaff_R13D;

-      *(undefined8 *)(unaff_RBP + -0x39) = 0;

-      *(undefined8 *)(unaff_RBP + -0x31) = uVar1;

-      *(undefined4 *)(unaff_RBP + -0x29) = 0;

-      *(uint *)(unaff_RBP + -0x25) = uVar6;

-      *(undefined2 *)(unaff_RBP + -0x21) = 0;

-      *(short *)(unaff_RBP + -0x1f) = (short)uVar7;

-      uVar1 = *(undefined8 *)(unaff_RBP + -0x39);

-      uVar2 = *(undefined8 *)(unaff_RBP + -0x31);

-      uVar3 = *(undefined8 *)(unaff_RBP + -0x29);

-      *unaff_R14 = *(undefined8 *)(unaff_RBP + -0x41);

-      unaff_R14[1] = uVar1;

-      uVar1 = *(undefined8 *)(unaff_RBP + -0x21);

-      unaff_R14[2] = uVar2;

-      unaff_R14[3] = uVar3;

-      unaff_R14[4] = uVar1;

-      if (unaff_RDI != (ushort *)0x0) {

-        memmove((void *)((longlong)unaff_R14 + 0x24),*(void **)(unaff_RDI + 4),(ulonglong)uVar7);

+    uVar3 = Feature_1270586681__private_IsEnabledDeviceUsageNoInline();

+    if (((int)uVar3 == 0) || (uVar4 <= param_5)) {

+      local_80 = local_88;

+      uStack_78 = 0;

+      local_70 = uVar1;

+      uStack_68 = 0;

+      local_60 = 0;

+      uStack_5e = (undefined2)uVar5;

+      *param_8 = CONCAT44(param_3,local_88);

+      param_8[1] = 0;

+      param_8[2] = uVar1;

+      param_8[3] = (ulonglong)uVar4 << 0x20;

+      param_8[4] = (ulonglong)CONCAT42(uStack_5c,uStack_5e) << 0x10;

+      if (param_6 != (ushort *)0x0) {

+        uStack_7c = param_3;

+        uStack_64 = uVar4;

+        memmove((void *)((longlong)param_8 + 0x24),*(void **)(param_6 + 4),(ulonglong)uVar5);

       }

-      *unaff_R12 = uVar6;

-      iVar4 = 0;

+      *param_7 = uVar4;

+      iVar2 = 0;

     }

     else {

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

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

          (WPP_GLOBAL_Control[0x29] != '\0')) {

+        local_98 = uVar4;

         WPP_SF_LL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x37,

-                  &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,*(uint *)(unaff_RBP + 0x67));

+                  &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,param_5);

       }

-      iVar4 = -0x3fffffdd;

+      iVar2 = -0x3fffffdd;

     }

   }

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

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

           (WPP_GLOBAL_Control[0x29] != '\0')) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),unaff_R15W + 0x36,

-             &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,iVar4);

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x36,

+             &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,iVar2);

   }

-  return iVar4;

+  return iVar2;

 }
```

## `memmove`  (modified)

```diff
--- memmove calling
+++ memmove calling
@@ -5,5 +5,5 @@
-FUN_140093316
-FUN_140097c2f
-FUN_140099cb5
-FUN_14009aa66
-FUN_14009c462
+FUN_140092b36
+FUN_14009744f
+FUN_1400994d5
+FUN_14009a286
+FUN_14009bc82
@@ -29,0 +30 @@
+Smb2ReadHashFileV2
```

## `Srv2StartDriver`  (modified)

```diff
--- Srv2StartDriver
+++ Srv2StartDriver
@@ -1,13 +1,151 @@
 

 uint Srv2StartDriver(undefined8 param_1,undefined8 param_2,longlong *param_3,ulonglong *param_4)

 

 {

-  int *piVar1;

-  uint in_EAX;

-  undefined4 in_register_00000004;

+  int iVar1;

+  uint uVar2;

+  ulonglong uVar3;

+  ulonglong *puVar4;

+  undefined *puVar5;

+  undefined8 uVar6;

+  int iVar7;

   

-  piVar1 = (int *)(CONCAT44(in_register_00000004,in_EAX) + 0x3b);

-  *piVar1 = *piVar1 + -1;

-  return in_EAX;

+  puVar5 = &Srv2StartupShutdownLock;

+  uVar6 = CONCAT71((int7)((ulonglong)param_2 >> 8),1);

+  ExAcquireResourceExclusiveLite();

+  if (Srv2DriverState == 2) {

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

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) != 0)) && (WPP_GLOBAL_Control[0x29] != '\0')) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0xb,

+               &WPP_de24281daf7333058ef6f468585a0364_Traceguids,2);

+    }

+    uVar2 = 0;

+    iVar1 = Srv2DriverState;

+  }

+  else if (Srv2DriverState == -1) {

+    uVar2 = 0xc0000184;

+    iVar1 = Srv2DriverState;

+  }

+  else {

+    Srv2DriverState = 1;

+    uVar2 = Srv2InitializeNodes();

+    iVar7 = 0;

+    if ((int)uVar2 < 0) {

+      iVar1 = 0;

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

+          (iVar1 = iVar7, (*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) != 0)) &&

+         (WPP_GLOBAL_Control[0x29] != '\0')) {

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0xc,

+                 &WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+      }

+    }

+    else {

+      uVar3 = Srv2InitializeStructures();

+      uVar2 = (uint)uVar3;

+      if ((int)uVar2 < 0) {

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) != 0)) && (WPP_GLOBAL_Control[0x29] != '\0')

+           ) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0xd,

+                   &WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+        }

+      }

+      else {

+        puVar4 = Smb2ProviderInitializeGlobal(puVar5,uVar6,param_3,param_4);

+        uVar2 = (uint)puVar4;

+        if ((int)uVar2 < 0) {

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

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

+             (WPP_GLOBAL_Control[0x29] != '\0')) {

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0xe,

+                     &WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+          }

+        }

+        else {

+          uVar2 = SrvAdminNodeInitialize();

+          if ((int)uVar2 < 0) {

+            puVar5 = WPP_GLOBAL_Control;

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

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

+               (WPP_GLOBAL_Control[0x29] != '\0')) {

+              puVar5 = *(undefined **)(WPP_GLOBAL_Control + 0x18);

+              param_3 = (longlong *)&WPP_de24281daf7333058ef6f468585a0364_Traceguids;

+              uVar6 = 0xf;

+              param_4 = (ulonglong *)(ulonglong)uVar2;

+              WPP_SF_D(puVar5,0xf,&WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+            }

+          }

+          else {

+            uVar6 = 0;

+            puVar4 = Srv2StartInstanceEx(0,0,param_3,param_4);

+            uVar2 = (uint)puVar4;

+            if ((int)uVar2 < 0) {

+              puVar5 = WPP_GLOBAL_Control;

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

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

+                 (WPP_GLOBAL_Control[0x29] != '\0')) {

+                puVar5 = *(undefined **)(WPP_GLOBAL_Control + 0x18);

+                param_3 = (longlong *)&WPP_de24281daf7333058ef6f468585a0364_Traceguids;

+                uVar6 = 0x10;

+                param_4 = (ulonglong *)((ulonglong)puVar4 & 0xffffffff);

+                WPP_SF_D(puVar5,0x10,&WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+              }

+            }

+            else {

+              uVar2 = Smb2ProviderStartGlobal();

+              if ((int)uVar2 < 0) {

+                puVar5 = WPP_GLOBAL_Control;

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

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

+                   (WPP_GLOBAL_Control[0x29] != '\0')) {

+                  puVar5 = *(undefined **)(WPP_GLOBAL_Control + 0x18);

+                  param_3 = (longlong *)&WPP_de24281daf7333058ef6f468585a0364_Traceguids;

+                  uVar6 = 0x11;

+                  param_4 = (ulonglong *)(ulonglong)uVar2;

+                  WPP_SF_D(puVar5,0x11,&WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+                }

+              }

+              else {

+                uVar2 = FireSrv2StateChangeEvent(0);

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

+                  Srv2IsRunning = 1;

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

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

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

+                    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x13,

+                            &WPP_de24281daf7333058ef6f468585a0364_Traceguids);

+                  }

+                  uVar2 = 0;

+                  iVar1 = 2;

+                  goto LAB_0;

+                }

+                puVar5 = WPP_GLOBAL_Control;

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

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

+                   (WPP_GLOBAL_Control[0x29] != '\0')) {

+                  puVar5 = *(undefined **)(WPP_GLOBAL_Control + 0x18);

+                  param_3 = (longlong *)&WPP_de24281daf7333058ef6f468585a0364_Traceguids;

+                  uVar6 = 0x12;

+                  param_4 = (ulonglong *)(ulonglong)uVar2;

+                  WPP_SF_D(puVar5,0x12,&WPP_de24281daf7333058ef6f468585a0364_Traceguids,uVar2);

+                }

+                Smb2ProviderStopGlobal();

+              }

+              Srv2StopInstances(puVar5,uVar6,(undefined *)param_3,param_4);

+            }

+            SrvAdminNodeUninitialize();

+          }

+          Smb2ProviderCleanupGlobal(puVar5,uVar6,param_3,param_4);

+        }

+        Srv2DeinitializeStructures();

+      }

+      Srv2DeinitializeNodes();

+      iVar1 = iVar7;

+    }

+  }

+LAB_0:

+  Srv2DriverState = iVar1;

+  ExReleaseResourceLite(&Srv2StartupShutdownLock);

+  return uVar2;

 }
```

## `Smb2GenerateV2HashHeader`  (modified)

```diff
--- Smb2GenerateV2HashHeader
+++ Smb2GenerateV2HashHeader
@@ -1,115 +1,90 @@
 

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

 

 int Smb2GenerateV2HashHeader

               (ulonglong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

 

 {

-  short sVar1;

-  int iVar2;

-  undefined2 uVar3;

-  uint *unaff_RBP;

-  wchar_t *unaff_RSI;

-  uint *puVar4;

-  longlong unaff_R13;

-  undefined8 in_stack_00000060;

-  longlong in_stack_00000068;

-  ushort in_stack_00000070;

-  longlong in_stack_00000078;

+  uint uVar1;

+  ulonglong uVar2;

+  undefined4 *puVar3;

+  undefined8 *puVar4;

+  int iVar5;

+  undefined8 *puVar6;

+  undefined8 *puVar7;

+  ulonglong *puVar8;

+  uint uVar9;

+  undefined1 auStackY_c8 [32];

+  uint local_88 [2];

+  undefined8 local_80;

+  undefined8 uStack_78;

+  undefined8 local_70;

+  undefined8 uStack_68;

+  undefined8 local_60;

+  undefined8 uStack_58;

+  undefined8 local_50;

+  ulonglong local_48;

   

-  iVar2 = RtlAppendUnicodeStringToString();

-  if (iVar2 < 0) {

-    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

-      return iVar2;

-    }

-    if ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0x1d & 1) == 0) {

-      return iVar2;

-    }

-    if (WPP_GLOBAL_Control[0x29] == '\0') {

-      return iVar2;

-    }

-    uVar3 = 0x20;

-LAB_0:

-    WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),uVar3,

-              &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,unaff_R13);

-    return iVar2;

+  local_48 = __security_cookie ^ (ulonglong)auStackY_c8;

+  uVar2 = param_1[0x46];

+  local_88[0] = 0;

+  puVar3 = *(undefined4 **)(uVar2 + 0xd0);

+  uVar9 = *(int *)(uVar2 + 0xc0) - 0x18;

+  uVar1 = puVar3[3];

+  if (uVar1 <= uVar9) {

+    uVar9 = uVar1;

   }

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

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

      (1 < (byte)WPP_GLOBAL_Control[0x29])) {

-    WPP_SF_qZ(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x21,

-              &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,unaff_R13,unaff_RSI);

+    param_4 = *(undefined8 *)(puVar3 + 4);

+    WPP_SF_iDddd(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),(ulonglong)uVar1,param_3,param_4);

   }

-  IoReuseIrp(*(undefined8 *)(unaff_R13 + 0x78),0);

-  puVar4 = unaff_RBP;

-  iVar2 = Smb2GetFileObjectID();

-  if (-1 < iVar2) {

-    *(undefined2 *)(unaff_RBP + -0x1e) = 0;

-    *(ulonglong *)(unaff_RBP + -0x1c) = in_stack_00000078 + (ulonglong)(in_stack_00000070 >> 1) * 2;

-    *(ushort *)((longlong)unaff_RBP + -0x76) = 0x206 - in_stack_00000070;

-    iVar2 = I_ObjectIdToHashPath

-                      ((_UNICODE_STRING *)(unaff_RBP + -0x1e),unaff_RBP,(ulong)puVar4,

-                       *(uint *)(in_stack_00000068 + 4));

-    if (iVar2 < 0) {

-      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

-        return iVar2;

+  puVar4 = *(undefined8 **)(uVar2 + 0xd8);

+  iVar5 = Smb2WriteHashFileHeader

+                    (param_2,*puVar3,puVar3[1],param_4,uVar9,(ushort *)0x0,local_88,puVar4 + 3);

+  if (-1 < iVar5) {

+    puVar7 = &local_70;

+    puVar6 = &local_80;

+    local_50 = 0;

+    local_70 = 0;

+    uStack_68 = 0;

+    puVar8 = (ulonglong *)0x28;

+    local_60 = 0;

+    uStack_58 = 0;

+    local_80 = 0;

+    uStack_78 = 0;

+    iVar5 = ZwQueryInformationFile(param_2);

+    uVar1 = local_88[0];

+    if (-1 < iVar5) {

+      puVar4[4] = uStack_58;

+      *(uint *)(puVar4 + 2) = local_88[0];

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

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

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

+          puVar8 = (ulonglong *)puVar4[4];

+          WPP_SF_iiDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),puVar6,puVar7,puVar8);

+        }

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

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

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

+          puVar8 = (ulonglong *)*puVar4;

+          WPP_SF_iiD(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),puVar6,puVar7,puVar8);

+        }

       }

-      if ((*(uint *)(WPP_GLOBAL_Control + 0x2c) >> 0x1d & 1) == 0) {

-        return iVar2;

-      }

-      if (WPP_GLOBAL_Control[0x29] == '\0') {

-        return iVar2;

-      }

-      uVar3 = 0x22;

-      goto LAB_0;

+      *(ulonglong *)(param_1[0xf] + 0x38) = (ulonglong)(uVar1 + 0x18);

+      uVar2 = param_1[0xf];

+      *(undefined4 *)(uVar2 + 0x30) = 0;

+      Smb2CompleteRetrieveHashData(param_1,uVar2,(ulonglong)(uVar1 + 0x18),puVar8);

+      return iVar5;

     }

-    *(longlong *)(unaff_RBP + -0x18) = in_stack_00000078;

-    sVar1 = (short)unaff_RBP[-0x1e] + in_stack_00000070;

-    *(short *)(unaff_RBP + -0x1a) = sVar1;

-    *(short *)((longlong)unaff_RBP + -0x66) = sVar1;

-    unaff_RBP[-0x10] = 0;

-    unaff_RBP[-0xf] = 0;

-    *(uint **)(unaff_RBP + -0xe) = unaff_RBP + -0x1a;

-    unaff_RBP[-0x12] = 0x30;

-    unaff_RBP[-0xc] = 0x200;

-    unaff_RBP[-10] = 0;

-    unaff_RBP[-9] = 0;

-    unaff_RBP[-8] = 0;

-    unaff_RBP[-7] = 0;

-    iVar2 = ZwCreateFile(&stack0x00000060,0x80000000,unaff_RBP + -0x12,unaff_RBP + -6,0);

-    if (-1 < iVar2) {

-      iVar2 = Smb2ValidateHashFile(unaff_R13,in_stack_00000060);

-      if (iVar2 == 0) {

-        SrvNotifyGroveler(*(undefined8 *)(unaff_RBP + -0x20),1,

-                          *(undefined4 *)(in_stack_00000068 + 4));

-        **(undefined8 **)(unaff_RBP + -0x14) = in_stack_00000060;

-        return 0;

-      }

-      if (iVar2 != -0x3fffffea) {

-        ZwClose();

-        return iVar2;

-      }

-      ZwClose(in_stack_00000060);

-      goto LAB_1;

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

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

+       (WPP_GLOBAL_Control[0x29] != '\0')) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),10,

+               &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,iVar5);

     }

-  }

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

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

-     (WPP_GLOBAL_Control[0x29] != '\0')) {

-    WPP_SF_qL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x23,

-              &WPP_2be8a1a89f51315fd7b3592fb029c951_Traceguids,unaff_R13);

-  }

-  if (iVar2 == -0x3fffffbd) {

-    return -0x3fff5eff;

-  }

-LAB_1:

-  SrvNotifyGroveler(*(undefined8 *)(unaff_RBP + -0x20),1,*(undefined4 *)(in_stack_00000068 + 4));

-  if (*(int *)(in_stack_00000068 + 4) == 1) {

-    *(int *)(Srv2Statistics + 0x94) = *(int *)(Srv2Statistics + 0x94) + 1;

-  }

-  else if (*(int *)(in_stack_00000068 + 4) == 2) {

-    *(int *)(Srv2Statistics + 0xbc) = *(int *)(Srv2Statistics + 0xbc) + 1;

   }

   return -0x3fff5eff;

 }
```

## `Smb2ValidateLoopbackAddress`  (modified)

```diff
--- Smb2ValidateLoopbackAddress
+++ Smb2ValidateLoopbackAddress
@@ -1,13 +1,38 @@
-

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

 

 int Smb2ValidateLoopbackAddress(undefined8 param_1,longlong param_2)

 

 {

-  longlong in_RAX;

+  char cVar1;

+  undefined4 uVar2;

+  int iVar3;

+  int local_res18 [4];

   

-  *(char *)(in_RAX + -0x75) = *(char *)(in_RAX + -0x75) + (char)param_1;

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

-  halt_baddata();

+  local_res18[0] = 0;

+  uVar2 = QueryContextAttributesW(param_1,0x25,local_res18);

+  iVar3 = MapSecurityError(uVar2);

+  if (iVar3 == -0x3fffff45) {

+    iVar3 = 0;

+  }

+  else if (iVar3 < 0) {

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

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

+       (WPP_GLOBAL_Control[0x29] != '\0')) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x26,

+               &WPP_96a17a52fdd0333a60f2af341653ee3d_Traceguids,iVar3);

+    }

+  }

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

+    cVar1 = SrvNetIsConnectionLoopback(*(undefined8 *)(param_2 + 0x1e0));

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

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

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

+         (WPP_GLOBAL_Control[0x29] != '\0')) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x27,

+                &WPP_96a17a52fdd0333a60f2af341653ee3d_Traceguids);

+      }

+      iVar3 = -0x3fffffde;

+    }

+  }

+  return iVar3;

 }
```

## `Srv2StopInstanceInternal`  (modified)

```diff
--- Srv2StopInstanceInternal
+++ Srv2StartInstance
@@ -1,20 +1,2 @@
-

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

-

-void Srv2StopInstanceInternal

-               (ulonglong *param_1,undefined8 param_2,undefined *param_3,ulonglong *param_4)

-

-{

-  undefined8 unaff_RBX;

-  

-  IoDeleteDevice();

-  Srv2ServerProcess = unaff_RBX;

-  Srv2DeviceObject = unaff_RBX;

-  wil_UninitializeFeatureStaging();

-  TlgUnregisterAggregateProvider(param_1,param_2,(_GUID *)param_3);

-  WppCleanupKm();

-  McGenEventUnregister_EtwUnregister();

-  ExDeleteResourceLite(&Srv2StartupShutdownLock);

-  return;

-}

-

+Failed to decompile srv2.sys - .ProgramDB Srv2StartInstance : Error: Decompile error: 
+Low-level Error: DuplicateFunctionError, but could not recover original symbol
```

## `NTOSKRNL.EXE::IoSizeofWorkItem`  (modified)

```diff
--- NTOSKRNL.EXE::IoSizeofWorkItem calling
+++ NTOSKRNL.EXE::IoSizeofWorkItem calling
@@ -1 +0,0 @@
-Srv2StartInstance
```

## `NTOSKRNL.EXE::RtlInitUnicodeString`  (modified)

```diff
--- NTOSKRNL.EXE::RtlInitUnicodeString calling
+++ NTOSKRNL.EXE::RtlInitUnicodeString calling
@@ -18 +17,0 @@
-Srv2StartInstance
```

## `NTOSKRNL.EXE::ExAcquireResourceExclusiveLite`  (modified)

```diff
--- NTOSKRNL.EXE::ExAcquireResourceExclusiveLite calling
+++ NTOSKRNL.EXE::ExAcquireResourceExclusiveLite calling
@@ -1 +1 @@
-FUN_140093c07
+FUN_140093427
@@ -44 +43,0 @@
-Srv2StartInstance
```

## `SRVNET.SYS::SrvNetStartClient`  (modified)

```diff
--- SRVNET.SYS::SrvNetStartClient calling
+++ SRVNET.SYS::SrvNetStartClient calling
@@ -1 +0,0 @@
-Srv2StartInstance
```

## `SRVNET.SYS::SrvNetIsTdiConnection`  (modified)

```diff
--- SRVNET.SYS::SrvNetIsTdiConnection calling
+++ SRVNET.SYS::SrvNetIsTdiConnection calling
@@ -1 +0,0 @@
-Smb2ValidateLoopbackAddress
```

## `NTOSKRNL.EXE::ExInitializeResourceLite`  (modified)

```diff
--- NTOSKRNL.EXE::ExInitializeResourceLite calling
+++ NTOSKRNL.EXE::ExInitializeResourceLite calling
@@ -12 +11,0 @@
-Srv2StartInstance
```

## `SRVNET.SYS::SrvNetQueryConnectionInformation`  (modified)

```diff
--- SRVNET.SYS::SrvNetQueryConnectionInformation calling
+++ SRVNET.SYS::SrvNetQueryConnectionInformation calling
@@ -1 +0,0 @@
-Smb2ValidateLoopbackAddress
```

## `NTOSKRNL.EXE::ExReleaseResourceLite`  (modified)

```diff
--- NTOSKRNL.EXE::ExReleaseResourceLite calling
+++ NTOSKRNL.EXE::ExReleaseResourceLite calling
@@ -2 +2 @@
-FUN_140093c07
+FUN_140093427
@@ -64 +63,0 @@
-Srv2StartInstance
```

## `SRVNET.SYS::SrvNetRegisterClient`  (modified)

```diff
--- SRVNET.SYS::SrvNetRegisterClient calling
+++ SRVNET.SYS::SrvNetRegisterClient calling
@@ -1 +0,0 @@
-Srv2StartInstance
```

## `NTOSKRNL.EXE::ExAllocatePool2`  (modified)

```diff
--- NTOSKRNL.EXE::ExAllocatePool2 calling
+++ NTOSKRNL.EXE::ExAllocatePool2 calling
@@ -1 +1 @@
-FUN_140093711
+FUN_140092f31
@@ -70 +69,0 @@
-Srv2StartInstance
```
