# CVE-2026-113863 — dhcpcore.dll patch diff

`dhcpcore.dll` 10.0.26100.9711 -> 10.0.26100.9974 (ghidriff).

## `GetOriginalSubnetMask`  (modified)

```diff
--- GetOriginalSubnetMask
+++ GetOriginalSubnetMask
@@ -1,23 +1,51 @@
 

 undefined4 GetOriginalSubnetMask(longlong param_1,u_long *param_2)

 

 {

-  int iVar1;

-  longlong in_RAX;

-  longlong unaff_RBX;

-  undefined1 auStackX_20 [8];

-  longlong lStack0000000000000028;

+  uint uVar1;

+  undefined8 *puVar2;

+  u_long uVar3;

+  undefined8 *puVar4;

+  ushort uVar5;

   

-  if (in_RAX != 0) {

-    lStack0000000000000028 = in_RAX;

-    iVar1 = RtlOemStringToUnicodeString(auStackX_20,&stack0x00000030,0);

-    if (-1 < iVar1) {

-      return (int)lStack0000000000000028;

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

+    return 0x57;

+  }

+  *param_2 = 0;

+  AcquireSRWLockShared((PSRWLOCK)(param_1 + 0x2a0));

+  puVar2 = *(undefined8 **)(param_1 + 0x2b8);

+  do {

+    puVar4 = puVar2;

+    if (puVar4 == (undefined8 *)(param_1 + 0x2b8)) {

+      if ((DAT_0 & 2) != 0) {

+        WPP_SF_q(0x401,0x3a,0x180057630,*(undefined8 *)(param_1 + 0x18));

+      }

+      goto LAB_1;

     }

-    if (unaff_RBX == 0) {

-      DhcpFree(&stack0x00000028);

+    puVar2 = (undefined8 *)*puVar4;

+  } while (*(int *)(puVar4 + 2) != 0xdd);

+  uVar1 = *(uint *)(puVar4 + 7);

+  if (g_fVelocityDhcpGetOriginalSubnetMaskFix == 0) {

+    memcpy(param_2,(void *)puVar4[6],(ulonglong)uVar1);

+    uVar3 = ntohl(*param_2);

+    if ((DAT_0 & 0x10) == 0) goto LAB_18001a181;

+    uVar5 = 0x3d;

+  }

+  else {

+    if (uVar1 != 4) {

+      if ((DAT_0 & 2) != 0) {

+        WPP_SF_DJ(0x401,0x3c,0x180057630,uVar1);

+      }

+      goto LAB_1;

     }

+    memcpy(param_2,(void *)puVar4[6],4);

+    uVar3 = ntohl(*param_2);

+    if ((DAT_0 & 0x10) == 0) goto LAB_18001a181;

+    uVar5 = 0x3b;

   }

+  WPP_SF_DJ(0x404,uVar5,0x180057630,uVar3);

+LAB_1:

+  ReleaseSRWLockShared((PSRWLOCK)(param_1 + 0x2a0));

   return 0;

 }
```

## `RenewIpAddressLeaseEx`  (modified)

```diff
--- RenewIpAddressLeaseEx
+++ RenewIpAddressLeaseEx
@@ -1,219 +1,622 @@
 

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

 

 ulonglong RenewIpAddressLeaseEx

                     (u_long param_1,longlong param_2,uint *param_3,undefined8 param_4,

-                    undefined8 *param_5,undefined8 *param_6,int param_7)

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

 

 {

-  undefined8 uVar1;

-  undefined8 uVar2;

-  undefined8 uVar3;

-  undefined8 uVar4;

-  uint uVar5;

-  u_long uVar6;

-  int iVar7;

-  longlong in_RAX;

-  longlong lVar8;

-  ulonglong uVar9;

-  undefined4 in_register_0000000c;

-  undefined8 *puVar10;

-  longlong *******ppppppplVar11;

-  byte bVar12;

-  longlong unaff_RSI;

-  u_long unaff_R12D;

-  int unaff_R13D;

-  undefined8 *unaff_R14;

-  undefined8 *unaff_R15;

-  byte in_CF;

-  undefined4 in_XMM0_Da;

-  undefined4 in_XMM0_Db;

-  undefined4 in_XMM0_Dc;

-  undefined4 in_XMM0_Dd;

-  longlong *******in_stack_00000040;

-  uint in_stack_00000048;

-  uint in_stack_0000004c;

-  u_long in_stack_00000050;

-  HLOCAL in_stack_00000058;

-  undefined4 in_stack_00000060;

-  undefined8 *in_stack_00000068;

+  int iVar1;

+  code *pcVar2;

+  undefined1 auVar3 [16];

+  undefined1 auVar4 [16];

+  undefined1 auVar5 [16];

+  undefined1 auVar6 [16];

+  undefined1 auVar7 [16];

+  undefined1 auVar8 [16];

+  undefined1 auVar9 [16];

+  undefined1 auVar10 [16];

+  undefined1 auVar11 [16];

+  undefined1 auVar12 [16];

+  undefined1 auVar13 [16];

+  undefined1 auVar14 [16];

+  undefined1 auVar15 [16];

+  undefined8 uVar16;

+  undefined8 uVar17;

+  undefined8 uVar18;

+  undefined8 uVar19;

+  u_long uVar20;

+  uint uVar21;

+  uint uVar22;

+  ulong uVar23;

+  DWORD DVar24;

+  ulonglong uVar25;

+  __time64_t _Var26;

+  longlong ******pppppplVar27;

+  longlong *******ppppppplVar28;

+  ULONGLONG UVar29;

+  undefined8 *puVar30;

+  undefined8 *puVar31;

+  uint *puVar32;

+  uint *puVar33;

+  longlong ******pppppplVar34;

+  ushort uVar35;

+  longlong lVar36;

+  size_t _Size;

+  ulonglong uVar37;

+  int iVar38;

+  longlong *******ppppppplVar39;

+  int iVar40;

+  undefined1 auStackY_4d8 [32];

+  uint local_494;

+  longlong *******local_490;

+  u_long local_488;

+  undefined4 local_484;

+  DWORD local_480 [2];

+  longlong *******local_478;

+  longlong *******ppppppplStack_470;

+  undefined8 local_468;

+  undefined8 local_460;

+  undefined8 local_458;

+  undefined8 local_450;

+  undefined4 *local_448;

+  undefined4 local_440;

+  undefined8 local_43c;

+  undefined4 local_434;

+  undefined8 *local_428;

+  undefined1 local_418 [24];

+  uint local_400;

+  uint local_3fc;

+  uint local_3f8;

+  undefined8 local_348 [34];

+  uint local_238 [68];

+  undefined4 local_128;

+  undefined2 local_124;

+  undefined1 local_122;

+  undefined1 local_118 [208];

+  ulonglong local_48;

   

-  puVar10 = (undefined8 *)CONCAT44(in_register_0000000c,param_1);

-  *(u_long *)(puVar10 + 6) = *(int *)(puVar10 + 6) + param_1 + (uint)in_CF;

-  while( true ) {

-    uVar1 = unaff_R15[10];

-    uVar2 = unaff_R15[0xb];

-    *(undefined4 *)(puVar10 + 8) = in_XMM0_Da;

-    *(undefined4 *)((longlong)puVar10 + 0x44) = in_XMM0_Db;

-    *(undefined4 *)(puVar10 + 9) = in_XMM0_Dc;

-    *(undefined4 *)((longlong)puVar10 + 0x4c) = in_XMM0_Dd;

-    uVar3 = unaff_R15[0xc];

-    uVar4 = unaff_R15[0xd];

-    puVar10[10] = uVar1;

-    puVar10[0xb] = uVar2;

-    uVar1 = unaff_R15[0xe];

-    uVar2 = unaff_R15[0xf];

-    unaff_R15 = (undefined8 *)((longlong)unaff_R15 + param_2);

-    puVar10[0xc] = uVar3;

-    puVar10[0xd] = uVar4;

-    puVar10 = (undefined8 *)((longlong)puVar10 + param_2);

-    puVar10[-2] = uVar1;

-    puVar10[-1] = uVar2;

-    in_RAX = in_RAX + -1;

-    if (in_RAX == 0) break;

-    uVar1 = unaff_R15[1];

-    uVar2 = unaff_R15[2];

-    uVar3 = unaff_R15[3];

-    *puVar10 = *unaff_R15;

-    puVar10[1] = uVar1;

-    uVar1 = unaff_R15[4];

-    uVar4 = unaff_R15[5];

-    puVar10[2] = uVar2;

-    puVar10[3] = uVar3;

-    uVar2 = unaff_R15[6];

-    uVar3 = unaff_R15[7];

-    puVar10[4] = uVar1;

-    puVar10[5] = uVar4;

-    in_XMM0_Da = *(undefined4 *)(unaff_R15 + 8);

-    in_XMM0_Db = *(undefined4 *)((longlong)unaff_R15 + 0x44);

-    in_XMM0_Dc = *(undefined4 *)(unaff_R15 + 9);

-    in_XMM0_Dd = *(undefined4 *)((longlong)unaff_R15 + 0x4c);

-    puVar10[6] = uVar2;

-    puVar10[7] = uVar3;

-  }

-  *(undefined4 *)puVar10 = *(undefined4 *)unaff_R15;

-  puVar10 = (undefined8 *)&stack0x00000360;

-  lVar8 = unaff_RSI;

-  do {

-    uVar1 = unaff_R14[1];

-    uVar2 = unaff_R14[2];

-    uVar3 = unaff_R14[3];

-    *puVar10 = *unaff_R14;

-    puVar10[1] = uVar1;

-    uVar1 = unaff_R14[4];

-    uVar4 = unaff_R14[5];

-    puVar10[2] = uVar2;

-    puVar10[3] = uVar3;

-    uVar2 = unaff_R14[6];

-    uVar3 = unaff_R14[7];

-    puVar10[4] = uVar1;

-    puVar10[5] = uVar4;

-    uVar1 = unaff_R14[8];

-    uVar4 = unaff_R14[9];

-    puVar10[6] = uVar2;

-    puVar10[7] = uVar3;

-    uVar2 = unaff_R14[10];

-    uVar3 = unaff_R14[0xb];

-    puVar10[8] = uVar1;

-    puVar10[9] = uVar4;

-    uVar1 = unaff_R14[0xc];

-    uVar4 = unaff_R14[0xd];

-    puVar10[10] = uVar2;

-    puVar10[0xb] = uVar3;

-    uVar2 = unaff_R14[0xe];

-    uVar3 = unaff_R14[0xf];

-    unaff_R14 = (undefined8 *)((longlong)unaff_R14 + param_2);

-    puVar10[0xc] = uVar1;

-    puVar10[0xd] = uVar4;

-    puVar10 = (undefined8 *)((longlong)puVar10 + param_2);

-    puVar10[-2] = uVar2;

-    puVar10[-1] = uVar3;

-    lVar8 = lVar8 + -1;

-  } while (lVar8 != 0);

-  *(undefined4 *)puVar10 = *(undefined4 *)unaff_R14;

-  uVar5 = CreateDhcpContextForNewLease

-                    ((longlong *)&stack0x00000040,param_2,(uint *)&stack0x00000360,in_stack_00000060

-                     ,(longlong)&stack0x00000250,unaff_R13D,&stack0x00000470,in_stack_00000048);

-  ppppppplVar11 = in_stack_00000040;

-  if (uVar5 == 0) {

-    if (unaff_R12D == 0x7f000001) {

-      uVar5 = GrandHashing((byte *)in_stack_00000040[0xb],*(uint *)(in_stack_00000040 + 0xc),

-                           (uint *)((longlong)in_stack_00000040 + 0x1ac),

-                           *(uint *)(in_stack_00000040 + 0x35),

-                           *(uint *)((longlong)in_stack_00000040 + 0x1a4));

-      *(uint *)(ppppppplVar11 + 0xf) = uVar5;

-      *(undefined4 *)((longlong)ppppppplVar11 + 0x7c) = *(undefined4 *)(ppppppplVar11 + 0x35);

-      *(undefined4 *)((longlong)ppppppplVar11 + 0x31c) = 1;

-    }

-    else {

-      uVar6 = ntohl(unaff_R12D);

-      ppppppplVar11 = in_stack_00000040;

-      uVar5 = InitializeDhcpSocket((SOCKET *)(in_stack_00000040 + 9),uVar6);

-      if (uVar5 != 0) goto LAB_0;

-      while (bVar12 = (byte)unaff_RSI, in_stack_0000004c < 3) {

-        in_stack_0000004c = in_stack_0000004c + 1;

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

-          WPP_SF_dDJ(0x404,0x16,0x18005ade8,in_stack_0000004c);

-        }

-        uVar9 = ObtainInitialParameters

-                          (ppppppplVar11,&stack0x00000050,(int *)&stack0x00000064,&stack0x00000070);

-        uVar5 = (uint)uVar9;

-        if (uVar5 == 0) {

-          iVar7 = CheckForAddressConflict

-                            (*(int *)(ppppppplVar11 + 0xf),ppppppplVar11[0xb],

-                             *(uint *)(ppppppplVar11 + 0xc),1);

-          uVar5 = 0;

-          if (iVar7 == 0x1004) {

-            uVar5 = 0x1004;

-          }

-          if (uVar5 == 0) {

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

-              WPP_SF_DJ(0x404,0x18,0x18005ade8,*(undefined4 *)(ppppppplVar11 + 0xf));

-            }

-            goto LAB_2;

-          }

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

-            WPP_SF_(0x404,0x19,0x18005ade8);

-          }

-          SendDhcpDecline(ppppppplVar11,in_stack_00000050,*(undefined4 *)(ppppppplVar11 + 0x10),

-                          *(undefined4 *)(ppppppplVar11 + 0xf));

-          *(undefined4 *)(ppppppplVar11 + 0xf) = 0;

-          *(undefined4 *)((longlong)ppppppplVar11 + 0x84) = 0;

-        }

-        else if ((bVar12 & DAT_1) != 0) {

-          WPP_SF_D(0x401,0x17,0x18005ade8,uVar5);

-        }

-      }

-      if (uVar5 == 0x79) {

-        if ((bVar12 & DAT_1) != 0) {

-          WPP_SF_D(0x401,0x1a,0x18005ade8,0x79);

-        }

-        uVar5 = DhcpPerformIPAutoconfiguration((longlong)ppppppplVar11);

-        if (uVar5 != 0) {

-          if ((DAT_1 & bVar12) != 0) {

-            WPP_SF_D(0x401,0x1b,0x18005ade8,uVar5);

-          }

-          goto LAB_0;

-        }

-      }

-      else if (uVar5 != 0) goto LAB_0;

-    }

+  local_48 = __security_cookie ^ (ulonglong)auStackY_4d8;

+  local_428 = param_5;

+  local_490 = (longlong *******)0x0;

+  local_480[0] = 0;

+  local_488 = param_1;

+  memset(local_418,0,200);

+  local_448 = &local_128;

+  local_128 = 0x10f2c2e;

+  local_124 = 0x603;

+  local_43c = 0;

+  local_434 = 0;

+  local_122 = 0x2f;

+  local_484 = 0;

+  local_478 = (longlong *******)0x0;

+  ppppppplStack_470 = (longlong *******)0x0;

+  local_468 = 0x37;

+  local_460 = 0;

+  local_458 = 0;

+  local_450 = 0;

+  local_440 = 7;

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

+    WPP_SF_D(0x404,0x1d,0x18005ade8,param_1);

+  }

+  if ((g_fVelocityDhcpv4ClassIdLenOverflowFix != 0) && (0xff < param_7)) {

+    if ((DAT_0 & 0x10) == 0) {

+      return 0x57;

+    }

+    uVar35 = 0x1e;

+LAB_1:

+    WPP_SF_(0x404,uVar35,0x18005ade8);

+    return 0x57;

+  }

+  if (param_2 == 0) {

+    if ((DAT_0 & 0x10) == 0) {

+      return 0x57;

+    }

+    uVar35 = 0x1f;

+    goto LAB_1;

+  }

+  uVar25 = DhcpCommonInit();

+  uVar37 = uVar25 & 0xffffffff;

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

+    if ((DAT_0 & 0x10) == 0) {

+      return uVar37;

+    }

+    uVar35 = 0x20;

+    goto LAB_2;

+  }

+  if ((param_1 == 0) || (param_1 == 0x7f000001)) {

+LAB_3:

+    local_494 = *param_3;

+    _Size = (size_t)local_494;

+    if (200 < local_494) {

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

+        WPP_SF_L(0x404,0x21,0x18005ade8,local_494);

+      }

+      return 0xd;

+    }

+    memcpy(local_118,(void *)((longlong)param_3 + 5),_Size);

+  }

+  else {

+    local_494 = 200;

+    GetHardwareAddressForIpAddress(param_1,local_118,&local_494);

+    _Size = (size_t)local_494;

+    if (local_494 == 0) goto LAB_3;

+  }

+  uVar21 = (uint)_Size;

+  if (g_fUseIpv6OnlyPreferred == 0) {

+    uVar22 = CreateDhcpContext(&local_490,uVar21);

+    ppppppplVar39 = local_490;

+    if (uVar22 != 0) {

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

+        WPP_SF_D(0x404,0x23,0x18005ade8,uVar22);

+      }

+      return (ulonglong)uVar22;

+    }

+    *(undefined1 *)((longlong)local_490 + 0x54) = 1;

+    *(uint *)(local_490 + 0xc) = uVar21;

+    memcpy(local_490[0xb],local_118,_Size);

+    *(undefined4 *)(ppppppplVar39 + 2) = 1;

+    *(undefined4 *)(ppppppplVar39 + 0x69) = 0;

+    uVar20 = htonl(*(u_long *)(param_2 + 0x10));

+    *(u_long *)(ppppppplVar39 + 0xf) = uVar20;

+    uVar20 = htonl(*(u_long *)(param_2 + 0x14));

+    *(u_long *)((longlong)ppppppplVar39 + 0x7c) = uVar20;

+    _Var26 = _time64((__time64_t *)0x0);

+    if (*(uint *)(param_2 + 0x28) < (uint)_Var26) {

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

+        WPP_SF_(0x404,0x24,0x18005ade8);

+      }

+      *(undefined4 *)(ppppppplVar39 + 0x10) = 0xffffffff;

+    }

+    else {

+      uVar20 = htonl(*(u_long *)(param_2 + 0x18));

+      *(u_long *)(ppppppplVar39 + 0x10) = uVar20;

+    }

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x84) = *(undefined4 *)(ppppppplVar39 + 0xf);

+    *(undefined4 *)(ppppppplVar39 + 0x37) = *(undefined4 *)(param_2 + 0x1c);

+    uVar21 = *(uint *)(param_2 + 0x20);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar7._8_8_ = 0;

+      auVar7._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar7,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x38] = pppppplVar34;

+    uVar21 = *(uint *)(param_2 + 0x24);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar8._8_8_ = 0;

+      auVar8._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar8,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x39] = pppppplVar34;

+    uVar21 = *(uint *)(param_2 + 0x28);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar9._8_8_ = 0;

+      auVar9._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar9,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x3a] = pppppplVar34;

+    uVar21 = *(uint *)(param_2 + 0x2c);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar10._8_8_ = 0;

+      auVar10._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar10,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x3b] = pppppplVar34;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x34c) = 1;

+    *(undefined4 *)(ppppppplVar39 + 0x6a) = 1;

+    *(undefined4 *)(ppppppplVar39 + 0x61) = 0;

+    *(undefined4 *)(ppppppplVar39 + 0x62) = 0;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x314) = 0;

+    *(undefined4 *)(ppppppplVar39 + 99) = 1;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x31c) = 0;

+    *(undefined4 *)(ppppppplVar39 + 100) = 0;

+    *(undefined4 *)(ppppppplVar39 + 0x62) = 1;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x314) = 1;

+    *(undefined4 *)(ppppppplVar39 + 0x66) = 1;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x234) = 1;

+    *(undefined4 *)(ppppppplVar39 + 0x34) = 0;

+    uVar23 = inet_addr("169.254.0.0");

+    *(ulong *)((longlong)ppppppplVar39 + 0x1a4) = uVar23;

+    uVar23 = inet_addr("255.255.0.0");

+    *(ulong *)(ppppppplVar39 + 0x35) = uVar23;

+    DVar24 = GetSeed();

+    *(DWORD *)((longlong)ppppppplVar39 + 0x1ac) = DVar24;

+    ppppppplVar28 = ppppppplVar39 + 0x57;

+    ppppppplVar39[0x58] = (longlong ******)ppppppplVar28;

+    *ppppppplVar28 = (longlong ******)ppppppplVar28;

+    local_478 = ppppppplVar39 + 0x55;

+    ppppppplVar39[0x56] = (longlong ******)&local_478;

+    *local_478 = (longlong ******)&local_478;

+    ppppppplVar28 = ppppppplVar39 + 0x59;

+    ppppppplVar39[0x5a] = (longlong ******)ppppppplVar28;

+    *ppppppplVar28 = (longlong ******)ppppppplVar28;

+    if (param_7 == 0) {

+      ppppppplVar39[0x5c] = (longlong ******)0x0;

+    }

+    else {

+      ppppppplVar39[0x5c] = (longlong ******)((longlong)param_6 + 4);

+    }

+    uVar21 = *param_3;

+    *(uint *)(ppppppplVar39 + 0x5d) = param_7;

+    ppppppplStack_470 = local_478;

+    uVar21 = DhcpMakeClientId(1,uVar21,(void *)((longlong)param_3 + 5),ppppppplVar39 + 0x36);

+    uVar37 = (ulonglong)uVar21;

+    if (uVar21 == 0) {

+      ppppppplVar39[7] = (longlong ******)0x0;

+      ppppppplVar39[9] = (longlong ******)0xffffffffffffffff;

+      ppppppplVar39[8] = (longlong ******)0xffffffffffffffff;

+      goto LAB_4;

+    }

+LAB_5:

+    if ((DAT_0 & 2) != 0) {

+      WPP_SF_D(0x401,0x27,0x18005ade8,(int)uVar37);

+    }

+  }

+  else {

+    uVar20 = htonl(*(u_long *)(param_2 + 0x10));

+    lVar36 = 2;

+    puVar30 = local_348;

+    do {

+      uVar16 = param_6[1];

+      uVar17 = param_6[2];

+      uVar18 = param_6[3];

+      *puVar30 = *param_6;

+      puVar30[1] = uVar16;

+      uVar16 = param_6[4];

+      uVar19 = param_6[5];

+      puVar30[2] = uVar17;

+      puVar30[3] = uVar18;

+      uVar17 = param_6[6];

+      uVar18 = param_6[7];

+      puVar30[4] = uVar16;

+      puVar30[5] = uVar19;

+      uVar16 = param_6[8];

+      uVar19 = param_6[9];

+      puVar30[6] = uVar17;

+      puVar30[7] = uVar18;

+      uVar17 = param_6[10];

+      uVar18 = param_6[0xb];

+      puVar30[8] = uVar16;

+      puVar30[9] = uVar19;

+      uVar16 = param_6[0xc];

+      uVar19 = param_6[0xd];

+      puVar30[10] = uVar17;

+      puVar30[0xb] = uVar18;

+      uVar17 = param_6[0xe];

+      uVar18 = param_6[0xf];

+      param_6 = param_6 + 0x10;

+      puVar30[0xc] = uVar16;

+      puVar30[0xd] = uVar19;

+      puVar31 = puVar30 + 0x10;

+      puVar30[0xe] = uVar17;

+      puVar30[0xf] = uVar18;

+      lVar36 = lVar36 + -1;

+      puVar30 = puVar31;

+    } while (lVar36 != 0);

+    *(undefined4 *)puVar31 = *(undefined4 *)param_6;

+    lVar36 = 2;

+    puVar32 = local_238;

+    do {

+      uVar16 = *(undefined8 *)(param_3 + 2);

+      uVar17 = *(undefined8 *)(param_3 + 4);

+      uVar18 = *(undefined8 *)(param_3 + 6);

+      *(undefined8 *)puVar32 = *(undefined8 *)param_3;

+      *(undefined8 *)(puVar32 + 2) = uVar16;

+      uVar16 = *(undefined8 *)(param_3 + 8);

+      uVar19 = *(undefined8 *)(param_3 + 10);

+      *(undefined8 *)(puVar32 + 4) = uVar17;

+      *(undefined8 *)(puVar32 + 6) = uVar18;

+      uVar17 = *(undefined8 *)(param_3 + 0xc);

+      uVar18 = *(undefined8 *)(param_3 + 0xe);

+      *(undefined8 *)(puVar32 + 8) = uVar16;

+      *(undefined8 *)(puVar32 + 10) = uVar19;

+      uVar16 = *(undefined8 *)(param_3 + 0x10);

+      uVar19 = *(undefined8 *)(param_3 + 0x12);

+      *(undefined8 *)(puVar32 + 0xc) = uVar17;

+      *(undefined8 *)(puVar32 + 0xe) = uVar18;

+      uVar17 = *(undefined8 *)(param_3 + 0x14);

+      uVar18 = *(undefined8 *)(param_3 + 0x16);

+      *(undefined8 *)(puVar32 + 0x10) = uVar16;

+      *(undefined8 *)(puVar32 + 0x12) = uVar19;

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

+      uVar19 = *(undefined8 *)(param_3 + 0x1a);

+      *(undefined8 *)(puVar32 + 0x14) = uVar17;

+      *(undefined8 *)(puVar32 + 0x16) = uVar18;

+      uVar17 = *(undefined8 *)(param_3 + 0x1c);

+      uVar18 = *(undefined8 *)(param_3 + 0x1e);

+      param_3 = param_3 + 0x20;

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

+      *(undefined8 *)(puVar32 + 0x1a) = uVar19;

+      puVar33 = puVar32 + 0x20;

+      *(undefined8 *)(puVar32 + 0x1c) = uVar17;

+      *(undefined8 *)(puVar32 + 0x1e) = uVar18;

+      lVar36 = lVar36 + -1;

+      puVar32 = puVar33;

+    } while (lVar36 != 0);

+    *puVar33 = *param_3;

+    uVar21 = CreateDhcpContextForNewLease

+                       ((longlong *)&local_490,0,local_238,uVar20,(longlong)local_348,param_7,

+                        local_118,uVar21);

+    ppppppplVar39 = local_490;

+    uVar37 = (ulonglong)uVar21;

+    if (uVar21 != 0) goto LAB_5;

+    *(u_long *)(local_490 + 0xf) = uVar20;

+    uVar20 = htonl(*(u_long *)(param_2 + 0x14));

+    *(u_long *)((longlong)ppppppplVar39 + 0x7c) = uVar20;

+    _Var26 = _time64((__time64_t *)0x0);

+    if (*(uint *)(param_2 + 0x28) < (uint)_Var26) {

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

+        WPP_SF_(0x404,0x22,0x18005ade8);

+      }

+      *(undefined4 *)(ppppppplVar39 + 0x10) = 0xffffffff;

+    }

+    else {

+      uVar20 = htonl(*(u_long *)(param_2 + 0x18));

+      *(u_long *)(ppppppplVar39 + 0x10) = uVar20;

+    }

+    *(undefined4 *)(ppppppplVar39 + 0x37) = *(undefined4 *)(param_2 + 0x1c);

+    uVar21 = *(uint *)(param_2 + 0x20);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar3._8_8_ = 0;

+      auVar3._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar3,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x38] = pppppplVar34;

+    uVar21 = *(uint *)(param_2 + 0x24);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar4._8_8_ = 0;

+      auVar4._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar4,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x39] = pppppplVar34;

+    uVar21 = *(uint *)(param_2 + 0x28);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar5._8_8_ = 0;

+      auVar5._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar5,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x3a] = pppppplVar34;

+    uVar21 = *(uint *)(param_2 + 0x2c);

+    if (uVar21 == 0xffffffff) {

+      pppppplVar34 = (longlong ******)0xffffffff;

+    }

+    else {

+      _Var26 = _time64((__time64_t *)0x0);

+      UVar29 = GetTickCount64();

+      auVar6._8_8_ = 0;

+      auVar6._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar6,8);

+      pppppplVar27 = (longlong ******)

+                     (((lVar36 + (UVar29 - lVar36 >> 1) >> 9) - _Var26) + (ulonglong)uVar21);

+      pppppplVar34 = (longlong ******)0x0;

+      if (-1 < (longlong)pppppplVar27) {

+        pppppplVar34 = pppppplVar27;

+      }

+    }

+    ppppppplVar39[0x3b] = pppppplVar34;

+    ppppppplVar28 = ppppppplVar39 + 0x55;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x314) = 1;

+    *(undefined4 *)((longlong)ppppppplVar39 + 0x234) = 1;

+    ppppppplVar39 = (longlong *******)*ppppppplVar28;

+    if ((longlong *******)ppppppplVar39[1] != ppppppplVar28) goto LAB_6;

+    ppppppplVar39[1] = (longlong ******)&local_478;

+    *ppppppplVar28 = (longlong ******)&local_478;

+    local_478 = ppppppplVar39;

+    ppppppplStack_470 = ppppppplVar28;

+LAB_4:

+    iVar38 = -1;

+    uVar20 = htonl(local_488);

+    ppppppplVar39 = local_490;

+    uVar21 = InitializeDhcpSocket((SOCKET *)(local_490 + 9),uVar20);

+    uVar37 = (ulonglong)uVar21;

+    if (uVar21 != 0) goto LAB_5;

+    ppppppplVar28 = RenewLease(ppppppplVar39,local_480,0,(longlong *******)0x1,&local_484,local_418)

+    ;

+    uVar37 = (ulonglong)ppppppplVar28 & 0xffffffff;

+    if (DhcpGlobalIsShuttingDown == 0) {

+      if ((int)ppppppplVar28 != 0) goto LAB_5;

+      uVar20 = ntohl(*(u_long *)(ppppppplVar39 + 0x10));

+      *(u_long *)(param_2 + 0x18) = uVar20;

+      uVar25 = 0xe10;

+      if (local_400 != 0) {

+        uVar25 = (ulonglong)local_400;

+      }

+      uVar21 = (uint)uVar25;

+      *(uint *)(param_2 + 0x1c) = uVar21;

+      UVar29 = GetTickCount64();

+      auVar11._8_8_ = 0;

+      auVar11._0_8_ = UVar29;

+      lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar11,8);

+      uVar22 = (uint)((UVar29 - lVar36 >> 1) + lVar36 >> 9);

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

+      if ((local_3f8 == 0) || (uVar21 < local_3f8)) {

+        local_3f8 = uVar21 * 7 >> 3;

+      }

+      if (((local_3fc == 0) || (local_3f8 < local_3fc)) &&

+         (local_3fc = (uint)(uVar25 >> 1), local_3f8 <= local_3fc)) {

+        local_3fc = local_3f8 - 1;

+      }

+      *(uint *)(param_2 + 0x24) = uVar22 + local_3fc;

+      if (uVar22 + local_3fc < uVar22) {

+        *(undefined4 *)(param_2 + 0x24) = 0xffffffff;

+      }

+      *(uint *)(param_2 + 0x28) = uVar22 + local_3f8;

+      if (uVar22 + local_3f8 < uVar22) {

+        *(undefined4 *)(param_2 + 0x28) = 0xffffffff;

+      }

+      *(uint *)(param_2 + 0x2c) = uVar22 + uVar21;

+      if (uVar22 + uVar21 < uVar22) {

+        *(undefined4 *)(param_2 + 0x2c) = 0xffffffff;

+      }

+      if (uVar22 == 0xffffffff) {

+        iVar40 = -1;

+      }

+      else {

+        _Var26 = _time64((__time64_t *)0x0);

+        UVar29 = GetTickCount64();

+        auVar12._8_8_ = 0;

+        auVar12._0_8_ = UVar29;

+        lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar12,8);

+        iVar40 = (uVar22 - (int)((UVar29 - lVar36 >> 1) + lVar36 >> 9)) + (int)_Var26;

+      }

+      iVar1 = *(int *)(param_2 + 0x24);

+      *(int *)(param_2 + 0x20) = iVar40;

+      if (iVar1 == -1) {

+        iVar40 = -1;

+      }

+      else {

+        _Var26 = _time64((__time64_t *)0x0);

+        UVar29 = GetTickCount64();

+        auVar13._8_8_ = 0;

+        auVar13._0_8_ = UVar29;

+        lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar13,8);

+        iVar40 = (iVar1 - (int)((UVar29 - lVar36 >> 1) + lVar36 >> 9)) + (int)_Var26;

+      }

+      *(int *)(param_2 + 0x24) = iVar40;

+      iVar40 = *(int *)(param_2 + 0x28);

+      if (iVar40 == -1) {

+        iVar40 = -1;

+      }

+      else {

+        _Var26 = _time64((__time64_t *)0x0);

+        UVar29 = GetTickCount64();

+        auVar14._8_8_ = 0;

+        auVar14._0_8_ = UVar29;

+        lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar14,8);

+        iVar40 = (iVar40 - (int)((UVar29 - lVar36 >> 1) + lVar36 >> 9)) + (int)_Var26;

+      }

+      *(int *)(param_2 + 0x28) = iVar40;

+      iVar40 = *(int *)(param_2 + 0x2c);

+      if (iVar40 != -1) {

+        _Var26 = _time64((__time64_t *)0x0);

+        UVar29 = GetTickCount64();

+        auVar15._8_8_ = 0;

+        auVar15._0_8_ = UVar29;

+        lVar36 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar15,8);

+        iVar38 = (int)_Var26 + (iVar40 - (int)((UVar29 - lVar36 >> 1) + lVar36 >> 9));

+      }

+      uVar37 = 0;

+      *(int *)(param_2 + 0x2c) = iVar38;

+    }

+    else {

+      uVar37 = 0x41;

+      if ((DAT_0 & 2) != 0) {

+        WPP_SF_D(0x401,0x25,0x18005ade8,0x41);

+        goto LAB_5;

+      }

+    }

+  }

+  if (local_428 != (undefined8 *)0x0) {

+    *local_428 = 0;

+  }

+  DhcpCleanParsedOptions(local_418);

+  if (ppppppplVar39 != (longlong *******)0x0) {

+    ppppppplVar28 = ppppppplVar39 + 0x55;

+    pppppplVar34 = *ppppppplVar28;

+    if (((longlong *******)pppppplVar34[1] != ppppppplVar28) ||

+       (pppppplVar27 = (longlong ******)*pppppplVar34,

+       (longlong ******)pppppplVar27[1] != pppppplVar34)) {

+LAB_6:

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

+      (*pcVar2)(3);

+      pcVar2 = (code *)swi(3);

+      uVar25 = (*pcVar2)();

+      return uVar25;

+    }

+    *ppppppplVar28 = pppppplVar27;

+    pppppplVar27[1] = (longlong *****)ppppppplVar28;

+    LOCK();

+    ppppppplVar39 = ppppppplVar39 + 2;

+    iVar38 = *(int *)ppppppplVar39;

+    *(int *)ppppppplVar39 = *(int *)ppppppplVar39 + -1;

+    UNLOCK();

+    if (iVar38 == 1) {

+      DhcpDestroyContextEx((longlong)local_490);

+    }

+  }

+  if ((DAT_0 & 0x10) == 0) {

+    return uVar37;

+  }

+  uVar35 = 0x26;

 LAB_2:

-    uVar5 = CreateInfoForNewLease((longlong)ppppppplVar11,&stack0x00000058);

-    if (uVar5 == 0) {

-      *in_stack_00000068 = in_stack_00000058;

-      in_stack_00000058 = (HLOCAL)0x0;

-    }

-    if (in_stack_00000058 != (HLOCAL)0x0) {

-      LocalFree(in_stack_00000058);

-      *in_stack_00000068 = 0;

-    }

-  }

-LAB_0:

-  DhcpCleanParsedOptions(&stack0x00000070);

-  if (ppppppplVar11 != (longlong *******)0x0) {

-    LOCK();

-    ppppppplVar11 = ppppppplVar11 + 2;

-    iVar7 = *(int *)ppppppplVar11;

-    *(int *)ppppppplVar11 = *(int *)ppppppplVar11 + -1;

-    UNLOCK();

-    if (iVar7 == 1) {

-      DhcpDestroyContextEx((longlong)in_stack_00000040);

-    }

-  }

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

-    WPP_SF_D(0x404,0x1c,0x18005ade8,uVar5);

-  }

-  return (ulonglong)uVar5;

+  WPP_SF_D(0x404,uVar35,0x18005ade8,(int)uVar37);

+  return uVar37;

 }
```

## `DhcpInitData`  (modified)

```diff
--- DhcpInitData
+++ DhcpInitData
@@ -1,11 +1,129 @@
+

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

 

 DWORD DhcpInitData(void)

 

 {

-  DWORD in_EAX;

-  longlong unaff_RBX;

+  DWORD DVar1;

+  LSTATUS LVar2;

+  int iVar3;

+  wchar_t *pwVar4;

+  undefined *puVar5;

+  DWORD unaff_retaddr;

+  undefined1 auStackY_68 [32];

+  DWORD local_28 [2];

+  undefined8 local_20 [2];

+  ulonglong local_10;

   

-  *(int *)(unaff_RBX + -0x74f71428) = *(int *)(unaff_RBX + -0x74f71428) + -1;

-  return in_EAX;

+  local_10 = __security_cookie ^ (ulonglong)auStackY_68;

+  local_28[0] = 0;

+  if (g_fVelocityConnectedStandbyHandlingCleanup != 0) {

+    DhcpInitData_New();

+    return unaff_retaddr;

+  }

+  DhcpGlobalTraceExArray = DhcpAlloc(0xa008);

+  if (DhcpGlobalTraceExArray != (undefined4 *)0x0) {

+    *DhcpGlobalTraceExArray = 0xffffffff;

+    g_pDhcpMainThreadTraceArray = DhcpAlloc(0xe04);

+    if (g_pDhcpMainThreadTraceArray != (undefined4 *)0x0) {

+      *g_pDhcpMainThreadTraceArray = 0xffffffff;

+      puVar5 = (undefined *)0x0;

+      DAT_0 = 2;

+      pwVar4 = L"DHCP";

+      DhcpGlobalServiceStatusHandle =

+           RegisterServiceCtrlHandlerExW(L"DHCP",ServiceControlHandler,(LPVOID)0x0);

+      if ((DhcpGlobalServiceStatusHandle == (SERVICE_STATUS_HANDLE)0x0) &&

+         (DVar1 = GetLastError(), (DAT_1 & 2) != 0)) {

+        pwVar4 = (wchar_t *)0x401;

+        puVar5 = &WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

+        WPP_SF_D(0x401,0x6f,0x180057608,DVar1);

+      }

+      if ((Microsoft_Windows_Dhcp_ClientEnableBits & 0x20) != 0) {

+        McGenEventWrite_EtwEventWriteTransfer(pwVar4,&ServiceRegistersForShutdown,puVar5,1,local_20)

+        ;

+      }

+      UpdateStatus();

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

+        pwVar4 = (wchar_t *)0x404;

+        puVar5 = &WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

+        WPP_SF_(0x404,0x70,0x180057608);

+      }

+      if ((Microsoft_Windows_Dhcp_ClientEnableBits & 0x20) != 0) {

+        McGenEventWrite_EtwEventWriteTransfer(pwVar4,&ServiceStart,puVar5,1,local_20);

+      }

+      TraceLogErrorv4(0,0,0xd);

+      DVar1 = DhcpInitRegistry();

+      if (DVar1 == 0) {

+        local_28[0] = 4;

+        LVar2 = RegQueryValueExW(DhcpGlobalInterfacesKey,L"UseNetworkHint",(LPDWORD)0x0,(LPDWORD)0x0

+                                 ,(LPBYTE)&DhcpGlobalUseNetworkHint,local_28);

+        if (LVar2 != 0) {

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

+            WPP_SF_D(0x404,0x71,0x180057608,LVar2);

+          }

+          DhcpGlobalUseNetworkHint = 1;

+        }

+        QueryPerformanceFrequency((LARGE_INTEGER *)&DhcpGlobalPerformanceFrequency);

+        DhcpGlobalWaitableTimerHandle =

+             CreateWaitableTimerExW((LPSECURITY_ATTRIBUTES)0x0,(LPCWSTR)0x0,0,0x1f0003);

+        if ((((DhcpGlobalWaitableTimerHandle == (HANDLE)0x0) ||

+             (DhcpGlobalRecomputeTimerEvent =

+                   CreateEventW((LPSECURITY_ATTRIBUTES)0x0,0,1,(LPCWSTR)0x0),

+             DhcpGlobalRecomputeTimerEvent == (HANDLE)0x0)) ||

+            (DhcpGlobalTerminateEvent = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,1,0,(LPCWSTR)0x0),

+            DhcpGlobalTerminateEvent == (HANDLE)0x0)) ||

+           ((DhcpGlobalServiceSyncEvent = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,0,0,(LPCWSTR)0x0),

+            DhcpGlobalServiceSyncEvent == (HANDLE)0x0 ||

+            (DhcpGlobalRefreshEvent = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,1,0,(LPCWSTR)0x0),

+            DhcpGlobalRefreshEvent == (HANDLE)0x0)))) {

+          DVar1 = GetLastError();

+        }

+        else {

+          DhcpGlobalFirewallReadyEvent = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,1,0,(LPCWSTR)0x0);

+          if (DhcpGlobalFirewallReadyEvent != (HANDLE)0x0) {

+            pwVar4 = L"wcmapi.dll";

+            iVar3 = IsBinaryPresent(L"wcmapi.dll");

+            if (iVar3 != 0) {

+              pwVar4 = L"wcmsvc.dll";

+              iVar3 = IsBinaryPresent(L"wcmsvc.dll");

+              if ((iVar3 != 0) && (DhcpGlobalDisableDs == 0)) {

+                DhcpGlobalDsFeatureEnabled = 1;

+              }

+            }

+            iVar3 = DhcpRegisterForCSNotification();

+            if ((iVar3 != 0) && (DhcpGlobalCSNotificationHandle = 0, (DAT_1 & 2) != 0)) {

+              pwVar4 = (wchar_t *)0x401;

+              WPP_SF_D(0x401,0x73,0x180057608,iVar3);

+            }

+            iVar3 = DhcpCRMPowerRegistration(pwVar4);

+            if (iVar3 == 0) {

+              return unaff_retaddr;

+            }

+            if ((DAT_1 & 2) != 0) {

+              WPP_SF_D(0x401,0x74,0x180057608,iVar3);

+            }

+            DhcpCRMPowerUnregistrationAndClean

+                      ((longlong *)&DhcpGlobalCrmNotificationHandle,

+                       (longlong *)&DhcpGlobalCrmActivity,DhcpGlobalIsCrmRegistered);

+            return unaff_retaddr;

+          }

+          DVar1 = GetLastError();

+          if ((DAT_1 & 2) != 0) {

+            WPP_SF_D(0x401,0x72,0x180057608,DVar1);

+          }

+        }

+        if (DVar1 == 0) {

+          return unaff_retaddr;

+        }

+      }

+      goto LAB_2;

+    }

+  }

+  DVar1 = 8;

+LAB_2:

+  if ((DAT_1 & 2) != 0) {

+    WPP_SF_D(0x401,0x75,0x180057608,DVar1);

+  }

+  return unaff_retaddr;

 }
```

## `DhcpStandbyCheckRenewalAllowed`  (modified)

```diff
--- DhcpStandbyCheckRenewalAllowed
+++ DhcpStandbyCheckRenewalAllowed
@@ -1,9 +1,46 @@
 

 undefined8 DhcpStandbyCheckRenewalAllowed(undefined4 *param_1,int param_2,int param_3)

 

 {

-  undefined8 in_RAX;

+  bool bVar1;

+  bool bVar2;

+  int iVar3;

+  uint uVar4;

+  undefined4 uVar5;

   

-  return in_RAX;

+  if ((param_3 == 0) || (DhcpGlobalDsFeatureEnabled != 0)) {

+    bVar2 = false;

+  }

+  else {

+    bVar2 = true;

+  }

+  iVar3 = DhcpStandbyGetNetworkBlocked((longlong)param_1);

+  if ((iVar3 == 0) && (uVar4 = DhcpStandbyGetFailureCount(param_1), uVar4 < 5)) {

+    bVar1 = false;

+  }

+  else {

+    bVar1 = true;

+  }

+  if (g_fVelocityConnectedStandbyHandlingCleanup == 0) {

+    if (((param_2 == 0) || (!bVar1)) && (!bVar2)) {

+      return 1;

+    }

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

+      DhcpStandbyGetFailureCount(param_1);

+      DhcpStandbyGetNetworkBlocked((longlong)param_1);

+      WPP_SF_ldl();

+    }

+  }

+  else {

+    if ((param_2 == 0) || (!bVar1)) {

+      return 1;

+    }

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

+      DhcpStandbyGetFailureCount(param_1);

+      uVar5 = DhcpStandbyGetNetworkBlocked((longlong)param_1);

+      WPP_SF_ld(param_1,0xb,0x18005aff8,uVar5);

+    }

+  }

+  return 0;

 }
```

## `LeaseIpAddressEx`  (modified)

```diff
--- LeaseIpAddressEx
+++ LeaseIpAddressEx
@@ -1,22 +1,289 @@
 

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

 

-ulonglong LeaseIpAddressEx(u_long param_1,uint *param_2,undefined4 param_3,undefined8 param_4,

-                          undefined8 *param_5,undefined8 *param_6,undefined8 *param_7,int param_8)

+int LeaseIpAddressEx(u_long param_1,uint *param_2,undefined4 param_3,undefined8 param_4,

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

 

 {

-  char *in_RAX;

-  undefined4 in_register_0000000c;

-  longlong in_stack_00000080;

+  undefined8 uVar1;

+  undefined8 uVar2;

+  undefined8 uVar3;

+  uint uVar4;

+  u_long uVar5;

+  int iVar6;

+  longlong *******ppppppplVar7;

+  undefined8 uVar8;

+  uint *puVar9;

+  longlong lVar10;

+  ulonglong uVar11;

+  uint *puVar12;

+  uint *puVar13;

+  undefined8 *puVar14;

+  undefined8 *puVar15;

+  ushort uVar16;

+  longlong lVar17;

+  int iVar18;

+  undefined1 auStackY_4b8 [32];

+  longlong *******local_478;

+  uint local_470;

+  uint local_46c;

+  uint local_468 [2];

+  HLOCAL local_460;

+  undefined4 local_458;

+  int local_454;

+  undefined8 *local_450;

+  undefined1 local_448 [208];

+  uint local_378 [68];

+  undefined8 local_268 [34];

+  uint local_158 [68];

+  undefined8 local_48;

+  ulonglong local_40;

   

-  *(int *)(in_stack_00000080 + 4) =

-       (int)CONCAT71((int7)((ulonglong)in_RAX >> 8),(char)in_RAX + *in_RAX) +

-       *(int *)(CONCAT44(in_register_0000000c,param_1) + 4);

-  if (gMadcapScopeList != 0) {

-    DhcpFree(&gMadcapScopeList);

-  }

-  gMadcapScopeList = in_stack_00000080;

-  LeaveCriticalSection((LPCRITICAL_SECTION)&MadcapGlobalScopeListCritSect);

-  return (ulonglong)param_6 >> 0x20;

+  local_40 = __security_cookie ^ (ulonglong)auStackY_4b8;

+  local_450 = param_5;

+  ppppppplVar7 = (longlong *******)0x0;

+  local_468[0] = 0;

+  local_478 = (longlong *******)0x0;

+  local_470 = 0;

+  local_48 = 0;

+  local_454 = 0;

+  local_46c = 0;

+  local_460 = (HLOCAL)0x0;

+  local_458 = param_3;

+  memset(local_448,0,200);

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

+    WPP_SF_lD(0x404,0x14,0x18005ade8,param_1);

+  }

+  if ((g_fVelocityDhcpv4LeaseIpAddressOverflow == 0) || (param_8 < 0x100)) {

+    *local_450 = 0;

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

+      *param_6 = 0;

+    }

+    uVar8 = DhcpCommonInit();

+    iVar18 = (int)uVar8;

+    ppppppplVar7 = (longlong *******)0x0;

+    if (iVar18 != 0) goto LAB_1;

+    lVar10 = 2;

+    puVar9 = param_2;

+    puVar12 = local_378;

+    lVar17 = lVar10;

+    do {

+      uVar8 = *(undefined8 *)(puVar9 + 2);

+      uVar1 = *(undefined8 *)(puVar9 + 4);

+      uVar2 = *(undefined8 *)(puVar9 + 6);

+      *(undefined8 *)puVar12 = *(undefined8 *)puVar9;

+      *(undefined8 *)(puVar12 + 2) = uVar8;

+      uVar8 = *(undefined8 *)(puVar9 + 8);

+      uVar3 = *(undefined8 *)(puVar9 + 10);

+      *(undefined8 *)(puVar12 + 4) = uVar1;

+      *(undefined8 *)(puVar12 + 6) = uVar2;

+      uVar1 = *(undefined8 *)(puVar9 + 0xc);

+      uVar2 = *(undefined8 *)(puVar9 + 0xe);

+      *(undefined8 *)(puVar12 + 8) = uVar8;

+      *(undefined8 *)(puVar12 + 10) = uVar3;

+      uVar8 = *(undefined8 *)(puVar9 + 0x10);

+      uVar3 = *(undefined8 *)(puVar9 + 0x12);

+      *(undefined8 *)(puVar12 + 0xc) = uVar1;

+      *(undefined8 *)(puVar12 + 0xe) = uVar2;

+      uVar1 = *(undefined8 *)(puVar9 + 0x14);

+      uVar2 = *(undefined8 *)(puVar9 + 0x16);

+      *(undefined8 *)(puVar12 + 0x10) = uVar8;

+      *(undefined8 *)(puVar12 + 0x12) = uVar3;

+      uVar8 = *(undefined8 *)(puVar9 + 0x18);

+      uVar3 = *(undefined8 *)(puVar9 + 0x1a);

+      *(undefined8 *)(puVar12 + 0x14) = uVar1;

+      *(undefined8 *)(puVar12 + 0x16) = uVar2;

+      uVar1 = *(undefined8 *)(puVar9 + 0x1c);

+      uVar2 = *(undefined8 *)(puVar9 + 0x1e);

+      puVar9 = puVar9 + 0x20;

+      *(undefined8 *)(puVar12 + 0x18) = uVar8;

+      *(undefined8 *)(puVar12 + 0x1a) = uVar3;

+      puVar13 = puVar12 + 0x20;

+      *(undefined8 *)(puVar12 + 0x1c) = uVar1;

+      *(undefined8 *)(puVar12 + 0x1e) = uVar2;

+      lVar17 = lVar17 + -1;

+      puVar12 = puVar13;

+    } while (lVar17 != 0);

+    *puVar13 = *puVar9;

+    iVar18 = DetermineHardwareAddressForNewLease(&local_48,0,&local_470,param_1,local_378);

+    if (iVar18 != 0) goto LAB_1;

+    lVar17 = lVar10;

+    puVar14 = local_268;

+    do {

+      uVar8 = param_7[1];

+      uVar1 = param_7[2];

+      uVar2 = param_7[3];

+      *puVar14 = *param_7;

+      puVar14[1] = uVar8;

+      uVar8 = param_7[4];

+      uVar3 = param_7[5];

+      puVar14[2] = uVar1;

+      puVar14[3] = uVar2;

+      uVar1 = param_7[6];

+      uVar2 = param_7[7];

+      puVar14[4] = uVar8;

+      puVar14[5] = uVar3;

+      uVar8 = param_7[8];

+      uVar3 = param_7[9];

+      puVar14[6] = uVar1;

+      puVar14[7] = uVar2;

+      uVar1 = param_7[10];

+      uVar2 = param_7[0xb];

+      puVar14[8] = uVar8;

+      puVar14[9] = uVar3;

+      uVar8 = param_7[0xc];

+      uVar3 = param_7[0xd];

+      puVar14[10] = uVar1;

+      puVar14[0xb] = uVar2;

+      uVar1 = param_7[0xe];

+      uVar2 = param_7[0xf];

+      param_7 = param_7 + 0x10;

+      puVar14[0xc] = uVar8;

+      puVar14[0xd] = uVar3;

+      puVar15 = puVar14 + 0x10;

+      puVar14[0xe] = uVar1;

+      puVar14[0xf] = uVar2;

+      lVar17 = lVar17 + -1;

+      puVar14 = puVar15;

+    } while (lVar17 != 0);

+    *(undefined4 *)puVar15 = *(undefined4 *)param_7;

+    puVar9 = local_158;

+    do {

+      uVar8 = *(undefined8 *)(param_2 + 2);

+      uVar1 = *(undefined8 *)(param_2 + 4);

+      uVar2 = *(undefined8 *)(param_2 + 6);

+      *(undefined8 *)puVar9 = *(undefined8 *)param_2;

+      *(undefined8 *)(puVar9 + 2) = uVar8;

+      uVar8 = *(undefined8 *)(param_2 + 8);

+      uVar3 = *(undefined8 *)(param_2 + 10);

+      *(undefined8 *)(puVar9 + 4) = uVar1;

+      *(undefined8 *)(puVar9 + 6) = uVar2;

+      uVar1 = *(undefined8 *)(param_2 + 0xc);

+      uVar2 = *(undefined8 *)(param_2 + 0xe);

+      *(undefined8 *)(puVar9 + 8) = uVar8;

+      *(undefined8 *)(puVar9 + 10) = uVar3;

+      uVar8 = *(undefined8 *)(param_2 + 0x10);

+      uVar3 = *(undefined8 *)(param_2 + 0x12);

+      *(undefined8 *)(puVar9 + 0xc) = uVar1;

+      *(undefined8 *)(puVar9 + 0xe) = uVar2;

+      uVar1 = *(undefined8 *)(param_2 + 0x14);

+      uVar2 = *(undefined8 *)(param_2 + 0x16);

+      *(undefined8 *)(puVar9 + 0x10) = uVar8;

+      *(undefined8 *)(puVar9 + 0x12) = uVar3;

+      uVar8 = *(undefined8 *)(param_2 + 0x18);

+      uVar3 = *(undefined8 *)(param_2 + 0x1a);

+      *(undefined8 *)(puVar9 + 0x14) = uVar1;

+      *(undefined8 *)(puVar9 + 0x16) = uVar2;

+      uVar1 = *(undefined8 *)(param_2 + 0x1c);

+      uVar2 = *(undefined8 *)(param_2 + 0x1e);

+      param_2 = param_2 + 0x20;

+      *(undefined8 *)(puVar9 + 0x18) = uVar8;

+      *(undefined8 *)(puVar9 + 0x1a) = uVar3;

+      puVar12 = puVar9 + 0x20;

+      *(undefined8 *)(puVar9 + 0x1c) = uVar1;

+      *(undefined8 *)(puVar9 + 0x1e) = uVar2;

+      lVar10 = lVar10 + -1;

+      puVar9 = puVar12;

+    } while (lVar10 != 0);

+    *puVar12 = *param_2;

+    iVar18 = CreateDhcpContextForNewLease

+                       ((longlong *)&local_478,0x80,local_158,local_458,(longlong)local_268,param_8,

+                        &local_48,local_470);

+    ppppppplVar7 = local_478;

+    if (iVar18 != 0) goto LAB_1;

+    if (param_1 == 0x7f000001) {

+      uVar4 = GrandHashing((byte *)local_478[0xb],*(uint *)(local_478 + 0xc),

+                           (uint *)((longlong)local_478 + 0x1ac),*(uint *)(local_478 + 0x35),

+                           *(uint *)((longlong)local_478 + 0x1a4));

+      *(uint *)(ppppppplVar7 + 0xf) = uVar4;

+      *(undefined4 *)((longlong)ppppppplVar7 + 0x7c) = *(undefined4 *)(ppppppplVar7 + 0x35);

+      *(undefined4 *)((longlong)ppppppplVar7 + 0x31c) = 1;

+    }

+    else {

+      uVar5 = ntohl(param_1);

+      ppppppplVar7 = local_478;

+      iVar18 = InitializeDhcpSocket((SOCKET *)(local_478 + 9),uVar5);

+      if (iVar18 != 0) goto LAB_1;

+      while (local_46c < 3) {

+        local_46c = local_46c + 1;

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

+          WPP_SF_dDJ(0x404,0x16,0x18005ade8,local_46c);

+        }

+        uVar11 = ObtainInitialParameters(ppppppplVar7,local_468,&local_454,local_448);

+        iVar18 = (int)uVar11;

+        if (iVar18 == 0) {

+          iVar6 = CheckForAddressConflict

+                            (*(int *)(ppppppplVar7 + 0xf),ppppppplVar7[0xb],

+                             *(uint *)(ppppppplVar7 + 0xc),1);

+          iVar18 = 0;

+          if (iVar6 == 0x1004) {

+            iVar18 = 0x1004;

+          }

+          if (iVar18 == 0) {

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

+              WPP_SF_DJ(0x404,0x18,0x18005ade8,*(undefined4 *)(ppppppplVar7 + 0xf));

+            }

+            goto LAB_2;

+          }

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

+            WPP_SF_(0x404,0x19,0x18005ade8);

+          }

+          SendDhcpDecline(ppppppplVar7,local_468[0],*(undefined4 *)(ppppppplVar7 + 0x10),

+                          *(undefined4 *)(ppppppplVar7 + 0xf));

+          *(undefined4 *)(ppppppplVar7 + 0xf) = 0;

+          *(undefined4 *)((longlong)ppppppplVar7 + 0x84) = 0;

+        }

+        else if ((DAT_0 & 2) != 0) {

+          WPP_SF_D(0x401,0x17,0x18005ade8,iVar18);

+        }

+      }

+      if (iVar18 == 0x79) {

+        if ((DAT_0 & 2) != 0) {

+          WPP_SF_D(0x401,0x1a,0x18005ade8,0x79);

+        }

+        iVar18 = DhcpPerformIPAutoconfiguration((longlong)ppppppplVar7);

+        if (iVar18 != 0) {

+          if ((DAT_0 & 2) == 0) goto LAB_180040051;

+          uVar16 = 0x1b;

+          goto LAB_3;

+        }

+      }

+      else if (iVar18 != 0) goto LAB_1;

+    }

+LAB_2:

+    iVar18 = CreateInfoForNewLease((longlong)ppppppplVar7,&local_460);

+    puVar14 = local_450;

+    if (iVar18 == 0) {

+      *local_450 = local_460;

+      local_460 = (HLOCAL)0x0;

+    }

+    if (local_460 != (HLOCAL)0x0) {

+      LocalFree(local_460);

+      *puVar14 = 0;

+    }

+  }

+  else {

+    iVar18 = 0x57;

+    if ((DAT_0 & 2) == 0) goto LAB_180040051;

+    uVar16 = 0x15;

+LAB_3:

+    WPP_SF_D(0x401,uVar16,0x18005ade8,iVar18);

+  }

+LAB_1:

+  DhcpCleanParsedOptions(local_448);

+  if (ppppppplVar7 != (longlong *******)0x0) {

+    LOCK();

+    ppppppplVar7 = ppppppplVar7 + 2;

+    iVar6 = *(int *)ppppppplVar7;

+    *(int *)ppppppplVar7 = *(int *)ppppppplVar7 + -1;

+    UNLOCK();

+    if (iVar6 == 1) {

+      DhcpDestroyContextEx((longlong)local_478);

+    }

+  }

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

+    WPP_SF_D(0x404,0x1c,0x18005ade8,iVar18);

+  }

+  return iVar18;

 }
```

## `DhcpTraceVelocityData`  (modified)

```diff
--- DhcpTraceVelocityData
+++ DhcpTraceVelocityData
@@ -1,37 +1,77 @@
-

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

 

 void DhcpTraceVelocityData(void)

 

 {

-  int iVar1;

-  int iVar2;

-  longlong unaff_RBP;

-  undefined8 *unaff_RDI;

-  ulong uVar3;

-  longlong lStack0000000000000028;

-  

-  EnterCriticalSection((LPCRITICAL_SECTION)(ulonglong)((int)unaff_RDI + 0x28));

-  lStack0000000000000028 = unaff_RBP + -0x28;

-  iVar1 = func_0x0001800471a0();

-  uVar3 = (ulong)*(undefined8 *)(unaff_RBP + -0x10);

-  lStack0000000000000028 = unaff_RBP + -0x18;

-  iVar2 = func_0x0001800471a0();

-  if (((longlong *)unaff_RDI[1] != unaff_RDI + 1) || ((longlong *)unaff_RDI[3] != unaff_RDI + 3)) {

-    WxSetThreadpoolTimer((_TP_TIMER *)*unaff_RDI,(_FILETIME *)(unaff_RDI + 10),uVar3,30000);

+  if (((((((((DAT_0 & 0x10) != 0) &&

+           (WPP_SF_L(0x404,10,0x18005b008,g_fUseIpv6OnlyPreferred), (DAT_0 & 0x10) != 0)) &&

+          (WPP_SF_L(0x404,0xb,0x18005b008,g_fVelocityIpv6OnlyPreferredEnabledDefault),

+          (DAT_0 & 0x10) != 0)) &&

+         (((WPP_SF_L(0x404,0xc,0x18005b008,g_fVelocityDhcpv4InformNegativeCacheFix),

+           (DAT_0 & 0x10) != 0 &&

+           (WPP_SF_L(0x404,0xd,0x18005b008,g_fVelocityDhcpInformModifiedLeaseTimesFix),

+           (DAT_0 & 0x10) != 0)) &&

+          ((WPP_SF_L(0x404,0xe,0x18005b008,g_fVelocityApistubStyleUpdate),

+           (DAT_0 & 0x10) != 0 &&

+           ((WPP_SF_L(0x404,0xf,0x18005b008,g_fVelocityDhcpClassedClasslessRoutesFix),

+            (DAT_0 & 0x10) != 0 &&

+            (WPP_SF_L(0x404,0x10,0x18005b008,g_fVelocityDhcpv6ParserFreeCleanup),

+            (DAT_0 & 0x10) != 0)))))))) &&

+        (WPP_SF_L(0x404,0x11,0x18005b008,g_fVelocityDhcpv6MultiRecordOptionSupport),

+        (DAT_0 & 0x10) != 0)) &&

+       ((((WPP_SF_L(0x404,0x12,0x18005b008,g_fVelocityResetUnderRenewalStatus),

+          (DAT_0 & 0x10) != 0 &&

+          (WPP_SF_L(0x404,0x13,0x18005b008,g_fVelocityAddUserClassTracing),

+          (DAT_0 & 0x10) != 0)) &&

+         (WPP_SF_L(0x404,0x14,0x18005b008,g_fVelocityDhcpFixEtwEventErrors),

+         (DAT_0 & 0x10) != 0)) &&

+        (((WPP_SF_L(0x404,0x15,0x18005b008,g_fVelocityDhcpnsiv6StyleUpdate),

+          (DAT_0 & 0x10) != 0 &&

+          (WPP_SF_L(0x404,0x16,0x18005b008,g_fVelocityRegFillParamsLoopFix),

+          (DAT_0 & 0x10) != 0)) &&

+         ((WPP_SF_L(0x404,0x17,0x18005b008,g_fVelocityRemoveFTimersEnabled),

+          (DAT_0 & 0x10) != 0 &&

+          ((WPP_SF_L(0x404,0x18,0x18005b008,g_fVelocityDhcpIPxlatPolicyMgr),

+           (DAT_0 & 0x10) != 0 &&

+           (WPP_SF_L(0x404,0x19,0x18005b008,g_fVelocityDhcpOption108RenewFix),

+           (DAT_0 & 0x10) != 0)))))))))) &&

+      ((WPP_SF_L(0x404,0x1a,0x18005b008,g_fVelocityFixDuidHardwareType), (DAT_0 & 0x10) != 0

+       && (((((WPP_SF_L(0x404,0x1b,0x18005b008,g_fVelocityDhcpv6ContextBitfieldUpdate),

+              (DAT_0 & 0x10) != 0 &&

+              (WPP_SF_L(0x404,0x1c,0x18005b008,g_fVelocityUpdateErrorDumpLimit),

+              (DAT_0 & 0x10) != 0)) &&

+             (WPP_SF_L(0x404,0x1d,0x18005b008,g_fVelocityDhcpSocketRaceConditionFix),

+             (DAT_0 & 0x10) != 0)) &&

+            ((WPP_SF_L(0x404,0x1e,0x18005b008,g_fVelocityStaticRouteCleanup),

+             (DAT_0 & 0x10) != 0 &&

+             (WPP_SF_L(0x404,0x1f,0x18005b008,g_fVelocityDhcpCaptivePortalSupport),

+             (DAT_0 & 0x10) != 0)))) &&

+           ((WPP_SF_L(0x404,0x20,0x18005b008,g_fVelocityDhcpRenewThreadRaceConditionFix),

+            (DAT_0 & 0x10) != 0 &&

+            ((WPP_SF_L(0x404,0x21,0x18005b008,g_fVelocityDhcpv6StaleOptionRemoval),

+             (DAT_0 & 0x10) != 0 &&

+             (WPP_SF_L(0x404,0x22,0x18005b008,g_fVelocityDnr), (DAT_0 & 0x10) != 0))))))))))

+     && ((WPP_SF_L(0x404,0x23,0x18005b008,g_fVelocityConnectedStandbyHandlingCleanup),

+         (DAT_0 & 0x10) != 0 &&

+         (WPP_SF_L(0x404,0x24,0x18005b008,g_fVelocityRpcMsftVendorSpecificOptionsFix),

+         (DAT_0 & 0x10) != 0)))) {

+    WPP_SF_L(0x404,0x25,0x18005b008,g_fVelocityDhcpv6AiBugFinderHighFixes);

   }

-  LeaveCriticalSection((LPCRITICAL_SECTION)(unaff_RDI + 5));

-  if (*(int *)(unaff_RDI + 0xc) == 1) {

-    if (iVar1 != 0) {

-      MicrosoftTelemetryAssertTriggeredNoArgs();

+  if ((g_fVelocityDhcpv4ClassIdLenOverflowFix != 0) && ((DAT_0 & 0x10) != 0)) {

+    WPP_SF_L(0x404,0x26,0x18005b008,g_fVelocityDhcpv4ClassIdLenOverflowFix);

+  }

+  if (g_fVelocityDhcpv4LeaseIpAddressOverflow != 0) {

+    if ((DAT_0 & 0x10) == 0) {

+      return;

     }

-    if (iVar2 != 0) {

-      MicrosoftTelemetryAssertTriggeredNoArgs();

-    }

+    WPP_SF_L(0x404,0x27,0x18005b008,g_fVelocityDhcpv4LeaseIpAddressOverflow);

   }

-  else if ((*(int *)(unaff_RDI + 0xc) == 0) && ((iVar1 != 0 || (iVar2 != 0)))) {

-    func_0x000180047268();

+  if ((((DAT_0 & 0x10) != 0) &&

+      (WPP_SF_L(0x404,0x28,0x18005b008,g_fVelocityDhcpGetOriginalSubnetMaskFix),

+      (DAT_0 & 0x10) != 0)) &&

+     (WPP_SF_L(0x404,0x29,0x18005b008,g_fVelocityDhcpRpcAuthnSvcUpdate), (DAT_0 & 0x10) != 0

+     )) {

+    WPP_SF_L(0x404,0x2a,0x18005b008,g_fVelocityAiBugFinderLockLeakFixes);

   }

   return;

 }
```

## `DhcpInitializeGlobalVelocityData`  (modified)

```diff
--- DhcpInitializeGlobalVelocityData
+++ DhcpInitializeGlobalVelocityData
@@ -1,26 +1,58 @@
-

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

 

 void DhcpInitializeGlobalVelocityData(void)

 

 {

-  undefined8 in_RCX;

-  byte *in_RDX;

-  longlong unaff_RBP;

-  undefined8 in_R8;

-  undefined8 in_R9;

-  undefined4 in_stack_00000020;

-  undefined8 *in_stack_00000028;

+  uint uVar1;

   

-  cRam000000000fffffc7 = cRam000000000fffffc7 + (char)in_RCX * '\x02';

-  cRam0000000010000000 = cRam0000000010000000 + (char)in_RCX;

-  *(undefined8 *)(unaff_RBP + 0xe8) = 8;

-  *(undefined8 *)(unaff_RBP + 0xf8) = 8;

-  *(undefined8 *)(unaff_RBP + 0x108) = 8;

-  *(undefined8 *)(unaff_RBP + -0x28) = 0x1000000;

-  *(undefined8 *)(unaff_RBP + 0x118) = 8;

-  _tlgWriteTransfer_EtwEventWriteTransfer

-            (in_RCX,in_RDX,in_R8,in_R9,in_stack_00000020,in_stack_00000028);

+  uVar1 = Feature_CLAT_DHCP_Option108__private_IsEnabledDeviceUsageNoInline();

+  g_fUseIpv6OnlyPreferred = (uint)(uVar1 != 0);

+  uVar1 = Feature_CLAT_Preview2_Dhcp108Default__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityIpv6OnlyPreferredEnabledDefault = (uint)(uVar1 != 0);

+  uVar1 = Feature_Servicing_Dhcpv4InformNegativeCacheResetTimersOnWakeFix__private_IsEnabledDeviceUsageNoInline

+                    ();

+  g_fVelocityDhcpv4InformNegativeCacheFix = (uint)(uVar1 != 0);

+  uVar1 = Feature_58976313__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpv6MultiRecordOptionSupport = (uint)(uVar1 != 0);

+  uVar1 = Feature_CLAT_Preview2_DhcpIPxlatPolicyMgr__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpIPxlatPolicyMgr = (uint)(uVar1 != 0);

+  uVar1 = Feature_CLAT_Preview2_DhcpOption108RenewFix__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpOption108RenewFix = (uint)(uVar1 != 0);

+  uVar1 = Feature_61277108__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpCaptivePortalSupport = (uint)(uVar1 != 0);

+  uVar1 = Feature_2263349562__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDnr = 0;

+  g_fVelocityDhcpv6StaleOptionRemoval = (uint)(uVar1 != 0);

+  uVar1 = Feature_341032248__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpv4ClassIdLenOverflowFix = (uint)(uVar1 != 0);

+  uVar1 = Feature_3211771192__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpv4LeaseIpAddressOverflow = (uint)(uVar1 != 0);

+  uVar1 = Feature_849856826__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpGetOriginalSubnetMaskFix = (uint)(uVar1 != 0);

+  uVar1 = Feature_59101910__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpFixEtwEventErrors = (uint)(uVar1 != 0);

+  g_fVelocityApistubStyleUpdate = g_fVelocityDhcpFixEtwEventErrors;

+  g_fVelocityResetUnderRenewalStatus = g_fVelocityDhcpFixEtwEventErrors;

+  g_fVelocityDhcpClassedClasslessRoutesFix = g_fVelocityDhcpFixEtwEventErrors;

+  g_fVelocityAddUserClassTracing = g_fVelocityDhcpFixEtwEventErrors;

+  g_fVelocityDhcpv6ParserFreeCleanup = g_fVelocityDhcpFixEtwEventErrors;

+  uVar1 = Feature_60512953__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityRemoveFTimersEnabled = (uint)(uVar1 != 0);

+  g_fVelocityDhcpSocketRaceConditionFix = g_fVelocityRemoveFTimersEnabled;

+  g_fVelocityUpdateErrorDumpLimit = g_fVelocityRemoveFTimersEnabled;

+  g_fVelocityDhcpv6ContextBitfieldUpdate = g_fVelocityRemoveFTimersEnabled;

+  g_fVelocityFixDuidHardwareType = g_fVelocityRemoveFTimersEnabled;

+  g_fVelocityRegFillParamsLoopFix = g_fVelocityRemoveFTimersEnabled;

+  g_fVelocityDhcpnsiv6StyleUpdate = g_fVelocityRemoveFTimersEnabled;

+  uVar1 = Feature_61186233__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityDhcpInformModifiedLeaseTimesFix = (uint)(uVar1 != 0);

+  g_fVelocityStaticRouteCleanup = g_fVelocityDhcpInformModifiedLeaseTimesFix;

+  g_fVelocityDhcpRenewThreadRaceConditionFix = g_fVelocityDhcpInformModifiedLeaseTimesFix;

+  uVar1 = Feature_61561226__private_IsEnabledDeviceUsageNoInline();

+  g_fVelocityConnectedStandbyHandlingCleanup = (uint)(uVar1 != 0);

+  g_fVelocityRpcMsftVendorSpecificOptionsFix = g_fVelocityConnectedStandbyHandlingCleanup;

+  g_fVelocityDhcpv6AiBugFinderHighFixes = g_fVelocityConnectedStandbyHandlingCleanup;

+  g_fVelocityDhcpRpcAuthnSvcUpdate = g_fVelocityConnectedStandbyHandlingCleanup;

+  g_fVelocityAiBugFinderLockLeakFixes = g_fVelocityConnectedStandbyHandlingCleanup;

   return;

 }
```

## `ProcessDhcpRequestForever`  (modified)

```diff
--- ProcessDhcpRequestForever
+++ FastWppTraceMessage
@@ -1,513 +1,52 @@
 

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

-/* WARNING: Enum "enum_6676": Some values do not have unique names */

-/* WARNING: Enum "enum_6677": Some values do not have unique names */

 

-DWORD ProcessDhcpRequestForever(ulonglong param_1,undefined8 param_2,undefined8 param_3)

+void FastWppTraceMessage(undefined2 param_1,ushort param_2,ULONGLONG param_3,undefined8 param_4)

 

 {

-  undefined **ppuVar1;

-  undefined1 auVar2 [16];

-  bool bVar3;

-  bool bVar4;

-  bool bVar5;

-  byte bVar6;

-  bool bVar7;

-  ushort uVar8;

-  DWORD DVar9;

-  NTSTATUS NVar10;

-  uint uVar11;

-  uint uVar12;

-  DWORD DVar13;

-  BOOL BVar14;

-  undefined7 extraout_var;

-  undefined7 extraout_var_00;

-  ULONGLONG UVar15;

-  undefined2 uVar16;

-  int *piVar17;

-  longlong *plVar18;

-  undefined8 uVar19;

-  LARGE_INTEGER LVar20;

-  undefined2 *puVar21;

-  longlong lVar22;

-  LPDWORD pDVar23;

-  LARGE_INTEGER LVar24;

-  undefined **ppuVar25;

-  LPDWORD nSize;

-  ulonglong uVar26;

-  undefined1 auStackY_138 [32];

-  LARGE_INTEGER local_f8;

-  int local_ec;

-  uint local_e4;

-  uint local_e0;

-  uint local_d8;

-  DWORD local_d4;

-  int local_d0;

-  int local_cc;

-  uint local_c8;

-  int local_c4;

-  int local_c0;

-  int local_bc;

-  longlong local_b8;

-  _FILETIME local_b0;

-  HANDLE local_a8;

-  undefined8 local_a0;

-  undefined8 uStack_98;

-  HANDLE local_90;

-  HANDLE pvStack_88;

-  HANDLE local_80;

-  undefined8 uStack_78;

-  LARGE_INTEGER local_70;

-  undefined8 local_68 [2];

-  undefined8 local_58 [2];

-  undefined8 local_48 [2];

-  ulonglong local_38;

-  ulonglong uVar27;

+  undefined1 *lpMem;

+  undefined8 local_res20;

+  undefined1 auStackY_1a8 [32];

+  EVENT_DESCRIPTOR local_160;

+  _EVENT_DATA_DESCRIPTOR local_150;

+  undefined1 *local_140;

+  ulonglong auStack_138 [2];

+  undefined1 local_128 [256];

+  ulonglong local_28;

   

-  local_38 = __security_cookie ^ (ulonglong)auStackY_138;

-  bVar7 = false;

-  local_c4 = 0;

-  local_90 = (HANDLE)0x0;

-  pvStack_88 = (HANDLE)0x0;

-  uVar26 = param_1 & 0xffffffff;

-  local_70.QuadPart = 0;

-  bVar4 = true;

-  local_d4 = 0;

-  local_80 = (HANDLE)0x0;

-  uStack_78 = 0;

-  local_a8 = (HANDLE)0x0;

-  LVar24.QuadPart = 0;

-  bVar5 = false;

-  local_bc = 0;

-  local_c0 = 0;

-  local_f8.QuadPart = 0;

-  local_b8 = 0;

-  local_d0 = 0;

-  local_cc = 0;

-  local_b0.dwLowDateTime = 0;

-  local_b0.dwHighDateTime = 0;

-  local_ec = 0;

-  if ((Microsoft_Windows_Dhcp_ClientEnableBits & 1) != 0) {

-    McGenEventWrite_EtwEventWriteTransfer(param_1,&ProcessDHCPRequestForever,param_3,1,&local_a0);

-  }

-  piVar17 = &local_bc;

-  DVar9 = DhcpSetThreadCompartmentScopeAll(piVar17,&local_c0);

-  bVar3 = false;

-  if (DVar9 == 0) {

-    DVar9 = DhcpInitNSI();

-    if (DVar9 == 0x32) {

-      piVar17 = DhcpGlobalServiceSyncEvent;

-      DVar9 = WaitForSingleObject(DhcpGlobalServiceSyncEvent,0xffffffff);

-      if (DVar9 != 0) {

-        local_f8.QuadPart = 0;

-        bVar3 = false;

-        if ((DAT_1 & 2) == 0) goto LAB_180015fd8;

-        uVar8 = 0x8f;

-        bVar4 = bVar7;

-LAB_2:

-        WPP_SF_D(0x401,uVar8,0x180057608,DVar9);

-        local_f8.QuadPart = LVar24.QuadPart;

-        bVar3 = bVar4;

-        goto LAB_0;

+  local_28 = __security_cookie ^ (ulonglong)auStackY_1a8;

+  lpMem = (undefined1 *)0x0;

+  if (FastWppInitState == 2) {

+    local_160.Version = '\0';

+    local_160.Channel = '\0';

+    local_160.Id = param_2;

+    local_160.Level = (char)((ushort)param_1 >> 8);

+    local_160.Opcode = '\0';

+    local_160.Task = 0;

+    local_160.Keyword = 1L << ((byte)param_1 & 0x3f);

+    local_140 = local_128;

+    local_150.Size = 0x10;

+    local_150.Reserved = 4;

+    auStack_138[0] = 0x100;

+    local_res20 = param_4;

+    local_150.Ptr = param_3;

+    FastWppPackEvent(&local_res20,local_128,0x100,(undefined4 *)auStack_138);

+    if (0x100 < (uint)auStack_138[0]) {

+      lpMem = HeapAlloc(*(HANDLE *)((longlong)ProcessEnvironmentBlock + 0x30),8,

+                        auStack_138[0] & 0xffffffff);

+      if (lpMem == (undefined1 *)0x0) {

+        auStack_138[0] = CONCAT44(auStack_138[0]._4_4_,0x100);

       }

-      DAT_3 = 4;

-      UpdateStatus();

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

-        piVar17 = (int *)0x404;

-        WPP_SF_(0x404,0x90,0x180057608);

+      else {

+        local_140 = lpMem;

+        FastWppPackEvent(&local_res20,lpMem,(uint)auStack_138[0],(undefined4 *)auStack_138);

       }

-      DVar9 = 0x490;

-      bVar3 = false;

-      goto LAB_4;

     }

-    bVar3 = false;

-    if (DVar9 != 0) goto LAB_4;

-    piVar17 = (int *)0x2;

-    local_c4 = 1;

-    nSize = (LPDWORD)0x0;

-    DVar9 = NotifyUnicastIpAddressChange

-                      (2,DhcpUnicastAddressChangeCallback,(PVOID)0x0,'\0',&local_a8);

-    if (DVar9 == 0) {

-      bVar3 = true;

-      DVar9 = DhcpStartRPCServer();

-      if (DVar9 == 0) {

-        DVar9 = WaitForSingleObject(DhcpGlobalServiceSyncEvent,0xffffffff);

-        if (DVar9 == 0) {

-          DAT_3 = 4;

-          UpdateStatus();

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

-            nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-            WPP_SF_(0x404,0x93,0x180057608);

-          }

-          pvStack_88 = DhcpGlobalRecomputeTimerEvent;

-          local_90 = DhcpGlobalTerminateEvent;

-          local_80 = DhcpGlobalRefreshEvent;

-          uStack_78 = DhcpLsaDnsDomChangeNotifyHandle;

-          local_e0 = 0;

-          local_e4 = 0;

-          bVar4 = false;

-          bVar6 = CheckIfSystemSupportsAOAC();

-          if ((int)CONCAT71(extraout_var,bVar6) != 0) {

-            nSize = (LPDWORD)0x0;

-            uVar19 = 0;

-            local_f8 = (LARGE_INTEGER)CreateEventW((LPSECURITY_ATTRIBUTES)0x0,1,0,(LPCWSTR)0x0);

-            if ((HANDLE)local_f8.QuadPart == (HANDLE)0x0) {

-              DVar9 = GetLastError();

-              if ((DAT_1 & 2) != 0) {

-                nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                uVar19 = 0x401;

-                WPP_SF_L(0x401,0x94,0x180057608,DVar9);

-              }

-              if ((Microsoft_Windows_Dhcp_ClientEnableBits & 4) != 0) {

-                nSize = (LPDWORD)(ulonglong)DVar9;

-                McTemplateU0q_EtwEventWriteTransfer(uVar19,&CreateRenewalSignalHandleFailed,nSize);

-              }

-            }

-          }

-LAB_5:

-          if (local_f8.QuadPart != 0) {

-            bVar5 = true;

-          }

-          uVar11 = 4;

-          uVar12 = (uint)uVar26;

-          if (uVar12 == 0xffffffff) {

-            LVar24.QuadPart = 0xffffffff;

-          }

-          else {

-            LVar24._0_4_ = uVar12 * 1000;

-            LVar24.s.HighPart = 0;

-            if (LVar24._0_4_ / 1000 != uVar12) {

-              LVar24.QuadPart = 0xfffffffe;

-            }

-          }

-          DVar9 = LVar24.s.LowPart;

-          if (bVar5) {

-            if (local_b8 != 0) {

-              LVar20.QuadPart = (LONGLONG)&local_b8;

-              uVar12 = DeleteRenewTimer((longlong *)LVar20);

-              if (uVar12 != 0) {

-                if ((DAT_1 & 2) != 0) {

-                  nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                  LVar20.QuadPart = 0x401;

-                  WPP_SF_L(0x401,0x95,0x180057608,uVar12);

-                }

-                if ((Microsoft_Windows_Dhcp_ClientEnableBits & 4) != 0) {

-                  nSize = (LPDWORD)(ulonglong)uVar12;

-                  McTemplateU0q_EtwEventWriteTransfer(LVar20,&DeleteRenewTimerFailed,nSize);

-                }

-                bVar5 = false;

-                goto LAB_6;

-              }

-            }

-            LVar20 = local_f8;

-            BVar14 = ResetEvent((HANDLE)local_f8);

-            if (BVar14 == 0) {

-              DVar13 = GetLastError();

-              pDVar23 = (LPDWORD)(ulonglong)DVar13;

-              if ((DAT_1 & 2) != 0) {

-                nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                LVar20.QuadPart = 0x401;

-                WPP_SF_L(0x401,0x96,0x180057608,DVar13);

-              }

-              if ((Microsoft_Windows_Dhcp_ClientEnableBits & 4) != 0) {

-                McTemplateU0q_EtwEventWriteTransfer(LVar20,&ResetRenewalSignalHandleFailed,pDVar23);

-                nSize = pDVar23;

-              }

-              bVar5 = false;

-            }

-          }

-          else {

-            LVar20.QuadPart = 0;

-          }

-LAB_6:

-          if (local_e4 == 0xffffffff) {

-            LVar20 = DhcpGlobalWaitableTimerHandle;

-            CancelWaitableTimer((HANDLE)DhcpGlobalWaitableTimerHandle);

-          }

-          else {

-            DhcpStartWaitableTimer(LVar20,local_e4);

-          }

-          if (g_fVelocityDhcpv4InformNegativeCacheFix == 0) {

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

-              nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-              LVar20.QuadPart = 0x404;

-              WPP_SF_L(0x404,0x98,0x180057608,DVar9);

-            }

-          }

-          else if ((DAT_1 & 0x10) != 0) {

-            nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-            LVar20.QuadPart = 0x404;

-            WPP_SF_L(0x404,0x97,0x180057608,DVar9);

-          }

-          if (bVar5) {

-            DVar13 = CreateRenewTimer(DVar9,local_f8,nSize,&local_b8);

-            if (DVar13 == 0) {

-              DVar9 = 0xffffffff;

-              local_70 = local_f8;

-              uVar11 = 5;

-              LVar20 = LVar24;

-            }

-            else {

-              if ((DAT_1 & 2) != 0) {

-                LVar24.QuadPart = 0x401;

-                WPP_SF_L(0x401,0x99,0x180057608,DVar13);

-              }

-              if ((Microsoft_Windows_Dhcp_ClientEnableBits & 4) != 0) {

-                McTemplateU0q_EtwEventWriteTransfer

-                          (LVar24,&CreateRenewTimerFailed,(ulonglong)DVar13);

-              }

-              bVar5 = false;

-              LVar20 = LVar24;

-            }

-          }

-          SetPreSleepMainThreadInfo(LVar20,DVar9,local_ec,&local_b0);

-          puVar21 = (undefined2 *)(ulonglong)uVar11;

-          DVar13 = WaitForMultipleObjectsEx(uVar11,&local_90,0,DVar9,0);

-          nSize = (LPDWORD)(ulonglong)DVar13;

-          SetPostSleepMainThreadInfo(puVar21,(longlong)local_b0,DVar13);

-          DVar9 = 0;

-          local_ec = 0;

-          uVar27 = 0;

-          uVar26 = 0;

-          if (DVar13 == 0) goto LAB_7;

-          if (DVar13 == 1) {

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

-              uVar8 = 0x9e;

-LAB_8:

-              nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-              WPP_SF_(0x404,uVar8,0x180057608);

-            }

-LAB_9:

-            local_e4 = 0xffffffff;

-            uVar27 = 0xffffffff;

-            local_d8 = 0xffffffff;

-            local_c8 = 0xffffffff;

-            bVar7 = DhcpIsFSEGuestSystem();

-            uVar26 = 0xffffffff;

-            if ((int)CONCAT71(extraout_var_00,bVar7) == 0) {

-              if (((g_fVelocityConnectedStandbyHandlingCleanup != 0) ||

-                  (DhcpGlobalDsFeatureEnabled != 0)) ||

-                 (uVar19 = DhcpIsMachineInDs(), (int)uVar19 == 0)) {

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

-                  nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                  WPP_SF_(0x404,0xa3,0x180057608);

-                }

-                if ((Microsoft_Windows_Dhcp_ClientEnableBits & 1) != 0) {

-                  McGenEventWrite_EtwEventWriteTransfer

-                            (1,&ProcessDHCPRequestForeverWaitTimeout,nSize,1,local_58);

-                }

-                if (bVar4) {

-                  HandleFailedRenewals();

-                  bVar4 = false;

-                }

-                UVar15 = GetTickCount64();

-                auVar2._8_8_ = 0;

-                auVar2._0_8_ = UVar15;

-                lVar22 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar2,8);

-                EnterCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNicListCritSect);

-                if ((undefined **)DhcpGlobalConnectedNICList != &DhcpGlobalConnectedNICList) {

-                  local_ec = 0;

-                  ppuVar25 = (undefined **)DhcpGlobalConnectedNICList;

-                  do {

-                    ppuVar1 = (undefined **)*ppuVar25;

-                    nSize = (LPDWORD)(ulonglong)local_e0;

-                    local_ec = local_ec + 1;

-                    ProcessSingleContext

-                              (ppuVar25,(UVar15 - lVar22 >> 1) + lVar22 >> 9,local_e0,

-                               (int *)&local_d8,&local_c8,&local_d0,&local_cc);

-                    if (local_d0 != 0) {

-                      bVar4 = true;

-                    }

-                    if (local_cc != 0) {

-                      if ((g_fVelocityDhcpRenewThreadRaceConditionFix != 0) &&

-                         ((DAT_1 & 0x10) != 0)) {

-                        nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                        WPP_SF_(0x404,0xa4,0x180057608);

-                      }

-                      SetEvent(DhcpGlobalRecomputeTimerEvent);

-                    }

-                    ppuVar25 = ppuVar1;

-                  } while (ppuVar1 != &DhcpGlobalConnectedNICList);

-                  uVar27 = (ulonglong)local_c8;

-                  local_e4 = local_d8;

-                }

-                local_e0 = 0;

-                LeaveCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNicListCritSect);

-                uVar26 = uVar27;

-                goto LAB_5;

-              }

-              if ((DAT_1 & 0x10) == 0) goto LAB_18001628b;

-              uVar8 = 0xa2;

-            }

-            else {

-              if ((DAT_1 & 0x10) == 0) goto LAB_18001628b;

-              uVar8 = 0xa1;

-            }

-            uVar16 = 0x404;

-            uVar26 = uVar27;

-            goto LAB_10;

-          }

-          if (DVar13 != 2) {

-            if (DVar13 == 3) {

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

-                nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                puVar21 = (undefined2 *)0x404;

-                WPP_SF_(0x404,0x9d,0x180057608);

-              }

-LAB_11:

-              if ((Microsoft_Windows_Dhcp_ClientEnableBits & 0x80) != 0) {

-                McGenEventWrite_EtwEventWriteTransfer

-                          (puVar21,&DomainChangeNotification,nSize,1,local_68);

-              }

-              local_e0 = 1;

-              if (DVar13 == 4) goto LAB_12;

-LAB_13:

-              if (DVar13 != 0x102) goto LAB_9;

-            }

-            else {

-              if (DVar13 == 4) {

-LAB_12:

-                if ((DAT_1 & 0x10) == 0) goto LAB_180016731;

-                nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                WPP_SF_(0x404,0x9f,0x180057608);

-                goto LAB_13;

-              }

-              if (DVar13 != 0x102) {

-                if (DVar13 != 0xffffffff) {

-                  uVar26 = uVar27;

-                  if ((DAT_1 & 2) != 0) {

-                    uVar8 = 0xa8;

-                    goto LAB_14;

-                  }

-                  goto LAB_5;

-                }

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

-                  nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-                  WPP_SF_(0x404,0xa6,0x180057608);

-                }

-                if ((DAT_1 & 2) == 0) goto LAB_18001628b;

-                DVar13 = GetLastError();

-                uVar8 = 0xa7;

-                goto LAB_14;

-              }

-            }

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

-              uVar8 = 0xa0;

-              goto LAB_8;

-            }

-            goto LAB_9;

-          }

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

-            WPP_SF_(0x404,0x9a,0x180057608);

-          }

-          ResetEvent(DhcpGlobalRefreshEvent);

-          nSize = &local_d4;

-          local_d4 = 0x40;

-          BVar14 = GetComputerNameExW(ComputerNameNetBIOS,&DhcpGlobalHostNameW,nSize);

-          if (BVar14 != 0) {

-            local_a0 = 0;

-            uStack_98 = 0;

-            RtlInitUnicodeString(&local_a0,&DhcpGlobalHostNameW);

-            uVar8 = RtlxUnicodeStringToOemSize(&local_a0);

-            if (uVar8 < 0x80) {

-              puVar21 = &DhcpGlobalHostNameW;

-              DhcpUnicodeToOem(&DhcpGlobalHostNameW,&DhcpGlobalHostName);

-              goto LAB_11;

-            }

-            if ((DAT_1 & 2) != 0) {

-              uVar8 = 0x9c;

-              uVar16 = 0x401;

-              uVar26 = uVar27;

-LAB_10:

-              nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-              WPP_SF_(uVar16,uVar8,0x180057608);

-            }

-            goto LAB_5;

-          }

-          if ((DAT_1 & 2) == 0) goto LAB_18001628b;

-          DVar13 = GetLastError();

-          uVar8 = 0x9b;

-LAB_14:

-          nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-          WPP_SF_D(0x401,uVar8,0x180057608,DVar13);

-          uVar26 = uVar27;

-          goto LAB_5;

-        }

-        local_f8.QuadPart = LVar24.QuadPart;

-        bVar3 = bVar4;

-        if ((DAT_1 & 2) == 0) goto LAB_180015fd8;

-        uVar8 = 0x92;

-        goto LAB_2;

-      }

-      MicrosoftTelemetryAssertTriggeredNoArgs();

-      bVar3 = bVar4;

-      goto LAB_4;

-    }

-    if ((DAT_1 & 2) != 0) {

-      piVar17 = (int *)0x401;

-      WPP_SF_D(0x401,0x91,0x180057608,DVar9);

-      goto LAB_4;

+    EventWriteEx(FastWppRegHandle,&local_160,0,0,(LPCGUID)0x0,(LPCGUID)0x0,2,&local_150);

+    if (lpMem != (undefined1 *)0x0) {

+      HeapFree(*(HANDLE *)((longlong)ProcessEnvironmentBlock + 0x30),0,lpMem);

     }

   }

-  else {

-LAB_4:

-    bVar7 = bVar3;

-    if ((DAT_1 & 2) != 0) {

-      piVar17 = (int *)0x401;

-      WPP_SF_D(0x401,0xab,0x180057608,DVar9);

-    }

-  }

-  local_f8.QuadPart = LVar24.QuadPart;

-  bVar3 = bVar7;

-  if ((Microsoft_Windows_Dhcp_ClientEnableBits & 4) != 0) {

-    McTemplateU0q_EtwEventWriteTransfer(piVar17,&ProcessDHCPRequestForeverFailed,(ulonglong)DVar9);

-  }

-LAB_0:

-  if (DhcpGlobalRpcServUp != 0) {

-    DhcpStopRPCServer();

-  }

-  if (((bVar3) && (NVar10 = CancelMibChangeNotify2(local_a8), NVar10 != 0)) &&

-     ((DAT_1 & 2) != 0)) {

-    WPP_SF_D(0x401,0xa9,0x180057608,NVar10);

-  }

-  if (local_c4 != 0) {

-    DhcpDeInitNSIMediaSense();

-  }

-  if (local_c0 != 0) {

-    DhcpRevertThreadCompartmentScope(local_bc);

-  }

-  if (local_b8 != 0) {

-    plVar18 = &local_b8;

-    uVar11 = DeleteRenewTimer(plVar18);

-    if (uVar11 != 0) {

-      if ((DAT_1 & 2) != 0) {

-        plVar18 = (longlong *)0x401;

-        WPP_SF_L(0x401,0xaa,0x180057608,uVar11);

-      }

-      if ((Microsoft_Windows_Dhcp_ClientEnableBits & 4) != 0) {

-        McTemplateU0q_EtwEventWriteTransfer(plVar18,&DeleteRenewTimerFailed,(ulonglong)uVar11);

-      }

-    }

-  }

-  if (local_f8.QuadPart != 0) {

-    CloseHandle((HANDLE)local_f8);

-  }

-  return DVar9;

-LAB_7:

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

-    nSize = (LPDWORD)&WPP_d86263a48abf38d4057ead6ce09cb882_Traceguids;

-    puVar21 = (undefined2 *)0x404;

-    WPP_SF_(0x404,0xa5,0x180057608);

-  }

-  if ((Microsoft_Windows_Dhcp_ClientEnableBits & 0x20) != 0) {

-    McGenEventWrite_EtwEventWriteTransfer(puVar21,&ServiceSetsTerminateEvent,nSize,1,local_48);

-  }

-  EnterCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNicListCritSect);

-  for (ppuVar25 = (undefined **)DhcpGlobalConnectedNICList; ppuVar25 != &DhcpGlobalConnectedNICList;

-      ppuVar25 = (undefined **)*ppuVar25) {

-    CancelRenew((longlong)ppuVar25);

-  }

-  LeaveCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNicListCritSect);

-  goto LAB_0;

+  return;

 }
```

## `DhcpV4DeactivateNetwork`  (modified)

```diff
--- DhcpV4DeactivateNetwork
+++ DhcpV4TraceWcmError
@@ -1,73 +1,53 @@
 

-void DhcpV4DeactivateNetwork

-               (longlong *param_1,longlong *param_2,undefined8 param_3,undefined4 param_4)

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

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

+

+void DhcpV4TraceWcmError(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

 

 {

-  int iVar1;

-  uint uVar2;

-  ushort uVar3;

+  bool bVar1;

+  undefined1 auStackY_c8 [32];

+  uint local_98 [2];

+  ulonglong local_90;

+  ulonglong local_88 [2];

+  _EVENT_DATA_DESCRIPTOR local_78 [2];

+  ulonglong *local_58;

+  undefined8 local_50;

+  ulonglong *local_48;

+  undefined8 local_40;

+  uint *local_38;

+  undefined8 local_30;

+  ulonglong *local_28;

+  undefined8 local_20;

+  ulonglong local_18;

   

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

-    WPP_SF_qqdJ();

+  local_18 = __security_cookie ^ (ulonglong)auStackY_c8;

+  TraceLogErrorv4(param_1,param_2,0x3d);

+  bVar1 = true;

+  if ((Microsoft_Windows_Dhcp_ClientEnableBits & 1) != 0) {

+    McTemplateU0q_EtwEventWriteTransfer(param_1,&FailedToAcquireWcm,(ulonglong)param_2);

   }

-  if (g_fVelocityConnectedStandbyHandlingCleanup == 0) {

-    if ((DhcpGlobalDsFeatureEnabled != 0) && (*param_1 != 0)) {

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

-        WPP_SF_(0x404,0x59,0x1800576e8);

-      }

-      iVar1 = DhcpWcmReleaseRef(param_1);

-      if ((iVar1 != 0) && ((DAT_0 & 2) != 0)) {

-        uVar3 = 0x5a;

-        goto LAB_1;

-      }

+  if (5 < DAT_0) {

+    if (((DAT_1 & 0x400000000000) == 0) ||

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

+      bVar1 = false;

     }

-  }

-  else if (*param_1 != 0) {

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

-      WPP_SF_(0x404,0x57,0x1800576e8);

+    if (bVar1) {

+      local_50 = 8;

+      local_40 = 8;

+      local_90 = (ulonglong)(DhcpGlobalIsShuttingDown == 0);

+      local_30 = 4;

+      local_58 = &local_90;

+      local_88[1] = 0x1000000;

+      local_88[0] = (ulonglong)(DhcpGlobalIsShuttingDown != 0);

+      local_20 = 8;

+      local_48 = local_88;

+      local_38 = local_98;

+      local_28 = local_88 + 1;

+      local_98[0] = param_2;

+      _tlgWriteAgg((ulonglong)DhcpGlobalIsShuttingDown,&DAT_3,0,param_4,local_78);

     }

-    iVar1 = DhcpWcmReleaseRef(param_1);

-    if ((iVar1 != 0) && ((DAT_0 & 2) != 0)) {

-      uVar3 = 0x58;

-LAB_1:

-      WPP_SF_(0x401,uVar3,0x1800576e8);

-    }

-  }

-  if (*param_2 == 0) {

-    if (g_PdcActivationDisabled == 0) {

-      MicrosoftTelemetryAssertTriggeredNoArgs();

-    }

-    if (*param_2 == 0) {

-      if ((DAT_0 & 2) != 0) {

-        WPP_SF_(0x401,0x5b,0x1800576e8);

-      }

-      goto LAB_2;

-    }

-  }

-  if (*param_1 != 0) {

-    MicrosoftTelemetryAssertTriggeredNoArgs();

-  }

-  uVar2 = PdcDeactivateNetwork(*param_2);

-  *param_2 = 0;

-  if (uVar2 != 0) {

-    if ((DAT_0 & 2) != 0) {

-      WPP_SF_(0x401,0x5c,0x1800576e8);

-    }

-    MicrosoftTelemetryAssertTriggeredNoArgs();

-  }

-  LOCK();

-  UNLOCK();

-  iVar1 = DhcpGlobalPdcCount + -1;

-  if ((DAT_0 & 0x10) == 0) {

-    DhcpGlobalPdcCount = DhcpGlobalPdcCount + -1;

-    return;

-  }

-  DhcpGlobalPdcCount = DhcpGlobalPdcCount + -1;

-  WPP_SF_L(0x404,0x5d,0x1800576e8,iVar1);

-LAB_2:

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

-    WPP_SF_DJ(0x404,0x5e,0x1800576e8,param_4);

   }

   return;

 }
```

## `DhcpGetCachedNetwork`  (modified)

```diff
--- DhcpGetCachedNetwork
+++ DhcpGetCachedNetwork
@@ -1,105 +1,126 @@
 

 undefined8 DhcpGetCachedNetwork(SOCKET *param_1)

 

 {

   STRSAFE_PCNZWCH psz;

-  wchar_t *pwVar1;

-  undefined1 auVar2 [16];

+  undefined1 auVar1 [16];

+  wchar_t *pwVar2;

   bool bVar3;

   HRESULT HVar4;

   int iVar5;

+  ulonglong uVar6;

   undefined7 extraout_var;

-  undefined8 uVar6;

-  ULONGLONG UVar7;

-  ulonglong uVar8;

-  wchar_t *pwVar9;

+  undefined8 uVar7;

+  ULONGLONG UVar8;

+  wchar_t **ppwVar9;

   longlong lVar10;

-  SOCKET *unaff_RBX;

-  longlong unaff_RBP;

-  ushort unaff_DI;

-  wchar_t *in_R9;

-  wchar_t *_Buf1;

-  size_t in_stack_00000038;

+  wchar_t **ppwVar11;

+  wchar_t **_Buf1;

+  uint local_res8 [2];

+  wchar_t **local_res10;

+  wchar_t *local_res18;

+  LARGE_INTEGER local_res20;

+  LARGE_INTEGER local_108;

+  size_t local_100;

+  undefined1 local_f8 [208];

   

+  local_res10 = (wchar_t **)0x0;

+  local_res18 = (wchar_t *)0x0;

+  memset(local_f8,0,200);

+  local_108.QuadPart = 0;

+  local_res20.QuadPart = 0;

+  local_res8[0] = 0;

   if ((DAT_0 & 0x10) != 0) {

-    in_R9 = (wchar_t *)((ulonglong)param_1 / 1000000);

-    WPP_SF_ii(param_1,unaff_DI,0x180057608,in_R9);

+    WPP_SF_q(0x404,199,0x180057608,param_1[3]);

   }

-  _Buf1 = *(wchar_t **)(unaff_RBP + 0x48);

-  psz = (STRSAFE_PCNZWCH)unaff_RBX[0xec];

-  pwVar1 = *(wchar_t **)(unaff_RBP + 0x50);

-  if (_Buf1 == (wchar_t *)0x0) {

-    *(undefined4 *)(unaff_RBX + 0xf0) = 0;

+  *(undefined4 *)((longlong)param_1 + 0x784) = 0;

+  *(undefined4 *)(param_1 + 0xf1) = 0;

+  *(undefined4 *)(param_1 + 0xf0) = 1;

+  *(undefined4 *)((longlong)param_1 + 0x7a4) = 1;

+  QueryPerformanceCounter(&local_108);

+  ppwVar11 = &local_res18;

+  GetNetworkHint(param_1[3],&local_res10,local_res8,ppwVar11);

+  QueryPerformanceCounter(&local_res20);

+  uVar6 = (ulonglong)((local_res20.QuadPart - (longlong)local_108) * 1000000000) /

+          DhcpGlobalPerformanceFrequency;

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

+    ppwVar11 = (wchar_t **)(uVar6 / 1000000);

+    WPP_SF_ii(uVar6,200,0x180057608,ppwVar11);

+  }

+  pwVar2 = local_res18;

+  _Buf1 = local_res10;

+  psz = (STRSAFE_PCNZWCH)param_1[0xec];

+  if (local_res10 == (wchar_t **)0x0) {

+    *(undefined4 *)(param_1 + 0xf0) = 0;

     if ((Microsoft_Windows_Dhcp_ClientEnableBits & 1) != 0) {

-      McTemplateU0q_EtwEventWriteTransfer

-                (param_1,&NetworkHintNotReceived,(ulonglong)(uint)unaff_RBX[6]);

+      McTemplateU0q_EtwEventWriteTransfer(uVar6,&NetworkHintNotReceived,(ulonglong)(uint)param_1[6])

+      ;

     }

-    DhcpSaveInterfaceConfiguration((longlong)unaff_RBX);

+    DhcpSaveInterfaceConfiguration((longlong)param_1);

     goto LAB_1;

   }

   if ((Microsoft_Windows_Dhcp_ClientEnableBits & 0x80) != 0) {

-    in_R9 = _Buf1;

+    ppwVar11 = local_res10;

     McTemplateU0zzqbr2_EtwEventWriteTransfer

-              (param_1,&NetworkHintReceived,pwVar1,_Buf1,(int)unaff_RBX[0xc],unaff_RBX[0xb]);

+              (uVar6,&NetworkHintReceived,local_res18,(wchar_t *)local_res10,(int)param_1[0xc],

+               param_1[0xb]);

   }

   if (psz == (STRSAFE_PCNZWCH)0x0) {

 LAB_2:

-    ProcessNetworkChange((undefined *)unaff_RBX,_Buf1,(ulonglong)*(uint *)(unaff_RBP + 0x40),pwVar1)

-    ;

+    ProcessNetworkChange((undefined *)param_1,(wchar_t *)_Buf1,(ulonglong)local_res8[0],pwVar2);

   }

   else {

-    in_stack_00000038 = 0;

-    HVar4 = StringCchLengthW(psz,0x7fffffff,&stack0x00000038);

+    local_100 = 0;

+    HVar4 = StringCchLengthW(psz,0x7fffffff,&local_100);

     if (-1 < HVar4) {

-      if ((ulonglong)*(uint *)(unaff_RBP + 0x40) == in_stack_00000038 + 1) {

-        pwVar9 = _Buf1;

-        iVar5 = memcmp(_Buf1,psz,in_stack_00000038 * 2);

+      if ((ulonglong)local_res8[0] == local_100 + 1) {

+        ppwVar9 = _Buf1;

+        iVar5 = memcmp(_Buf1,psz,local_100 * 2);

         if (iVar5 == 0) {

-          *(undefined4 *)((longlong)unaff_RBX + 0x784) = 1;

+          *(undefined4 *)((longlong)param_1 + 0x784) = 1;

           if ((Microsoft_Windows_Dhcp_ClientEnableBits & 0x80) != 0) {

             McTemplateU0zzqbr2_EtwEventWriteTransfer

-                      (pwVar9,&NetworkHintMatchFound,pwVar1,_Buf1,(int)unaff_RBX[0xc],unaff_RBX[0xb]

-                      );

-            in_R9 = _Buf1;

+                      (ppwVar9,&NetworkHintMatchFound,pwVar2,(wchar_t *)_Buf1,(int)param_1[0xc],

+                       param_1[0xb]);

+            ppwVar11 = _Buf1;

           }

-          bVar3 = DhcpIsInitState((longlong)unaff_RBX);

+          bVar3 = DhcpIsInitState((longlong)param_1);

           if ((int)CONCAT71(extraout_var,bVar3) == 0) {

-            uVar6 = IsDhcpAddressPlumbedInStack((longlong)unaff_RBX);

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

-              UVar7 = GetTickCount64();

-              auVar2._8_8_ = 0;

-              auVar2._0_8_ = UVar7;

-              lVar10 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar2,8);

-              if ((UVar7 - lVar10 >> 1) + lVar10 >> 9 <= unaff_RBX[0x3b]) {

-                DhcpCopyExistingStackParams((longlong)unaff_RBX,&stack0x00000040);

-                uVar8 = ApplyDhcpConfigurationToNIC

-                                  (unaff_RBX,(longlong)&stack0x00000040,(undefined *)0x1,

-                                   (uint *)in_R9);

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

-                  *(undefined4 *)(unaff_RBX + 0x61) = 0;

+            uVar7 = IsDhcpAddressPlumbedInStack((longlong)param_1);

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

+              UVar8 = GetTickCount64();

+              auVar1._8_8_ = 0;

+              auVar1._0_8_ = UVar8;

+              lVar10 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar1,8);

+              if ((UVar8 - lVar10 >> 1) + lVar10 >> 9 <= param_1[0x3b]) {

+                DhcpCopyExistingStackParams((longlong)param_1,local_f8);

+                uVar6 = ApplyDhcpConfigurationToNIC

+                                  (param_1,(longlong)local_f8,(undefined *)0x1,(uint *)ppwVar11);

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

+                  *(undefined4 *)(param_1 + 0x61) = 0;

                   if ((DAT_0 & 0x10) != 0) {

                     WPP_SF_(0x404,0xca,0x180057608);

                   }

                 }

                 else if ((DAT_0 & 0x10) != 0) {

-                  WPP_SF_D(0x404,0xc9,0x180057608,(int)uVar8);

+                  WPP_SF_D(0x404,0xc9,0x180057608,(int)uVar6);

                 }

               }

             }

           }

           goto LAB_3;

         }

       }

       goto LAB_2;

     }

   }

 LAB_3:

-  DhcpFree((undefined8 *)(unaff_RBP + 0x48));

+  DhcpFree(&local_res10);

 LAB_1:

-  if (pwVar1 != (wchar_t *)0x0) {

-    DhcpFree((undefined8 *)(unaff_RBP + 0x50));

+  if (pwVar2 != (wchar_t *)0x0) {

+    DhcpFree(&local_res18);

   }

-  DhcpCleanParsedOptions(&stack0x00000040);

+  DhcpCleanParsedOptions(local_f8);

   return 0;

 }
```

## `DhcpV4ActivateNetwork_New`  (modified)

```diff
--- DhcpV4ActivateNetwork_New
+++ DhcpV4DeactivateNetwork
@@ -1,184 +1,73 @@
 

-uint DhcpV4ActivateNetwork_New

-               (longlong *param_1,undefined8 *param_2,undefined4 *param_3,longlong *param_4,

-               uint param_5)

+void DhcpV4DeactivateNetwork

+               (longlong *param_1,longlong *param_2,undefined8 param_3,undefined4 param_4)

 

 {

-  longlong lVar1;

-  undefined4 uVar2;

-  bool bVar3;

-  undefined4 uVar4;

-  int iVar5;

-  DWORD DVar6;

-  uint uVar7;

-  undefined7 extraout_var;

-  undefined8 uVar8;

-  longlong *plVar9;

-  ulonglong uVar10;

-  longlong *plVar11;

-  ushort uVar12;

-  longlong *plVar13;

-  undefined4 uVar14;

-  undefined4 *puVar15;

-  ulonglong uVar16;

-  int iVar17;

-  ulonglong uVar18;

-  int local_res8 [4];

-  longlong local_res18;

+  int iVar1;

+  uint uVar2;

+  ushort uVar3;

   

-  plVar9 = (longlong *)0x0;

-  uVar4 = 0;

-  uVar14 = 0;

-  local_res18 = 0;

-  plVar13 = (longlong *)0x0;

-  local_res8[0] = 0;

-  plVar11 = param_1;

-  puVar15 = param_3;

   if ((DAT_0 & 0x10) != 0) {

-    WPP_SF_dJl();

+    WPP_SF_qqdJ();

   }

-  if (param_1 != (longlong *)0x0) {

-    *param_1 = 0;

-  }

-  if (param_2 != (undefined8 *)0x0) {

-    *param_2 = 0;

-  }

-  if (param_3 != (undefined4 *)0x0) {

-    *param_3 = 0;

-  }

-  uVar2 = uVar14;

-  if ((DhcpGlobalIsShuttingDown == 0) || (param_5 == 8)) {

-    bVar3 = DhcpIsFSEGuestSystem();

-    if ((int)CONCAT71(extraout_var,bVar3) == 0) {

-      uVar8 = DhcpIsMachineInCs();

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

-        plVar11 = param_4 + 0xfc;

-        iVar5 = DhcpStandbyGetNetworkBlocked((longlong)plVar11);

-        if (iVar5 != 0) {

-          uVar7 = 0x15;

-          plVar9 = plVar13;

-          if ((DAT_0 & 2) != 0) {

-            plVar11 = (longlong *)0x401;

-            WPP_SF_D(0x401,0x3e,0x1800576e8,0x15);

-          }

-          goto LAB_1;

-        }

+  if (g_fVelocityConnectedStandbyHandlingCleanup == 0) {

+    if ((DhcpGlobalDsFeatureEnabled != 0) && (*param_1 != 0)) {

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

+        WPP_SF_(0x404,0x59,0x1800576e8);

       }

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

-        puVar15 = (undefined4 *)&WPP_a8b3aba1617b3dad64c7ed75a036cb8a_Traceguids;

-        WPP_SF_(0x404,0x3f,0x1800576e8);

-      }

-      plVar11 = DhcpGlobalFirewallReadyEvent;

-      DVar6 = WaitForSingleObject(DhcpGlobalFirewallReadyEvent,500);

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

-        puVar15 = (undefined4 *)&WPP_a8b3aba1617b3dad64c7ed75a036cb8a_Traceguids;

-        plVar11 = (longlong *)0x404;

-        WPP_SF_D(0x404,0x40,0x1800576e8,DVar6);

-      }

-      if ((DVar6 != 0) && ((Microsoft_Windows_Dhcp_ClientEnableBits & 1) != 0)) {

-        puVar15 = (undefined4 *)(ulonglong)DVar6;

-        McTemplateU0q_EtwEventWriteTransfer(plVar11,&FirewallExemptionGrantDelayed,puVar15);

-      }

-      uVar7 = 0;

-      if (g_PdcActivationDisabled == 0) {

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

-          plVar11 = (longlong *)0x404;

-          WPP_SF_Jq(0x404,0x41,puVar15,param_4[3]);

-        }

-        plVar9 = (longlong *)PdcActivateNetwork(plVar11,param_5);

-        if (plVar9 == (longlong *)0x0) {

-          uVar7 = 0x490;

-          uVar2 = 0x14d0;

-          if ((DAT_0 & 2) != 0) {

-            plVar11 = (longlong *)param_4[3];

-            WPP_SF_DDJq();

-          }

-          goto LAB_1;

-        }

-      }

-      if (DhcpGlobalIsShuttingDown != 0) {

-LAB_2:

-        if (plVar9 != (longlong *)0x0) {

-          LOCK();

-          iVar5 = DhcpGlobalPdcCount + 1;

-          UNLOCK();

-          iVar17 = DhcpGlobalPdcCount + 1;

-          DhcpGlobalPdcCount = iVar5;

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

-            plVar11 = (longlong *)0x404;

-            WPP_SF_L(0x404,0x44,0x1800576e8,iVar17);

-          }

-          *param_2 = plVar9;

-        }

-        lVar1 = local_res18;

-        local_res18 = 0;

-        *param_1 = lVar1;

-        goto LAB_3;

-      }

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

-        WPP_SF_(0x404,0x43,0x1800576e8);

-      }

-      uVar10 = DhcpIsMachineInCs();

-      uVar18 = (ulonglong)param_5;

-      plVar11 = param_4 + 4;

-      uVar16 = uVar10 & 0xffffffff;

-      uVar7 = DhcpWcmAcquireRef(plVar11,(longlong)(param_4 + 0xfc),(int)uVar10,param_5,local_res8,

-                                &local_res18);

-      if (local_res8[0] != 0) {

-        DhcpV4TraceWcmError((longlong)param_4,uVar7,uVar16,uVar18);

-        plVar11 = param_4;

-      }

-      if (uVar7 == 0x13c) {

-        uVar2 = 0x14d0;

-      }

-      else if (uVar7 == 0) goto LAB_2;

-    }

-    else {

-      uVar7 = 0x32;

-      plVar9 = plVar13;

-      if ((DAT_0 & 2) != 0) {

-        uVar12 = 0x3d;

-        uVar4 = 0x32;

-        goto LAB_4;

+      iVar1 = DhcpWcmReleaseRef(param_1);

+      if ((iVar1 != 0) && ((DAT_0 & 2) != 0)) {

+        uVar3 = 0x5a;

+        goto LAB_1;

       }

     }

   }

-  else {

-    uVar7 = 0x41;

-    uVar2 = 0;

-    if ((DAT_0 & 2) != 0) {

-      uVar12 = 0x3c;

-      uVar4 = 0x41;

-LAB_4:

-      plVar11 = (longlong *)0x401;

-      WPP_SF_lD(0x401,uVar12,0x1800576e8,uVar4);

-      plVar9 = plVar13;

-      uVar2 = uVar14;

+  else if (*param_1 != 0) {

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

+      WPP_SF_(0x404,0x57,0x1800576e8);

+    }

+    iVar1 = DhcpWcmReleaseRef(param_1);

+    if ((iVar1 != 0) && ((DAT_0 & 2) != 0)) {

+      uVar3 = 0x58;

+LAB_1:

+      WPP_SF_(0x401,uVar3,0x1800576e8);

     }

   }

-LAB_1:

-  uVar4 = uVar2;

-  if (local_res18 != 0) {

+  if (*param_2 == 0) {

+    if (g_PdcActivationDisabled == 0) {

+      MicrosoftTelemetryAssertTriggeredNoArgs();

+    }

+    if (*param_2 == 0) {

+      if ((DAT_0 & 2) != 0) {

+        WPP_SF_(0x401,0x5b,0x1800576e8);

+      }

+      goto LAB_2;

+    }

+  }

+  if (*param_1 != 0) {

+    MicrosoftTelemetryAssertTriggeredNoArgs();

+  }

+  uVar2 = PdcDeactivateNetwork(*param_2);

+  *param_2 = 0;

+  if (uVar2 != 0) {

     if ((DAT_0 & 2) != 0) {

-      WPP_SF_(0x401,0x45,0x1800576e8);

+      WPP_SF_(0x401,0x5c,0x1800576e8);

     }

-    plVar11 = &local_res18;

-    DhcpWcmReleaseRef(plVar11);

+    MicrosoftTelemetryAssertTriggeredNoArgs();

   }

-  if (plVar9 != (longlong *)0x0) {

-    if ((DAT_0 & 2) != 0) {

-      WPP_SF_(0x401,0x46,0x1800576e8);

-    }

-    PdcDeactivateNetwork(plVar9);

-    plVar11 = plVar9;

+  LOCK();

+  UNLOCK();

+  iVar1 = DhcpGlobalPdcCount + -1;

+  if ((DAT_0 & 0x10) == 0) {

+    DhcpGlobalPdcCount = DhcpGlobalPdcCount + -1;

+    return;

   }

-LAB_3:

-  if (param_3 != (undefined4 *)0x0) {

-    *param_3 = uVar4;

+  DhcpGlobalPdcCount = DhcpGlobalPdcCount + -1;

+  WPP_SF_L(0x404,0x5d,0x1800576e8,iVar1);

+LAB_2:

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

+    WPP_SF_DJ(0x404,0x5e,0x1800576e8,param_4);

   }

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

-    WPP_SF_DdJ(plVar11,0x47,0x1800576e8,uVar7);

-  }

-  return uVar7;

+  return;

 }
```

## `DhcpCreateThreadAndRenew`  (modified)

```diff
--- DhcpCreateThreadAndRenew
+++ DhcpCreateThreadAndRenew
@@ -1,11 +1,47 @@
 

 DWORD DhcpCreateThreadAndRenew(LPVOID param_1)

 

 {

-  DWORD in_EAX;

-  longlong unaff_RBX;

+  int *piVar1;

+  int iVar2;

+  DWORD DVar3;

+  HANDLE pvVar4;

+  DWORD local_res10 [2];

   

-  *(char *)(unaff_RBX + -0x3b7eb73a) = *(char *)(unaff_RBX + -0x3b7eb73a) + (char)param_1;

-  return in_EAX;

+  DVar3 = 0;

+  local_res10[0] = 0;

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

+    WPP_SF_q(0x404,0x82,0x180057608,*(undefined8 *)((longlong)param_1 + 0x18));

+  }

+  if (*(HANDLE *)((longlong)param_1 + 0x868) != (HANDLE)0x0) {

+    DVar3 = WaitForSingleObjectWin32Err(*(HANDLE *)((longlong)param_1 + 0x868),0);

+    if (DVar3 != 0) goto LAB_1;

+    CloseHandle(*(HANDLE *)((longlong)param_1 + 0x868));

+    *(undefined8 *)((longlong)param_1 + 0x868) = 0;

+  }

+  LOCK();

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

+  UNLOCK();

+  pvVar4 = CreateThread((LPSECURITY_ATTRIBUTES)0x0,0,DhcpRenewThread,param_1,0,local_res10);

+  *(HANDLE *)((longlong)param_1 + 0x868) = pvVar4;

+  if (pvVar4 == (HANDLE)0x0) {

+    DVar3 = GetLastError();

+    if ((DAT_0 & 2) != 0) {

+      WPP_SF_DJ(0x401,0x83,0x180057608,DVar3);

+    }

+    LOCK();

+    piVar1 = (int *)((longlong)param_1 + 0x10);

+    iVar2 = *piVar1;

+    *piVar1 = *piVar1 + -1;

+    UNLOCK();

+    if (iVar2 == 1) {

+      DhcpDestroyContextEx((longlong)param_1);

+    }

+  }

+LAB_1:

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

+    WPP_SF_DJ(0x404,0x84,0x180057608,DVar3);

+  }

+  return DVar3;

 }
```

## `API-MS-WIN-CORE-PROFILE-L1-1-0.DLL::QueryPerformanceFrequency`  (modified)

```diff
--- API-MS-WIN-CORE-PROFILE-L1-1-0.DLL::QueryPerformanceFrequency calling
+++ API-MS-WIN-CORE-PROFILE-L1-1-0.DLL::QueryPerformanceFrequency calling
@@ -1,0 +2 @@
+DhcpInitData_New
```

## `API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateWaitableTimerExW`  (modified)

```diff
--- API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateWaitableTimerExW calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateWaitableTimerExW calling
@@ -1,0 +2 @@
+DhcpInitData_New
```

## `API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL::RegQueryValueExW`  (modified)

```diff
--- API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL::RegQueryValueExW calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::ReleaseSRWLockShared calling
@@ -1,21 +1,37 @@
-CheckIfPdcActivationDisabled
-DhcpDynDnsRegisterAdapterCheckingForStatic
-DhcpInitData
-DhcpInitRegistry
-DhcpIsFSEFlagEnabledInRegistry
-DhcpQueryRegistryValue
-DhcpRegFillFallbackConfig
-DhcpRegFillParams
-DhcpRegQueryBooleanDwordValue
-DhcpRegReadDWORDWithKey
-DhcpRegReadEnabledDhcp
-DhcpRegReadFromLocation
-DhcpRegReadOptionDef
-DhcpRegReadReachableGateway
-DhcpSetContextForcedBroadcastFlag
-GetPerAdapterRegConfig
-GetRegistryString
-IsHardwareAddressRandomized
-ProcessNetworkChange
-ReadClientID
-ReadConfigs
+DhcpCopyExistingStackParams
+DhcpDoInform
+DhcpFindByteOption
+DhcpFindDwordOption
+DhcpOnMediaConnected
+DhcpRegisterWithDns
+DhcpSetEventInRenewState
+GetCurrentMessageSize
+GetOriginalSubnetMask
+HandleFailedRenewals
+InsertEventEntryInLookUpTable
+ProcessSingleContext
+RequestCachedParams
+RequestParamsDetailed
+RescheduleLeaseRenewalOnModernStandbyEntry
+RetreiveGatewaysList
+RpcSrvGetClassId
+RpcSrvGetClassId_New
+RpcSrvGetClientId
+RpcSrvGetClientId_New
+RpcSrvGetFallbackParams
+RpcSrvGetFallbackParams_New
+RpcSrvIsMeteredDetected
+RpcSrvQueryLeaseInfo
+RpcSrvQueryLeaseInfoArray
+RpcSrvQueryLeaseInfo_New
+RpcSrvRequestParams
+RpcSrvRequestParams_New
+RpcSrvSetClassId
+RpcSrvSetClassId_New
+RpcSrvSetClientId
+RpcSrvSetClientId_New
+SendDhcpDiscover
+SendDhcpInform
+SendDhcpRequest
+SendInformAndGetReplies
+SendTwoDiscoversForDiagnostics
```

## `API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateEventW`  (modified)

```diff
--- API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateEventW calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateEventW calling
@@ -2,0 +3 @@
+DhcpInitData_New
```

## `API-MS-WIN-CORE-SYSINFO-L1-1-0.DLL::GetTickCount64`  (modified)

```diff
--- API-MS-WIN-CORE-SYSINFO-L1-1-0.DLL::GetTickCount64 calling
+++ API-MS-WIN-CORE-SYSINFO-L1-1-0.DLL::GetTickCount64 calling
@@ -8,0 +9 @@
+DhcpAddReceivedOptionsToContext
```

## `API-MS-WIN-SERVICE-CORE-L1-1-0.DLL::RegisterServiceCtrlHandlerExW`  (modified)

```diff
--- API-MS-WIN-SERVICE-CORE-L1-1-0.DLL::RegisterServiceCtrlHandlerExW calling
+++ API-MS-WIN-SERVICE-CORE-L1-1-0.DLL::RegisterServiceCtrlHandlerExW calling
@@ -1,0 +2 @@
+DhcpInitData_New
```

## `API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL::GetLastError`  (modified)

```diff
--- API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL::GetLastError calling
+++ API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL::GetLastError calling
@@ -15,0 +16 @@
+DhcpInitData_New
```

## `IPHLPAPI.DLL::GetDnsSettings`  (modified)

```diff
--- IPHLPAPI.DLL::GetDnsSettings calling
+++ IPHLPAPI.DLL::GetDnsSettings calling
@@ -1 +1,2 @@
-HandleDhcpContextConnected
+DhcpRefreshDnrEnabledState
+DhcpRefreshDnrEnabledState_New
```

## `IPHLPAPI.DLL::FreeDnsSettings`  (modified)

```diff
--- IPHLPAPI.DLL::FreeDnsSettings calling
+++ IPHLPAPI.DLL::FreeDnsSettings calling
@@ -1 +1,2 @@
-HandleDhcpContextConnected
+DhcpRefreshDnrEnabledState
+DhcpRefreshDnrEnabledState_New
```
