# CVE-2026-45594 — appid.sys patch diff

`appid.sys` 10.0.26100.8457 -> 10.0.26100.8655 (ghidriff).

## `SmartlockerConstructOriginClaim`  (modified)

```diff
--- SmartlockerConstructOriginClaim
+++ SmartlockerConstructOriginClaim
@@ -1,23 +1,64 @@
 

-ulonglong SmartlockerConstructOriginClaim

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

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

+undefined8

+SmartlockerConstructOriginClaim

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

+          int *param_6,undefined8 *param_7)

 

 {

-  undefined1 *unaff_RBX;

-  longlong unaff_RBP;

-  longlong unaff_RSI;

-  undefined8 unaff_RDI;

+  ulonglong uVar1;

+  undefined8 uVar2;

+  undefined4 *puVar3;

+  int iVar4;

   

-  *unaff_RBX = 0;

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

-  **(undefined8 **)(unaff_RBP + 0x58) = unaff_RDI;

-  if (unaff_RSI != 0) {

-    ExFreePoolWithTag();

+  iVar4 = 0x40;

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

+    uVar1 = Feature_563344699__private_IsEnabledDeviceUsageNoInline();

+    iVar4 = *param_5 + 0x40;

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

+      iVar4 = *param_5 + 0x42;

+    }

   }

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

-    ExFreePoolWithTag(*(longlong *)(unaff_RBP + -0x20),0);

+  if (param_1 < 2) {

+    uVar1 = Feature_563344699__private_IsEnabledDeviceUsageNoInline();

+    uVar2 = 0x102;

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

+      uVar2 = 0x100;

+    }

+    puVar3 = (undefined4 *)ExAllocatePool2(uVar2,iVar4,0x41746d73);

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

+      uVar2 = 0xc0000017;

+    }

+    else {

+      *puVar3 = 1;

+      puVar3[1] = param_1;

+      puVar3[2] = param_2;

+      puVar3[3] = 1;

+      BCryptGenRandom((BCRYPT_ALG_HANDLE)0x0,(PUCHAR)(puVar3 + 4),0x10,2);

+      if (param_1 == 0) {

+        *(undefined8 *)(puVar3 + 8) = *(undefined8 *)(puVar3 + 4);

+        *(undefined8 *)(puVar3 + 10) = *(undefined8 *)(puVar3 + 6);

+      }

+      else {

+        BCryptGenRandom((BCRYPT_ALG_HANDLE)0x0,(PUCHAR)(puVar3 + 8),0x10,2);

+      }

+      puVar3[0xc] = param_4;

+      puVar3[0xd] = DAT_0;

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

+        puVar3[0xe] = 0;

+      }

+      else {

+        puVar3[0xe] = (uint)*param_5;

+        memmove(puVar3 + 0xf,*(void **)(param_5 + 4),(ulonglong)*param_5);

+      }

+      *(undefined2 *)((longlong)puVar3 + (ulonglong)((uint)puVar3[0xe] >> 1) * 2 + 0x3c) = 0;

+      *param_6 = iVar4;

+      *param_7 = puVar3;

+      uVar2 = 0;

+    }

   }

-  return (ulonglong)unaff_RBX & 0xffffffff;

+  else {

+    uVar2 = 0xc000000d;

+  }

+  return uVar2;

 }
```

## `wil_InitializeFeatureStaging`  (modified)

```diff
--- wil_InitializeFeatureStaging
+++ wil_InitializeFeatureStaging
@@ -1,74 +1,74 @@
 

 int wil_InitializeFeatureStaging(void)

 

 {

   bool bVar1;

   int iVar2;

   undefined **ppuVar3;

   undefined **ppuVar4;

   undefined8 local_res8;

   undefined **local_28;

   undefined *local_20;

   undefined8 local_18;

-  undefined4 uStack_10;

-  undefined4 uStack_c;

+  undefined4 local_10;

+  undefined4 local_c;

   

   bVar1 = false;

   if (g_wil_details_isFeatureStagingInitialized == 0) {

     g_wil_details_isFeatureStagingInitialized = 1;

     local_res8 = RtlQueryFeatureConfigurationChangeStamp();

     wil_details_PopulateInitialConfiguredFeatureStates();

     wil_details_EvaluateFeatureDependencies();

     ppuVar4 = &wil_details_featureDescriptors_a;

     ppuVar3 = &wil_details_featureDescriptors_a;

     do {

       if (*ppuVar3 != (undefined *)0x0) goto LAB_0;

       ppuVar3 = ppuVar3 + 1;

     } while (ppuVar3 < &wil_details_featureDescriptors_z);

 LAB_1:

-    uStack_c = 0;

+    local_c = 0;

     g_wil_details_recordFeatureUsage = wil_details_RecordFeatureUsageReporting;

     for (; (local_28 = (undefined **)0x0, ppuVar4 < &wil_details_featureDescriptors_z &&

            (local_28 = ppuVar4, *ppuVar4 == (undefined *)0x0)); ppuVar4 = ppuVar4 + 1) {

     }

     local_20 = &wil_details_featureDescriptors_z;

     local_18 = 0;

-    uStack_10 = 1;

+    local_10 = 1;

     iVar2 = RtlRegisterFeatureUsageProvider

                       (wil_details_OnFeatureUsageProviderFlushNotification,&local_28,

                        &g_wil_details_featureUsageProvider);

     if (iVar2 != 0) {

       if (!bVar1) {

         g_wil_details_featureUsageProvider = 0;

         return iVar2;

       }

       g_wil_details_featureUsageProvider = 0;

       return 0;

     }

   }

   return 0;

 LAB_0:

   if (ppuVar3 == (undefined **)0x0) goto LAB_1;

   if (((*(char *)((longlong)ppuVar3 + 0x1d) == '\0') &&

       (*(char *)((longlong)ppuVar3 + 0x1e) == '\0')) &&

      (*(char *)((longlong)ppuVar3 + 0x1c) == '\0')) {

     iVar2 = RtlRegisterFeatureConfigurationChangeNotification

                       (wil_details_ReevaluateOnFeatureConfigurationChange,0,&local_res8,

                        &g_wil_details_featureChangeNotification);

     if (iVar2 == 0) {

       bVar1 = true;

     }

     else {

       g_wil_details_featureChangeNotification = 0;

     }

     goto LAB_1;

   }

   ppuVar3 = ppuVar3 + 7;

   while( true ) {

     if (&UNK_2 < ppuVar3) goto LAB_1400387ed;

     if (*ppuVar3 != (undefined *)0x0) break;

     ppuVar3 = ppuVar3 + 1;

   }

   goto LAB_0;

 }
```

## `AiParseAndTagUninstallerFromUninstallString`  (modified)

```diff
--- AiParseAndTagUninstallerFromUninstallString
+++ AiParseAndTagUninstallerFromUninstallString
@@ -1,11 +1,248 @@
+

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

 

 void AiParseAndTagUninstallerFromUninstallString(longlong param_1,longlong param_2)

 

 {

-  code *pcVar1;

+  short *psVar1;

+  char cVar2;

+  int iVar3;

+  undefined8 uVar4;

+  short *psVar5;

+  ulonglong uVar6;

+  ushort uVar7;

+  short *psVar8;

+  short *psVar9;

+  longlong lVar10;

+  uint uVar11;

+  undefined8 uVar12;

+  short *psVar13;

+  short *psVar14;

+  short *psVar15;

+  short *psVar16;

+  short *psVar17;

+  undefined4 uVar18;

+  undefined1 auStackY_178 [32];

+  ushort local_148 [2];

+  uint local_144 [3];

+  undefined8 local_138;

+  undefined8 uStack_130;

+  uint local_128 [2];

+  short *local_120;

+  wchar_t local_118;

+  short sStack_116;

+  undefined4 uStack_114;

+  undefined4 uStack_110;

+  undefined4 uStack_10c;

+  short *local_108;

+  longlong local_100;

+  ulonglong local_f8;

+  short *psStack_f0;

+  short *local_e8;

+  void *local_e0;

+  longlong local_d8;

+  ushort *local_c8;

+  undefined8 local_c0;

+  undefined8 local_b8;

+  uint local_b0;

+  undefined4 local_ac;

+  uint *local_a8;

+  undefined8 local_a0;

+  short *local_98;

+  uint local_90;

+  undefined4 local_8c;

+  uint *local_88;

+  undefined8 local_80;

+  undefined8 local_78;

+  uint local_70;

+  undefined4 local_6c;

+  longlong local_68;

+  undefined8 local_60;

+  longlong local_58;

+  undefined8 local_50;

+  short **local_48;

+  undefined8 local_40;

+  ulonglong local_38;

   

-  pcVar1 = (code *)swi(3);

-  (*pcVar1)();

+  local_38 = __security_cookie ^ (ulonglong)auStackY_178;

+  psVar5 = (short *)0x0;

+  local_108 = (short *)0x0;

+  lVar10 = -1;

+  local_148[0] = 0;

+  local_138 = 0;

+  uStack_130 = (short *)0x0;

+  psVar8 = (short *)0x0;

+  uVar11 = *(uint *)(param_1 + 0x10);

+  uStack_114 = *(undefined4 *)(param_1 + 0x14);

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

+  uStack_10c = *(undefined4 *)(param_1 + 0x1c);

+  psVar1 = *(short **)(param_1 + 0x18);

+  local_100 = -1;

+  local_e0 = (void *)0x0;

+  uVar6 = (ulonglong)uVar11;

+  psVar15 = (short *)0x0;

+  local_120 = (short *)0x0;

+  psVar13 = (short *)0x0;

+  local_128[0] = 0;

+  iVar3 = 0;

+  local_144[0] = 0;

+  local_118 = (wchar_t)uVar11;

+  sStack_116 = (short)(uVar11 >> 0x10);

+  local_f8 = 0;

+  psStack_f0 = (short *)0x0;

+  psVar9 = psVar5;

+  psVar14 = psVar5;

+  psVar16 = psVar5;

+  psVar17 = psVar5;

+  local_d8 = param_1;

+  if ((ushort)local_118 < 4) goto LAB_0;

+  while (uVar7 = (ushort)uVar6, *(short *)((longlong)psVar1 + ((uVar6 & 0xfffe) - 2)) == 0) {

+    local_118 = uVar7 + L'\xfffe';

+    uVar6 = (ulonglong)(ushort)local_118;

+  }

+  psVar9 = psVar8;

+  psVar14 = psVar13;

+  psVar16 = psVar15;

+  psVar17 = (short *)0x0;

+  if (uVar7 < 4) goto LAB_0;

+  if (*psVar1 == 0x22) {

+    uStack_130 = psVar1 + 1;

+    local_138 = (ulonglong)CONCAT22(sStack_116 + -2,uVar7 - 2);

+    uVar4 = AiRtlFindCharInUnicodeString

+                      (0,(ushort *)&local_138,(ushort *)&DAT_1,(short *)local_148);

+    iVar3 = (int)uVar4;

+    if (iVar3 < 0) goto LAB_0;

+LAB_2:

+    local_138 = CONCAT62(local_138._2_6_,local_148[0] - 2);

+  }

+  else {

+    cVar2 = RtlSuffixUnicodeString

+                      (&DAT_3,&local_118,CONCAT71((int7)((ulonglong)psVar1 >> 8),1));

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

+      uVar4 = AiRtlFindCharInUnicodeString

+                        (0,(ushort *)&local_118,(ushort *)&DAT_4,(short *)local_148);

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

+        local_138 = CONCAT44(uStack_114,CONCAT22(sStack_116,local_118));

+        uStack_130 = (short *)CONCAT44(uStack_10c,uStack_110);

+        goto LAB_2;

+      }

+      if ((int)uVar4 == -0x3ffffddb) goto LAB_5;

+    }

+    else {

+LAB_5:

+      local_138 = CONCAT44(uStack_114,CONCAT22(sStack_116,local_118));

+      uStack_130 = (short *)CONCAT44(uStack_10c,uStack_110);

+    }

+  }

+  cVar2 = RtlPrefixUnicodeString(&DAT_6,&local_138);

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

+    cVar2 = RtlPrefixUnicodeString(&DAT_7,&local_138);

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

+      uVar11 = 0x440042;

+      uVar18 = 0x4000a540;

+      goto LAB_8;

+    }

+    uVar11 = (uint)(ushort)local_138;

+    psVar5 = (short *)AiAlloc((ulonglong)(uVar11 + 0x18));

+    if (psVar5 == (short *)0x0) {

+      iVar3 = -0x3fffffe9;

+      psVar17 = psVar5;

+      goto LAB_0;

+    }

+    uVar6 = local_f8 >> 0x20;

+    local_f8._0_4_ = (uVar11 + 0x18) * 0x10000;

+    local_f8 = CONCAT44((int)uVar6,(int)local_f8);

+    psStack_f0 = psVar5;

+    RtlCopyUnicodeString(&local_f8,&DAT_9);

+    RtlAppendUnicodeStringToString(&local_f8,&local_138);

+    local_138 = local_f8;

+    uStack_130 = psStack_f0;

+  }

+  else {

+    uVar11 = 0x420040;

+    uVar18 = 0x4000a4d0;

+LAB_8:

+    local_138 = (ulonglong)uVar11;

+    uStack_130 = (short *)CONCAT44(1,uVar18);

+  }

+  iVar3 = AiOpenFile(&local_138,&local_100);

+  lVar10 = local_100;

+  psVar17 = psVar5;

+  if (-1 < iVar3) {

+    local_e8 = (short *)0x0;

+    iVar3 = ObReferenceObjectByHandle(local_100,1);

+    psVar14 = local_e8;

+    if (-1 < iVar3) {

+      iVar3 = AiGetUninstallStringEa

+                        (local_e8,(longlong *)&local_e0,local_128,(longlong *)&local_108);

+      if (iVar3 < 0) {

+        uVar4 = AiAllocUninstallStringEaData((ushort *)&local_118,param_2,&local_120,local_144);

+        iVar3 = (int)uVar4;

+      }

+      else {

+        uVar6 = AiAddUninstallStringToUninstallStringEaData

+                          ((ushort *)&local_118,local_e0,local_128[0],&local_120,local_144);

+        iVar3 = (int)uVar6;

+      }

+      psVar9 = local_120;

+      psVar16 = local_108;

+      if (-1 < iVar3) {

+        iVar3 = AiSetUninstallStringEa(psVar14,local_120,local_144[0]);

+        psVar16 = local_108;

+      }

+    }

+  }

+LAB_0:

+  uVar4 = DAT_10;

+  local_120 = (short *)CONCAT44(local_120._4_4_,iVar3);

+  cVar2 = EtwEventEnabled(DAT_10,&AppIdRegisterUninstallerEvent);

+  uVar12 = 0;

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

+    local_148[0] = (ushort)local_118 >> 1;

+    local_c8 = local_148;

+    local_b8 = CONCAT44(uStack_10c,uStack_110);

+    local_b0 = (uint)(ushort)local_118;

+    local_128[0] = CONCAT22(local_128[0]._2_2_,(ushort)local_138 >> 1);

+    local_a8 = local_128;

+    local_98 = uStack_130;

+    local_90 = (uint)(ushort)local_138;

+    local_144[0] = CONCAT22(local_144[0]._2_2_,*(ushort *)(local_d8 + 0x20) >> 1);

+    local_88 = local_144;

+    local_78 = *(undefined8 *)(local_d8 + 0x28);

+    local_68 = param_2 + 0x10;

+    local_58 = param_2 + 0x20;

+    local_48 = &local_120;

+    local_70 = (uint)*(ushort *)(local_d8 + 0x20);

+    local_c0 = 2;

+    local_ac = 0;

+    local_a0 = 2;

+    local_8c = 0;

+    local_80 = 2;

+    local_6c = 0;

+    local_60 = 0x10;

+    local_50 = 0x10;

+    local_40 = 4;

+    iVar3 = EtwWrite(uVar4,&AppIdRegisterUninstallerEvent,0,9);

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

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

+      WPP_SF_ZDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),0x15,uVar12,&local_118);

+    }

+  }

+  if (psVar17 != (short *)0x0) {

+    ExFreePoolWithTag(psVar17,0);

+  }

+  if (psVar14 != (short *)0x0) {

+    ObfDereferenceObject(psVar14);

+  }

+  if (lVar10 != -1) {

+    ZwClose(lVar10);

+  }

+  if (psVar16 != (short *)0x0) {

+    ExFreePoolWithTag(psVar16,0);

+  }

+  if (psVar9 != (short *)0x0) {

+    ExFreePoolWithTag(psVar9,0);

+  }

   return;

 }
```
