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

`dhcpcore.dll` 10.0.26100.8875 -> 10.0.26100.9168 (ghidriff).

## `DhcpCopyExistingStackParams`  (modified)

```diff
--- DhcpCopyExistingStackParams
+++ DhcpCopyExistingStackParams
@@ -1,24 +1,196 @@
+

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

 

 ulonglong DhcpCopyExistingStackParams(longlong param_1,void *param_2)

 

 {

-  ulonglong unaff_RBX;

-  longlong unaff_RBP;

-  longlong unaff_RSI;

+  undefined8 *puVar1;

+  errno_t eVar2;

+  undefined8 *puVar3;

+  LPVOID pvVar4;

+  ulonglong uVar5;

+  ulonglong uVar6;

+  undefined1 **ppuVar7;

+  uint uVar8;

+  undefined1 auStackY_2b8 [32];

+  undefined1 local_278 [20];

+  undefined1 local_264 [4];

+  undefined1 auStack_260 [4];

+  undefined1 local_25c [4];

+  undefined1 local_258 [12];

+  uint local_24c;

+  undefined1 local_248 [8];

+  uint local_240 [2];

+  undefined1 local_238 [8];

+  uint local_230 [2];

+  byte *local_228 [3];

+  uint local_210 [2];

+  undefined1 local_208 [8];

+  undefined1 local_200 [8];

+  undefined1 local_1f8 [80];

+  undefined4 local_1a8;

+  undefined1 *local_1a0;

+  uint *local_198;

+  undefined4 local_190;

+  undefined1 *local_188;

+  uint *local_180;

+  undefined4 local_178;

+  byte **local_170;

+  uint *local_168;

+  undefined4 local_160;

+  undefined1 *local_158;

+  uint *local_150;

+  undefined4 local_148;

+  undefined1 *local_140;

+  undefined1 *local_138;

+  undefined4 local_128;

+  undefined1 *local_120;

+  undefined8 local_118;

+  undefined4 local_110;

+  undefined1 *local_108;

+  undefined8 local_100;

+  undefined4 local_f8;

+  undefined1 *local_f0;

+  undefined8 local_e8;

+  undefined4 local_e0;

+  undefined1 *local_d8;

+  undefined8 local_d0;

+  undefined4 local_c8;

+  undefined1 *local_c0;

+  uint *local_b8;

+  undefined4 local_b0;

+  undefined1 *local_a8;

+  uint *local_a0;

+  undefined4 local_98;

+  byte **local_90;

+  uint *local_88;

+  undefined4 local_80;

+  undefined1 *local_78;

+  uint *local_70;

+  undefined4 local_68;

+  undefined1 *local_60;

+  undefined1 *local_58;

+  ulonglong local_48;

   

-  *(char *)((longlong)param_2 + 0x62) = *(char *)((longlong)param_2 + 0x62) + (char)(unaff_RBX >> 8)

-  ;

-  WPP_SF_(0x404,(ushort)param_2,0x180053720);

-  if (*(HKEY *)(unaff_RBP + 0x30) != (HKEY)0x0) {

-    RegCloseKey(*(HKEY *)(unaff_RBP + 0x30));

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

+  local_48 = __security_cookie ^ (ulonglong)auStackY_2b8;

+  memset(local_278,0,200);

+  local_118 = 0;

+  local_120 = local_264;

+  local_100 = 0;

+  local_e8 = 0;

+  local_d0 = 0;

+  local_108 = auStack_260;

+  local_f0 = local_25c;

+  local_d8 = local_258;

+  local_128 = 1;

+  local_c0 = local_248;

+  local_110 = 0x33;

+  local_b8 = &local_24c;

+  local_f8 = 0x3a;

+  local_a8 = local_238;

+  local_a0 = local_240;

+  local_90 = local_228;

+  local_88 = local_230;

+  local_78 = local_208;

+  local_70 = local_210;

+  local_60 = local_1f8;

+  local_58 = local_200;

+  local_1a0 = local_248;

+  local_198 = &local_24c;

+  local_188 = local_238;

+  local_180 = local_240;

+  local_170 = local_228;

+  local_168 = local_230;

+  local_158 = local_208;

+  local_150 = local_210;

+  local_140 = local_1f8;

+  local_138 = local_200;

+  local_e0 = 0x3b;

+  local_c8 = 3;

+  local_b0 = 0x21;

+  local_98 = 0x79;

+  local_80 = 6;

+  local_68 = 0xf;

+  local_1a8 = 3;

+  local_190 = 0x21;

+  local_178 = 0x79;

+  local_160 = 6;

+  local_148 = 0xf;

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

+    WPP_SF_q(0x404,0xea,0x180053658,*(undefined8 *)(param_1 + 0x18));

   }

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

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

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

+  memset(param_2,0,200);

+  uVar8 = 0;

+  if (g_fVelocityPointerToDwordMismatchFix == 0) {

+    ppuVar7 = &local_120;

+    do {

+      puVar3 = DhcpFindOption((undefined8 *)(param_1 + 0x2b8),(uint)*(byte *)(ppuVar7 + -1),0,

+                              *(void **)(param_1 + 0x2e0),*(uint *)(param_1 + 0x2e8),0);

+      puVar1 = (undefined8 *)*ppuVar7;

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

+        *puVar1 = 0;

+        if ((undefined4 *)ppuVar7[1] != (undefined4 *)0x0) {

+          *(undefined4 *)ppuVar7[1] = 0;

+        }

+      }

+      else {

+        pvVar4 = DhcpAlloc((ulonglong)*(uint *)(puVar3 + 7));

+        *puVar1 = pvVar4;

+        if (pvVar4 == (LPVOID)0x0) goto LAB_1;

+        memcpy(pvVar4,(void *)puVar3[6],(ulonglong)*(uint *)(puVar3 + 7));

+        if ((undefined4 *)ppuVar7[1] != (undefined4 *)0x0) {

+          *(undefined4 *)ppuVar7[1] = *(undefined4 *)(puVar3 + 7);

+        }

+      }

+      uVar8 = uVar8 + 1;

+      ppuVar7 = ppuVar7 + 3;

+    } while (uVar8 < 9);

   }

-  if (unaff_RSI != 0) {

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

+  else {

+    ppuVar7 = &local_1a0;

+    do {

+      puVar3 = DhcpFindOption((undefined8 *)(param_1 + 0x2b8),(uint)*(byte *)(ppuVar7 + -1),0,

+                              *(void **)(param_1 + 0x2e0),*(uint *)(param_1 + 0x2e8),0);

+      puVar1 = (undefined8 *)*ppuVar7;

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

+        *puVar1 = 0;

+        if ((undefined4 *)ppuVar7[1] != (undefined4 *)0x0) {

+          *(undefined4 *)ppuVar7[1] = 0;

+        }

+      }

+      else {

+        pvVar4 = DhcpAlloc((ulonglong)*(uint *)(puVar3 + 7));

+        *puVar1 = pvVar4;

+        if (pvVar4 == (LPVOID)0x0) goto LAB_1;

+        memcpy(pvVar4,(void *)puVar3[6],(ulonglong)*(uint *)(puVar3 + 7));

+        if ((undefined4 *)ppuVar7[1] != (undefined4 *)0x0) {

+          *(undefined4 *)ppuVar7[1] = *(undefined4 *)(puVar3 + 7);

+        }

+      }

+      uVar8 = uVar8 + 1;

+      ppuVar7 = ppuVar7 + 3;

+    } while (uVar8 < 5);

   }

-  return unaff_RBX & 0xffffffff;

+  local_24c = local_24c >> 2;

+  local_240[0] = local_240[0] >> 3;

+  local_210[0] = local_210[0] >> 2;

+  CheckCLRoutes(local_230[0],local_228[0],(int *)local_230);

+  eVar2 = memcpy_s(param_2,200,local_278,200);

+  uVar5 = Win32FromErrno(eVar2);

+  uVar6 = uVar5 & 0xffffffff;

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

+    memset(local_278,0,200);

+  }

+LAB_2:

+  DhcpCleanParsedOptions(local_278);

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

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

+    WPP_SF_D(0x404,0xeb,0x180053658,(int)uVar6);

+  }

+  return uVar6;

+LAB_1:

+  uVar6 = 8;

+  goto LAB_2;

 }
```

## `DhcpDynDnsRegisterAdapterCheckingForStatic`  (modified)

```diff
--- DhcpDynDnsRegisterAdapterCheckingForStatic
+++ DhcpDynDnsRegisterAdapterCheckingForStatic
@@ -1,90 +1,87 @@
+

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

 

 DWORD DhcpDynDnsRegisterAdapterCheckingForStatic

-                (HKEY param_1,wchar_t *param_2,undefined4 *param_3,undefined8 *param_4,uint *param_5

-                ,short *param_6,uint param_7,void *param_8,uint param_9,int param_10)

+                (HKEY param_1,wchar_t *param_2,undefined4 *param_3,undefined8 param_4,uint *param_5,

+                short *param_6,uint param_7,void *param_8,uint param_9,int param_10)

 

 {

-  uint uVar1;

-  LSTATUS LVar2;

-  LPBYTE lpData;

-  ushort uVar3;

-  longlong in_R11;

+  LSTATUS LVar1;

+  DWORD DVar2;

+  LPWSTR _Dst;

+  wchar_t *pwVar3;

   uint uVar4;

-  LPBYTE unaff_R13;

-  LPBYTE in_stack_00000020;

+  wchar_t *pwVar5;

+  uint uVar6;

+  wchar_t **_Size;

+  bool bVar7;

+  bool bVar8;

+  undefined1 auStackY_2b8 [32];

+  DWORD local_278;

+  DWORD local_274;

+  wchar_t *local_270;

+  LPWSTR local_268 [2];

+  wchar_t local_258 [264];

+  ulonglong local_48;

   

-  uRamffffffffffffffe0 = 4;

-  uVar4 = (uint)unaff_R13;

-  uRamffffffffffffffe8 = uVar4;

-  *(undefined8 *)(in_R11 + -0x50) = 0xffffffffffffffe0;

-  uRamffffffffffffffe4 = uVar4;

-  *(undefined8 *)(in_R11 + -0x58) = 0xffffffffffffffe4;

-  LVar2 = RegQueryValueExW((HKEY)param_1,L"DhcpClientIdentifierType",(LPDWORD)0x0,

-                           (LPDWORD)0xffffffffffffffe8,in_stack_00000020,param_5);

-  if (LVar2 == 0) {

-    if ((uRamffffffffffffffe8 != 4) || (uVar1 = uRamffffffffffffffe4, 0xff < uRamffffffffffffffe4))

-    {

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

-        WPP_SF_L(0x401,0x1e,0x180053720,uRamffffffffffffffe4);

-      }

-      goto LAB_1;

+  local_48 = __security_cookie ^ (ulonglong)auStackY_2b8;

+  local_278 = 0x201;

+  local_274 = 0;

+  memset(local_258,0,0x202);

+  LVar1 = RegQueryValueExW(param_1,L"Domain",(LPDWORD)0x0,&local_274,(LPBYTE)local_258,&local_278);

+  if (((LVar1 != 0) || (local_274 != 1)) || (local_278 < 3)) {

+    if ((param_7 == 0) || (*param_6 == 0)) {

+      local_258[0] = L'\0';

+      goto LAB_0;

+    }

+    local_278 = 0x101;

+    if (g_fVelocityReplaceIncorrectParameter == 0) {

+      bVar7 = param_7 < 0x202;

+      bVar8 = param_7 == 0x202;

+    }

+    else {

+      bVar7 = param_7 < 0x101;

+      bVar8 = param_7 == 0x101;

+    }

+    if (bVar7 || bVar8) {

+      wmemcpy_s(local_258,0x101,param_6);

+    }

+    else {

+      local_258[0] = L'\0';

     }

   }

-  else {

-    uVar1 = uVar4;

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

-      WPP_SF_(0x401,(short)unaff_R13 + 0x1d,0x180053720);

+  *param_5 = *param_5 | 2;

+LAB_0:

+  local_270 = (wchar_t *)0x0;

+  pwVar5 = L"NameServer";

+  LVar1 = GetRegistryString(param_1,L"NameServer",&local_270,(uint *)0x0);

+  pwVar3 = local_270;

+  _Size = &local_270;

+  local_270 = (wchar_t *)((ulonglong)local_270 & 0xffffffff00000000);

+  if (LVar1 != 0) {

+    pwVar3 = (wchar_t *)0x0;

+  }

+  _Dst = DhcpCreateListFromStringAndFree(pwVar3,pwVar5,(int *)_Size);

+  uVar6 = (uint)local_270;

+  local_268[0] = _Dst;

+  if ((uint)local_270 == 0) {

+    uVar4 = param_9 >> 2;

+    if ((uVar4 != 0) &&

+       (_Dst = DhcpAlloc((ulonglong)uVar4 << 2), uVar6 = 0, local_268[0] = _Dst, _Dst != (LPWSTR)0x0

+       )) {

+      _Size = (wchar_t **)(ulonglong)param_9;

+      memcpy(_Dst,param_8,(size_t)_Size);

+      uVar6 = uVar4;

     }

   }

-  uRamffffffffffffffe4 = uVar1;

-  uRamffffffffffffffe0 = uVar4;

-  LVar2 = RegQueryValueExW((HKEY)param_1,L"DhcpClientIdentifier",(LPDWORD)0x0,(LPDWORD)0x0,unaff_R13

-                           ,(LPDWORD)0xffffffffffffffe0);

-  if ((LVar2 == 0) && (uRamffffffffffffffe0 - 1 < 0xfe)) {

-    lpData = DhcpAlloc((ulonglong)uRamffffffffffffffe0);

-    pBRamfffffffffffffff0 = lpData;

-    if (lpData != (LPBYTE)0x0) {

-      LVar2 = RegQueryValueExW((HKEY)param_1,L"DhcpClientIdentifier",(LPDWORD)0x0,(LPDWORD)0x0,

-                               lpData,(LPDWORD)0xffffffffffffffe0);

-      uVar1 = uRamffffffffffffffe0;

-      if (LVar2 == 0) {

-        *(char *)param_2 = (char)uRamffffffffffffffe4;

-        *param_3 = uVar1;

-        *param_4 = lpData;

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

-          return 1;

-        }

-        if (lpData == (LPBYTE)0x0) {

-          uRamfffffffffffffff8 = (ulonglong)unaff_R13 & 0xffff;

-        }

-        else {

-          uRamfffffffffffffff8 = 0xffff;

-          if (uVar1 < 0x10000) {

-            uRamfffffffffffffff8 = (ulonglong)(ushort)uVar1;

-          }

-        }

-        pBRamfffffffffffffff0 = lpData;

-        WPP_SF_Dd_HEX_();

-        return 1;

-      }

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

-        WPP_SF_D(0x401,0x21,0x180053720,LVar2);

-      }

-      DhcpFree((undefined8 *)0xfffffffffffffff0);

-      goto LAB_1;

-    }

-    if ((DAT_0 & 2) == 0) goto LAB_180006625;

-    uVar3 = 0x20;

+  pwVar3 = local_258;

+  if (param_10 != 0) {

+    pwVar3 = (wchar_t *)0x0;

   }

-  else {

-    if ((DAT_0 & 2) == 0) goto LAB_180006625;

-    uVar3 = 0x1f;

+  DVar2 = DhcpDynDnsRegisterAdapter(param_2,param_3,_Size,*param_5,pwVar3,_Dst,uVar6);

+  if (uVar6 != 0) {

+    DhcpFree(local_268);

   }

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

-LAB_1:

-  *(char *)param_2 = (char)unaff_R13;

-  *param_3 = uVar4;

-  *param_4 = unaff_R13;

-  return uVar4;

+  return DVar2;

 }
```

## `API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapFree`  (modified)

```diff
--- API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapFree calling
+++ API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapFree calling
@@ -11 +10,0 @@
-DhcpDynDnsRegisterAdapterCheckingForStatic
```

## `API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapAlloc`  (modified)

```diff
--- API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapAlloc calling
+++ API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapAlloc calling
@@ -3 +2,0 @@
-DhcpRegExpandString
```
