Function at 0x40e4c0
Capabilities:
Create new key via cryptacquirecontext
Hash data using sha1
Hash data using sha1 via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xe24
mov eax, dword [0x418064]
xor eax, esp
mov dword [esp + 0xe20], eax
push ebx
mov ebx, dword [ebp + 8]
xor eax, eax
push esi
push edi
mov edi, ecx
mov dword [esp + 0x18], ebx
cmp dword [edi + 0x40010], eax
je 0x40e7c1
cmp dword [edi + 0x4001c], eax
je 0x40e7c1
mov dword [esp + 0x14], eax
mov dword [esp + 0xc24], eax
mov byte [esp + 0x20], al
mov byte [esp + 0xc23], al
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x20]
push 0x404808
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40e77f
mov ecx, dword [edi + 0x40014]
lea eax, [esp + 0x20]
mov edx, dword [edi + 0x40018]
push eax
call fcn.0040afae
mov edx, dword [edi + 0x4001c]
mov esi, eax
mov dword [edi + 0x40014], esi
sub esi, dword [edi + 0x40010]
mov dword [esp + 0x14], 0x100
mov ecx, dword [edx + 0x2010]
sar esi, 1
sub ecx, 1
je 0x40e5bf
sub ecx, 1
je 0x40e58d
mov esi, 0x80004001
jmp 0x40e77f
push 0x20
push 1
push dword [edx + 0x24ac]
lea eax, [esp + 0x18]
push dword [edx + 0x24b0]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
je 0x40e5f5
lea eax, [esp + 0x1c]
push eax
push 2
push dword [esp + 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
jmp 0x40e626
push 0x10
push 1
push 0x404820
push 0x404810
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
push 8
push 1
push 0x404820
push 0x404810
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x40e601
call fcn.00405fe6
mov esi, eax
jmp 0x40e77f
mov eax, dword [edi + 0x4001c]
lea ecx, [esp + 0x1c]
push ecx
push 0
push 0
push dword [eax + 0x24a8]
add eax, 0x2014
push eax
push dword [esp + 0x20]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
je 0x40e5f5
lea eax, [esp + 0x10]
push eax
push 0
push 0
push 0x8004
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
je 0x40e5f5
push 0
lea eax, [esi + esi]
push eax
push dword [edi + 0x40010]
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40e5f5
mov eax, dword [edi + 0x4001c]
cmp byte [eax + 0x2019], 0x24
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0xc2c]
push eax
push 0
push 0
jne 0x40e7ba
push 2
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptSignHashA]
test eax, eax
je 0x40e5f5
mov ebx, dword [esp + 0x14]
xor ecx, ecx
test ebx, ebx
je 0x40e6c0
lea edx, [esp + ebx + 0xc27]
cmp ecx, 0x100
jae 0x40e6c0
mov al, byte [edx]
mov byte [esp + ecx + 0xd28], al
inc ecx
dec edx
cmp ecx, ebx
jb 0x40e6a9
cmp dword [esp + 0xc24], 0
jbe 0x40e6d7
and dword [esp + 0xc24], 0
mov byte [esp + 0x20], 0
lea eax, [esp + 0x20]
push 0x4053a0
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40e77b
push 0x405190
lea eax, [esp + 0x24]
push 0x405340
push eax
call fcn.004109f3
mov esi, eax
add esp, 0xc
test esi, esi
js 0x40e77b
lea eax, [esp + 0x20]
push 0x405394
push eax
call fcn.004109f3
pop ecx
pop ecx
mov esi, eax
test esi, esi
js 0x40e77b
push ebx
lea eax, [esp + 0xd2c]
push eax
mov eax, ebx
shl eax, 3
push eax
lea eax, [esp + 0x2c]
push 0x4053d4
push eax
call fcn.004109f3
add esp, 0x14
mov esi, eax
test esi, esi
js 0x40e77b
mov edx, 0x40484c
lea ecx, [esp + 0x20]
call fcn.0041075e
mov esi, eax
test esi, esi
js 0x40e77b
mov edx, dword [edi + 0x40018]
mov eax, ecx
mov ecx, dword [edi + 0x40014]
push eax
call fcn.0040afae
mov dword [edi + 0x40014], eax
mov ebx, dword [esp + 0x18]
cmp dword [esp + 0x10], 0
je 0x40e790
push dword [esp + 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
cmp dword [esp + 0xc], 0
je 0x40e7a3
push 0
push dword [esp + 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
test esi, esi
jns 0x40e7b6
push esi
push 0x404854
push ebx
call fcn.004109f3
add esp, 0xc
mov eax, esi
jmp 0x40e7c6
push 1
jmp 0x40e686
mov eax, 0x80049301
mov ecx, dword [esp + 0xe2c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00416650
mov esp, ebp
pop ebp
ret 4