Function at 0x409250
Capabilities:
Delete registry value
Encrypt data using dpapi
Set registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x56d8
call fcn.00415110
mov eax, dword [0x426004]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
push 0x528c
lea eax, [ebp + 8]
mov esi, ecx
push eax
lea ecx, [ebp - 0x56ac]
push ecx
call fcn.00410190
add esp, 0xc
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2_WriteCertificates__
mov eax, 0x40000
mov dword [ebp - 0x56c8], 0
call fcn.0040b690
mov ebx, dword [sym.imp.USER32.dll_wsprintfW]
push esi
push str.SOFTWARESecureW2MethodsDefaultProfiles
lea edx, [ebp - 0x41c]
push str._s_sRootCACert
push edx
call ebx
lea eax, [ebp - 0x41c]
push eax
lea edx, [ebp - 0x56c8]
lea ecx, [ebp - 0x56b0]
call fcn.0040c2e0
mov edi, eax
add esp, 0x1c
test edi, edi
jne 0x4094cc
push 0x410
xor esi, esi
lea ecx, [ebp - 0x41c]
push esi
push ecx
call fcn.00410110
add esp, 0xc
lea edx, [ebp - 0x41c]
push str.Certificate.0
push edx
call ebx
mov ecx, dword [ebp - 0x56b0]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
add esp, 8
lea eax, [ebp - 0x41c]
push eax
push ecx
call ebx
test eax, eax
jne 0x40934e
inc esi
push esi
lea edx, [ebp - 0x41c]
push str.Certificate._ld
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebp - 0x56b0]
add esp, 0xc
lea eax, [ebp - 0x41c]
push eax
push ecx
call ebx
test eax, eax
je 0x409323
xor esi, esi
xor ebx, ebx
cmp dword [ebp - 0x281c], esi
jbe 0x4094bf
lea edx, [ebp - 0x2818]
mov dword [ebp - 0x56b4], edx
jmp 0x409372
xor esi, esi
push 0x410
lea eax, [ebp - 0x41c]
push esi
push eax
call fcn.00410110
add esp, 0xc
push ebx
lea ecx, [ebp - 0x41c]
push str.Certificate._ld
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
mov edx, dword [ebp - 0x56b4]
mov edi, dword [ebp - 0x56b0]
add esp, 0xc
lea eax, [ebp - 0x56c0]
push eax
push 5
push esi
push esi
lea ecx, [ebp - 0x56d8]
push ecx
mov dword [ebp - 0x56cc], edx
push str.SECUREW2
lea edx, [ebp - 0x56d0]
push edx
mov dword [ebp - 0x56c0], esi
mov dword [ebp - 0x56bc], esi
mov dword [ebp - 0x56d0], 0x14
mov dword [ebp - 0x56d4], str.534543555245573252554c455a544845574f524c44574954484f55544245494e474556494c
mov dword [ebp - 0x56d8], 0x4b
call dword [sym.imp.CRYPT32.dll_CryptProtectData]
test eax, eax
je 0x40944f
mov eax, dword [ebp - 0x56c0]
push eax
lea esi, [ebp - 0x56b8]
call fcn.0040bae0
mov esi, eax
add esp, 4
test esi, esi
jne 0x409440
mov eax, dword [ebp - 0x56c0]
mov ecx, dword [ebp - 0x56bc]
mov edx, dword [ebp - 0x56b8]
push eax
push ecx
push eax
push edx
mov dword [ebp - 0x56c4], eax
call fcn.0040f557
add esp, 0x10
mov eax, dword [ebp - 0x56bc]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x409472
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2EncryptData__::CryptProtectData_FAILED___ld_
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
mov esi, 0x1770
test esi, esi
jne 0x4094a9
mov ecx, dword [ebp - 0x56c4]
mov edx, dword [ebp - 0x56b8]
push ecx
push edx
push 3
push esi
lea eax, [ebp - 0x41c]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
je 0x40949e
mov esi, 0x6e
lea eax, [ebp - 0x56b8]
call fcn.0040bb70
add dword [ebp - 0x56b4], 0x14
inc ebx
mov edi, esi
cmp ebx, dword [ebp - 0x281c]
jb 0x409370
mov ecx, dword [ebp - 0x56b0]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2_WriteCertificates__::returning__ld
mov eax, 0x40000
call fcn.0040b690
mov ecx, dword [ebp - 8]
add esp, 0xc
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040f43d
mov esp, ebp
pop ebp
ret