Function at 0x1040589
Capabilities:
Encrypt data using rc4 via winapi
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
sub esp, 0x28
push esi
push dword [ebp + 8]
xor esi, esi
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 8], esi
call fcn.0104142c
cmp dword [ebp + 0x10], esi
mov eax, dword [ebp + 0x1c]
mov dword [eax], esi
je 0x104075a
cmp dword [ebp + 0x14], esi
je 0x104075a
cmp dword [ebp + 0x18], esi
je 0x104075a
cmp dword [ebp + 8], esi
je 0x10405e2
cmp dword [ebp - 0x18], esi
jne 0x10405e2
mov esi, 0xc000009a
jmp 0x104075f
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
push edi
push eax
call fcn.01040420
mov edi, eax
cmp edi, esi
je 0x104060b
lea eax, [ebp - 0xc]
push eax
push esi
push esi
push 0x8004
push edi
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x1040617
mov dword [ebp - 4], 0xc0000321
jmp 0x104072c
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_CryptHashData]
push esi
push 0x20
push dword [ebp + 0x10]
push dword [ebp - 0xc]
call ebx
test eax, eax
je 0x1040724
cmp dword [ebp + 8], esi
je 0x1040651
push esi
lea ecx, [ebp - 0x28]
call fcn.010413a7
push eax
push 0x20
push edi
call dword [sym.imp.ADVAPI32.dll_CryptSetProvParam]
test eax, eax
je 0x1040724
mov edi, dword [sym.imp.ADVAPI32.dll_CryptSignHashW]
lea eax, [ebp - 0x10]
push eax
push esi
push esi
push esi
push 1
push dword [ebp - 0xc]
call edi
cmp dword [ebp - 0x10], esi
jbe 0x1040724
push dword [ebp - 0x10]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
cmp eax, esi
mov dword [ebp - 0x14], eax
jne 0x104068c
mov dword [ebp - 4], 0xc000009a
jmp 0x104072b
lea ecx, [ebp - 0x10]
push ecx
push eax
push esi
push esi
push 1
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x1040724
mov edi, dword [ebp + 0x1c]
push 0xf0000000
push 1
push esi
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x1040724
lea eax, [ebp - 8]
push eax
push esi
push esi
push 0x8004
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
je 0x1040724
push esi
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push dword [ebp - 8]
call ebx
test eax, eax
je 0x1040724
mov eax, dword [ebp + 0x10]
push esi
push 0x20
add eax, 0x20
push eax
push dword [ebp - 8]
call ebx
test eax, eax
je 0x1040724
push dword [ebp + 0x18]
push esi
push dword [ebp - 8]
push 0x6801
push dword [edi]
mov edi, dword [sym.imp.ADVAPI32.dll_CryptDeriveKey]
call edi
test eax, eax
je 0x1040724
push dword [ebp + 0x14]
mov eax, dword [ebp + 0x1c]
push esi
push dword [ebp - 8]
push 0x6602
push dword [eax]
call edi
test eax, eax
jne 0x104072b
mov dword [ebp - 4], 0xc0000321
pop ebx
cmp dword [ebp - 0xc], esi
mov edi, dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
je 0x104073c
push dword [ebp - 0xc]
call edi
cmp dword [ebp - 8], esi
je 0x1040746
push dword [ebp - 8]
call edi
cmp dword [ebp - 0x14], esi
pop edi
je 0x1040755
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov esi, dword [ebp - 4]
jmp 0x104075f
mov esi, 0xc000000d
lea ecx, [ebp - 0x28]
call fcn.010411db
mov eax, esi
pop esi
leave
ret 0x18