Function at 0x100040e0
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using rc4 via winapi
Encrypt or decrypt via wincrypt
Hash data via wincrypt
Hash data with md5
Initialize hashing via wincrypt
Print debug messages

Disassembly:
sub esp, 0x9c
mov eax, dword [0x10052084]
xor eax, esp
mov dword [esp + 0x98], eax
mov eax, dword [esp + 0xa0]
push ebp
mov ebp, dword [esp + 0xa8]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
push 0
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
push 0
lea edx, [esp + 0x1c]
push edx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
call esi
test eax, eax
jne 0x1000418f
push 8
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
push eax
lea eax, [esp + 0x1c]
push eax
call esi
test eax, eax
jne 0x1000418f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
lea ecx, [esp + 0x25]
push 0
push ecx
mov esi, eax
mov byte [esp + 0x2c], 0
call fcn.1002fe50
push esi
push str.Error_during_CryptAcquireContext___lu__n
lea edx, [esp + 0x34]
push edx
call fcn.1002b5cf
add esp, 0x18
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.1002b34a
add esp, 0x9c
ret
mov edx, dword [esp + 0xc]
lea ecx, [esp + 8]
push ecx
push 0
push 0
push 0x8003
push edx
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x100041fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
mov esi, eax
lea eax, [esp + 0x25]
push 0
push eax
mov byte [esp + 0x2c], 0
call fcn.1002fe50
push esi
lea ecx, [esp + 0x30]
push str.Error_during_CryptCreateHash___lu__n
push ecx
call fcn.1002b5cf
add esp, 0x18
lea edx, [esp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.1002b34a
add esp, 0x9c
ret
mov eax, dword [esp + 8]
push 0
push 0x10
push str.Smtz2007Security
push eax
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
jne 0x1000423c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
lea ecx, [esp + 0x25]
push 0
push ecx
mov esi, eax
mov byte [esp + 0x2c], 0
call fcn.1002fe50
push esi
push str.Error_during_CryptHashData___lu__n
jmp 0x1000415e
mov edx, dword [esp + 8]
mov eax, dword [esp + 0xc]
lea ecx, [esp + 0x10]
push ecx
push 0x800000
push edx
push 0x6801
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDeriveKey]
test eax, eax
jne 0x10004285
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
lea ecx, [esp + 0x25]
push 0
push ecx
mov esi, eax
mov byte [esp + 0x2c], 0
call fcn.1002fe50
push esi
push str.Error_during_CryptDeriveKey___lu__n
jmp 0x1000415e
mov eax, dword [esp + 8]
test eax, eax
je 0x100042c6
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
test eax, eax
jne 0x100042be
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
lea ecx, [esp + 0x25]
push 0
push ecx
mov esi, eax
mov byte [esp + 0x2c], 0
call fcn.1002fe50
push esi
push str.Error_during_CryptDestroyHash.__lu__n
jmp 0x1000415e
mov dword [esp + 8], 0
push edi
mov edi, ebx
and edi, 7
add edi, ebx
push edi
call fcn.1001c248
mov esi, eax
add esp, 4
test esi, esi
jne 0x10004302
push str.Out_of_memory._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.1002b34a
add esp, 0x9c
ret
push edi
push ebp
push esi
call fcn.10033a50
mov edx, dword [esp + 0x20]
add esp, 0xc
lea ecx, [esp + 0x18]
push ecx
push esi
push 0
push 1
push 0
push edx
mov dword [esp + 0x30], ebx
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x10004388
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
mov edi, eax
lea eax, [esp + 0x29]
push 0
push eax
mov byte [esp + 0x30], 0
call fcn.1002fe50
push edi
lea ecx, [esp + 0x34]
push str.Error_during_CryptDecrypt___lu__n
push ecx
call fcn.1002b5cf
add esp, 0x18
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push esi
call fcn.1002b1d9
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.1002b34a
add esp, 0x9c
ret
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
push edi
push esi
push eax
call fcn.10033a50
mov ecx, dword [esp + 0x2c]
push esi
mov dword [ecx], edi
call fcn.1002b1d9
mov eax, dword [esp + 0x24]
add esp, 0x10
test eax, eax
je 0x100043dd
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
test eax, eax
jne 0x100043dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
lea edx, [esp + 0x29]
push 0
push edx
mov esi, eax
mov byte [esp + 0x30], 0
call fcn.1002fe50
push esi
push str.Error_during_CryptDestroyKey.__lu__n
jmp 0x10004413
mov eax, dword [esp + 0x10]
test eax, eax
je 0x10004445
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
test eax, eax
jne 0x10004445
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7f
lea edx, [esp + 0x29]
push 0
push edx
mov esi, eax
mov byte [esp + 0x30], 0
call fcn.1002fe50
push esi
push str.Error_during_CryptReleaseContext.__lu__n
lea eax, [esp + 0x38]
push eax
call fcn.1002b5cf
add esp, 0x18
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.1002b34a
add esp, 0x9c
ret
mov ecx, dword [esp + 0xa4]
pop edi
pop esi
pop ebp
xor ecx, esp
mov eax, 1
call fcn.1002b34a
add esp, 0x9c
ret