# ncp-1928.dll-ncp-2134.dll Diff

# TOC

* [Visual Chart Diff](#visual-chart-diff)
* [Metadata](#metadata)
	* [Ghidra Diff Engine](#ghidra-diff-engine)
		* [Command Line](#command-line)
	* [Binary Metadata Diff](#binary-metadata-diff)
	* [Program Options](#program-options)
	* [Diff Stats](#diff-stats)
	* [Strings](#strings)
* [Deleted](#deleted)
	* [FUN_18000fe5d](#fun_18000fe5d)
	* [FUN_18000fe73](#fun_18000fe73)
	* [FUN_1800109c2](#fun_1800109c2)
	* [FUN_180010a15](#fun_180010a15)
* [Added](#added)
* [Modified](#modified)
	* [SPCryptSetProviderProperty](#spcryptsetproviderproperty)
	* [SPCryptSetKeyProperty](#spcryptsetkeyproperty)
* [Modified (No Code Changes)](#modified-no-code-changes)
	* [DebugTraceError](#debugtraceerror)

# Visual Chart Diff



```mermaid

flowchart LR

SPCryptSetProviderProperty-5-old<--Match 96%-->SPCryptSetProviderProperty-5-new
SPCryptSetKeyProperty-6-old<--Match 5%-->SPCryptSetKeyProperty-6-new

subgraph ncp-2134.dll
    SPCryptSetProviderProperty-5-new
SPCryptSetKeyProperty-6-new
    
end

subgraph ncp-1928.dll
    SPCryptSetProviderProperty-5-old
SPCryptSetKeyProperty-6-old
    subgraph Deleted
direction LR
FUN_18000fe5d
    FUN_18000fe73
    FUN_1800109c2
    FUN_180010a15
end
end

```


```mermaid
pie showData
    title Function Matches - 99.8435%
"unmatched_funcs_len" : 4
"matched_funcs_len" : 2552
```



```mermaid
pie showData
    title Matched Function Similarity - 99.7649%
"matched_funcs_with_code_changes_len" : 2
"matched_funcs_with_non_code_changes_len" : 4
"matched_funcs_no_changes_len" : 2546
```

# Metadata

## Ghidra Diff Engine

### Command Line

#### Captured Command Line


```
ghidriff --project-location ./proj --project-name ncp-36906 --symbols-path symbols --gzfs-path gzfs --threaded --log-level INFO --file-log-level INFO --log-path ghidriff.log --min-func-len 10 --gdt [] --bsim --max-ram-percent 60.0 --max-section-funcs 200 ncp-1928.dll ncp-2134.dll
```


#### Verbose Args


<details>

```
--old ['ncp-1928.dll'] --new [['ncp-2134.dll']] --engine VersionTrackingDiff --output-path ./out --summary False --project-location ./proj --project-name ncp-36906 --symbols-path symbols --gzfs-path gzfs --base-address None --program-options None --threaded True --force-analysis False --force-diff False --no-symbols False --log-level INFO --file-log-level INFO --log-path ghidriff.log --va False --min-func-len 10 --use-calling-counts False --gdt [] --bsim True --bsim-full False --max-ram-percent 60.0 --print-flags False --jvm-args None --side-by-side False --max-section-funcs 200 --md-title None
```


</details>

#### Download Original PEs


```
wget https://msdl.microsoft.com/download/symbols/ncryptprov.dll/FA5BBAB46A000/ncryptprov.dll -O ncryptprov.dll.x64.10.0.22621.2062
wget https://msdl.microsoft.com/download/symbols/ncryptprov.dll/E6DD38236A000/ncryptprov.dll -O ncryptprov.dll.x64.10.0.22621.1125
```


## Binary Metadata Diff


```diff
--- ncp-1928.dll Meta
+++ ncp-2134.dll Meta
@@ -1,44 +1,44 @@
-Program Name: ncp-1928.dll
+Program Name: ncp-2134.dll
 Language ID: x86:LE:64:default (4.6)
 Compiler ID: windows
 Processor: x86
 Endian: Little
 Address Size: 64
 Minimum Address: 180000000
 Maximum Address: ff0000184f
 # of Bytes: 437704
 # of Memory Blocks: 9
-# of Instructions: 78246
-# of Defined Data: 4030
-# of Functions: 1280
-# of Symbols: 10974
+# of Instructions: 78410
+# of Defined Data: 4029
+# of Functions: 1276
+# of Symbols: 10969
 # of Data Types: 859
 # of Data Type Categories: 43
 Analyzed: true
 Compiler: visualstudio:unknown
 Created With Ghidra Version: 12.0.4
-Date Created: Sun Aug 16 10:38:06 SGT 2026
+Date Created: Sun Aug 16 10:38:10 SGT 2026
 Executable Format: Portable Executable (PE)
-Executable Location: /sessions/fervent-laughing-brahmagupta/mnt/patchpalooza/ghidriff/ncryptprov-36906/ncp-1928.dll
-Executable MD5: be120c014281866e6edf0379c1c38b8b
-Executable SHA256: 879a649afbbd2c83519a0308d06178ae1b9e2a2c7ed236e4a4368a7761270beb
-FSRL: file:///sessions/fervent-laughing-brahmagupta/mnt/patchpalooza/ghidriff/ncryptprov-36906/ncp-1928.dll?MD5=be120c014281866e6edf0379c1c38b8b
+Executable Location: /sessions/fervent-laughing-brahmagupta/mnt/patchpalooza/ghidriff/ncryptprov-36906/ncp-2134.dll
+Executable MD5: cf73916a7c907f7c60d081e3e41f35a9
+Executable SHA256: 9072392ae7ff191ed806eda9f46822326fded010a204b80a8beb6d5b86bfec61
+FSRL: file:///sessions/fervent-laughing-brahmagupta/mnt/patchpalooza/ghidriff/ncryptprov-36906/ncp-2134.dll?MD5=cf73916a7c907f7c60d081e3e41f35a9
 PDB Age: 1
 PDB File: ncryptprov.pdb
-PDB GUID: 5e771c90-6a84-3830-acd5-621767539e4a
+PDB GUID: b819c820-386e-d8b5-80c5-198dd86c0f9f
 PDB Loaded: true
 PDB Version: RSDS
 PE Property[CompanyName]: Microsoft Corporation
 PE Property[FileDescription]: Microsoft KSP
-PE Property[FileVersion]: 10.0.22621.2062 (WinBuild.160101.0800)
+PE Property[FileVersion]: 10.0.22621.1125 (WinBuild.160101.0800)
 PE Property[InternalName]: ncryptprov.dll
 PE Property[LegalCopyright]: © Microsoft Corporation. All rights reserved.
 PE Property[OriginalFilename]: ncryptprov.dll
 PE Property[ProductName]: Microsoft® Windows® Operating System
-PE Property[ProductVersion]: 10.0.22621.2062
+PE Property[ProductVersion]: 10.0.22621.1125
 PE Property[Translation]: 4b00409
 Preferred Root Namespace Category: 
 RTTI Found: false
 Relocatable: true
 SectionAlignment: 4096
 Should Ask To Analyze: false

```


## Program Options


<details>
<summary>Ghidra ncp-1928.dll Decompiler Options</summary>


|Decompiler Option|Value|
| :---: | :---: |
|Prototype Evaluation|__fastcall|

</details>


<details>
<summary>Ghidra ncp-1928.dll Specification extensions Options</summary>


|Specification extensions Option|Value|
| :---: | :---: |
|FormatVersion|0|
|VersionCounter|0|

</details>


<details>
<summary>Ghidra ncp-1928.dll Analyzers Options</summary>


|Analyzers Option|Value|
| :---: | :---: |
|ASCII Strings|true|
|ASCII Strings.Create Strings Containing Existing Strings|true|
|ASCII Strings.Create Strings Containing References|true|
|ASCII Strings.Force Model Reload|false|
|ASCII Strings.Minimum String Length|LEN_5|
|ASCII Strings.Model File|StringModel.sng|
|ASCII Strings.Require Null Termination for String|true|
|ASCII Strings.Search Only in Accessible Memory Blocks|true|
|ASCII Strings.String Start Alignment|ALIGN_1|
|ASCII Strings.String end alignment|4|
|Aggressive Instruction Finder|false|
|Aggressive Instruction Finder.Create Analysis Bookmarks|true|
|Apply Data Archives|true|
|Apply Data Archives.Archive Chooser|[Auto-Detect]|
|Apply Data Archives.Create Analysis Bookmarks|true|
|Apply Data Archives.GDT User File Archive Path|None|
|Apply Data Archives.User Project Archive Path|None|
|Call Convention ID|true|
|Call Convention ID.Analysis Decompiler Timeout (sec)|60|
|Call-Fixup Installer|true|
|Condense Filler Bytes|false|
|Condense Filler Bytes.Filler Value|Auto|
|Condense Filler Bytes.Minimum number of sequential bytes|1|
|Create Address Tables|true|
|Create Address Tables.Allow Offcut References|false|
|Create Address Tables.Auto Label Table|false|
|Create Address Tables.Create Analysis Bookmarks|true|
|Create Address Tables.Maxmimum Pointer Distance|16777215|
|Create Address Tables.Minimum Pointer Address|4132|
|Create Address Tables.Minimum Table Size|2|
|Create Address Tables.Pointer Alignment|1|
|Create Address Tables.Relocation Table Guide|true|
|Create Address Tables.Table Alignment|4|
|Data Reference|true|
|Data Reference.Address Table Alignment|1|
|Data Reference.Address Table Minimum Size|2|
|Data Reference.Align End of Strings|false|
|Data Reference.Ascii String References|true|
|Data Reference.Create Address Tables|true|
|Data Reference.Minimum String Length|5|
|Data Reference.References to Pointers|true|
|Data Reference.Relocation Table Guide|true|
|Data Reference.Respect Execute Flag|true|
|Data Reference.Subroutine References|true|
|Data Reference.Switch Table References|false|
|Data Reference.Unicode String References|true|
|Decompiler Parameter ID|true|
|Decompiler Parameter ID.Analysis Clear Level|ANALYSIS|
|Decompiler Parameter ID.Analysis Decompiler Timeout (sec)|60|
|Decompiler Parameter ID.Commit Data Types|true|
|Decompiler Parameter ID.Commit Void Return Values|false|
|Decompiler Parameter ID.Prototype Evaluation|__fastcall|
|Decompiler Switch Analysis|true|
|Decompiler Switch Analysis.Analysis Decompiler Timeout (sec)|60|
|Demangler Microsoft|true|
|Demangler Microsoft.Apply Function Calling Conventions|true|
|Demangler Microsoft.Apply Function Signatures|true|
|Demangler Microsoft.C-Style Symbol Interpretation|FUNCTION_IF_EXISTS|
|Demangler Microsoft.Demangle Only Known Mangled Symbols|false|
|Disassemble Entry Points|true|
|Disassemble Entry Points.Respect Execute Flag|true|
|Embedded Media|true|
|Embedded Media.Create Analysis Bookmarks|true|
|External Entry References|true|
|Function ID|true|
|Function ID.Always Apply FID Labels|false|
|Function ID.Create Analysis Bookmarks|true|
|Function ID.Instruction Count Threshold|14.6|
|Function ID.Multiple Match Threshold|30.0|
|Function Start Search|true|
|Function Start Search.Bookmark Functions|false|
|Function Start Search.Search Data Blocks|false|
|Non-Returning Functions - Discovered|true|
|Non-Returning Functions - Discovered.Create Analysis Bookmarks|true|
|Non-Returning Functions - Discovered.Function Non-return Threshold|3|
|Non-Returning Functions - Discovered.Repair Flow Damage|true|
|Non-Returning Functions - Known|true|
|Non-Returning Functions - Known.Create Analysis Bookmarks|true|
|PDB MSDIA|false|
|PDB MSDIA.Search untrusted symbol servers|false|
|PDB Universal|true|
|PDB Universal.Import Source Line Info|true|
|PDB Universal.Search untrusted symbol servers|false|
|Reference|true|
|Reference.Address Table Alignment|1|
|Reference.Address Table Minimum Size|2|
|Reference.Align End of Strings|false|
|Reference.Ascii String References|true|
|Reference.Create Address Tables|true|
|Reference.Minimum String Length|5|
|Reference.References to Pointers|true|
|Reference.Relocation Table Guide|true|
|Reference.Respect Execute Flag|true|
|Reference.Subroutine References|true|
|Reference.Switch Table References|false|
|Reference.Unicode String References|true|
|Scalar Operand References|true|
|Scalar Operand References.Relocation Table Guide|true|
|Shared Return Calls|true|
|Shared Return Calls.Allow Conditional Jumps|false|
|Shared Return Calls.Assume Contiguous Functions Only|true|
|Stack|true|
|Stack.Create Local Variables|true|
|Stack.Create Param Variables|false|
|Stack.Max Threads|2|
|Subroutine References|true|
|Subroutine References.Create Thunks Early|true|
|Variadic Function Signature Override|false|
|Variadic Function Signature Override.Create Analysis Bookmarks|false|
|Windows x86 PE Exception Handling|true|
|Windows x86 PE RTTI Analyzer|true|
|Windows x86 Thread Environment Block (TEB) Analyzer|true|
|Windows x86 Thread Environment Block (TEB) Analyzer.Starting Address of the TEB||
|Windows x86 Thread Environment Block (TEB) Analyzer.Windows OS Version|Windows 7|
|WindowsPE x86 Propagate External Parameters|false|
|WindowsResourceReference|true|
|WindowsResourceReference.Create Analysis Bookmarks|true|
|x86 Constant Reference Analyzer|true|
|x86 Constant Reference Analyzer.Create Data from pointer|false|
|x86 Constant Reference Analyzer.Function parameter/return Pointer analysis|true|
|x86 Constant Reference Analyzer.Max Threads|2|
|x86 Constant Reference Analyzer.Min absolute reference|4|
|x86 Constant Reference Analyzer.Require pointer param data type|false|
|x86 Constant Reference Analyzer.Speculative reference max|256|
|x86 Constant Reference Analyzer.Speculative reference min|1024|
|x86 Constant Reference Analyzer.Stored Value Pointer analysis|true|
|x86 Constant Reference Analyzer.Trust values read from writable memory|true|

</details>


<details>
<summary>Ghidra ncp-2134.dll Decompiler Options</summary>


|Decompiler Option|Value|
| :---: | :---: |
|Prototype Evaluation|__fastcall|

</details>


<details>
<summary>Ghidra ncp-2134.dll Specification extensions Options</summary>


|Specification extensions Option|Value|
| :---: | :---: |
|FormatVersion|0|
|VersionCounter|0|

</details>


<details>
<summary>Ghidra ncp-2134.dll Analyzers Options</summary>


|Analyzers Option|Value|
| :---: | :---: |
|ASCII Strings|true|
|ASCII Strings.Create Strings Containing Existing Strings|true|
|ASCII Strings.Create Strings Containing References|true|
|ASCII Strings.Force Model Reload|false|
|ASCII Strings.Minimum String Length|LEN_5|
|ASCII Strings.Model File|StringModel.sng|
|ASCII Strings.Require Null Termination for String|true|
|ASCII Strings.Search Only in Accessible Memory Blocks|true|
|ASCII Strings.String Start Alignment|ALIGN_1|
|ASCII Strings.String end alignment|4|
|Aggressive Instruction Finder|false|
|Aggressive Instruction Finder.Create Analysis Bookmarks|true|
|Apply Data Archives|true|
|Apply Data Archives.Archive Chooser|[Auto-Detect]|
|Apply Data Archives.Create Analysis Bookmarks|true|
|Apply Data Archives.GDT User File Archive Path|None|
|Apply Data Archives.User Project Archive Path|None|
|Call Convention ID|true|
|Call Convention ID.Analysis Decompiler Timeout (sec)|60|
|Call-Fixup Installer|true|
|Condense Filler Bytes|false|
|Condense Filler Bytes.Filler Value|Auto|
|Condense Filler Bytes.Minimum number of sequential bytes|1|
|Create Address Tables|true|
|Create Address Tables.Allow Offcut References|false|
|Create Address Tables.Auto Label Table|false|
|Create Address Tables.Create Analysis Bookmarks|true|
|Create Address Tables.Maxmimum Pointer Distance|16777215|
|Create Address Tables.Minimum Pointer Address|4132|
|Create Address Tables.Minimum Table Size|2|
|Create Address Tables.Pointer Alignment|1|
|Create Address Tables.Relocation Table Guide|true|
|Create Address Tables.Table Alignment|4|
|Data Reference|true|
|Data Reference.Address Table Alignment|1|
|Data Reference.Address Table Minimum Size|2|
|Data Reference.Align End of Strings|false|
|Data Reference.Ascii String References|true|
|Data Reference.Create Address Tables|true|
|Data Reference.Minimum String Length|5|
|Data Reference.References to Pointers|true|
|Data Reference.Relocation Table Guide|true|
|Data Reference.Respect Execute Flag|true|
|Data Reference.Subroutine References|true|
|Data Reference.Switch Table References|false|
|Data Reference.Unicode String References|true|
|Decompiler Parameter ID|true|
|Decompiler Parameter ID.Analysis Clear Level|ANALYSIS|
|Decompiler Parameter ID.Analysis Decompiler Timeout (sec)|60|
|Decompiler Parameter ID.Commit Data Types|true|
|Decompiler Parameter ID.Commit Void Return Values|false|
|Decompiler Parameter ID.Prototype Evaluation|__fastcall|
|Decompiler Switch Analysis|true|
|Decompiler Switch Analysis.Analysis Decompiler Timeout (sec)|60|
|Demangler Microsoft|true|
|Demangler Microsoft.Apply Function Calling Conventions|true|
|Demangler Microsoft.Apply Function Signatures|true|
|Demangler Microsoft.C-Style Symbol Interpretation|FUNCTION_IF_EXISTS|
|Demangler Microsoft.Demangle Only Known Mangled Symbols|false|
|Disassemble Entry Points|true|
|Disassemble Entry Points.Respect Execute Flag|true|
|Embedded Media|true|
|Embedded Media.Create Analysis Bookmarks|true|
|External Entry References|true|
|Function ID|true|
|Function ID.Always Apply FID Labels|false|
|Function ID.Create Analysis Bookmarks|true|
|Function ID.Instruction Count Threshold|14.6|
|Function ID.Multiple Match Threshold|30.0|
|Function Start Search|true|
|Function Start Search.Bookmark Functions|false|
|Function Start Search.Search Data Blocks|false|
|Non-Returning Functions - Discovered|true|
|Non-Returning Functions - Discovered.Create Analysis Bookmarks|true|
|Non-Returning Functions - Discovered.Function Non-return Threshold|3|
|Non-Returning Functions - Discovered.Repair Flow Damage|true|
|Non-Returning Functions - Known|true|
|Non-Returning Functions - Known.Create Analysis Bookmarks|true|
|PDB MSDIA|false|
|PDB MSDIA.Search untrusted symbol servers|false|
|PDB Universal|true|
|PDB Universal.Import Source Line Info|true|
|PDB Universal.Search untrusted symbol servers|false|
|Reference|true|
|Reference.Address Table Alignment|1|
|Reference.Address Table Minimum Size|2|
|Reference.Align End of Strings|false|
|Reference.Ascii String References|true|
|Reference.Create Address Tables|true|
|Reference.Minimum String Length|5|
|Reference.References to Pointers|true|
|Reference.Relocation Table Guide|true|
|Reference.Respect Execute Flag|true|
|Reference.Subroutine References|true|
|Reference.Switch Table References|false|
|Reference.Unicode String References|true|
|Scalar Operand References|true|
|Scalar Operand References.Relocation Table Guide|true|
|Shared Return Calls|true|
|Shared Return Calls.Allow Conditional Jumps|false|
|Shared Return Calls.Assume Contiguous Functions Only|true|
|Stack|true|
|Stack.Create Local Variables|true|
|Stack.Create Param Variables|false|
|Stack.Max Threads|2|
|Subroutine References|true|
|Subroutine References.Create Thunks Early|true|
|Variadic Function Signature Override|false|
|Variadic Function Signature Override.Create Analysis Bookmarks|false|
|Windows x86 PE Exception Handling|true|
|Windows x86 PE RTTI Analyzer|true|
|Windows x86 Thread Environment Block (TEB) Analyzer|true|
|Windows x86 Thread Environment Block (TEB) Analyzer.Starting Address of the TEB||
|Windows x86 Thread Environment Block (TEB) Analyzer.Windows OS Version|Windows 7|
|WindowsPE x86 Propagate External Parameters|false|
|WindowsResourceReference|true|
|WindowsResourceReference.Create Analysis Bookmarks|true|
|x86 Constant Reference Analyzer|true|
|x86 Constant Reference Analyzer.Create Data from pointer|false|
|x86 Constant Reference Analyzer.Function parameter/return Pointer analysis|true|
|x86 Constant Reference Analyzer.Max Threads|2|
|x86 Constant Reference Analyzer.Min absolute reference|4|
|x86 Constant Reference Analyzer.Require pointer param data type|false|
|x86 Constant Reference Analyzer.Speculative reference max|256|
|x86 Constant Reference Analyzer.Speculative reference min|1024|
|x86 Constant Reference Analyzer.Stored Value Pointer analysis|true|
|x86 Constant Reference Analyzer.Trust values read from writable memory|true|

</details>

## Diff Stats



|Stat|Value|
| :---: | :---: |
|added_funcs_len|0|
|deleted_funcs_len|4|
|modified_funcs_len|6|
|added_symbols_len|2|
|deleted_symbols_len|2|
|diff_time|7.500628471374512|
|deleted_strings_len|0|
|added_strings_len|0|
|match_types|Counter({'SymbolsHash': 1254, 'ExternalsName': 280, 'ExactInstructionsFunctionHasher': 16, 'ExactBytesFunctionHasher': 4, 'SigCallingCalledHasher': 2})|
|items_to_process|14|
|diff_types|Counter({'address': 6, 'refcount': 5, 'calling': 3, 'code': 2, 'length': 2, 'sig': 2, 'called': 1})|
|unmatched_funcs_len|4|
|total_funcs_len|2556|
|matched_funcs_len|2552|
|matched_funcs_with_code_changes_len|2|
|matched_funcs_with_non_code_changes_len|4|
|matched_funcs_no_changes_len|2546|
|match_func_similarity_percent|99.7649%|
|func_match_overall_percent|99.8435%|
|first_matches|Counter({'SymbolsHash': 1254, 'ExactInstructionsFunctionHasher': 16, 'ExactBytesFunctionHasher': 4, 'SigCallingCalledHasher': 2})|



```mermaid
pie showData
    title All Matches
"SymbolsHash" : 1254
"ExternalsName" : 280
"ExactBytesFunctionHasher" : 4
"ExactInstructionsFunctionHasher" : 16
"SigCallingCalledHasher" : 2
```



```mermaid
pie showData
    title First Matches
"SymbolsHash" : 1254
"ExactBytesFunctionHasher" : 4
"ExactInstructionsFunctionHasher" : 16
"SigCallingCalledHasher" : 2
```



```mermaid
pie showData
    title Diff Stats
"added_funcs_len" : 0
"deleted_funcs_len" : 4
"modified_funcs_len" : 6
```



```mermaid
pie showData
    title Symbols
"added_symbols_len" : 2
"deleted_symbols_len" : 2
```

## Strings


*No string differences found*

# Deleted

## FUN_18000fe5d

### Function Meta



|Key|ncp-1928.dll|
| :---: | :---: |
|name|FUN_18000fe5d|
|fullname|FUN_18000fe5d|
|refcount|1|
|length|22|
|called||
|calling|SPCryptSetKeyProperty|
|paramcount|0|
|address|18000fe5d|
|sig|undefined4 __fastcall FUN_18000fe5d(void)|
|sym_type|Function|
|sym_source|DEFAULT|
|external|False|


```diff
--- FUN_18000fe5d
+++ FUN_18000fe5d
@@ -1,17 +0,0 @@
-
-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
-
-undefined4 FUN_18000fe5d(void)
-
-{
-  undefined4 in_EAX;
-  longlong unaff_RBP;
-  undefined4 unaff_EDI;
-  longlong unaff_R12;
-  
-  DebugTraceError(in_EAX,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-  RtlReleaseResource(*(undefined8 *)(unaff_RBP + -0x49));
-  RtlReleaseResource(unaff_R12 + 0x40);
-  return unaff_EDI;
-}
-

```


## FUN_18000fe73

### Function Meta



|Key|ncp-1928.dll|
| :---: | :---: |
|name|FUN_18000fe73|
|fullname|FUN_18000fe73|
|refcount|1|
|length|29|
|called|DebugTraceError|
|calling|FUN_180010a15|
|paramcount|0|
|address|18000fe73|
|sig|undefined4 __fastcall FUN_18000fe73(void)|
|sym_type|Function|
|sym_source|DEFAULT|
|external|False|


```diff
--- FUN_18000fe73
+++ FUN_18000fe73
@@ -1,18 +0,0 @@
-
-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
-
-undefined4 FUN_18000fe73(void)
-
-{
-  undefined4 in_EAX;
-  longlong unaff_RBP;
-  undefined4 unaff_EDI;
-  longlong unaff_R12;
-  undefined8 unaff_R15;
-  
-  DebugTraceError(in_EAX,unaff_R15,"onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c");
-  RtlReleaseResource(*(undefined8 *)(unaff_RBP + -0x49));
-  RtlReleaseResource(unaff_R12 + 0x40);
-  return unaff_EDI;
-}
-

```


## FUN_1800109c2

### Function Meta



|Key|ncp-1928.dll|
| :---: | :---: |
|name|FUN_1800109c2|
|fullname|FUN_1800109c2|
|refcount|1|
|length|193|
|called|DebugTraceError<br>NTDLL.DLL::RtlFreeHeap<br>WriteKeyToStore|
|calling|SPCryptSetKeyProperty|
|paramcount|3|
|address|1800109c2|
|sig|uint __fastcall FUN_1800109c2(undefined8 param_1, undefined8 param_2, longlong param_3)|
|sym_type|Function|
|sym_source|DEFAULT|
|external|False|


```diff
--- FUN_1800109c2
+++ FUN_1800109c2
@@ -1,196 +0,0 @@
-
-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
-/* WARNING: Function: _guard_xfg_dispatch_icall_nop replaced with injection: guard_dispatch_icall */
-
-uint FUN_1800109c2(undefined8 param_1,undefined8 param_2,longlong param_3)
-
-{
-  longlong *plVar1;
-  short sVar2;
-  uint uVar3;
-  void *_Src;
-  undefined8 *puVar4;
-  longlong *plVar5;
-  code *pcVar6;
-  uint uVar7;
-  int iVar8;
-  undefined4 *puVar9;
-  short *psVar10;
-  undefined8 uVar11;
-  longlong lVar12;
-  char *pcVar13;
-  longlong lVar14;
-  longlong unaff_RBX;
-  longlong unaff_RBP;
-  longlong unaff_RSI;
-  uint uVar15;
-  longlong unaff_R12;
-  undefined4 unaff_R14D;
-  wchar_t *pwVar16;
-  longlong unaff_R15;
-  undefined1 auStackX_8 [32];
-  
-  plVar1 = (longlong *)(param_3 + 0x98);
-  lVar12 = *plVar1;
-  if ((*(longlong **)(lVar12 + 8) == plVar1) &&
-     (plVar5 = *(longlong **)(param_3 + 0xa0), (longlong *)*plVar5 == plVar1)) {
-    *plVar5 = lVar12;
-    *(longlong **)(lVar12 + 8) = plVar5;
-    RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
-    uVar7 = *(uint *)(unaff_RBP + -0x61);
-    puVar9 = (undefined4 *)
-             RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
-                             (ulonglong)uVar7 + 0xa8);
-    if (puVar9 == (undefined4 *)0x0) {
-      uVar15 = 0x8009000e;
-LAB_180010a40:
-      pcVar13 = "Status";
-      DebugTraceError(uVar15,"Status",
-                      "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-    }
-    else {
-      *puVar9 = unaff_R14D;
-      lVar12 = 0x41;
-      psVar10 = (short *)(puVar9 + 1);
-      lVar14 = unaff_RBX - (longlong)psVar10;
-      while (lVar12 != -0x7fffffbd) {
-        sVar2 = *(short *)((longlong)psVar10 + lVar14);
-        if (sVar2 == 0) {
-          if (lVar12 != 0) break;
-          psVar10[-1] = 0;
-          RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,puVar9);
-          uVar15 = 0x80090027;
-          goto LAB_180010a40;
-        }
-        *psVar10 = sVar2;
-        psVar10 = psVar10 + 1;
-        lVar12 = lVar12 + -1;
-        if (lVar12 == 0) {
-          uVar7 = FUN_180010a15();
-          return uVar7;
-        }
-      }
-      _Src = *(void **)(unaff_RBP + -0x69);
-      uVar15 = 0;
-      uVar3 = *(uint *)(unaff_RBP + -0x79);
-      *psVar10 = 0;
-      puVar9[0x22] = *(undefined4 *)(unaff_RBP + -0x61);
-      puVar9[0x23] = 0;
-      puVar9[0x24] = (uint)((uVar3 & 0xc0000000) != 0);
-      memcpy(puVar9 + 0x2a,_Src,(ulonglong)uVar7);
-      puVar9[0x25] = 1;
-      plVar1 = (longlong *)(puVar9 + 0x26);
-      pcVar13 = *(char **)(unaff_R15 + 8);
-      if (*(longlong *)pcVar13 != unaff_R15) goto LAB_180010a64;
-      *plVar1 = unaff_R15;
-      *(char **)(puVar9 + 0x28) = pcVar13;
-      *(longlong **)pcVar13 = plVar1;
-      *(longlong **)(unaff_R15 + 8) = plVar1;
-      if (puVar9[0x24] != 0) {
-        if ((*(byte *)(unaff_RSI + 0x1ac) & 0x20) != 0) goto LAB_180010a6b;
-        if (*(longlong *)(unaff_RSI + 0xe0) != 0) {
-          pcVar13 = (char *)0x0;
-          uVar7 = WriteKeyToStore(unaff_RSI,0,0);
-          if (uVar7 != 0) {
-            pcVar13 = "Status";
-            DebugTraceError(uVar7,"Status",
-                            "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-            uVar15 = uVar7;
-          }
-        }
-      }
-    }
-  }
-  else {
-LAB_180010a64:
-    pcVar6 = (code *)swi(0x29);
-    (*pcVar6)(3);
-    register0x00000020 = (BADSPACEBASE *)auStackX_8;
-LAB_180010a6b:
-    pcVar13 = "Status";
-    uVar15 = 0x80090010;
-    *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180010a91;
-    DebugTraceError(0x80090010,"Status",
-                    "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-  }
-  if (*(int *)(unaff_RBP + -0x71) != 0) {
-    if (uVar15 == 0) {
-      puVar4 = *(undefined8 **)(unaff_RSI + 0x40);
-      pwVar16 = L"UNKNOWN";
-      *(undefined8 *)(unaff_RBP + -0x41) = 0;
-      *(undefined8 *)(unaff_RBP + -0x39) = 0;
-      *(undefined8 *)(unaff_RBP + -0x31) = 0;
-      *(undefined8 *)(unaff_RBP + -0x29) = 0;
-      *(undefined8 *)(unaff_RBP + -0x21) = 0;
-      *(undefined8 *)(unaff_RBP + -0x19) = 0;
-      *(undefined8 *)(unaff_RBP + -0x11) = 0;
-      *(undefined8 *)(unaff_RBP + -9) = 0;
-      if (puVar4 != (undefined8 *)0x0) {
-        pwVar16 = (wchar_t *)*puVar4;
-      }
-      lVar12 = *(longlong *)(unaff_RSI + 8);
-      if (*(int *)(unaff_RSI + 0x20) == 0) {
-        uVar7 = 0x9c4;
-      }
-      else {
-        uVar7 = 0x9c3;
-      }
-      if (lVar12 == 0) {
-        if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&
-           ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) {
-          uVar11 = *(undefined8 *)(WPP_GLOBAL_Control + 0x10);
-          *(undefined4 *)((longlong)register0x00000020 + 0x30) = 0x13f;
-          *(char **)((longlong)register0x00000020 + 0x28) =
-               "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c";
-          *(undefined4 *)((longlong)register0x00000020 + 0x20) = 0xc000000d;
-          *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180010b65;
-          WPP_SF_sDsd(uVar11,pcVar13,"onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c",
-                      "Status",*(undefined8 *)((longlong)register0x00000020 + 0x20),
-                      *(char **)((longlong)register0x00000020 + 0x28));
-        }
-      }
-      else {
-        *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180010b79;
-        uVar11 = CryptAuditTranslateString(0x9a1,(STRSAFE_LPWSTR)(unaff_RBP + -0x41));
-        iVar8 = (int)uVar11;
-        if (-1 < iVar8) {
-          *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180010b9d;
-          uVar11 = CryptAuditTranslateString(uVar7,(STRSAFE_LPWSTR)(unaff_RBP + -0x21));
-          iVar8 = (int)uVar11;
-          if (-1 < iVar8) {
-            if ((g_pAuditingFuncs != 0) &&
-               (pcVar6 = *(code **)(g_pAuditingFuncs + 0x18), pcVar6 != (code *)0x0)) {
-              *(undefined4 *)((longlong)register0x00000020 + 0x30) = 0;
-              *(longlong *)((longlong)register0x00000020 + 0x28) = unaff_RBP + -0x41;
-              *(longlong *)((longlong)register0x00000020 + 0x20) = unaff_RBP + -0x21;
-              *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180010c0c;
-              iVar8 = (*pcVar6)(1,L"Microsoft Software Key Storage Provider",pwVar16,lVar12);
-              if (iVar8 < 0) {
-                uVar7 = FUN_18000fe73();
-                return uVar7;
-              }
-            }
-            goto LAB_180003467;
-          }
-        }
-        *(undefined8 *)((longlong)register0x00000020 + -8) = 0x18000fe8a;
-        DebugTraceError(iVar8,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c");
-      }
-    }
-    else {
-      *(uint *)((longlong)register0x00000020 + 0x20) = uVar15;
-      *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180010c2d;
-      KspCryptAuditKeyMigrationOperation
-                (0,pcVar13,unaff_RSI,0x9a1,*(undefined4 *)((longlong)register0x00000020 + 0x20));
-    }
-  }
-LAB_180003467:
-  uVar11 = *(undefined8 *)(unaff_RBP + -0x49);
-  *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180003472;
-  RtlReleaseResource(uVar11);
-  *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180003483;
-  RtlReleaseResource(unaff_R12 + 0x40);
-  *(undefined8 *)((longlong)register0x00000020 + -8) = 0x180003496;
-  return uVar15;
-}
-

```


## FUN_180010a15

### Function Meta



|Key|ncp-1928.dll|
| :---: | :---: |
|name|FUN_180010a15|
|fullname|FUN_180010a15|
|refcount|2|
|length|335|
|called|CryptAuditTranslateString<br>DebugTraceError<br>FUN_18000fe73<br>KspCryptAuditKeyMigrationOperation<br>NTDLL.DLL::RtlFreeHeap<br>WPP_SF_sDsd|
|calling|SPCryptSetKeyProperty|
|paramcount|0|
|address|180010a15|
|sig|undefined4 __fastcall FUN_180010a15(void)|
|sym_type|Function|
|sym_source|DEFAULT|
|external|False|


```diff
--- FUN_180010a15
+++ FUN_180010a15
@@ -1,44 +0,0 @@
-
-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
-/* WARNING: Function: _guard_xfg_dispatch_icall_nop replaced with injection: guard_dispatch_icall */
-/* WARNING: Removing unreachable block (ram,0x000180003405) */
-/* WARNING: Removing unreachable block (ram,0x00018000342b) */
-/* WARNING: Removing unreachable block (ram,0x00018000342e) */
-/* WARNING: Removing unreachable block (ram,0x000180010b33) */
-/* WARNING: Removing unreachable block (ram,0x00018000343c) */
-/* WARNING: Removing unreachable block (ram,0x000180003441) */
-/* WARNING: Removing unreachable block (ram,0x000180010b6b) */
-/* WARNING: Removing unreachable block (ram,0x000180010b92) */
-/* WARNING: Removing unreachable block (ram,0x000180010bb6) */
-/* WARNING: Removing unreachable block (ram,0x000180010bc6) */
-/* WARNING: Removing unreachable block (ram,0x000180010bd3) */
-/* WARNING: Removing unreachable block (ram,0x000180010c14) */
-/* WARNING: Removing unreachable block (ram,0x000180010ba1) */
-/* WARNING: Removing unreachable block (ram,0x000180010b7d) */
-/* WARNING: Removing unreachable block (ram,0x00018000fe83) */
-/* WARNING: Removing unreachable block (ram,0x00018000344a) */
-/* WARNING: Removing unreachable block (ram,0x00018000345d) */
-/* WARNING: Removing unreachable block (ram,0x000180010b3d) */
-
-undefined4 FUN_180010a15(void)
-
-{
-  longlong in_RAX;
-  char *pcVar1;
-  longlong unaff_RBP;
-  longlong unaff_RSI;
-  longlong unaff_R12;
-  
-  *(undefined2 *)(in_RAX + -2) = 0;
-  RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
-  pcVar1 = "Status";
-  DebugTraceError(0x80090027,"Status",
-                  "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-  if (*(int *)(unaff_RBP + -0x71) != 0) {
-    KspCryptAuditKeyMigrationOperation(0,pcVar1,unaff_RSI,0x9a1,0x80090027);
-  }
-  RtlReleaseResource(*(undefined8 *)(unaff_RBP + -0x49));
-  RtlReleaseResource(unaff_R12 + 0x40);
-  return 0x80090027;
-}
-

```


# Added

# Modified


*Modified functions contain code changes*
## SPCryptSetProviderProperty

### Match Info



|Key|ncp-1928.dll - ncp-2134.dll|
| :---: | :---: |
|diff_type|code,length,sig,address|
|ratio|0.85|
|i_ratio|0.64|
|m_ratio|0.96|
|b_ratio|0.96|
|match_types|SymbolsHash|

### Function Meta Diff



|Key|ncp-1928.dll|ncp-2134.dll|
| :---: | :---: | :---: |
|name|SPCryptSetProviderProperty|SPCryptSetProviderProperty|
|fullname|SPCryptSetProviderProperty|SPCryptSetProviderProperty|
|refcount|3|3|
|`length`|666|726|
|called|CreateSystemDirectory<br>DebugTraceError<br>KspValidateAndLockProvider<br>NTDLL.DLL::RtlAllocateHeap<br>NTDLL.DLL::RtlFreeHeap<br>NTDLL.DLL::RtlReleaseResource<br>ValidateAlternateStorageLocation<br>memcpy<br>wcscmp|CreateSystemDirectory<br>DebugTraceError<br>KspValidateAndLockProvider<br>NTDLL.DLL::RtlAllocateHeap<br>NTDLL.DLL::RtlFreeHeap<br>NTDLL.DLL::RtlReleaseResource<br>ValidateAlternateStorageLocation<br>memcpy<br>wcscmp|
|calling|||
|paramcount|5|5|
|`address`|180029660|180029900|
|`sig`|ulonglong __fastcall SPCryptSetProviderProperty(uint * param_1, wchar_t * param_2, STRSAFE_PCNZWCH param_3, uint param_4, uint param_5)|ulonglong __fastcall SPCryptSetProviderProperty(uint * param_1, wchar_t * param_2, STRSAFE_PCNZWCH param_3, ulonglong param_4, uint param_5)|
|sym_type|Function|Function|
|sym_source|IMPORTED|IMPORTED|
|external|False|False|

### SPCryptSetProviderProperty Diff


```diff
--- SPCryptSetProviderProperty
+++ SPCryptSetProviderProperty
@@ -1,108 +1,109 @@
 
 ulonglong SPCryptSetProviderProperty
-                    (uint *param_1,wchar_t *param_2,STRSAFE_PCNZWCH param_3,uint param_4,
+                    (uint *param_1,wchar_t *param_2,STRSAFE_PCNZWCH param_3,ulonglong param_4,
                     uint param_5)
 
 {
-  ulonglong _Size;
   int iVar1;
   int iVar2;
   uint uVar3;
   uint *puVar4;
   void *_Dst;
   longlong lVar5;
   ulonglong uVar6;
   ulonglong uVar7;
+  ulonglong _Size;
   wchar_t *local_28 [2];
   
-  _Size = (ulonglong)param_4;
+  _Size = param_4 & 0xffffffff;
   puVar4 = KspValidateAndLockProvider(param_1,1);
   uVar7 = 0;
   if (puVar4 == (uint *)0x0) {
     DebugTraceError(0x80090026,"Status",
                     "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
     return 0x80090026;
   }
   if (param_2 == (wchar_t *)0x0) {
 LAB_0:
     uVar6 = 0x80090027;
     uVar3 = 0x80090027;
   }
   else {
     uVar6 = 0xffffffffffffffff;
     do {
       uVar6 = uVar6 + 1;
     } while (param_2[uVar6] != L'\0');
     if ((0x40 < uVar6) ||
        (((iVar1 = wcscmp(param_2,L"PCP_ALTERNATE_KEY_STORAGE_LOCATION"),
-         param_3 == (STRSAFE_PCNZWCH)0x0 && (iVar1 != 0)) || (0x7fffffff < param_4))))
-    goto LAB_0;
+         param_3 == (STRSAFE_PCNZWCH)0x0 && (iVar1 != 0)) ||
+        (uVar3 = (uint)param_4, 0x7fffffff < uVar3)))) goto LAB_0;
     if ((param_5 & 0xffffffbf) == 0) {
       iVar2 = wcscmp(param_2,L"Use Context");
       if (iVar2 == 0) {
+        if ((param_3 == (STRSAFE_PCNZWCH)0x0) || (0x7ffffffd < uVar3)) goto LAB_0;
         if (*(longlong *)(puVar4 + 8) != 0) {
           RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
         }
         _Dst = (void *)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
-                                       _Size);
+                                       _Size + 2);
         *(void **)(puVar4 + 8) = _Dst;
         if (_Dst != (void *)0x0) {
-LAB_1:
           memcpy(_Dst,param_3,_Size);
-          goto LAB_2;
+          *(undefined2 *)(*(longlong *)(puVar4 + 8) + (param_4 & 0xfffffffe)) = 0;
+          goto LAB_1;
         }
-LAB_3:
+LAB_2:
         uVar6 = 0x8009000e;
         uVar3 = 0x8009000e;
       }
       else {
         iVar2 = wcscmp(param_2,L"MSSP/Client Process ID");
         if (iVar2 == 0) {
-          if (param_4 == 4) {
+          if (uVar3 == 4) {
             puVar4[0xf] = *(uint *)param_3;
-            goto LAB_2;
+            goto LAB_1;
           }
           uVar6 = 0x80090005;
           uVar3 = 0x80090005;
         }
         else if (iVar1 == 0) {
           if (*(longlong *)(puVar4 + 10) != 0) {
             RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
             puVar4[10] = 0;
             puVar4[0xb] = 0;
           }
-          if (param_4 == 0) goto LAB_2;
-          uVar6 = ValidateAlternateStorageLocation(param_3,param_4,local_28);
+          if (uVar3 == 0) goto LAB_1;
+          uVar6 = ValidateAlternateStorageLocation(param_3,uVar3,local_28);
           uVar3 = (uint)uVar6;
           uVar6 = uVar6 & 0xffffffff;
           if (uVar3 == 0) {
             lVar5 = RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
                                     _Size);
             *(longlong *)(puVar4 + 10) = lVar5;
-            if (lVar5 == 0) goto LAB_3;
+            if (lVar5 == 0) goto LAB_2;
             uVar3 = CreateSystemDirectory(local_28[0],0,3);
             uVar6 = (ulonglong)uVar3;
             if (uVar3 == 0) {
-              _Dst = *(void **)(puVar4 + 10);
+              memcpy(*(void **)(puVar4 + 10),param_3,_Size);
               goto LAB_1;
             }
           }
         }
         else {
           uVar6 = 0x80090029;
           uVar3 = 0x80090029;
         }
       }
     }
     else {
       uVar6 = 0x80090009;
       uVar3 = 0x80090009;
     }
   }
   DebugTraceError(uVar3,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
   uVar7 = uVar6;
-LAB_2:
+LAB_1:
   RtlReleaseResource(puVar4 + 0x10);
   return uVar7;
 }
 

```


## SPCryptSetKeyProperty

### Match Info



|Key|ncp-1928.dll - ncp-2134.dll|
| :---: | :---: |
|diff_type|code,refcount,length,sig,address,called|
|ratio|0.04|
|i_ratio|0.05|
|m_ratio|0.89|
|b_ratio|0.05|
|match_types|SymbolsHash|

### Function Meta Diff



|Key|ncp-1928.dll|ncp-2134.dll|
| :---: | :---: | :---: |
|name|SPCryptSetKeyProperty|SPCryptSetKeyProperty|
|fullname|SPCryptSetKeyProperty|SPCryptSetKeyProperty|
|`refcount`|6|5|
|`length`|5367|6716|
|`called`|<details><summary>Expand for full list:<br>API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::GetSecurityDescriptorLength<br>API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::IsValidSecurityDescriptor<br>BCRYPT.DLL::BCryptDestroyKey<br>BCRYPT.DLL::BCryptGenerateKeyPair<br>BCRYPT.DLL::BCryptGetProperty<br>BCRYPT.DLL::BCryptSetProperty<br>ChangePasswordOnTheKey<br>ComputeAndSetPasswordHashOnTheKey<br>DebugTraceError<br>FUN_18000fe5d<br>FUN_1800109c2</summary>FUN_180010a15<br>KspCheckStrongKeyAndUnprotect<br>KspValidateKeyLength<br>NTDLL.DLL::RtlAcquireResourceExclusive<br>NTDLL.DLL::RtlAcquireResourceShared<br>NTDLL.DLL::RtlAllocateHeap<br>NTDLL.DLL::RtlFreeHeap<br>NTDLL.DLL::RtlReleaseResource<br>SKCacheAdd<br>SKCacheRemove<br>SetCertificateProperty<br>SetKeyAccessPolicy<br>SetUIKeyProperties<br>UnprotectLegacyPrivateKey<br>UnprotectPrivateKey<br>WriteKeyToStore<br>__security_check_cookie<br>_guard_xfg_dispatch_icall_nop<br>memcpy<br>wcscmp</details>|<details><summary>Expand for full list:<br>API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::GetSecurityDescriptorLength<br>API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::IsValidSecurityDescriptor<br>BCRYPT.DLL::BCryptDestroyKey<br>BCRYPT.DLL::BCryptGenerateKeyPair<br>BCRYPT.DLL::BCryptGetProperty<br>BCRYPT.DLL::BCryptSetProperty<br>ChangePasswordOnTheKey<br>ComputeAndSetPasswordHashOnTheKey<br>CryptAuditTranslateString<br>DebugTraceError<br>KspCheckStrongKeyAndUnprotect</summary>KspCryptAuditKeyMigrationOperation<br>KspValidateKeyLength<br>NTDLL.DLL::RtlAcquireResourceExclusive<br>NTDLL.DLL::RtlAcquireResourceShared<br>NTDLL.DLL::RtlAllocateHeap<br>NTDLL.DLL::RtlFreeHeap<br>NTDLL.DLL::RtlReleaseResource<br>SKCacheAdd<br>SKCacheRemove<br>SetCertificateProperty<br>SetKeyAccessPolicy<br>SetPrivateKeyProperty<br>SetUIKeyProperties<br>UnprotectLegacyPrivateKey<br>UnprotectPrivateKey<br>WPP_SF_sDsd<br>WriteKeyToStore<br>__security_check_cookie<br>_guard_xfg_dispatch_icall_nop<br>memcpy</details>|
|calling|FUN_180002ab0<br>_PkcsImportPlainTextKeyEcc|FUN_180002ab0<br>_PkcsImportPlainTextKeyEcc|
|paramcount|6|6|
|`address`|180002e10|180003050|
|`sig`|uint __fastcall SPCryptSetKeyProperty(uint * param_1, uint * param_2, char * param_3, ulonglong * param_4, uint param_5, uint param_6)|ulonglong __fastcall SPCryptSetKeyProperty(uint * param_1, uint * param_2, char * param_3, ulonglong * param_4, uint param_5, uint param_6)|
|sym_type|Function|Function|
|sym_source|IMPORTED|IMPORTED|
|external|False|False|

### SPCryptSetKeyProperty Called Diff


```diff
--- SPCryptSetKeyProperty called
+++ SPCryptSetKeyProperty called
@@ -8,0 +9 @@
+CryptAuditTranslateString
@@ -10,3 +10,0 @@
-FUN_18000fe5d
-FUN_1800109c2
-FUN_180010a15
@@ -13,0 +12 @@
+KspCryptAuditKeyMigrationOperation
@@ -23,0 +23 @@
+SetPrivateKeyProperty
@@ -26,0 +27 @@
+WPP_SF_sDsd
@@ -31 +31,0 @@
-wcscmp
```


### SPCryptSetKeyProperty Diff


```diff
--- SPCryptSetKeyProperty
+++ SPCryptSetKeyProperty
@@ -1,900 +1,994 @@
 
 /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
 /* WARNING: Function: _guard_xfg_dispatch_icall_nop replaced with injection: guard_dispatch_icall */
 
-uint SPCryptSetKeyProperty
-               (uint *param_1,uint *param_2,char *param_3,ulonglong *param_4,uint param_5,
-               uint param_6)
+ulonglong SPCryptSetKeyProperty
+                    (uint *param_1,uint *param_2,char *param_3,ulonglong *param_4,uint param_5,
+                    uint param_6)
 
 {
   short sVar1;
   short sVar2;
-  code *pcVar3;
-  bool bVar4;
-  int iVar5;
-  uint uVar6;
-  BOOL BVar7;
-  DWORD DVar8;
-  ulonglong uVar9;
-  PUCHAR pbOutput;
-  void *pvVar10;
-  uint *puVar11;
-  uint *puVar12;
-  int *piVar13;
-  ulonglong uVar14;
-  undefined8 uVar15;
-  uint uVar16;
-  undefined4 uVar17;
-  uint uVar18;
-  short *psVar19;
+  undefined8 *puVar3;
+  code *pcVar4;
+  bool bVar5;
+  BOOL BVar6;
+  DWORD DVar7;
+  uint uVar8;
+  int iVar9;
+  ulonglong uVar10;
+  void *pvVar11;
+  int *piVar12;
+  uint *puVar13;
+  short *psVar14;
+  short *psVar15;
+  PUCHAR pUVar16;
+  undefined8 uVar17;
+  undefined4 uVar18;
+  uint uVar19;
   longlong lVar20;
-  longlong lVar21;
-  undefined1 *puVar22;
-  undefined1 *puVar23;
+  uint *puVar21;
+  uint *puVar22;
+  char *pcVar23;
   undefined1 *puVar24;
   undefined1 *puVar25;
   undefined1 *puVar26;
-  uint *puVar27;
-  char *pcVar28;
-  wchar_t *pwVar29;
-  undefined1 auStackY_108 [8];
-  undefined1 auStackY_100 [24];
-  uint local_c8;
-  ULONG local_c4;
-  uint local_c0 [2];
-  ulonglong *local_b8;
-  uint local_b0 [2];
-  BCRYPT_KEY_HANDLE local_a8;
-  ULONG local_a0 [2];
-  uint *local_98;
-  undefined8 local_90;
-  undefined8 uStack_88;
-  undefined8 local_80;
-  undefined8 uStack_78;
-  undefined8 local_70;
-  undefined8 uStack_68;
-  undefined8 local_60;
-  undefined8 uStack_58;
-  ulonglong local_50;
+  ulonglong uVar27;
+  PUCHAR pUVar28;
+  longlong lVar29;
+  char *pcVar30;
+  wchar_t *pwVar31;
+  undefined1 auStackY_118 [8];
+  undefined1 auStackY_110 [24];
+  uint local_d8;
+  uint local_c8 [2];
+  undefined8 local_c0;
+  ULONG local_b8;
+  uint local_b4;
+  BCRYPT_KEY_HANDLE local_b0;
+  uint *local_a8;
+  uint *local_a0;
+  undefined8 local_98;
+  undefined8 uStack_90;
+  undefined8 local_88;
+  undefined8 uStack_80;
+  undefined8 local_78;
+  undefined8 uStack_70;
+  undefined8 local_68;
+  undefined8 uStack_60;
+  ulonglong local_58;
   
-  puVar25 = auStackY_108;
-  puVar24 = auStackY_108;
-  puVar22 = auStackY_108;
-  puVar26 = auStackY_108;
-  puVar23 = auStackY_108;
-  local_50 = __security_cookie ^ (ulonglong)auStackY_108;
-  uVar14 = (ulonglong)param_5;
-  local_b0[0] = param_5;
-  uVar6 = 0;
-  local_c0[0] = 0;
-  local_b8 = param_4;
+  puVar24 = auStackY_118;
+  puVar26 = auStackY_118;
+  puVar25 = auStackY_118;
+  local_58 = __security_cookie ^ (ulonglong)auStackY_118;
+  uVar27 = (ulonglong)param_5;
+  local_b4 = param_5;
+  local_c8[0] = 0;
   if (((param_1 == (uint *)0x0) || (*param_1 < 0xa0)) || (param_1[1] != 0x4b535050)) {
-    uVar6 = 0x80090026;
+    uVar27 = 0x80090026;
     DebugTraceError(0x80090026,"Status",
                     "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
     goto LAB_0;
   }
   RtlAcquireResourceShared(param_1 + 0x10,1);
   if (((param_2 == (uint *)0x0) || (*param_2 < 0x238)) || (param_2[1] != 0x4b53504b)) {
-    uVar6 = 0x80090026;
+    uVar27 = 0x80090026;
     DebugTraceError(0x80090026,"Status",
                     "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
   }
   else {
     if (param_3 == (char *)0x0) {
 LAB_1:
-      uVar6 = 0x80090027;
-      uVar17 = 0x80090027;
+      uVar27 = 0x80090027;
+      uVar18 = 0x80090027;
     }
     else {
-      uVar9 = 0xffffffffffffffff;
+      uVar10 = 0xffffffffffffffff;
       do {
-        uVar9 = uVar9 + 1;
-      } while (*(short *)(param_3 + uVar9 * 2) != 0);
-      if (0x40 < uVar9) goto LAB_1;
-      iVar5 = wcscmp((wchar_t *)param_3,L"Security Descr");
-      if (iVar5 == 0) {
-        local_c8 = param_6 & 0xffffffbf;
-        if (local_c8 != 0) {
-          uVar16 = param_6 & 0x7fffffa0;
-          goto joined_r0x00018000fc16;
-        }
-      }
-      else {
-        uVar16 = param_6 & 0x3fffffbf;
-        local_c8 = param_6;
-joined_r0x00018000fc16:
-        if (uVar16 == 0) {
-          local_98 = param_2 + 0x4c;
-          RtlAcquireResourceExclusive(local_98,1);
-          if ((local_c8 >> 0x1e & 1) == 0) {
-            iVar5 = wcscmp((wchar_t *)param_3,L"Export Policy");
-            if (iVar5 == 0) {
-              uVar9 = local_90;
-              if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-              uVar6 = 3;
-              if (param_5 == 4) {
-                if (*(longlong *)(param_2 + 0x38) == 0) {
-                  uVar16 = (uint)*param_4;
-                  local_c8 = 0x80000000;
-                  if ((uVar16 & 0xfffffff0) == 0) {
-                    if (((*(longlong *)(param_2 + 0x68) == 0) ||
-                        ((*(byte *)(*(longlong *)(param_2 + 0x68) + 4) & 4) == 0)) || (uVar16 == 0))
-                    {
-                      param_2[9] = uVar16;
-                      uVar18 = uVar16;
-                      if ((uVar16 & 4) != 0) {
-                        uVar18 = uVar16 | 1;
-                        param_2[9] = uVar18;
-                      }
-                      if ((uVar16 & 8) != 0) {
-                        param_2[9] = uVar18 | 2;
-                      }
-                      goto LAB_3;
+        uVar10 = uVar10 + 1;
+      } while (*(short *)(param_3 + uVar10 * 2) != 0);
+      if (0x40 < uVar10) goto LAB_1;
+      lVar20 = -1;
+      do {
+        if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"Security Descr"[lVar20 + 1]) break;
+        lVar20 = lVar20 + 2;
+        if (lVar20 == 0xf) {
+          local_d8 = param_6 & 0xffffffbf;
+          if (local_d8 == 0) {
+            uVar27 = 0x80090009;
+            uVar18 = 0x80090009;
+          }
+          else {
+            if ((param_6 & 0x7fffffa0) == 0) goto LAB_2;
+            uVar27 = 0x80090009;
+            uVar18 = 0x80090009;
+          }
+          goto LAB_3;
+        }
+      } while (*(wchar_t *)(param_3 + lVar20 * 2) == L"Security Descr"[lVar20]);
+      local_d8 = param_6;
+      if ((param_6 & 0x3fffffbf) == 0) {
+LAB_2:
+        local_a0 = param_2 + 0x4c;
+        RtlAcquireResourceExclusive(local_a0,"age\\property.c");
+        uVar10 = local_98;
+        if ((local_d8 >> 0x1e & 1) == 0) {
+          puVar13 = (uint *)0x0;
+          puVar21 = puVar13;
+          do {
+            puVar22 = puVar13;
+            if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) !=
+                 L"Export Policy"[(longlong)puVar21]) ||
+               (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+                L"Export Policy"[(longlong)((longlong)puVar21 + 1)])) goto LAB_4;
+            puVar21 = (uint *)((longlong)puVar21 + 2);
+          } while (puVar21 != (uint *)0xe);
+          if ((param_4 != (ulonglong *)0x0) && (param_5 < 0x80000000)) {
+            local_c0 = CONCAT44(local_c0._4_4_,3);
+            if (param_5 == 4) {
+              if (*(longlong *)(param_2 + 0x38) == 0) {
+                uVar8 = (uint)*param_4;
+                local_d8 = 0x80000000;
+                if ((uVar8 & 0xfffffff0) == 0) {
+                  if (((*(longlong *)(param_2 + 0x68) == 0) ||
+                      ((*(byte *)(*(longlong *)(param_2 + 0x68) + 4) & 4) == 0)) || (uVar8 == 0)) {
+                    param_2[9] = uVar8;
+                    uVar19 = uVar8;
+                    if ((uVar8 & 4) != 0) {
+                      uVar19 = uVar8 | 1;
+                      param_2[9] = uVar19;
                     }
-                    goto LAB_2;
+                    if ((uVar8 & 8) != 0) {
+                      param_2[9] = uVar19 | 2;
+                    }
+                    goto LAB_5;
                   }
-                  uVar16 = 0x80090029;
+                  goto LAB_6;
                 }
-                else {
-                  uVar16 = 0x8009000b;
-                }
+                uVar27 = 0x80090029;
+                uVar8 = 0x80090029;
               }
               else {
-                uVar16 = 0x80090005;
+                uVar27 = 0x8009000b;
+                uVar8 = 0x8009000b;
               }
-LAB_4:
-              uVar6 = uVar16;
-              DebugTraceError(uVar6,"Status",
-                              "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
             }
             else {
-              iVar5 = wcscmp((wchar_t *)param_3,L"Key Usage");
-              if (iVar5 == 0) {
-                uVar9 = local_90;
-                if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                uVar6 = 5;
-                if (param_5 == 4) {
-                  if (*(longlong *)(param_2 + 0x38) == 0) {
-                    param_2[10] = (uint)*param_4;
-                    local_c8 = 0x80000000;
-                    goto LAB_3;
-                  }
-                  uVar16 = 0x8009000b;
-                }
-                else {
-                  uVar16 = 0x80090005;
-                }
-                goto LAB_4;
+              uVar27 = 0x80090005;
+              uVar8 = 0x80090005;
+            }
+            goto LAB_7;
+          }
+        }
+        else if ((param_4 != (ulonglong *)0x0) && (param_5 < 0x80000000)) {
+          local_c0 = local_c0 & 0xffffffff00000000;
+          goto LAB_5;
+        }
+        goto LAB_6;
+      }
+      uVar27 = 0x80090009;
+      uVar18 = 0x80090009;
+    }
+LAB_3:
+    DebugTraceError(uVar18,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c")
+    ;
+    puVar25 = auStackY_118;
+  }
+  goto LAB_8;
+  while (puVar22 = (uint *)((longlong)puVar22 + 2), puVar22 != (uint *)0xa) {
+LAB_4:
+    puVar21 = puVar13;
+    if ((*(wchar_t *)(param_3 + (longlong)puVar22 * 2) != L"Key Usage"[(longlong)puVar22]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar22 * 2 + 2) !=
+        L"Key Usage"[(longlong)((longlong)puVar22 + 1)])) goto LAB_9;
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  local_c0 = CONCAT44(local_c0._4_4_,5);
+  if (param_5 == 4) {
+    if (*(longlong *)(param_2 + 0x38) == 0) {
+      param_2[10] = (uint)*param_4;
+      local_d8 = 0x80000000;
+      goto LAB_5;
+    }
+    uVar27 = 0x8009000b;
+    uVar8 = 0x8009000b;
+  }
+  else {
+    uVar27 = 0x80090005;
+    uVar8 = 0x80090005;
+  }
+  goto LAB_7;
+  while (puVar21 = (uint *)((longlong)puVar21 + 2), puVar21 != (uint *)0xc) {
+LAB_9:
+    if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) != L"HWND Handle"[(longlong)puVar21]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+        L"HWND Handle"[(longlong)((longlong)puVar21 + 1)])) {
+      puVar21 = puVar13;
+      if ((*(short *)param_3 != 0x49) ||
+         ((*(short *)(param_3 + 2) != 0x56 || (*(short *)(param_3 + 4) != 0)))) goto LAB_10;
+      if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+      if (*(longlong *)(param_2 + 0x1c) == 0) {
+        uVar27 = KspCheckStrongKeyAndUnprotect((ulonglong)param_2,(ulonglong)local_d8);
+        uVar8 = (uint)uVar27;
+        uVar27 = uVar27 & 0xffffffff;
+        if ((int)uVar8 < 0) goto LAB_7;
+      }
+      uVar8 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x18))
+                        (*(undefined8 *)(param_2 + 0x1c),L"IV",param_4,param_5);
+      goto joined_r0x000180003709;
+    }
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  local_c0 = CONCAT44(local_c0._4_4_,0x11);
+  if (param_5 < 9) {
+    memcpy(param_2 + 100,param_4,uVar27);
+    local_d8 = local_d8 & 0x7fffffff;
+    param_2[0x66] = param_5;
+    goto LAB_5;
+  }
+  uVar27 = 0x80090005;
+  uVar8 = 0x80090005;
+  goto LAB_7;
+  while (puVar21 = (uint *)((longlong)puVar21 + 2), puVar21 != (uint *)0xe) {
+LAB_10:
+    puVar22 = puVar13;
+    if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) != L"Chaining Mode"[(longlong)puVar21]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+        L"Chaining Mode"[(longlong)((longlong)puVar21 + 1)])) goto LAB_11;
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  if (*(longlong *)(param_2 + 0x1c) == 0) {
+    uVar27 = KspCheckStrongKeyAndUnprotect((ulonglong)param_2,(ulonglong)local_d8);
+    uVar8 = (uint)uVar27;
+    uVar27 = uVar27 & 0xffffffff;
+    if ((int)uVar8 < 0) goto LAB_7;
+  }
+  uVar8 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x18))
+                    (*(undefined8 *)(param_2 + 0x1c),L"ChainingMode",param_4,param_5);
+joined_r0x000180003709:
+  uVar27 = (ulonglong)uVar8;
+  puVar25 = auStackY_118;
+  if ((int)uVar8 < 0) goto LAB_12;
+  goto LAB_13;
+  while (puVar22 = puVar21, puVar21 != (uint *)0x7) {
+LAB_11:
+    puVar21 = (uint *)((longlong)puVar22 + 1);
+    if (*(wchar_t *)(param_3 + (longlong)puVar22 * 2) !=
+        L"MSSP/UI Internal Flags"[(longlong)(puVar22 + 6)]) {
+      lVar20 = -1;
+      goto LAB_14;
+    }
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  if (param_5 == 4) {
+    if (*(longlong *)(param_2 + 0x38) == 0) {
+      uVar19 = param_2[7];
+      uVar27 = *param_4;
+      param_2[7] = (uint)uVar27;
+      uVar8 = KspValidateKeyLength((longlong)param_2,(uint)uVar27);
+      uVar27 = (ulonglong)uVar8;
+      if (uVar8 == 0) {
+        if (*(int *)(*(longlong *)(param_2 + 0x10) + 0x20) - 0x3000aU < 2) {
+          uVar10 = local_98;
+          if ((*(longlong *)(param_2 + 0x8a) == 0) || (puVar25 = auStackY_118, uVar19 != param_2[7])
+             ) goto LAB_6;
+        }
+        else {
+          puVar25 = auStackY_118;
+          if (*(longlong *)(param_2 + 0x1c) != 0) {
+            uVar8 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x18))
+                              (*(longlong *)(param_2 + 0x1c),L"KeyLength",param_4,4);
+            goto joined_r0x000180003709;
+          }
+        }
+        goto LAB_13;
+      }
+    }
+    else {
+      uVar27 = 0x8009000b;
+      uVar8 = 0x8009000b;
+    }
+  }
+  else {
+    uVar27 = 0x80090005;
+    uVar8 = 0x80090005;
+  }
+  goto LAB_7;
+  while( true ) {
+    lVar20 = lVar20 + 2;
+    if (lVar20 == 0xf) {
+      if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+      if (param_5 == 0) {
+        uVar27 = 0x80090005;
+        uVar8 = 0x80090005;
+        goto LAB_7;
+      }
+      BVar6 = IsValidSecurityDescriptor(param_4);
+      if (BVar6 == 0) {
+        uVar27 = 0x80090005;
+        uVar8 = 0x80090005;
+        goto LAB_7;
+      }
+      DVar7 = GetSecurityDescriptorLength(param_4);
+      if (param_5 < DVar7) {
+        uVar27 = 0x80090005;
+        uVar8 = 0x80090005;
+        goto LAB_7;
+      }
+      param_2[0x43] = local_d8 & 0x7fffffff;
+      if (*(longlong *)(param_2 + 0x44) != 0) {
+        RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
+      }
+      pvVar11 = (void *)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
+                                        uVar27);
+      *(void **)(param_2 + 0x44) = pvVar11;
+      if (pvVar11 == (void *)0x0) {
+        uVar27 = 0x8009000e;
+        uVar8 = 0x8009000e;
+        goto LAB_7;
+      }
+      param_2[0x46] = param_5;
+      memcpy(pvVar11,param_4,uVar27);
+      if (*(longlong *)(param_2 + 0x38) == 0) goto LAB_15;
+      uVar8 = WriteKeyToStore((longlong)param_2,1,0);
+      uVar27 = (ulonglong)uVar8;
+      if (uVar8 != 0) goto LAB_7;
+      goto LAB_15;
+    }
+    if (*(wchar_t *)(param_3 + lVar20 * 2) != L"Security Descr"[lVar20]) break;
+LAB_14:
+    if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"Security Descr"[lVar20 + 1]) break;
+  }
+  lVar20 = -1;
+  do {
+    puVar21 = puVar13;
+    if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"MSSP/UI Internal Flags"[lVar20 + 1]) break;
+    lVar20 = lVar20 + 2;
+    if (lVar20 == 0x17) {
+      if ((((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) ||
+          (local_c0 = 0x12, param_5 != 4)) || (uVar8 = (uint)*param_4, (uVar8 & 0xffffffc0) != 0))
+      goto LAB_6;
+      if (*(longlong *)(param_2 + 0x38) == 0) {
+        local_d8 = local_d8 | 0x80000000;
+        *(uint *)param_4 = uVar8 & 1;
+        param_2[0x6b] = uVar8;
+        goto LAB_5;
+      }
+      param_2[0x6b] = (uVar8 ^ param_2[0x6b]) & 1 ^ uVar8;
+      goto LAB_16;
+    }
+  } while (*(wchar_t *)(param_3 + lVar20 * 2) == L"MSSP/UI Internal Flags"[lVar20]);
+  do {
+    puVar22 = puVar13;
+    if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) !=
+         L"MSSP/UI Password Hash"[(longlong)puVar21]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+        L"MSSP/UI Password Hash"[(longlong)((longlong)puVar21 + 1)])) goto LAB_17;
+    puVar21 = (uint *)((longlong)puVar21 + 2);
+  } while (puVar21 != (uint *)0x16);
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  local_c0 = CONCAT44(local_c0._4_4_,0x13);
+  if (param_5 < 0x41) {
+    if ((param_2[0x6b] & 2) != 0) {
+      puVar21 = param_2 + 0x6c;
+      for (lVar20 = 0x40; lVar20 != 0; lVar20 = lVar20 + -1) {
+        *(undefined1 *)puVar21 = 0;
+        puVar21 = (uint *)((longlong)puVar21 + 1);
+      }
+      memcpy(param_2 + 0x6c,param_4,uVar27);
+      local_d8 = local_d8 & 0x7fffffff;
+      goto LAB_5;
+    }
+    uVar27 = 0x80090029;
+    uVar8 = 0x80090029;
+  }
+  else {
+    uVar27 = 0x80090005;
+    uVar8 = 0x80090005;
+  }
+  goto LAB_7;
+  while (puVar22 = (uint *)((longlong)puVar22 + 2), puVar22 != (uint *)0xc) {
+LAB_17:
+    puVar21 = puVar13;
+    if ((*(wchar_t *)(param_3 + (longlong)puVar22 * 2) != L"Use Context"[(longlong)puVar22]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar22 * 2 + 2) !=
+        L"Use Context"[(longlong)((longlong)puVar22 + 1)])) goto LAB_18;
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7ffffffd < param_5)) goto LAB_6;
+  local_d8 = local_d8 & 0x7fffffff;
+  local_c0 = CONCAT44(local_c0._4_4_,0x15);
+  if (*(longlong *)(param_2 + 0x7e) != 0) {
+    RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
+  }
+  pvVar11 = (void *)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
+                                    uVar27 + 2);
+  *(void **)(param_2 + 0x7e) = pvVar11;
+  if (pvVar11 != (void *)0x0) {
+    memcpy(pvVar11,param_4,uVar27);
+    *(undefined2 *)(*(longlong *)(param_2 + 0x7e) + (ulonglong)(param_5 >> 1) * 2) = 0;
+    goto LAB_5;
+  }
+  uVar27 = 0x8009000e;
+  uVar8 = 0x8009000e;
+  goto LAB_7;
+  while (puVar21 = (uint *)((longlong)puVar21 + 2), puVar21 != (uint *)0xa) {
+LAB_18:
+    if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) != L"UI Policy"[(longlong)puVar21]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+        L"UI Policy"[(longlong)((longlong)puVar21 + 1)])) {
+      lVar20 = -1;
+      goto LAB_19;
+    }
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  local_c0 = CONCAT44(local_c0._4_4_,0xc);
+  local_d8 = 0x80000000;
+  if (param_5 < 0x14) {
+    uVar27 = 0x80090005;
+    uVar8 = 0x80090005;
+  }
+  else {
+    uVar10 = *param_4;
+    uStack_90 = param_4[1];
+    local_98 = uVar10;
+    if (uVar27 == (uStack_90 & 0xffffffff) + 0x14 +
+                  (uStack_90 >> 0x20) + (ulonglong)(uint)param_4[2]) {
+      local_98._4_4_ = (int)(uVar10 >> 0x20);
+      if (((uVar10 & 0xfffffff800000000) != 0) ||
+         ((((uVar10 & 0x400000000) != 0 &&
+           ((((uVar10 & 0xfffffffb00000000) != 0 || ((param_2[9] & 0xf) != 0)) || (param_2[8] == 1))
+           )) || ((uStack_90._4_4_ = (uint)(uStack_90 >> 0x20), bVar5 = 0x102 < uStack_90._4_4_,
+                  bVar5 || (0x2002 < (uint)param_4[2])))))) goto LAB_6;
+      if (*(longlong *)(param_2 + 0x38) == 0) {
+        if ((param_2[0x6b] & 1) == 0) goto LAB_20;
+        uVar27 = 0x80090029;
+        uVar8 = 0x80090029;
+      }
+      else if (*(longlong *)(param_2 + 0x68) == 0) {
+        if (local_98._4_4_ == 0) goto LAB_20;
+        uVar27 = 0x8009000b;
+        uVar8 = 0x8009000b;
+      }
+      else if (local_98._4_4_ == *(int *)(*(longlong *)(param_2 + 0x68) + 4)) {
+LAB_20:
+        if (*(longlong *)(param_2 + 0x68) != 0) {
+          RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
+        }
+        pvVar11 = (void *)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),
+                                          0,uVar27);
+        *(void **)(param_2 + 0x68) = pvVar11;
+        if (pvVar11 != (void *)0x0) {
+          param_2[0x6a] = param_5;
+          memcpy(pvVar11,param_4,uVar27);
+          goto LAB_5;
+        }
+        uVar27 = 0x8009000e;
+        uVar8 = 0x8009000e;
+      }
+      else {
+        uVar27 = 0x8009000b;
+        uVar8 = 0x8009000b;
+      }
+    }
+    else {
+      uVar27 = 0x80090005;
+      uVar8 = 0x80090005;
+    }
+  }
+  goto LAB_7;
+LAB_19:
+  if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) == L"SmartCardPin"[lVar20 + 1]) {
+    lVar20 = lVar20 + 2;
+    if (lVar20 != 0xd) goto code_r0x000180003dae;
+    if (0x7fffffff < param_5) goto LAB_6;
+    lVar20 = *(longlong *)(param_2 + 0x68);
+    if (param_2[0xb] != 0) {
+      if ((lVar20 == 0) || ((param_2[0x6b] & 1) == 0)) {
+        if ((param_4 == (ulonglong *)0x0) || ((param_5 == 2 && ((short)*param_4 == 0))))
+        goto LAB_16;
+        goto LAB_6;
+      }
+      if ((param_4 == (ulonglong *)0x0) || ((param_5 == 2 && ((short)*param_4 == 0)))) {
+        if (*(longlong *)(param_2 + 0x1c) == 0) {
+          uVar27 = 0x8009000b;
+          uVar8 = 0x8009000b;
+        }
+        else {
+          uVar8 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x88))();
+          uVar8 = uVar8 | 0x10000000;
+          uVar27 = (ulonglong)uVar8;
+          if (-1 < (int)uVar8) {
+            param_2[0x1c] = 0;
+            param_2[0x1d] = 0;
+            puVar21 = param_2 + 0x6c;
+            for (lVar20 = 0x40; lVar20 != 0; lVar20 = lVar20 + -1) {
+              *(undefined1 *)puVar21 = 0;
+              puVar21 = (uint *)((longlong)puVar21 + 1);
+            }
+            uVar27 = SKCacheRemove((longlong)param_2);
+            uVar8 = (uint)uVar27;
+            uVar27 = uVar27 & 0xffffffff;
+            puVar25 = auStackY_118;
+            if ((int)uVar8 < 0) {
+              if (uVar8 == 0x80090011) {
+                uVar27 = 0;
+                puVar25 = auStackY_118;
+                goto LAB_13;
               }
-              iVar5 = wcscmp((wchar_t *)param_3,L"HWND Handle");
-              uVar9 = local_90;
-              if (iVar5 == 0) {
-                if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                uVar6 = 0x11;
-                if (param_5 < 9) {
-                  memcpy(param_2 + 100,param_4,uVar14);
-                  local_c8 = local_c8 & 0x7fffffff;
-                  param_2[0x66] = param_5;
-                  goto LAB_3;
-                }
-                uVar16 = 0x80090005;
-                goto LAB_4;
-              }
-              uVar16 = *(ushort *)param_3 - 0x49;
-              if ((uVar16 == 0) && (uVar16 = *(ushort *)(param_3 + 2) - 0x56, uVar16 == 0)) {
-                uVar16 = (uint)*(ushort *)(param_3 + 4);
-              }
-              if (uVar16 == 0) {
-                if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                if (*(longlong *)(param_2 + 0x1c) == 0) {
-                  uVar14 = KspCheckStrongKeyAndUnprotect((ulonglong)param_2,(ulonglong)local_c8);
-                  param_4 = local_b8;
-                  uVar16 = (uint)uVar14;
-                  if ((int)(uint)uVar14 < 0) goto LAB_4;
-                }
-                uVar6 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x18))
-                                  (*(undefined8 *)(param_2 + 0x1c),L"IV",param_4,param_5);
-joined_r0x00018000fe4f:
-                puVar23 = auStackY_108;
-                if (-1 < (int)uVar6) goto LAB_5;
+              goto LAB_12;
+            }
+            goto LAB_13;
+          }
+        }
+      }
+      else {
+        if (*(longlong *)(param_2 + 0x1c) == 0) goto LAB_21;
+        uVar27 = 0x8009000b;
+        uVar8 = 0x8009000b;
+      }
+      goto LAB_7;
+    }
+    if (((lVar20 == 0) || ((*(byte *)(lVar20 + 4) & 2) == 0)) || ((param_2[0x6b] & 1) != 0)) {
+      uVar27 = 0x80090029;
+      uVar8 = 0x80090029;
+      goto LAB_7;
+    }
+    if ((param_4 == (ulonglong *)0x0) || ((param_5 == 2 && ((short)*param_4 == 0))))
+    goto LAB_6;
+LAB_21:
+    puVar21 = param_2 + 0x6b;
+    uVar27 = ComputeAndSetPasswordHashOnTheKey((longlong)param_2,(PUCHAR)param_4,param_5);
+    uVar8 = (uint)uVar27;
+    uVar27 = uVar27 & 0xffffffff;
+    if (uVar8 != 0) goto LAB_7;
+    if (param_2[0xb] == 0) {
+      *puVar21 = *puVar21 | 1;
+      local_c8[0] = 1;
+      uVar27 = SetUIKeyProperties((longlong)param_2,L"MSSP/UI Internal Flags",0x12,local_c8,4);
+      uVar8 = (uint)uVar27;
+      uVar27 = uVar27 & 0xffffffff;
+      if (uVar8 != 0) goto LAB_7;
+      *puVar21 = *puVar21 | 0x10;
+      goto LAB_22;
+    }
+    if (*(longlong *)(param_2 + 0x3c) == 0) {
+      if (*(longlong *)(param_2 + 0x40) != 0) {
+        DVar7 = UnprotectLegacyPrivateKey((longlong)param_2);
+        goto LAB_23;
+      }
+    }
+    else {
+      piVar12 = UnprotectPrivateKey((longlong)param_2);
+      DVar7 = (DWORD)piVar12;
+LAB_23:
+      DebugTraceError(DVar7,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
+                     );
+      if (DVar7 != 0) {
+        uVar27 = 0x80090033;
+        goto LAB_22;
+      }
+    }
+    DVar7 = SKCacheAdd((longlong)param_2);
+    uVar27 = (ulonglong)DVar7;
+    puVar25 = auStackY_118;
+    if (DVar7 == 0) {
+      param_2[0x6b] = param_2[0x6b] | 0x18;
+      puVar25 = auStackY_118;
+    }
+    goto LAB_13;
+  }
+  goto LAB_24;
+code_r0x000180003dae:
+  if (*(wchar_t *)(param_3 + lVar20 * 2) != L"SmartCardPin"[lVar20]) goto LAB_24;
+  goto LAB_19;
+LAB_16:
+  uVar27 = 0;
+  goto LAB_22;
+LAB_24:
+  lVar20 = -1;
+  do {
+    puVar21 = puVar13;
+    if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"PCP_CHANGEPASSWORD"[lVar20 + 1]) break;
+    lVar20 = lVar20 + 2;
+    if (lVar20 == 0x13) {
+      uVar27 = ChangePasswordOnTheKey((longlong)param_2,(short *)param_4,param_5);
+      uVar8 = (uint)uVar27;
+      uVar27 = uVar27 & 0xffffffff;
+      goto joined_r0x0001800040e7;
+    }
+  } while (*(wchar_t *)(param_3 + lVar20 * 2) == L"PCP_CHANGEPASSWORD"[lVar20]);
+  do {
+    if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) != L"Key Access Policy"[(longlong)puVar21])
+       || (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+           L"Key Access Policy"[(longlong)((longlong)puVar21 + 1)])) {
+      lVar20 = -1;
+      goto LAB_25;
+    }
+    puVar21 = (uint *)((longlong)puVar21 + 2);
+  } while (puVar21 != (uint *)0x12);
+  uVar8 = SetKeyAccessPolicy((longlong)param_2,(int *)param_4,param_5);
+  uVar27 = (ulonglong)uVar8;
+joined_r0x0001800040e7:
+  puVar25 = auStackY_118;
+  if (uVar8 == 0) goto LAB_13;
+LAB_12:
+  DebugTraceError(uVar8,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+  puVar25 = auStackY_118;
+  goto LAB_13;
+LAB_25:
+  puVar21 = puVar13;
+  if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"KDFKeySecret"[lVar20 + 1]) goto LAB_26;
+  lVar20 = lVar20 + 2;
+  if (lVar20 != 0xd) {
+    if (*(wchar_t *)(param_3 + lVar20 * 2) != L"KDFKeySecret"[lVar20]) goto LAB_26;
+    goto LAB_25;
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+  if ((*(int *)(*(longlong *)(param_2 + 0x10) + 8) != 7) && (param_2[0xb] == 1)) {
+    uVar27 = 0x32;
+    uVar8 = 0x32;
+    goto LAB_7;
+  }
+  uVar8 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x40))
+                    (*(undefined8 *)(param_2 + 0x26),param_2 + 0x1c,0);
+  uVar27 = (ulonglong)uVar8;
+  if ((int)uVar8 < 0) goto LAB_7;
+LAB_15:
+  uVar27 = 0;
+  goto LAB_22;
+  while (puVar21 = (uint *)((longlong)puVar21 + 2), puVar21 != (uint *)0x18) {
+LAB_26:
+    if ((*(wchar_t *)(param_3 + (longlong)puVar21 * 2) !=
+         L"SmartCardKeyCertificate"[(longlong)puVar21]) ||
+       (*(wchar_t *)(param_3 + (longlong)puVar21 * 2 + 2) !=
+        L"SmartCardKeyCertificate"[(longlong)((longlong)puVar21 + 1)])) {
+      lVar20 = -1;
+      goto LAB_27;
+    }
+  }
+  local_c0 = CONCAT44(local_c0._4_4_,0x18);
+  uVar27 = SetCertificateProperty((longlong)param_2,(BYTE *)param_4,param_5);
+  uVar8 = (uint)uVar27;
+  uVar27 = uVar27 & 0xffffffff;
+  if (uVar8 != 0) goto LAB_7;
+  local_d8 = local_d8 | 0x80000000;
+  if (*(longlong *)(param_2 + 0x38) != 0) {
+    uVar8 = WriteKeyToStore((longlong)param_2,0,0);
+    uVar27 = (ulonglong)uVar8;
+    if (uVar8 != 0) goto LAB_7;
+  }
+LAB_5:
+  local_a8 = param_2 + 0x48;
+  puVar21 = *(uint **)local_a8;
+  do {
+    puVar13 = puVar21;
+    if (puVar13 == local_a8) goto LAB_28;
+    puVar21 = *(uint **)puVar13;
+    pUVar28 = (PUCHAR)((longlong)puVar13 + (-0x94 - (longlong)param_3));
+    psVar14 = (short *)param_3;
+    do {
+      sVar1 = *psVar14;
+      sVar2 = *(short *)((longlong)psVar14 + (longlong)pUVar28);
+      if (sVar1 != sVar2) break;
+      psVar14 = psVar14 + 1;
+    } while (sVar2 != 0);
+  } while (sVar1 != sVar2);
+  if (puVar13 + -0x26 == (uint *)0x0) {
+LAB_28:
+    uVar27 = (ulonglong)local_b4;
+    pUVar28 = (PUCHAR)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
+                                      uVar27 + 0xa8);
+    if (pUVar28 == (PUCHAR)0x0) {
+      uVar27 = 0x8009000e;
+    }
+    else {
+      psVar14 = (short *)(pUVar28 + 4);
+      *(int *)pUVar28 = (int)local_c0;
+      lVar29 = (longlong)param_3 - (longlong)psVar14;
+      lVar20 = 0x41;
+      do {
+        if ((lVar20 == -0x7fffffbd) || (sVar1 = *(short *)(lVar29 + (longlong)psVar14), sVar1 == 0))
+        break;
+        *psVar14 = sVar1;
+        psVar14 = psVar14 + 1;
+        lVar20 = lVar20 + -1;
+      } while (lVar20 != 0);
+      psVar15 = psVar14 + -1;
+      if (lVar20 != 0) {
+        psVar15 = psVar14;
+      }
+      param_3 = (char *)0x0;
+      *psVar15 = 0;
+      if (lVar20 != 0) {
+        *(uint *)(pUVar28 + 0x88) = local_b4;
+        pUVar28[0x8c] = '\0';
+        pUVar28[0x8d] = '\0';
+        pUVar28[0x8e] = '\0';
+        pUVar28[0x8f] = '\0';
+        *(uint *)(pUVar28 + 0x90) = (uint)((local_d8 & 0xc0000000) != 0);
+        memcpy(pUVar28 + 0xa8,param_4,uVar27);
+        pUVar16 = pUVar28 + 0x98;
+        pUVar28[0x94] = '\x01';
+        pUVar28[0x95] = '\0';
+        pUVar28[0x96] = '\0';
+        pUVar28[0x97] = '\0';
+        pcVar23 = *(char **)(local_a8 + 2);
+        puVar21 = local_a8;
+        pcVar30 = param_3;
+        if (*(uint **)pcVar23 != local_a8) goto LAB_29;
+        goto LAB_30;
+      }
+      RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,pUVar28);
+      uVar27 = 0x80090027;
+    }
+    param_3 = "Status";
+    DebugTraceError((int)uVar27,"Status",
+                    "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+    puVar24 = auStackY_118;
+  }
+  else {
+    pcVar23 = *(char **)puVar13;
+    if ((*(uint **)(pcVar23 + 8) == puVar13) &&
+       (puVar3 = *(undefined8 **)(puVar13 + 2), (uint *)*puVar3 == puVar13)) {
+      *puVar3 = pcVar23;
+      *(undefined8 **)(pcVar23 + 8) = puVar3;
+      RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,puVar13 + -0x26);
+      goto LAB_28;
+    }
+LAB_29:
+    pcVar4 = (code *)swi(0x29);
+    pUVar16 = (PUCHAR)(*pcVar4)();
+    puVar24 = auStackY_110;
+    pcVar30 = param_3;
+LAB_30:
+    *(uint **)pUVar16 = puVar21;
+    *(char **)(pUVar16 + 8) = pcVar23;
+    *(PUCHAR *)pcVar23 = pUVar16;
+    *(PUCHAR *)(puVar21 + 2) = pUVar16;
+    param_3 = pcVar23;
+    if (*(int *)(pUVar28 + 0x90) != (int)pcVar30) {
+      if ((param_2[0x6b] & 0x20) != 0) {
+        param_3 = "Status";
+        uVar27 = 0x80090010;
+        *(undefined8 *)(puVar24 + -8) = 0x1800048a0;
+        DebugTraceError(0x80090010,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        goto LAB_31;
+      }
+      if (*(char **)(param_2 + 0x38) != pcVar30) {
+        param_3 = (char *)0x0;
+        *(undefined8 *)(puVar24 + -8) = 0x1800048b8;
+        uVar8 = WriteKeyToStore((longlong)param_2,0,0);
+        uVar27 = (ulonglong)uVar8;
+        if (uVar8 != 0) {
+          param_3 = "Status";
+          *(undefined8 *)(puVar24 + -8) = 0x1800048d1;
+          DebugTraceError(uVar8,"Status",
+                          "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+          goto LAB_31;
+        }
+      }
+    }
+    uVar27 = (ulonglong)pcVar30 & 0xffffffff;
+  }
+LAB_31:
+  puVar25 = puVar24;
+  if (local_c8[0] != 0) goto LAB_32;
+  goto LAB_13;
+  while( true ) {
+    lVar20 = lVar20 + 2;
+    if (lVar20 == 0xd) {
+      if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_6;
+      if (param_2[0xb] == 1) {
+        uVar27 = 0x80090026;
+        uVar8 = 0x80090026;
+        goto LAB_7;
+      }
+      if (1 < *(int *)(*(longlong *)(param_2 + 0x10) + 0x20) - 0x3000aU) {
+        uVar27 = 0x80090026;
+        uVar8 = 0x80090026;
+        goto LAB_7;
+      }
+      if (*(longlong *)(param_2 + 0x8a) != 0) {
+        uVar27 = 0x80090029;
+        uVar8 = 0x80090029;
+        goto LAB_7;
+      }
+      local_b0 = (BCRYPT_HANDLE)0x0;
+      local_c8[0] = 0;
+      local_c0 = (ulonglong)local_c0._4_4_ << 0x20;
+      local_b8 = 0;
+      uVar8 = BCryptGenerateKeyPair(*(BCRYPT_ALG_HANDLE *)(param_2 + 0x16),&local_b0,0,0);
+      uVar27 = (ulonglong)uVar8;
+      if (uVar8 != 0) {
+        DebugTraceError(uVar8,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        goto LAB_33;
+      }
+      uVar8 = BCryptSetProperty(local_b0,(LPCWSTR)param_3,(PUCHAR)param_4,local_b4,0);
+      uVar27 = (ulonglong)uVar8;
+      if (uVar8 != 0) {
+        DebugTraceError(uVar8,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        goto LAB_33;
+      }
+      uVar8 = BCryptGetProperty(local_b0,L"PublicKeyLength",(PUCHAR)local_c8,4,(ULONG *)&local_c0,0)
+      ;
+      uVar27 = (ulonglong)uVar8;
+      puVar13 = (uint *)0x0;
+      if (uVar8 != 0) {
+        DebugTraceError(uVar8,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        goto LAB_33;
+      }
+      uVar8 = BCryptGetProperty(local_b0,L"ECCParameters",(PUCHAR)0x0,0,&local_b8,0);
+      uVar27 = (ulonglong)uVar8;
+      if (uVar8 != 0) {
+        DebugTraceError(uVar8,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        goto LAB_33;
+      }
+      puVar13 = (uint *)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
+                                        local_b8);
+      local_a8 = puVar13;
+      if (puVar13 == (uint *)0x0) {
+        uVar27 = 0x8009000e;
+        DebugTraceError(0x8009000e,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        goto LAB_33;
+      }
+      uVar8 = BCryptGetProperty(local_b0,L"ECCParameters",(PUCHAR)puVar13,local_b8,&local_b8,0);
+      uVar27 = (ulonglong)uVar8;
+      if (uVar8 == 0) {
+        lVar20 = -1;
+        goto LAB_34;
+      }
+      DebugTraceError(uVar8,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
+                     );
+      goto LAB_33;
+    }
+    if (*(wchar_t *)(param_3 + lVar20 * 2) != L"ECCCurveName"[lVar20]) break;
+LAB_27:
+    if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"ECCCurveName"[lVar20 + 1]) break;
+  }
+  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) {
 LAB_6:
-                pcVar28 = "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c";
-                uVar16 = uVar6;
-                goto LAB_7;
-              }
-              iVar5 = wcscmp((wchar_t *)param_3,L"Chaining Mode");
-              if (iVar5 == 0) {
-                uVar9 = local_90;
-                if ((param_4 != (ulonglong *)0x0) && (param_5 < 0x80000000)) {
-                  if (*(longlong *)(param_2 + 0x1c) == 0) {
-                    uVar14 = KspCheckStrongKeyAndUnprotect((ulonglong)param_2,(ulonglong)local_c8);
-                    param_4 = local_b8;
-                    uVar16 = (uint)uVar14;
-                    if ((int)(uint)uVar14 < 0) goto LAB_4;
-                  }
-                  uVar6 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x18))
-                                    (*(undefined8 *)(param_2 + 0x1c),L"ChainingMode",param_4,param_5
-                                    );
-                  goto joined_r0x00018000fe4f;
-                }
-LAB_2:
-                local_90 = uVar9;
-                uVar16 = 0x80090027;
-                goto LAB_4;
-              }
-              iVar5 = wcscmp((wchar_t *)param_3,L"Length");
-              if (iVar5 == 0) {
-                uVar9 = local_90;
-                if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                if (param_5 == 4) {
-                  if (*(longlong *)(param_2 + 0x38) == 0) {
-                    uVar18 = param_2[7];
-                    uVar14 = *param_4;
-                    param_2[7] = (uint)uVar14;
-                    uVar6 = KspValidateKeyLength((longlong)param_2,(uint)uVar14);
-                    uVar16 = uVar6;
-                    if (uVar6 == 0) {
-                      if (*(int *)(*(longlong *)(param_2 + 0x10) + 0x20) - 0x3000aU < 2) {
-                        uVar9 = local_90;
-                        if ((*(longlong *)(param_2 + 0x8a) == 0) || (uVar18 != param_2[7]))
-                        goto LAB_2;
-                      }
-                      else {
-                        puVar23 = auStackY_108;
-                        if ((*(longlong *)(param_2 + 0x1c) != 0) &&
-                           (uVar6 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x18))
-                                              (*(longlong *)(param_2 + 0x1c),L"KeyLength",local_b8,4
-                                              ), puVar23 = auStackY_108, (int)uVar6 < 0))
-                        goto LAB_6;
-                      }
-                      goto LAB_5;
-                    }
-                  }
-                  else {
-                    uVar16 = 0x8009000b;
-                  }
-                }
-                else {
-                  uVar16 = 0x80090005;
-                }
-                goto LAB_4;
-              }
-              iVar5 = wcscmp((wchar_t *)param_3,L"Security Descr");
-              if (iVar5 == 0) {
-                uVar9 = local_90;
-                if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                if (param_5 == 0) {
-                  uVar16 = 0x80090005;
-                }
-                else {
-                  BVar7 = IsValidSecurityDescriptor(param_4);
-                  if (BVar7 == 0) {
-                    uVar16 = 0x80090005;
-                  }
-                  else {
-                    DVar8 = GetSecurityDescriptorLength(param_4);
-                    if (param_5 < DVar8) {
-                      uVar16 = 0x80090005;
-                    }
-                    else {
-                      param_2[0x43] = local_c8 & 0x7fffffff;
-                      if (*(longlong *)(param_2 + 0x44) != 0) {
-                        RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
-                      }
-                      pvVar10 = (void *)RtlAllocateHeap(*(undefined8 *)
-                                                         ((longlong)ProcessEnvironmentBlock + 0x30),
-                                                        0,uVar14);
-                      *(void **)(param_2 + 0x44) = pvVar10;
-                      if (pvVar10 == (void *)0x0) {
-                        uVar16 = 0x8009000e;
-                      }
-                      else {
-                        param_2[0x46] = param_5;
-                        memcpy(pvVar10,param_4,uVar14);
-                        if ((*(longlong *)(param_2 + 0x38) == 0) ||
-                           (uVar16 = WriteKeyToStore((longlong)param_2,1,0), uVar16 == 0))
-                        goto LAB_8;
-                      }
-                    }
-                  }
-                }
-                goto LAB_4;
-              }
-              iVar5 = wcscmp((wchar_t *)param_3,L"MSSP/UI Internal Flags");
-              if (iVar5 != 0) {
-                iVar5 = wcscmp((wchar_t *)param_3,L"MSSP/UI Password Hash");
-                if (iVar5 == 0) {
-                  uVar9 = local_90;
-                  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                  uVar6 = 0x13;
-                  if (param_5 < 0x41) {
-                    if ((param_2[0x6b] & 2) != 0) {
-                      puVar27 = param_2 + 0x6c;
-                      for (lVar20 = 0x40; lVar20 != 0; lVar20 = lVar20 + -1) {
-                        *(undefined1 *)puVar27 = 0;
-                        puVar27 = (uint *)((longlong)puVar27 + 1);
-                      }
-                      memcpy(param_2 + 0x6c,local_b8,uVar14);
-                      local_c8 = local_c8 & 0x7fffffff;
-                      goto LAB_3;
-                    }
-                    uVar16 = 0x80090029;
-                  }
-                  else {
-                    uVar16 = 0x80090005;
-                  }
-                }
-                else {
-                  iVar5 = wcscmp((wchar_t *)param_3,L"Use Context");
-                  if (iVar5 == 0) {
-                    uVar9 = local_90;
-                    if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-                    local_c8 = local_c8 & 0x7fffffff;
-                    uVar6 = 0x15;
-                    if (*(longlong *)(param_2 + 0x7e) != 0) {
-                      RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0);
-                    }
-                    pvVar10 = (void *)RtlAllocateHeap(*(undefined8 *)
-                                                       ((longlong)ProcessEnvironmentBlock + 0x30),0,
-                                                      uVar14);
-                    *(void **)(param_2 + 0x7e) = pvVar10;
-                    if (pvVar10 != (void *)0x0) {
-                      memcpy(pvVar10,param_4,uVar14);
-                      goto LAB_3;
-                    }
-                    uVar16 = 0x8009000e;
-                  }
-                  else {
-                    iVar5 = wcscmp((wchar_t *)param_3,L"UI Policy");
-                    if (iVar5 == 0) {
-                      uVar9 = local_90;
-                      if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5))
-                      goto LAB_2;
-                      local_c8 = 0x80000000;
-                      uVar6 = 0xc;
-                      if (param_5 < 0x14) {
-                        uVar16 = 0x80090005;
-                      }
-                      else {
-                        uVar9 = *param_4;
-                        uStack_88 = param_4[1];
-                        local_90 = uVar9;
-                        if (uVar14 == (uStack_88 & 0xffffffff) + 0x14 +
-                                      (uStack_88 >> 0x20) + (ulonglong)(uint)param_4[2]) {
-                          local_90._4_4_ = (int)(uVar9 >> 0x20);
-                          if (((uVar9 & 0xfffffff800000000) != 0) ||
-                             ((((uVar9 & 0x400000000) != 0 &&
-                               ((((uVar9 & 0xfffffffb00000000) != 0 || ((param_2[9] & 0xf) != 0)) ||
-                                (param_2[8] == 1)))) ||
-                              ((uStack_88._4_4_ = (uint)(uStack_88 >> 0x20),
-                               bVar4 = 0x102 < uStack_88._4_4_, bVar4 || (0x2002 < (uint)param_4[2])
-                               ))))) goto LAB_2;
-                          if (*(longlong *)(param_2 + 0x38) == 0) {
-                            if ((param_2[0x6b] & 1) == 0) goto LAB_9;
-                            uVar16 = 0x80090029;
-                          }
-                          else if (*(longlong *)(param_2 + 0x68) == 0) {
-                            if (local_90._4_4_ == 0) goto LAB_9;
-                            uVar16 = 0x8009000b;
-                          }
-                          else if (local_90._4_4_ == *(int *)(*(longlong *)(param_2 + 0x68) + 4)) {
-LAB_9:
-                            if (*(longlong *)(param_2 + 0x68) != 0) {
-                              RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),
-                                          0);
-                            }
-                            pvVar10 = (void *)RtlAllocateHeap(*(undefined8 *)
-                                                               ((longlong)ProcessEnvironmentBlock +
-                                                               0x30),0,uVar14);
-                            *(void **)(param_2 + 0x68) = pvVar10;
-                            if (pvVar10 != (void *)0x0) {
-                              param_2[0x6a] = param_5;
-                              memcpy(pvVar10,local_b8,uVar14);
-                              goto LAB_3;
-                            }
-                            uVar16 = 0x8009000e;
-                          }
-                          else {
-                            uVar16 = 0x8009000b;
-                          }
-                        }
-                        else {
-                          uVar16 = 0x80090005;
-                        }
-                      }
-                    }
-                    else {
-                      iVar5 = wcscmp((wchar_t *)param_3,L"SmartCardPin");
-                      if (iVar5 != 0) {
-                        iVar5 = wcscmp((wchar_t *)param_3,L"PCP_CHANGEPASSWORD");
-                        if (iVar5 == 0) {
-                          uVar14 = ChangePasswordOnTheKey
-                                             ((longlong)param_2,(short *)param_4,param_5);
-                          uVar6 = (uint)uVar14;
-                          puVar23 = auStackY_108;
-                          if (uVar6 != 0) goto LAB_6;
-                        }
-                        else {
-                          iVar5 = wcscmp((wchar_t *)param_3,L"Key Access Policy");
-                          if (iVar5 != 0) {
-                            iVar5 = wcscmp((wchar_t *)param_3,L"KDFKeySecret");
-                            if (iVar5 == 0) {
-                              uVar9 = local_90;
-                              if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5))
-                              goto LAB_2;
-                              if ((*(int *)(*(longlong *)(param_2 + 0x10) + 8) == 7) ||
-                                 (param_2[0xb] != 1)) {
-                                uVar16 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x40))
-                                                   (*(undefined8 *)(param_2 + 0x26),param_2 + 0x1c,0
-                                                    ,0);
-                                if (-1 < (int)uVar16) goto LAB_8;
-                              }
-                              else {
-                                uVar16 = 0x32;
-                              }
-                            }
-                            else {
-                              iVar5 = wcscmp((wchar_t *)param_3,L"SmartCardKeyCertificate");
-                              if (iVar5 == 0) {
-                                uVar6 = 0x18;
-                                uVar15 = SetCertificateProperty
-                                                   ((longlong)param_2,(BYTE *)param_4,param_5);
-                                uVar16 = (uint)uVar15;
-                                if (((uint)uVar15 == 0) &&
-                                   ((local_c8 = local_c8 | 0x80000000,
-                                    *(longlong *)(param_2 + 0x38) == 0 ||
-                                    (uVar16 = WriteKeyToStore((longlong)param_2,0,0), uVar16 == 0)))
-                                   ) goto LAB_3;
-                              }
-                              else {
-                                iVar5 = wcscmp((wchar_t *)param_3,L"ECCCurveName");
-                                uVar9 = local_90;
-                                if (iVar5 != 0) {
-                                  if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5))
-                                  goto LAB_2;
-                                  uVar14 = SetPrivateKeyProperty
-                                                     ((longlong)param_2,(wchar_t *)param_3,
-                                                      (uint *)param_4,param_5);
-                                  uVar6 = (uint)uVar14;
-                                  puVar22 = auStackY_108;
-                                  if (uVar6 != 0) {
-                                    param_3 = "Status";
-                                    DebugTraceError(uVar6,"Status",
-                                                                                                        
-                                                  "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
-                                                  );
-                                    puVar22 = auStackY_108;
-                                  }
-                                  goto LAB_10;
-                                }
-                                if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5))
-                                goto LAB_2;
-                                if (param_2[0xb] == 1) {
-                                  uVar16 = 0x80090026;
-                                }
-                                else if (*(int *)(*(longlong *)(param_2 + 0x10) + 0x20) - 0x3000aU <
-                                         2) {
-                                  if (*(longlong *)(param_2 + 0x8a) == 0) {
-                                    local_a8 = (BCRYPT_HANDLE)0x0;
-                                    local_c0[0] = 0;
-                                    local_a0[0] = 0;
-                                    local_c4 = 0;
-                                    uVar16 = BCryptGenerateKeyPair
-                                                       (*(BCRYPT_ALG_HANDLE *)(param_2 + 0x16),
-                                                        &local_a8,0,0);
-                                    pbOutput = (PUCHAR)0x0;
-                                    if ((((uVar16 == 0) &&
-                                         (uVar16 = BCryptSetProperty(local_a8,(LPCWSTR)param_3,
-                                                                     (PUCHAR)local_b8,param_5,0),
-                                         uVar16 == 0)) &&
-                                        (uVar16 = BCryptGetProperty(local_a8,L"PublicKeyLength",
-                                                                    (PUCHAR)local_c0,4,local_a0,0),
-                                        pbOutput = (PUCHAR)0x0, uVar16 == 0)) &&
-                                       (uVar16 = BCryptGetProperty(local_a8,L"ECCParameters",
-                                                                   (PUCHAR)0x0,0,&local_c4,0),
-                                       uVar16 == 0)) {
-                                      pbOutput = (PUCHAR)RtlAllocateHeap(*(undefined8 *)
-                                                                          ((longlong)
-                                                                           ProcessEnvironmentBlock +
-                                                                          0x30),0,local_c4);
-                                      if (pbOutput == (PUCHAR)0x0) {
-                                        uVar16 = 0x8009000e;
-                                        goto LAB_11;
-                                      }
-                                      uVar16 = BCryptGetProperty(local_a8,L"ECCParameters",pbOutput,
-                                                                 local_c4,&local_c4,0);
-                                      if (uVar16 != 0) goto LAB_11;
-                                      iVar5 = wcscmp((wchar_t *)param_3,L"ECCCurveName");
-                                      if (iVar5 == 0) {
-                                        pvVar10 = (void *)RtlAllocateHeap(*(undefined8 *)
-                                                                           ((longlong)
-                                                                            ProcessEnvironmentBlock
-                                                                           + 0x30),0,uVar14);
-                                        *(void **)(param_2 + 0x88) = pvVar10;
-                                        if (pvVar10 != (void *)0x0) {
-                                          memcpy(pvVar10,local_b8,uVar14);
-                                          goto LAB_12;
-                                        }
-                                        uVar16 = 0x8009000e;
-                                        DebugTraceError(0x8009000e,"Status",
-                                                                                                                
-                                                  "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
-                                                  );
-                                      }
-                                      else {
-LAB_12:
-                                        param_2[7] = local_c0[0];
-                                        *(PUCHAR *)(param_2 + 0x8a) = pbOutput;
-                                        pbOutput = (PUCHAR)0x0;
-                                        param_2[0x8c] = local_c4;
-                                      }
-                                    }
-                                    else {
-LAB_11:
-                                      DebugTraceError(uVar16,"Status",
-                                                                                                            
-                                                  "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
-                                                  );
-                                    }
-                                    if (local_a8 != (BCRYPT_KEY_HANDLE)0x0) {
-                                      BCryptDestroyKey(local_a8);
-                                    }
-                                    if (pbOutput != (PUCHAR)0x0) {
-                                      RtlFreeHeap(*(undefined8 *)
-                                                   ((longlong)ProcessEnvironmentBlock + 0x30),0,
-                                                  pbOutput);
-                                    }
-                                    if (uVar16 == 0) {
-                                      local_c0[0] = 1;
-                                      uVar6 = 0x19;
-                                      local_c8 = local_c8 | 0x80000000;
-                                      goto LAB_3;
-                                    }
-                                  }
-                                  else {
-                                    uVar16 = 0x80090029;
-                                  }
-                                }
-                                else {
-                                  uVar16 = 0x80090026;
-                                }
-                              }
-                            }
-                            goto LAB_4;
-                          }
-                          DVar8 = SetKeyAccessPolicy((longlong)param_2,(int *)param_4,param_5);
-                          uVar6 = 0;
-                          puVar23 = auStackY_108;
-                          if (DVar8 != 0) {
-                            uVar6 = FUN_18000fe5d();
-                            return uVar6;
-                          }
-                        }
-                        goto LAB_5;
-                      }
-                      uVar9 = local_90;
-                      if (0x7fffffff < param_5) goto LAB_2;
-                      lVar20 = *(longlong *)(param_2 + 0x68);
-                      if (param_2[0xb] == 0) {
-                        if (((lVar20 == 0) || ((*(byte *)(lVar20 + 4) & 2) == 0)) ||
-                           ((param_2[0x6b] & 1) != 0)) {
-                          uVar16 = 0x80090029;
-                        }
-                        else {
-                          if ((param_4 == (ulonglong *)0x0) ||
-                             ((param_5 == 2 && ((short)*param_4 == 0)))) goto LAB_2;
+    local_98 = uVar10;
+    uVar8 = 0x80090027;
+    uVar27 = 0x80090027;
+    goto LAB_7;
+  }
+  uVar10 = SetPrivateKeyProperty((longlong)param_2,(wchar_t *)param_3,(uint *)param_4,param_5);
+  uVar27 = uVar10 & 0xffffffff;
+  puVar24 = auStackY_118;
+  if ((int)uVar10 != 0) {
+    param_3 = "Status";
+    DebugTraceError((int)uVar10,"Status",
+                    "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+    puVar24 = auStackY_118;
+  }
+LAB_32:
+  puVar25 = puVar24;
+  if ((int)uVar27 == 0) {
+    pwVar31 = L"UNKNOWN";
+    local_98 = 0;
+    uStack_90 = 0;
+    local_88 = 0;
+    uStack_80 = 0;
+    local_78 = 0;
+    uStack_70 = 0;
+    local_68 = 0;
+    uStack_60 = 0;
+    if (*(undefined8 **)(param_2 + 0x10) != (undefined8 *)0x0) {
+      pwVar31 = (wchar_t *)**(undefined8 **)(param_2 + 0x10);
+    }
+    uVar8 = param_2[8];
+    lVar20 = *(longlong *)(param_2 + 2);
+    if (lVar20 == 0) {
+      if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&
+         ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) {
+        uVar17 = *(undefined8 *)(WPP_GLOBAL_Control + 0x10);
+        *(undefined4 *)(puVar24 + 0x30) = 0x13f;
+        *(char **)(puVar24 + 0x28) = "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c";
+        *(undefined4 *)(puVar24 + 0x20) = 0xc000000d;
+        *(undefined8 *)(puVar24 + -8) = 0x180004368;
+        WPP_SF_sDsd(uVar17,param_3,"onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c",
+                    "Status",*(undefined8 *)(puVar24 + 0x20),*(char **)(puVar24 + 0x28));
+      }
+    }
+    else {
+      *(undefined8 *)(puVar24 + -8) = 0x1800048fe;
+      uVar17 = CryptAuditTranslateString(0x9a1,(STRSAFE_LPWSTR)&local_98);
+      if ((int)uVar17 < 0) {
+        *(undefined8 *)(puVar24 + -8) = 0x180004919;
+        DebugTraceError((int)uVar17,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c");
+      }
+      else {
+        *(undefined8 *)(puVar24 + -8) = 0x18000492d;
+        uVar17 = CryptAuditTranslateString(0x9c4 - (uVar8 != 0),(STRSAFE_LPWSTR)&local_78);
+        if ((int)uVar17 < 0) {
+          *(undefined8 *)(puVar24 + -8) = 0x180004948;
+          DebugTraceError((int)uVar17,"Status",
+                          "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c");
+        }
+        else if ((g_pAuditingFuncs != 0) &&
+                (pcVar4 = *(code **)(g_pAuditingFuncs + 0x18), pcVar4 != (code *)0x0)) {
+          *(undefined4 *)(puVar24 + 0x30) = 0;
+          *(undefined8 **)(puVar24 + 0x28) = &local_98;
+          *(undefined8 **)(puVar24 + 0x20) = &local_78;
+          *(undefined8 *)(puVar24 + -8) = 0x1800049a4;
+          iVar9 = (*pcVar4)(1,L"Microsoft Software Key Storage Provider",pwVar31,lVar20);
+          if (iVar9 < 0) {
+            *(undefined8 *)(puVar24 + -8) = 0x1800049bf;
+            DebugTraceError(iVar9,"Status",
+                            "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c");
+          }
+        }
+      }
+    }
+  }
+  else {
+    *(int *)(puVar24 + 0x20) = (int)uVar27;
+    *(undefined8 *)(puVar24 + -8) = 0x1800049d5;
+    KspCryptAuditKeyMigrationOperation
+              (0,param_3,(longlong)param_2,0x9a1,*(undefined4 *)(puVar24 + 0x20));
+  }
+  goto LAB_13;
+  while( true ) {
+    lVar20 = lVar20 + 2;
+    if (lVar20 == 0xd) {
+      uVar10 = (ulonglong)local_b4;
+      pvVar11 = (void *)RtlAllocateHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,
+                                        uVar10);
+      *(void **)(param_2 + 0x88) = pvVar11;
+      if (pvVar11 == (void *)0x0) {
+        uVar27 = 0x8009000e;
+        DebugTraceError(0x8009000e,"Status",
+                        "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+        puVar13 = local_a8;
+        goto LAB_33;
+      }
+      memcpy(pvVar11,param_4,uVar10);
+      puVar13 = local_a8;
+      break;
+    }
+    if (*(wchar_t *)(param_3 + lVar20 * 2) != L"ECCCurveName"[lVar20]) break;
+LAB_34:
+    if (*(wchar_t *)(param_3 + lVar20 * 2 + 2) != L"ECCCurveName"[lVar20 + 1]) break;
+  }
+  param_2[7] = local_c8[0];
+  param_2[0x8c] = local_b8;
+  *(uint **)(param_2 + 0x8a) = puVar13;
+  puVar13 = (uint *)0x0;
+LAB_33:
+  if (local_b0 != (BCRYPT_KEY_HANDLE)0x0) {
+    BCryptDestroyKey(local_b0);
+  }
+  if (puVar13 != (uint *)0x0) {
+    RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,puVar13);
+  }
+  uVar8 = (uint)uVar27;
+  if (uVar8 == 0) {
+    local_d8 = local_d8 | 0x80000000;
+    local_c8[0] = 1;
+    local_c0 = CONCAT44(local_c0._4_4_,0x19);
+    goto LAB_5;
+  }
+LAB_7:
+  DebugTraceError(uVar8,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
+LAB_22:
+  puVar25 = auStackY_118;
 LAB_13:
-                          puVar27 = param_2 + 0x6b;
-                          uVar14 = ComputeAndSetPasswordHashOnTheKey
-                                             ((longlong)param_2,(PUCHAR)param_4,param_5);
-                          uVar16 = (uint)uVar14;
-                          if ((uint)uVar14 == 0) {
-                            if (param_2[0xb] != 0) {
-                              if (*(longlong *)(param_2 + 0x3c) == 0) {
-                                if (*(longlong *)(param_2 + 0x40) != 0) {
-                                  DVar8 = UnprotectLegacyPrivateKey((longlong)param_2);
-                                  goto LAB_14;
-                                }
-                              }
-                              else {
-                                piVar13 = UnprotectPrivateKey((longlong)param_2);
-                                DVar8 = (DWORD)piVar13;
-LAB_14:
-                                DebugTraceError(DVar8,"Status",
-                                                "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
-                                               );
-                                if (DVar8 != 0) {
-                                  uVar6 = 0x80090033;
-                                  goto LAB_8;
-                                }
-                              }
-                              uVar6 = SKCacheAdd((longlong)param_2);
-                              puVar23 = auStackY_108;
-                              if (uVar6 == 0) {
-                                param_2[0x6b] = param_2[0x6b] | 0x18;
-                                puVar23 = auStackY_108;
-                              }
-                              goto LAB_5;
-                            }
-                            *puVar27 = *puVar27 | 1;
-                            local_b0[0] = 1;
-                            uVar14 = SetUIKeyProperties((longlong)param_2,L"MSSP/UI Internal Flags",
-                                                        0x12,local_b0,4);
-                            uVar6 = (uint)uVar14;
-                            uVar16 = uVar6;
-                            if (uVar6 == 0) {
-                              *puVar27 = *puVar27 | 0x10;
-                              goto LAB_8;
-                            }
-                          }
-                        }
-                      }
-                      else {
-                        if ((lVar20 == 0) || ((param_2[0x6b] & 1) == 0)) {
-                          if ((param_4 == (ulonglong *)0x0) ||
-                             ((param_5 == 2 && ((short)*param_4 == 0)))) goto LAB_8;
-                          goto LAB_2;
-                        }
-                        if ((param_4 == (ulonglong *)0x0) ||
-                           ((param_5 == 2 && ((short)*param_4 == 0)))) {
-                          if (*(longlong *)(param_2 + 0x1c) == 0) {
-                            uVar16 = 0x8009000b;
-                          }
-                          else {
-                            uVar6 = (**(code **)(*(longlong *)(param_2 + 0x2a) + 0x88))();
-                            uVar16 = uVar6 | 0x10000000;
-                            if (-1 < (int)(uVar6 | 0x10000000)) {
-                              param_2[0x1c] = 0;
-                              param_2[0x1d] = 0;
-                              puVar27 = param_2 + 0x6c;
-                              for (lVar20 = 0x40; lVar20 != 0; lVar20 = lVar20 + -1) {
-                                *(undefined1 *)puVar27 = 0;
-                                puVar27 = (uint *)((longlong)puVar27 + 1);
-                              }
-                              uVar15 = SKCacheRemove((longlong)param_2);
-                              uVar6 = (uint)uVar15;
-                              puVar23 = auStackY_108;
-                              if ((int)uVar6 < 0) {
-                                if (uVar6 != 0x80090011) goto LAB_6;
-                                uVar6 = 0;
-                                puVar23 = auStackY_108;
-                              }
-                              goto LAB_5;
-                            }
-                          }
-                        }
-                        else {
-                          if (*(longlong *)(param_2 + 0x1c) == 0) goto LAB_13;
-                          uVar16 = 0x8009000b;
-                        }
-                      }
-                    }
-                  }
-                }
-                goto LAB_4;
-              }
-              uVar9 = local_90;
-              if (((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) ||
-                 ((uVar6 = 0x12, param_5 != 4 ||
-                  (uVar16 = (uint)*param_4, (uVar16 & 0xffffffc0) != 0)))) goto LAB_2;
-              if (*(longlong *)(param_2 + 0x38) == 0) {
-                local_c8 = local_c8 | 0x80000000;
-                *(uint *)param_4 = uVar16 & 1;
-                param_2[0x6b] = uVar16;
-                goto LAB_3;
-              }
-              param_2[0x6b] = (uVar16 ^ param_2[0x6b]) & 1 ^ uVar16;
-              uVar6 = 0;
-            }
+  *(undefined8 *)(puVar25 + -8) = 0x180004a08;
+  RtlReleaseResource(local_a0);
 LAB_8:
-            puVar23 = auStackY_108;
-          }
-          else {
-            uVar9 = local_90;
-            if ((param_4 == (ulonglong *)0x0) || (0x7fffffff < param_5)) goto LAB_2;
-LAB_3:
-            puVar27 = param_2 + 0x48;
-            puVar11 = *(uint **)puVar27;
-            do {
-              if (puVar11 == puVar27) goto LAB_15;
-              puVar12 = puVar11 + -0x26;
-              psVar19 = (short *)param_3;
-              do {
-                sVar1 = *psVar19;
-                sVar2 = *(short *)((longlong)psVar19 +
-                                  (longlong)puVar11 + (-0x94 - (longlong)param_3));
-                if (sVar1 != sVar2) break;
-                psVar19 = psVar19 + 1;
-              } while (sVar2 != 0);
-              puVar11 = *(uint **)puVar11;
-            } while (sVar1 != sVar2);
-            if (puVar12 != (uint *)0x0) {
-              uVar6 = FUN_1800109c2(psVar19,0,(longlong)puVar12);
-              return uVar6;
-            }
-LAB_15:
-            uVar14 = (ulonglong)local_b0[0];
-            puVar11 = (uint *)RtlAllocateHeap(*(undefined8 *)
-                                               ((longlong)ProcessEnvironmentBlock + 0x30),0,
-                                              uVar14 + 0xa8);
-            if (puVar11 == (uint *)0x0) {
-              uVar6 = 0x8009000e;
-LAB_16:
-              param_3 = "Status";
-              DebugTraceError(uVar6,"Status",
-                              "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-              puVar23 = auStackY_108;
-            }
-            else {
-              *puVar11 = uVar6;
-              lVar20 = 0x41;
-              puVar12 = puVar11 + 1;
-              lVar21 = (longlong)param_3 - (longlong)puVar12;
-              while (lVar20 != -0x7fffffbd) {
-                sVar1 = *(short *)((longlong)puVar12 + lVar21);
-                if (sVar1 == 0) {
-                  if (lVar20 != 0) break;
-                  *(short *)((longlong)puVar12 + -2) = 0;
-                  RtlFreeHeap(*(undefined8 *)((longlong)ProcessEnvironmentBlock + 0x30),0,puVar11);
-                  uVar6 = 0x80090027;
-                  goto LAB_16;
-                }
-                *(short *)puVar12 = sVar1;
-                puVar12 = (uint *)((longlong)puVar12 + 2);
-                lVar20 = lVar20 + -1;
-                if (lVar20 == 0) {
-                  uVar6 = FUN_180010a15();
-                  return uVar6;
-                }
-              }
-              *(short *)puVar12 = 0;
-              puVar11[0x22] = local_b0[0];
-              uVar6 = 0;
-              puVar11[0x23] = 0;
-              puVar11[0x24] = (uint)((local_c8 & 0xc0000000) != 0);
-              memcpy(puVar11 + 0x2a,local_b8,uVar14);
-              puVar11[0x25] = 1;
-              puVar12 = puVar11 + 0x26;
-              param_3 = *(char **)(param_2 + 0x4a);
-              if (*(uint **)param_3 == puVar27) {
-                *(uint **)puVar12 = puVar27;
-                *(char **)(puVar11 + 0x28) = param_3;
-                *(uint **)param_3 = puVar12;
-                *(uint **)(param_2 + 0x4a) = puVar12;
-                puVar23 = auStackY_108;
-                if (puVar11[0x24] != 0) {
-                  if ((param_2[0x6b] & 0x20) != 0) goto LAB_17;
-                  puVar23 = auStackY_108;
-                  if (*(longlong *)(param_2 + 0x38) != 0) {
-                    param_3 = (char *)0x0;
-                    uVar16 = WriteKeyToStore((longlong)param_2,0,0);
-                    puVar23 = auStackY_108;
-                    if (uVar16 != 0) {
-                      param_3 = "Status";
-                      DebugTraceError(uVar16,"Status",
-                                      "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c"
-                                     );
-                      puVar23 = auStackY_108;
-                      uVar6 = uVar16;
-                    }
-                  }
-                }
-              }
-              else {
-                pcVar3 = (code *)swi(0x29);
-                (*pcVar3)(3);
-                puVar26 = auStackY_100;
-LAB_17:
-                param_3 = "Status";
-                uVar6 = 0x80090010;
-                *(undefined8 *)(puVar26 + -8) = 0x180010a91;
-                DebugTraceError(0x80090010,"Status",
-                                "onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c");
-                puVar23 = puVar26;
-              }
-            }
-            puVar22 = puVar23;
-            if (local_c0[0] != 0) {
-LAB_10:
-              puVar23 = puVar22;
-              if (uVar6 == 0) {
-                pwVar29 = L"UNKNOWN";
-                local_90 = 0;
-                uStack_88 = 0;
-                local_80 = 0;
-                uStack_78 = 0;
-                local_70 = 0;
-                uStack_68 = 0;
-                local_60 = 0;
-                uStack_58 = 0;
-                if (*(undefined8 **)(param_2 + 0x10) != (undefined8 *)0x0) {
-                  pwVar29 = (wchar_t *)**(undefined8 **)(param_2 + 0x10);
-                }
-                lVar20 = *(longlong *)(param_2 + 2);
-                if (param_2[8] == 0) {
-                  uVar16 = 0x9c4;
-                }
-                else {
-                  uVar16 = 0x9c3;
-                }
-                if (lVar20 == 0) {
-                  if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&
-                     ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) {
-                    uVar15 = *(undefined8 *)(WPP_GLOBAL_Control + 0x10);
-                    *(undefined4 *)(puVar22 + 0x30) = 0x13f;
-                    *(char **)(puVar22 + 0x28) =
-                         "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c";
-                    *(undefined4 *)(puVar22 + 0x20) = 0xc000000d;
-                    *(undefined8 *)(puVar22 + -8) = 0x180010b65;
-                    WPP_SF_sDsd(uVar15,param_3,
-                                "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c","Status"
-                                ,*(undefined8 *)(puVar22 + 0x20),*(char **)(puVar22 + 0x28));
-                  }
-                }
-                else {
-                  *(undefined8 *)(puVar22 + -8) = 0x180010b79;
-                  uVar15 = CryptAuditTranslateString(0x9a1,(STRSAFE_LPWSTR)&local_90);
-                  if ((int)(uint)uVar15 < 0) {
-                    pcVar28 = "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c";
-                    uVar16 = (uint)uVar15;
-                  }
-                  else {
-                    *(undefined8 *)(puVar22 + -8) = 0x180010b9d;
-                    uVar15 = CryptAuditTranslateString(uVar16,(STRSAFE_LPWSTR)&local_70);
-                    if (-1 < (int)(uint)uVar15) {
-                      if ((g_pAuditingFuncs != 0) &&
-                         (pcVar3 = *(code **)(g_pAuditingFuncs + 0x18), pcVar3 != (code *)0x0)) {
-                        *(undefined4 *)(puVar22 + 0x30) = 0;
-                        *(undefined8 **)(puVar22 + 0x28) = &local_90;
-                        *(undefined8 **)(puVar22 + 0x20) = &local_70;
-                        *(undefined8 *)(puVar22 + -8) = 0x180010c0c;
-                        iVar5 = (*pcVar3)(1,L"Microsoft Software Key Storage Provider",pwVar29,
-                                          lVar20);
-                        if (iVar5 < 0) {
-                          uVar6 = FUN_18000fe73();
-                          return uVar6;
-                        }
-                      }
-                      goto LAB_5;
-                    }
-                    pcVar28 = "onecore\\ds\\security\\cryptoapi\\ncrypt\\common\\audit.c";
-                    uVar16 = (uint)uVar15;
-                  }
-LAB_7:
-                  *(undefined8 *)(puVar22 + -8) = 0x18000fe8a;
-                  DebugTraceError(uVar16,"Status",pcVar28);
-                  puVar23 = puVar22;
-                }
-              }
-              else {
-                *(uint *)(puVar22 + 0x20) = uVar6;
-                *(undefined8 *)(puVar22 + -8) = 0x180010c2d;
-                KspCryptAuditKeyMigrationOperation
-                          (0,param_3,(longlong)param_2,0x9a1,*(undefined4 *)(puVar22 + 0x20));
-              }
-            }
-          }
-LAB_5:
-          *(undefined8 *)(puVar23 + -8) = 0x180003472;
-          RtlReleaseResource(local_98);
-          puVar24 = puVar23;
-          goto LAB_18;
-        }
-      }
-      uVar6 = 0x80090009;
-      uVar17 = 0x80090009;
-    }
-    DebugTraceError(uVar17,"Status","onecore\\ds\\security\\cryptoapi\\ncrypt\\storage\\property.c")
-    ;
-    puVar24 = auStackY_108;
-  }
-LAB_18:
-  *(undefined8 *)(puVar24 + -8) = 0x180003483;
+  *(undefined8 *)(puVar25 + -8) = 0x180004a40;
   RtlReleaseResource(param_1 + 0x10);
-  puVar25 = puVar24;
+  puVar26 = puVar25;
 LAB_0:
-  *(undefined8 *)(puVar25 + -8) = 0x180003496;
-  return uVar6;
+  *(undefined8 *)(puVar26 + -8) = 0x180004a78;
+  return uVar27;
 }
 

```


# Modified (No Code Changes)


*Slightly modified functions have no code changes, rather differnces in:*
- refcount
- length
- called
- calling
- name
- fullname

## DebugTraceError

### Match Info



|Key|ncp-1928.dll - ncp-2134.dll|
| :---: | :---: |
|diff_type|refcount,address,calling|
|ratio|1.0|
|i_ratio|0.81|
|m_ratio|1.0|
|b_ratio|1.0|
|match_types|SymbolsHash|

### Function Meta Diff



|Key|ncp-1928.dll|ncp-2134.dll|
| :---: | :---: | :---: |
|name|DebugTraceError|DebugTraceError|
|fullname|DebugTraceError|DebugTraceError|
|`refcount`|672|680|
|length|62|62|
|called|WPP_SF_sDsd|WPP_SF_sDsd|
|`calling`|<details><summary>Expand for full list:<br>AddMachineGuidAndAppContainerSidHashToContainerNameA<br>AddMachineGuidAndAppContainerSidHashToContainerNameW<br>BCryptIsoServerBind<br>BSafeComputePrvKeySizes<br>BuildMasterKeyFileList<br>BuildSerializedPropertyList<br>CNG_ComputeHash<br>CNG_GetBCryptHandle<br>CNG_PackCredUIData<br>CNG_UnpackCredUIData<br>ChangePasswordOnTheKey</summary>ChangeThreadILToMedium<br>CheckAndChangeAccessMasks<br>CliCryptCreateClaim<br>CliCryptCreatePersistedKey<br>CliCryptDecrypt<br>CliCryptDeleteKey<br>CliCryptDeriveKey<br>CliCryptEncrypt<br>CliCryptEnumAlgorithms<br>CliCryptEnumKeys<br>CliCryptExportKey<br>CliCryptFinalizeKey<br>CliCryptFreeBuffer<br>CliCryptFreeKey<br>CliCryptFreeProvider<br>CliCryptFreeSecret<br>CliCryptGetKeyProperty<br>CliCryptGetProviderProperty<br>CliCryptImportKey<br>CliCryptIsAlgSupported<br>CliCryptKeyDerivation<br>CliCryptNotifyChangeKey<br>CliCryptOpenKey<br>CliCryptOpenStorageProvider<br>CliCryptSecretAgreement<br>CliCryptSetKeyProperty<br>CliCryptSetProviderProperty<br>CliCryptSignHash<br>CliCryptVerifyClaim<br>CliCryptVerifySignature<br>CngSetAuditingInterface<br>ComputeAndSetPasswordHashOnTheKey<br>ConstructMessageContentBuffer<br>ConvertContainerSecurityDescriptor<br>ConvertLegacyDhFileToPublicBlob<br>ConvertLegacyDsaFileToPublicBlob<br>ConvertRsaPrivateBlobToFullRsa<br>CreateBioPinOnKeyAndSaveEncryptedPinInFile<br>CreateBioProtectionAndSaveEncryptedPin<br>CreateEncryptedPinBlob<br>CreateFileHandle<br>CreateNestedDirectories<br>CreateSystemDirectory<br>CryptAuditTranslateString<br>DecryptPinAndSetPinHashOnKey<br>DecryptPrivateKey<br>DeleteEncryptedPinFile<br>DeleteFileInStorageArea<br>DeserializeProperties<br>DpapiProtectPinBlob<br>DpapiUnprotectPinBlob<br>EncryptLegacyFlags<br>EncryptLegacyRsaKey<br>EncryptPrivateKey<br>ExtractLegacyUIPolicies<br>FUN_180003a65<br>FUN_18000401f<br>FUN_18000dc52<br>FUN_18000ea35<br>FUN_18000f571<br>FUN_18000fe73<br>FUN_1800109c2<br>FUN_180010a15<br>FUN_180011012<br>FinalizeCipherOrKDFKey<br>FinalizeDsaOrDhKey<br>FinalizeEccKey<br>FinalizeEccKeyFull<br>FinalizeKey<br>FinalizeRsaKey<br>FindClosestFileInStorageArea<br>FinishNewKeyObject<br>FinishNewKeyObject_VirtualIso<br>GetAppContainerInfo<br>GetAppContainerSidAsString<br>GetBCryptSecretsProviders<br>GetBioEncryptedPin<br>GetBioFunctionTable<br>GetCurrentUserIdentity<br>GetCurrentUserSid<br>GetDllPath<br>GetDpapiUserDirectory<br>GetEncryptedPin<br>GetEncryptedPinFilePath<br>GetEncryptedPinFileStoragePath<br>GetFullPath<br>GetFulltrustUserStorageArea<br>GetHashOfAppContainerSid<br>GetHashOfContainerA<br>GetHashOfContainerW<br>GetImagePathInReg<br>GetKeyFileFullPath<br>GetKeyFileNameWithoutMachineGuid<br>GetKeyLengthsFromBCrypt<br>GetKeySearchPath<br>GetKeysetDirSD<br>GetLegacyUserDirectory<br>GetMachineGUID<br>GetMediumIntegrityToken<br>GetPasswordEntropy<br>GetPinFileFullPath<br>GetSecurityOnKeyFile<br>GetTextualSidW<br>GetUserDirectory<br>GetUserSid<br>GetUserStorageArea<br>GetUserTextualSidW<br>GetVsmIdkSPub<br>I_OpenBCryptAlgHandle<br>ImportDsaOrDhKey<br>ImportEccKey<br>ImportKey<br>ImportRsaKey<br>InitializeCNGProv<br>InitializeNewKeyObject<br>IsDsaV2KeyBlob<br>IsThreadWellKnownSid<br>KGT_CreateAndStartEventTimer<br>KGT_CreateImage<br>KGT_CreatePid<br>KGT_GetClientProcessId<br>KGT_GetClientProcessName<br>KGT_GetClientProcessPath<br>KGT_Initialize<br>KGT_TimerEventCallback<br>KeyIsoRpcCreateClientBinding<br>KeyIsoServerBind<br>KspAppContainerOpensFullTrustKey<br>KspCallCredUI<br>KspCheckKeyDoesNotExist<br>KspCheckStrongKey<br>KspCheckStrongKeyAndUnprotect<br>KspCryptAuditCryptOperation<br>KspCryptAuditKeyFileOperation<br>KspCryptAuditKeyMigrationOperation<br>KspCryptAuditVerificationFailure<br>KspExportCipherOrKDFBlob<br>KspExportOpaqueBlob<br>KspExportPKCS7Blob<br>KspExportProtectedBlob<br>KspFindFirstFullTrustKeyFile<br>KspFindFirstKeyFile<br>KspFindNextKeyFile<br>KspGetKeyNameFromParameters<br>KspGetProfilePath<br>KspImportCipherOrKDFBlob<br>KspImportDhPrivateKey<br>KspImportDsaPrivateKey<br>KspImportEccPrivateKey<br>KspImportPKCS7Blob<br>KspImportProtectedBlob<br>KspInitStrongKeyForcePassword<br>KspParseKey<br>KspProcessOpaqueBlob<br>KspReadAndParseKey<br>KspReadKey<br>KspValidateKeyLength<br>LoadDllBasedOnRegistryValue<br>LoadStringFromResourceFiles<br>LoadTitleAndDescriptionFormatStrings<br>MSCryptOpenHKLMKey<br>MSCryptQueryValue<br>MsProvCryptCreateClaim<br>MsProvCryptCreatePersistedKey<br>MsProvCryptDecrypt<br>MsProvCryptDeleteKey<br>MsProvCryptDeriveKey<br>MsProvCryptEncrypt<br>MsProvCryptEnumAlgorithms<br>MsProvCryptEnumKeys<br>MsProvCryptExportKey<br>MsProvCryptFinalizeKey<br>MsProvCryptFreeKey<br>MsProvCryptFreeProvider<br>MsProvCryptFreeSecret<br>MsProvCryptGetKeyProperty<br>MsProvCryptGetProviderProperty<br>MsProvCryptImportKey<br>MsProvCryptIsAlgSupported<br>MsProvCryptKeyDerivation<br>MsProvCryptNotifyChangeKey<br>MsProvCryptOpenKey<br>MsProvCryptOpenProvider_KeyIso<br>MsProvCryptOpenProvider_Local<br>MsProvCryptPromptUser<br>MsProvCryptSecretAgreement<br>MsProvCryptSetKeyProperty<br>MsProvCryptSetProviderProperty<br>MsProvCryptSignHash<br>MsProvCryptVerifyClaim<br>MsProvCryptVerifySignature<br>MyCreateFile<br>MyCryptProtectData<br>MyCryptUnprotectData<br>OpenAndSetPropertyOnBCryptHandle<br>OpenCallerToken<br>OpenConsentKeyForAppContainer<br>OpenContainerFile<br>OpenEccAltSigKey<br>OpenFileInStorageArea<br>OpenNearestFileInStorageArea<br>OpenOrCreateAppKeyAccessConsentRegKey<br>ParseKeyFile<br>ParseLegacyKeyFile<br>ProtectPrivateKey<br>ReadContainerInfo<br>ReadEncryptedPinFile<br>ReadKeyFromStore<br>ReadKeyNameFromFile<br>ReadLegacyKeyFile<br>RemoveKeyFromLegacyStore<br>RemoveKeyFromStore<br>RevertBackToCallerToken<br>RevertToLocalSystem<br>SKCacheAdd<br>SKCacheLookup<br>SKCacheRemove<br>SPCryptCreateClaim<br>SPCryptCreatePersistedKey<br>SPCryptDecrypt<br>SPCryptDeleteKey<br>SPCryptDeriveKey<br>SPCryptEncrypt<br>SPCryptEnumAlgorithms<br>SPCryptEnumKeys<br>SPCryptExportKey<br>SPCryptFinalizeKey<br>SPCryptFreeKey<br>SPCryptFreeProvider<br>SPCryptFreeSecret<br>SPCryptGetKeyProperty<br>SPCryptGetProviderProperty<br>SPCryptIsAlgSupported<br>SPCryptKeyDerivation<br>SPCryptNotifyChangeKey<br>SPCryptOpenKey<br>SPCryptOpenProvider<br>SPCryptPromptForCredentials<br>SPCryptSetKeyProperty<br>SPCryptSetProviderProperty<br>SPCryptVerifyClaim<br>SPCryptVerifySignature<br>SPImportIsolatedKey<br>SPPkcs8ExportKey<br>SPPkcs8ImportKey<br>SPPkcsExportPlainTextKey<br>SPPkcsImportPlainTextKey<br>SerializeCurveNameList<br>SerializeKeyForStorage<br>SerializeProperties<br>SetCertificateProperty<br>SetKeyAccessPolicy<br>SetPrivateKeyProperty<br>SetSecurityOnKeyFile<br>SetUIKeyProperties<br>ShouldTryRpcCall<br>StoreEncryptedPin<br>TranslateRsaBlobToBSafePrivate<br>TranslateRsaBlobToBSafePublic<br>UnprotectExportabilityFlag<br>UnprotectLegacyPrivateKey<br>UnprotectPrivateKey<br>UpdateECCHandleWithCurve<br>ValidateAlternateStorageLocation<br>ValidateDSAKeyBlobV1Format<br>ValidateDSAKeyBlobV2Format<br>ValidateDsaKeyBlob<br>ValidateKeyAccessPolicyInput<br>ValidatePinBlobAndGetEncryptedPin<br>VerifyDhPrivateBlob<br>VerifyEccPrivateBlob<br>VerifyEccPrivateBlobFull<br>VerifyRsaFullPrivateBlob<br>VerifyVsmKeyAttestationClaim<br>VerifyVsmSignedReport<br>WriteEncryptedPinFile<br>WriteKeyToStore<br>WriteRsaKeyToLegacyStore<br>ZeroizeFile<br>_CacheLookup<br>_CliCreateContext<br>_CliReleaseContext<br>_CliThreadCryptDecryptCallback<br>_CliThreadCryptEncryptCallback<br>_CliThreadCryptFinalizeKeyCallback<br>_CliThreadCryptKeyDerivationCallback<br>_CliThreadCryptSecretAgreementCallback<br>_CliThreadCryptSignHashCallback<br>_FreeKeyInfo<br>_GetCurrentLuid<br>_GetKeyInfo<br>_GetPublicKey<br>_KicpCreateBindingHandle<br>_MapBufferDescToRPC<br>_OpenCallerToken<br>_PackCipherPaddingInfo<br>_PackPaddingInfoPtr<br>_PkcsAllocAndExportKeyBlob<br>_PkcsCreateKeyObject<br>_PkcsDecodeDsaPrivateKey<br>_PkcsExportPlainTextKeyDsa<br>_PkcsExportPlainTextKeyEcc<br>_PkcsExportPlainTextKeyRsa<br>_PkcsGetDsaParam<br>_PkcsGetDsaPrivateKey<br>_PkcsImportPlainTextKeyDsa<br>_PkcsImportPlainTextKeyEcc<br>_PkcsImportPlainTextKeyRsa<br>_PkcsScanAttrList<br>lLoadUXFromRegistry</details>|<details><summary>Expand for full list:<br>AddMachineGuidAndAppContainerSidHashToContainerNameA<br>AddMachineGuidAndAppContainerSidHashToContainerNameW<br>BCryptIsoServerBind<br>BSafeComputePrvKeySizes<br>BuildMasterKeyFileList<br>BuildSerializedPropertyList<br>CNG_ComputeHash<br>CNG_GetBCryptHandle<br>CNG_PackCredUIData<br>CNG_UnpackCredUIData<br>ChangePasswordOnTheKey</summary>ChangeThreadILToMedium<br>CheckAndChangeAccessMasks<br>CliCryptCreateClaim<br>CliCryptCreatePersistedKey<br>CliCryptDecrypt<br>CliCryptDeleteKey<br>CliCryptDeriveKey<br>CliCryptEncrypt<br>CliCryptEnumAlgorithms<br>CliCryptEnumKeys<br>CliCryptExportKey<br>CliCryptFinalizeKey<br>CliCryptFreeBuffer<br>CliCryptFreeKey<br>CliCryptFreeProvider<br>CliCryptFreeSecret<br>CliCryptGetKeyProperty<br>CliCryptGetProviderProperty<br>CliCryptImportKey<br>CliCryptIsAlgSupported<br>CliCryptKeyDerivation<br>CliCryptNotifyChangeKey<br>CliCryptOpenKey<br>CliCryptOpenStorageProvider<br>CliCryptSecretAgreement<br>CliCryptSetKeyProperty<br>CliCryptSetProviderProperty<br>CliCryptSignHash<br>CliCryptVerifyClaim<br>CliCryptVerifySignature<br>CngSetAuditingInterface<br>ComputeAndSetPasswordHashOnTheKey<br>ConstructMessageContentBuffer<br>ConvertContainerSecurityDescriptor<br>ConvertLegacyDhFileToPublicBlob<br>ConvertLegacyDsaFileToPublicBlob<br>ConvertRsaPrivateBlobToFullRsa<br>CreateBioPinOnKeyAndSaveEncryptedPinInFile<br>CreateBioProtectionAndSaveEncryptedPin<br>CreateEncryptedPinBlob<br>CreateFileHandle<br>CreateNestedDirectories<br>CreateSystemDirectory<br>CryptAuditTranslateString<br>DecryptPinAndSetPinHashOnKey<br>DecryptPrivateKey<br>DeleteEncryptedPinFile<br>DeleteFileInStorageArea<br>DeserializeProperties<br>DpapiProtectPinBlob<br>DpapiUnprotectPinBlob<br>EncryptLegacyFlags<br>EncryptLegacyRsaKey<br>EncryptPrivateKey<br>ExtractLegacyUIPolicies<br>FUN_180004df5<br>FUN_1800053af<br>FUN_18000efe2<br>FUN_18000fdc5<br>FUN_180010901<br>FUN_1800112ae<br>FinalizeCipherOrKDFKey<br>FinalizeDsaOrDhKey<br>FinalizeEccKey<br>FinalizeEccKeyFull<br>FinalizeKey<br>FinalizeRsaKey<br>FindClosestFileInStorageArea<br>FinishNewKeyObject<br>FinishNewKeyObject_VirtualIso<br>GetAppContainerInfo<br>GetAppContainerSidAsString<br>GetBCryptSecretsProviders<br>GetBioEncryptedPin<br>GetBioFunctionTable<br>GetCurrentUserIdentity<br>GetCurrentUserSid<br>GetDllPath<br>GetDpapiUserDirectory<br>GetEncryptedPin<br>GetEncryptedPinFilePath<br>GetEncryptedPinFileStoragePath<br>GetFullPath<br>GetFulltrustUserStorageArea<br>GetHashOfAppContainerSid<br>GetHashOfContainerA<br>GetHashOfContainerW<br>GetImagePathInReg<br>GetKeyFileFullPath<br>GetKeyFileNameWithoutMachineGuid<br>GetKeyLengthsFromBCrypt<br>GetKeySearchPath<br>GetKeysetDirSD<br>GetLegacyUserDirectory<br>GetMachineGUID<br>GetMediumIntegrityToken<br>GetPasswordEntropy<br>GetPinFileFullPath<br>GetSecurityOnKeyFile<br>GetTextualSidW<br>GetUserDirectory<br>GetUserSid<br>GetUserStorageArea<br>GetUserTextualSidW<br>GetVsmIdkSPub<br>I_OpenBCryptAlgHandle<br>ImportDsaOrDhKey<br>ImportEccKey<br>ImportKey<br>ImportRsaKey<br>InitializeCNGProv<br>InitializeNewKeyObject<br>IsDsaV2KeyBlob<br>IsThreadWellKnownSid<br>KGT_CreateAndStartEventTimer<br>KGT_CreateImage<br>KGT_CreatePid<br>KGT_GetClientProcessId<br>KGT_GetClientProcessName<br>KGT_GetClientProcessPath<br>KGT_Initialize<br>KGT_TimerEventCallback<br>KeyIsoRpcCreateClientBinding<br>KeyIsoServerBind<br>KspAppContainerOpensFullTrustKey<br>KspCallCredUI<br>KspCheckKeyDoesNotExist<br>KspCheckStrongKey<br>KspCheckStrongKeyAndUnprotect<br>KspCryptAuditCryptOperation<br>KspCryptAuditKeyFileOperation<br>KspCryptAuditKeyMigrationOperation<br>KspCryptAuditVerificationFailure<br>KspExportCipherOrKDFBlob<br>KspExportOpaqueBlob<br>KspExportPKCS7Blob<br>KspExportProtectedBlob<br>KspFindFirstFullTrustKeyFile<br>KspFindFirstKeyFile<br>KspFindNextKeyFile<br>KspGetKeyNameFromParameters<br>KspGetProfilePath<br>KspImportCipherOrKDFBlob<br>KspImportDhPrivateKey<br>KspImportDsaPrivateKey<br>KspImportEccPrivateKey<br>KspImportPKCS7Blob<br>KspImportProtectedBlob<br>KspInitStrongKeyForcePassword<br>KspParseKey<br>KspProcessOpaqueBlob<br>KspReadAndParseKey<br>KspReadKey<br>KspValidateKeyLength<br>LoadDllBasedOnRegistryValue<br>LoadStringFromResourceFiles<br>LoadTitleAndDescriptionFormatStrings<br>MSCryptOpenHKLMKey<br>MSCryptQueryValue<br>MsProvCryptCreateClaim<br>MsProvCryptCreatePersistedKey<br>MsProvCryptDecrypt<br>MsProvCryptDeleteKey<br>MsProvCryptDeriveKey<br>MsProvCryptEncrypt<br>MsProvCryptEnumAlgorithms<br>MsProvCryptEnumKeys<br>MsProvCryptExportKey<br>MsProvCryptFinalizeKey<br>MsProvCryptFreeKey<br>MsProvCryptFreeProvider<br>MsProvCryptFreeSecret<br>MsProvCryptGetKeyProperty<br>MsProvCryptGetProviderProperty<br>MsProvCryptImportKey<br>MsProvCryptIsAlgSupported<br>MsProvCryptKeyDerivation<br>MsProvCryptNotifyChangeKey<br>MsProvCryptOpenKey<br>MsProvCryptOpenProvider_KeyIso<br>MsProvCryptOpenProvider_Local<br>MsProvCryptPromptUser<br>MsProvCryptSecretAgreement<br>MsProvCryptSetKeyProperty<br>MsProvCryptSetProviderProperty<br>MsProvCryptSignHash<br>MsProvCryptVerifyClaim<br>MsProvCryptVerifySignature<br>MyCreateFile<br>MyCryptProtectData<br>MyCryptUnprotectData<br>OpenAndSetPropertyOnBCryptHandle<br>OpenCallerToken<br>OpenConsentKeyForAppContainer<br>OpenContainerFile<br>OpenEccAltSigKey<br>OpenFileInStorageArea<br>OpenNearestFileInStorageArea<br>OpenOrCreateAppKeyAccessConsentRegKey<br>ParseKeyFile<br>ParseLegacyKeyFile<br>ProtectPrivateKey<br>ReadContainerInfo<br>ReadEncryptedPinFile<br>ReadKeyFromStore<br>ReadKeyNameFromFile<br>ReadLegacyKeyFile<br>RemoveKeyFromLegacyStore<br>RemoveKeyFromStore<br>RevertBackToCallerToken<br>RevertToLocalSystem<br>SKCacheAdd<br>SKCacheLookup<br>SKCacheRemove<br>SPCryptCreateClaim<br>SPCryptCreatePersistedKey<br>SPCryptDecrypt<br>SPCryptDeleteKey<br>SPCryptDeriveKey<br>SPCryptEncrypt<br>SPCryptEnumAlgorithms<br>SPCryptEnumKeys<br>SPCryptExportKey<br>SPCryptFinalizeKey<br>SPCryptFreeKey<br>SPCryptFreeProvider<br>SPCryptFreeSecret<br>SPCryptGetKeyProperty<br>SPCryptGetProviderProperty<br>SPCryptIsAlgSupported<br>SPCryptKeyDerivation<br>SPCryptNotifyChangeKey<br>SPCryptOpenKey<br>SPCryptOpenProvider<br>SPCryptPromptForCredentials<br>SPCryptSetKeyProperty<br>SPCryptSetProviderProperty<br>SPCryptVerifyClaim<br>SPCryptVerifySignature<br>SPImportIsolatedKey<br>SPPkcs8ExportKey<br>SPPkcs8ImportKey<br>SPPkcsExportPlainTextKey<br>SPPkcsImportPlainTextKey<br>SerializeCurveNameList<br>SerializeKeyForStorage<br>SerializeProperties<br>SetCertificateProperty<br>SetKeyAccessPolicy<br>SetPrivateKeyProperty<br>SetSecurityOnKeyFile<br>SetUIKeyProperties<br>ShouldTryRpcCall<br>StoreEncryptedPin<br>TranslateRsaBlobToBSafePrivate<br>TranslateRsaBlobToBSafePublic<br>UnprotectExportabilityFlag<br>UnprotectLegacyPrivateKey<br>UnprotectPrivateKey<br>UpdateECCHandleWithCurve<br>ValidateAlternateStorageLocation<br>ValidateDSAKeyBlobV1Format<br>ValidateDSAKeyBlobV2Format<br>ValidateDsaKeyBlob<br>ValidateKeyAccessPolicyInput<br>ValidatePinBlobAndGetEncryptedPin<br>VerifyDhPrivateBlob<br>VerifyEccPrivateBlob<br>VerifyEccPrivateBlobFull<br>VerifyRsaFullPrivateBlob<br>VerifyVsmKeyAttestationClaim<br>VerifyVsmSignedReport<br>WriteEncryptedPinFile<br>WriteKeyToStore<br>WriteRsaKeyToLegacyStore<br>ZeroizeFile<br>_CacheLookup<br>_CliCreateContext<br>_CliReleaseContext<br>_CliThreadCryptDecryptCallback<br>_CliThreadCryptEncryptCallback<br>_CliThreadCryptFinalizeKeyCallback<br>_CliThreadCryptKeyDerivationCallback<br>_CliThreadCryptSecretAgreementCallback<br>_CliThreadCryptSignHashCallback<br>_FreeKeyInfo<br>_GetCurrentLuid<br>_GetKeyInfo<br>_GetPublicKey<br>_KicpCreateBindingHandle<br>_MapBufferDescToRPC<br>_OpenCallerToken<br>_PackCipherPaddingInfo<br>_PackPaddingInfoPtr<br>_PkcsAllocAndExportKeyBlob<br>_PkcsCreateKeyObject<br>_PkcsDecodeDsaPrivateKey<br>_PkcsExportPlainTextKeyDsa<br>_PkcsExportPlainTextKeyEcc<br>_PkcsExportPlainTextKeyRsa<br>_PkcsGetDsaParam<br>_PkcsGetDsaPrivateKey<br>_PkcsImportPlainTextKeyDsa<br>_PkcsImportPlainTextKeyEcc<br>_PkcsImportPlainTextKeyRsa<br>_PkcsScanAttrList<br>lLoadUXFromRegistry</details>|
|paramcount|3|3|
|`address`|180012d2c|180012fcc|
|sig|undefined __fastcall DebugTraceError(undefined4 param_1, undefined8 param_2, undefined8 param_3)|undefined __fastcall DebugTraceError(undefined4 param_1, undefined8 param_2, undefined8 param_3)|
|sym_type|Function|Function|
|sym_source|IMPORTED|IMPORTED|
|external|False|False|

### DebugTraceError Calling Diff


```diff
--- DebugTraceError calling
+++ DebugTraceError calling
@@ -67,9 +67,6 @@
-FUN_180003a65
-FUN_18000401f
-FUN_18000dc52
-FUN_18000ea35
-FUN_18000f571
-FUN_18000fe73
-FUN_1800109c2
-FUN_180010a15
-FUN_180011012
+FUN_180004df5
+FUN_1800053af
+FUN_18000efe2
+FUN_18000fdc5
+FUN_180010901
+FUN_1800112ae
```




<sub>Generated with `ghidriff` version: 1.0.0 on 2026-08-16T10:40:04</sub>