Function at 0x40c557
Capabilities:
Generate random numbers via winapi
Terminate process

Disassembly:
sub esp, 0x15c
mov eax, dword [0x6b0d44]
xor eax, esp
mov dword [esp + 0x154], eax
mov eax, dword [esp + 0x160]
or dword [esp + 0x10], 0xffffffff
push ebx
push ebp
push esi
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x174]
push edi
xor edi, edi
mov dword [esp + 0x50], eax
mov eax, edi
mov dword [esp + 0x1c], edx
mov esi, edi
mov edx, dword [esp + 0x17c]
mov ebp, edi
mov dword [esp + 0x6c], ecx
mov ebx, edi
mov dword [esp + 0x70], edx
mov dword [esp + 0x28], edi
mov dword [esp + 0x58], edi
mov dword [esp + 0x54], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x30], 0xc00
mov dword [esp + 0x74], 1
mov dword [esp + 0x60], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x5c], edi
mov dword [esp + 0x64], edi
cmp dword [ecx], edi
je 0x40cd6e
cmp dword [ecx + 4], edi
je 0x40cd6e
cmp dword [ecx + 8], edi
je 0x40cd6e
push 8
pop ecx
mov dword [edx], edi
lea edi, [esp + 0x9c]
push ebx
rep stosd dword es:[edi], eax
push 0x69a6c0
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.ncrypt.dll_NCryptOpenStorageProvider]
test eax, eax
js 0x40cce1
push 0x80
push 1
push 0x69a710
push 0x69a724
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x38]
call dword [sym.imp.ncrypt.dll_NCryptCreatePersistedKey]
test eax, eax
js 0x40cce1
mov edi, dword [sym.imp.ncrypt.dll_NCryptSetProperty]
lea eax, [esp + 0x30]
push 0x80000040
push 4
push eax
push 0x69a72c
push dword [esp + 0x28]
call edi
test eax, eax
jns 0x40c694
push 0x80000040
push 4
lea eax, [esp + 0x38]
mov dword [esp + 0x38], 0x800
push eax
push str.Length
push dword [esp + 0x28]
call edi
test eax, eax
js 0x40cce1
push 0x80000040
push 4
lea eax, [esp + 0x7c]
push eax
push str.Export_Policy
push dword [esp + 0x28]
call edi
test eax, eax
js 0x40cce1
push 0x40
push dword [esp + 0x1c]
call dword [sym.imp.ncrypt.dll_NCryptFinalizeKey]
test eax, eax
js 0x40cce1
lea eax, [esp + 0x10]
push eax
push 0
push 1
push 1
push dword [esp + 0x28]
call dword [sym.imp.CRYPT32.dll_CryptExportPublicKeyInfo]
test eax, eax
je 0x40cce1
push dword [esp + 0x10]
call fcn.005d0f60
mov edi, eax
mov dword [esp + 0x60], edi
pop ecx
test edi, edi
je 0x40cd8b
lea eax, [esp + 0x10]
push eax
push edi
push 1
push 1
push dword [esp + 0x28]
call dword [sym.imp.CRYPT32.dll_CryptExportPublicKeyInfo]
test eax, eax
je 0x40cce1
xor ecx, ecx
lea eax, [esp + 0x34]
push ecx
push eax
push ecx
push ecx
push 3
push dword [esp + 0x30]
push 1
call dword [sym.imp.CRYPT32.dll_CertStrToNameA]
test eax, eax
je 0x40cce1
push dword [esp + 0x34]
call fcn.005d0f60
mov dword [esp + 0x44], eax
pop ecx
test eax, eax
jne 0x40c779
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x233
push esi
push edi
mov edx, 0x69a7c4
xor ecx, ecx
call fcn.0047145c
push edi
push 0x69a7e0
push 0x69a7fc
jmp 0x40cdb5
push 0
lea ecx, [esp + 0x38]
push ecx
push eax
push 0
push 3
push dword [esp + 0x30]
push 1
call dword [sym.imp.CRYPT32.dll_CertStrToNameA]
test eax, eax
je 0x40cce1
mov eax, dword [esp + 0x34]
xor ecx, ecx
push ecx
mov dword [esp + 0x6c], eax
lea eax, [esp + 0x3c]
push eax
push ecx
push ecx
push 3
push dword [esp + 0x40]
push 1
call dword [sym.imp.CRYPT32.dll_CertStrToNameW]
test eax, eax
je 0x40cce1
push dword [esp + 0x38]
call fcn.005d0f60
mov dword [esp + 0x48], eax
pop ecx
test eax, eax
jne 0x40c802
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x23a
push esi
push edi
mov edx, 0x69a820
xor ecx, ecx
call fcn.0047145c
push edi
push 0x69a83c
push 0x69a858
jmp 0x40cdb5
push 0
lea ecx, [esp + 0x3c]
push ecx
push eax
push 0
push 3
push dword [esp + 0x40]
push 1
call dword [sym.imp.CRYPT32.dll_CertStrToNameW]
test eax, eax
je 0x40cce1
mov eax, dword [esp + 0x38]
push 0x70
mov dword [esp + 0x30], eax
lea eax, [esp + 0xdc]
push 0
push eax
call fcn.0059de40
add esp, 0xc
lea eax, [esp + 0x14c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
mov esi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
mov eax, 0xffff
add word [esp + 0x14c], ax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x150]
push eax
call esi
add word [esp + 0x14c], 0x1e
lea eax, [esp + 0x94]
push eax
lea eax, [esp + 0x150]
push eax
call esi
xor esi, esi
lea eax, [esp + 0x1c]
push esi
push esi
push 0x69a5a4
push eax
mov dword [esp + 0x2c], esi
call dword [sym.imp.ncrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
js 0x40c8be
push 1
push 8
lea eax, [esp + 0x164]
push eax
push dword [esp + 0x28]
call dword [sym.imp.ncrypt.dll_BCryptGenRandom]
cmp dword [esp + 0x1c], ebx
je 0x40c8cf
push esi
push dword [esp + 0x20]
call dword [sym.imp.ncrypt.dll_BCryptCloseAlgorithmProvider]
lea eax, [esp + 0x15c]
mov dword [esp + 0xd8], 2
mov dword [esp + 0xe0], eax
mov esi, edi
mov eax, dword [esp + 0x68]
lea edi, [esp + 0x110]
mov dword [esp + 0xf0], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0xf4], eax
mov eax, dword [esp + 0x8c]
mov dword [esp + 0xf8], eax
mov eax, dword [esp + 0x90]
mov dword [esp + 0xfc], eax
mov eax, dword [esp + 0x94]
mov dword [esp + 0x100], eax
mov eax, dword [esp + 0x98]
mov dword [esp + 0x104], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x108], eax
mov eax, dword [esp + 0x44]
push 6
mov dword [esp + 0x110], eax
xor eax, eax
pop ecx
mov dword [esp + 0xdc], 8
mov dword [esp + 0xe4], str.1.2.840.113549.1.1.12
rep movsd dword es:[edi], dword [esi]
lea edi, [esp + 0x80]
mov dword [esp + 0x78], 4
stosd dword es:[edi], eax
xor esi, esi
xor ecx, ecx
mov dword [esp + 0x7c], 0x6b50cc
inc ecx
mov byte [esp + 0x17], 0xa8
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [esp + 0x17]
mov edi, dword [sym.imp.CRYPT32.dll_CryptEncodeObject]
mov dword [esp + 0x84], eax
lea eax, [esp + 0x10]
push eax
push esi
lea eax, [esp + 0x88]
mov dword [esp + 0x88], ecx
push eax
push 0xe
push ecx
call edi
test eax, eax
je 0x40ccdf
push dword [esp + 0x10]
call fcn.005d0f60
mov ebp, eax
pop ecx
test ebp, ebp
jne 0x40ca08
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x274
push esi
push edi
mov edx, 0x69a894
xor ecx, ecx
call fcn.0047145c
push edi
push 0x69a8b0
push 0x69a8cc
jmp 0x40cdb5
lea eax, [esp + 0x10]
push eax
push ebp
lea eax, [esp + 0x88]
push eax
push 0xe
push 1
call edi
test eax, eax
je 0x40ccdf
mov eax, dword [esp + 0x10]
mov dword [esp + 0xa4], eax
lea eax, [esp + 0x10]
push eax
push esi
lea eax, [esp + 0x80]
mov dword [esp + 0xa4], str.2.5.29.15
push eax
push 0x24
push 1
mov dword [esp + 0xb4], esi
mov dword [esp + 0xbc], ebp
call edi
test eax, eax
je 0x40ccdf
push dword [esp + 0x10]
call fcn.005d0f60
mov esi, eax
pop ecx
test esi, esi
jne 0x40caa3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x27d
push esi
push edi
mov edx, 0x69a8fc
xor ecx, ecx
call fcn.0047145c
push edi
push 0x69a918
push 0x69a934
jmp 0x40cdb5
lea eax, [esp + 0x10]
push eax
push esi
lea eax, [esp + 0x80]
push eax
push 0x24
push 1
call edi
test eax, eax
je 0x40cce1
mov eax, dword [esp + 0x10]
xor edi, edi
mov dword [esp + 0xb4], eax
lea eax, [esp + 0x9c]
mov dword [esp + 0x144], eax
lea eax, [esp + 0x54]
push eax
lea eax, [esp + 0x5c]
mov dword [esp + 0xb0], str.2.5.29.37
push eax
lea eax, [esp + 0x30]
mov dword [esp + 0xb8], edi
push eax
mov eax, dword [esp + 0x78]
push edi
push 0x10040
mov dword [esp + 0xcc], esi
push dword [eax + 8]
mov dword [esp + 0x158], 2
call dword [sym.imp.CRYPT32.dll_CryptAcquireCertificatePrivateKey]
test eax, eax
je 0x40cce1
lea eax, [esp + 0x20]
push eax
push edi
push edi
lea eax, [esp + 0xf0]
push eax
lea eax, [esp + 0xe8]
push eax
push 2
push 1
push 1
push dword [esp + 0x48]
call dword [sym.imp.CRYPT32.dll_CryptSignAndEncodeCertificate]
test eax, eax
je 0x40cce1
push dword [esp + 0x20]
call fcn.005d0f60
mov edi, eax
pop ecx
test edi, edi
jne 0x40cb96
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x28b
push esi
push edi
mov edx, 0x69a964
xor ecx, ecx
call fcn.0047145c
push edi
push 0x69a980
push 0x69a99c
jmp 0x40cdb5
lea eax, [esp + 0x20]
push eax
push edi
push 0
lea eax, [esp + 0xf0]
push eax
lea eax, [esp + 0xe8]
push eax
push 2
push 1
push 1
push dword [esp + 0x48]
call dword [sym.imp.CRYPT32.dll_CryptSignAndEncodeCertificate]
test eax, eax
je 0x40cce1
push 0
push 0x2000
push 0
push 1
push 2
call dword [sym.imp.CRYPT32.dll_CertOpenStore]
mov ebx, eax
test ebx, ebx
je 0x40cce1
lea eax, [esp + 0x64]
push eax
push 1
push dword [esp + 0x28]
push edi
push 1
push ebx
call dword [sym.imp.CRYPT32.dll_CertAddEncodedCertificateToStore]
test eax, eax
je 0x40cce1
push 7
pop ecx
xor eax, eax
lea edi, [esp + 0xbc]
rep stosd dword es:[edi], eax
xor edi, edi
mov dword [esp + 0xbc], str.MeshDummy
lea eax, [esp + 0xbc]
mov dword [esp + 0xc0], str.Microsoft_Software_Key_Storage_Provider
push eax
push edi
push 2
push dword [esp + 0x70]
mov dword [esp + 0xd4], edi
mov dword [esp + 0xd8], edi
mov dword [esp + 0xe4], edi
call dword [sym.imp.CRYPT32.dll_CertSetCertificateContextProperty]
test eax, eax
je 0x40cce1
push 4
push dword [esp + 0x54]
lea eax, [esp + 0x50]
mov dword [esp + 0x50], edi
push eax
mov dword [esp + 0x58], edi
mov edi, dword [sym.imp.CRYPT32.dll_PFXExportCertStore]
push ebx
call edi
test eax, eax
je 0x40cce1
push dword [esp + 0x48]
call fcn.005d0f60
mov dword [esp + 0x50], eax
pop ecx
test eax, eax
jne 0x40ccb9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x2a6
push esi
push edi
mov edx, 0x69a9d4
xor ecx, ecx
call fcn.0047145c
push edi
push str...meshcorewincrypto.cpp
push 0x69aa5c
jmp 0x40cdb5
push 4
push dword [esp + 0x54]
lea eax, [esp + 0x50]
push eax
push ebx
call edi
test eax, eax
je 0x40cce1
mov ecx, dword [esp + 0x70]
mov eax, dword [esp + 0x4c]
mov dword [ecx], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x60], eax
jmp 0x40cce1
mov esi, ebx
cmp dword [esp + 0x24], 0
mov edi, dword [sym.imp.ncrypt.dll_NCryptFreeObject]
je 0x40ccf4
push dword [esp + 0x24]
call edi
cmp dword [esp + 0x54], 0
je 0x40cd18
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40cd18
cmp dword [esp + 0x58], 0xffffffff
jne 0x40cd0f
push eax
call edi
jmp 0x40cd18
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x40cd27
push eax
call fcn.005d0f40
pop ecx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x40cd36
push eax
call fcn.005d0f40
pop ecx
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40cd45
push eax
call fcn.005d0f40
pop ecx
test ebx, ebx
je 0x40cd52
push 0
push ebx
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
test esi, esi
je 0x40cd5d
push esi
call fcn.005d0f40
pop ecx
test ebp, ebp
je 0x40cd68
push ebp
call fcn.005d0f40
pop ecx
mov eax, dword [esp + 0x60]
jmp 0x40cd70
xor eax, eax
mov ecx, dword [esp + 0x164]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0059b3f0
add esp, 0x15c
ret 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x22e
push esi
push edi
mov edx, 0x69a768
xor ecx, ecx
call fcn.0047145c
push edi
push 0x69a784
push 0x69a7a0
call fcn.004010b4
add esp, 0x18
push esi
call fcn.005aae60
int3