Function at 0x40b650
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
xor eax, eax
mov ecx, 0x1fd
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x800]
push ebx
sub esp, 0x83c
mov dword [ebp - 0x80c], 0x656e6957
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x818]
mov dword [ebp - 0x808], 0x636f7220
mov dword [ebp - 0x804], 0x21736b
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x42b014]
mov edi, dword fs:[0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptGetUserKey]
mov dword [ebp - 0x820], eax
call eax
sub esp, 0xc
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x924
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.00401ac0
test ebx, ebx
jne 0x40b6f8
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x810], 0xc
lea ebx, [ebp - 0x810]
mov dword [esp + 0x18], 0x800
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptEncrypt]
mov dword [ebp - 0x81c], eax
call eax
mov esi, eax
mov eax, dword [0x42b010]
sub esp, 0x1c
test eax, eax
je 0x40b769
test esi, esi
jne 0x40b769
cmp dword [edi + 0x34], 0x80090003
je 0x40c328
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x92e
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 4], str.CryptEncrypt_failed:__08lx_n
mov dword [esp + 8], eax
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x92f
mov eax, dword [ebp - 0x810]
mov dword [esp + 4], str.Unexpected_length__ld_n
cmp eax, 0x80
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [ebp - 0x810], 0xc
mov dword [esp + 0x18], 0x800
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x81c]
call eax
sub esp, 0x1c
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x933
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
mov dword [esp], esi
call fcn.00401ac0
test esi, esi
je 0x40b6e9
lea eax, [ebp - 0x80c]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptDecrypt]
mov dword [ebp - 0x824], eax
call eax
sub esp, 0x18
mov esi, eax
mov eax, 0x937
call fcn.00401310
mov eax, dword [edi + 0x34]
test esi, esi
je 0x40b8b0
xor esi, esi
cmp dword [ebp - 0x810], 0xc
je 0x40c308
mov dword [esp + 8], eax
mov dword [esp], esi
mov dword [esp + 4], str._08lx_n
mov esi, dword fs:[0x18]
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [esi + 0x34], 0xdeadbeef
mov dword [ebp - 0x810], 1
mov dword [esp + 0x18], 0x2a
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x81c]
call eax
mov edx, dword [esi + 0x34]
sub esp, 0x1c
mov edi, eax
mov eax, 0x93f
mov dword [ebp - 0x828], edx
call fcn.00401310
mov edx, dword [ebp - 0x828]
test edi, edi
mov dword [esp + 4], str._08lx_n
sete cl
xor eax, eax
cmp edx, 0xea
mov dword [esp + 8], edx
sete al
and eax, ecx
mov dword [esp], eax
call fcn.00401ac0
lea ecx, [ebp - 0x80c]
mov dword [ebp - 0x810], 0x7d7
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], 0x800
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x81c]
call eax
mov edx, dword [esi + 0x34]
sub esp, 0x1c
mov edi, eax
mov eax, 0x945
mov dword [ebp - 0x828], edx
call fcn.00401310
mov edx, dword [ebp - 0x828]
test edi, edi
mov dword [esp + 4], str._08lx_n
sete cl
xor eax, eax
cmp edx, 0x80090004
mov dword [esp + 8], edx
sete al
and eax, ecx
mov dword [esp], eax
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [esi + 0x34], 0xdeadbeef
mov dword [ebp - 0x810], 0xc
mov dword [ebp - 0x80c], 0x656e6957
mov dword [ebp - 0x808], 0x636f7220
mov dword [ebp - 0x804], 0x21736b
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x824]
call eax
mov esi, dword [esi + 0x34]
sub esp, 0x18
mov edi, eax
mov eax, 0x94e
call fcn.00401310
xor eax, eax
test edi, edi
jne 0x40ba8f
mov eax, 1
cmp esi, 0x80090005
je 0x40ba8f
mov edi, dword [0x42b050]
test edi, edi
sete dl
xor eax, eax
cmp esi, 0x80090012
sete al
and eax, edx
mov dword [esp + 8], esi
mov dword [esp], eax
mov dword [esp + 4], str._08lx_n
mov edi, dword fs:[0x18]
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [ebp - 0x810], 0xc
mov dword [ebp - 0x80c], 0x656e6957
mov dword [ebp - 0x808], 0x636f7220
mov dword [ebp - 0x804], 0x21736b
mov dword [esp + 0x18], 0x800
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x81c]
call eax
sub esp, 0x1c
mov esi, eax
mov eax, 0x955
call fcn.00401310
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [ebp - 0x810], 0xb
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x824]
call eax
mov edi, dword [edi + 0x34]
sub esp, 0x18
mov esi, eax
mov eax, 0x95b
call fcn.00401310
mov eax, dword [ebp - 0x810]
test esi, esi
jne 0x40c278
cmp eax, 0xb
sete cl
xor edx, edx
cmp edi, 0x80090005
sete dl
and edx, ecx
mov dword [esp], edx
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str._08x__ld__08lx_n
mov edi, dword fs:[0x18]
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [ebp - 0x810], 0xc
mov dword [ebp - 0x80c], 0x656e6957
mov dword [ebp - 0x808], 0x636f7220
mov dword [ebp - 0x804], 0x21736b
mov dword [esp + 0x18], 0x800
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x81c]
call eax
sub esp, 0x1c
mov esi, eax
mov eax, 0x962
call fcn.00401310
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x824]
call eax
sub esp, 0x18
mov esi, eax
mov eax, 0x964
call fcn.00401310
mov eax, dword [edi + 0x34]
test esi, esi
je 0x40bcc5
xor esi, esi
cmp dword [ebp - 0x810], 0xc
je 0x40c358
mov dword [esp + 8], eax
mov dword [esp], esi
mov dword [esp + 4], str._08lx_n
call fcn.00401ac0
lea eax, [ebp - 0x814]
mov dword [ebp - 0x814], 0xdeadbeef
mov dword [ebp - 0x810], 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptGetKeyParam]
mov dword [ebp - 0x824], eax
call eax
sub esp, 0x14
mov esi, eax
mov eax, 0x969
call fcn.00401310
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp], esi
mov dword [esp + 8], eax
call fcn.00401ac0
mov eax, 0x96a
call fcn.00401310
mov edx, dword [ebp - 0x814]
mov eax, 1
cmp edx, 0x3b
je 0x40bd7c
mov esi, dword [0x42b050]
test esi, esi
sete cl
xor eax, eax
cmp edx, 0xffffffff
sete al
and eax, ecx
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.expected_CRYPT_MACCRYPT_WRITECRYPT_READCRYPT_DECRYPTCRYPT_ENCRYPT__got__08lx_n
call fcn.00401ac0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x824]
call eax
sub esp, 0x14
mov esi, eax
mov eax, 0x972
call fcn.00401310
xor eax, eax
mov edx, dword fs:[0x18]
mov ecx, dword [edx + 0x34]
test esi, esi
jne 0x40bdf4
mov eax, 1
cmp ecx, 0x80090003
je 0x40bdf4
xor eax, eax
cmp ecx, 0x80090011
sete al
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.expected_NTE_BAD_KEY_or_NTE_NOT_FOUND__got__08lx_n
mov edi, dword fs:[0x18]
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov esi, dword [sym.imp.advapi32.dll_CryptExportKey]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call esi
sub esp, 0x18
mov dword [ebp - 0x828], eax
mov eax, 0x977
call fcn.00401310
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x828]
mov dword [esp], edx
call fcn.00401ac0
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call esi
mov dword [ebp - 0x828], eax
sub esp, 0x18
mov eax, 0x97b
call fcn.00401310
mov edx, dword [ebp - 0x828]
mov eax, dword [edi + 0x34]
test edx, edx
jne 0x40c2a0
xor edx, edx
cmp eax, 0x8009000b
sete dl
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 4], str.expected_NTE_BAD_KEY_STATE__got__08lx_n
call fcn.00401ac0
lea eax, [ebp - 0x814]
or dword [ebp - 0x814], 4
mov edx, dword fs:[0x18]
mov dword [edx + 0x34], 0xdeadbeef
mov dword [ebp - 0x828], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptSetKeyParam]
mov dword [ebp - 0x82c], eax
call eax
sub esp, 0x10
mov edi, eax
mov eax, 0x982
call fcn.00401310
mov edx, dword [ebp - 0x828]
xor eax, eax
mov ecx, dword [edx + 0x34]
test edi, edi
jne 0x40bf6d
mov eax, 1
cmp ecx, 0x80090005
je 0x40bf6d
xor eax, eax
cmp ecx, 0x80090009
sete al
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.expected_NTE_BAD_DATA_or_NTE_BAD_FLAGS__got__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptDestroyKey]
mov dword [ebp - 0x828], eax
call eax
lea eax, [ebp - 0x818]
sub esp, 4
mov dword [esp + 8], eax
mov dword [esp + 4], 2
mov eax, dword [0x42b014]
mov dword [esp], eax
mov eax, dword [ebp - 0x820]
call eax
sub esp, 0xc
test eax, eax
je 0x40c2b8
mov dword [ebp - 0x814], 0xdeadbeef
lea eax, [ebp - 0x814]
mov dword [ebp - 0x810], 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x824]
call eax
sub esp, 0x14
mov edi, eax
mov eax, 0x993
call fcn.00401310
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp], edi
mov dword [esp + 8], eax
call fcn.00401ac0
mov eax, 0x994
call fcn.00401310
mov edx, dword [ebp - 0x814]
mov eax, 1
cmp edx, 0x3b
je 0x40c065
mov edi, dword [0x42b050]
test edi, edi
sete cl
xor eax, eax
cmp edx, 0xffffffff
sete al
and eax, ecx
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.expected_CRYPT_MACCRYPT_WRITECRYPT_READCRYPT_DECRYPTCRYPT_ENCRYPT__got__08lx_n
mov edi, dword fs:[0x18]
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call esi
sub esp, 0x18
mov dword [ebp - 0x820], eax
mov eax, 0x99c
call fcn.00401310
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x820]
mov dword [esp], edx
call fcn.00401ac0
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call esi
sub esp, 0x18
mov esi, eax
mov eax, 0x9a0
call fcn.00401310
mov eax, dword [edi + 0x34]
test esi, esi
jne 0x40c2f0
xor edx, edx
cmp eax, 0x8009000b
sete dl
mov dword [esp], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str.expected_NTE_BAD_KEY_STATE__got__08lx_n
mov edi, dword fs:[0x18]
call fcn.00401ac0
lea eax, [ebp - 0x814]
or dword [ebp - 0x814], 4
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x82c]
call eax
sub esp, 0x10
mov esi, eax
mov eax, 0x9a7
call fcn.00401310
mov edx, dword [edi + 0x34]
xor eax, eax
test esi, esi
jne 0x40c1bd
mov eax, 1
cmp edx, 0x80090005
je 0x40c1bd
xor eax, eax
cmp edx, 0x80090009
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.expected_NTE_BAD_DATA_or_NTE_BAD_FLAGS__got__08lx_n
call fcn.00401ac0
lea eax, [ebp - 0x80c]
mov dword [ebp - 0x810], 0xc
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], 0x800
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x81c]
call eax
sub esp, 0x1c
mov ebx, eax
mov eax, 0x9ad
call fcn.00401310
xor eax, eax
mov edx, dword fs:[0x18]
mov ecx, dword [edx + 0x34]
test ebx, ebx
jne 0x40c244
xor eax, eax
cmp ecx, 0x80090003
sete al
mov dword [esp], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], str._08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 0xc
sete cl
cmp esi, 1
sete dl
test cl, dl
je 0x40c294
cmp edi, 0x3f0
je 0x40c340
xor edx, edx
jmp 0x40bbb9
mov ecx, dword [0x42b050]
xor edx, edx
test ecx, ecx
sete dl
jmp 0x40bed8
mov eax, 0x98c
call fcn.00401310
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 8], eax
mov eax, dword [0x42b010]
mov dword [esp], str.No_signature_key_in_provider__s_found__error__lx._n
mov eax, dword [eax*4 + 0x419230]
mov dword [esp + 4], eax
call fcn.00401430
jmp 0x40b6e9
mov ecx, dword [0x42b050]
xor edx, edx
test ecx, ecx
sete dl
jmp 0x40c139
cmp dword [ebp - 0x80c], 0x656e6957
je 0x40c378
mov esi, 1
xor esi, 1
jmp 0x40b8b0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDestroyKey]
sub esp, 4
jmp 0x40b6e9
mov ecx, dword [0x42b050]
xor edx, edx
test ecx, ecx
sete dl
jmp 0x40bbb9
cmp dword [ebp - 0x80c], 0x656e6957
je 0x40c398
mov esi, 1
xor esi, 1
jmp 0x40bcc5
cmp dword [ebp - 0x808], 0x636f7220
jne 0x40c314
cmp dword [ebp - 0x804], 0x21736b
jne 0x40c314
jmp 0x40c319
cmp dword [ebp - 0x808], 0x636f7220
jne 0x40c364
cmp dword [ebp - 0x804], 0x21736b
jne 0x40c364
jmp 0x40c369