Function at 0x403970
Capabilities:
Encrypt or decrypt via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ecx, 0x1e0
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x78c]
mov esi, section..data
push ebx
sub esp, 0xb28
mov dword [ebp - 0xb14], eax
rep movsd dword es:[edi], dword [esi]
lea edi, [ebp - 0xa7c]
mov eax, ecx
mov ecx, 0x3c
rep stosd dword es:[edi], eax
mov dword [ebp - 0xa3c], 1
mov dword [ebp - 0xa40], 1
mov dword [ebp - 0xa6c], 1
mov dword [ebp - 0xa70], 1
mov dword [ebp - 0x9dc], 1
mov dword [ebp - 0x9e0], 1
mov dword [ebp - 0xa0c], 1
mov dword [ebp - 0xa10], 1
call fcn.00401150
lea eax, [ebp - 0x98c]
lea ecx, [ebp - 0x78c]
mov dword [ebp - 0xb10], eax
movzx ebx, byte [ebp - 0xb10]
mov edi, ecx
mov dword [ebp - 0xb10], 0
neg ebx
jmp 0x403a40
add edi, 0x20
lea eax, [ebp - 0xc]
add dword [ebp - 0xb10], 1
add ebx, 1
cmp eax, edi
je 0x40400e
mov edx, dword [0x42b008]
test edx, edx
je 0x403a5b
mov eax, dword [ebp - 0xb10]
mov eax, dword [ebp + eax*4 - 0xa7c]
test eax, eax
jne 0x403a28
lea eax, [ebp - 0x98c]
lea esi, [esi]
lea edx, [ebx + eax]
add eax, 1
mov byte [eax - 1], dl
cmp eax, ecx
jne 0x403a68
lea eax, [ebp - 0xb08]
mov esi, dword fs:[0x18]
mov dword [esi + 0x34], 0xdeadbeef
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [edi + 4]
mov dword [esp + 4], eax
mov eax, dword [0x42b014]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptCreateHash]
sub esp, 0x14
test eax, eax
je 0x403fba
mov dword [ebp - 0xb18], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf6a
mov eax, dword [esi + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0xb14]
mov dword [esp + 4], str.Test___s__ld_:_CryptCreateHash_failed_with_error_0x_08lx_n
mov dword [esp + 8], edx
mov edx, dword [ebp - 0xb18]
mov dword [esp], edx
call fcn.00401ac0
lea ecx, [ebp - 0x98c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], ecx
mov dword [esp + 8], 0x200
mov eax, dword [ebp - 0xb08]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptHashData]
sub esp, 0x10
mov dword [ebp - 0xb18], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf6c
mov eax, dword [esi + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0xb14]
mov dword [esp + 4], str.Test___s__ld_:_CryptHashData_failed_with_error_0x_08lx_n
mov dword [esp + 8], edx
mov edx, dword [ebp - 0xb18]
mov dword [esp], edx
call fcn.00401ac0
lea ecx, [ebp - 0xb04]
mov dword [ebp - 0xb04], pe_nt_image_headers32
mov dword [esp + 0xc], ecx
lea ecx, [ebp - 0xafc]
mov dword [esp + 8], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 4], 2
mov eax, dword [ebp - 0xb08]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptGetHashParam]
sub esp, 0x14
mov dword [ebp - 0xb18], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf70
mov eax, dword [esi + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0xb14]
mov dword [esp + 4], str.Test___s__ld_:_CryptGetHashParam_failed_with_error_0x_08lx_n
mov dword [esp + 8], edx
mov edx, dword [ebp - 0xb18]
mov dword [esp], edx
call fcn.00401ac0
call fcn.00412e10
mov esi, dword [edi + 0xc]
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf71
mov eax, dword [ebp - 0xb04]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov ecx, dword [ebp - 0xb10]
cmp eax, esi
sete al
mov dword [esp + 0xc], ecx
mov edx, dword [ebp - 0xb14]
movzx eax, al
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], str.Test___s__ld_:_Expected_hash_len__d__got__ld_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf73
mov eax, 1
test esi, esi
je 0x403c8f
mov dword [esp + 8], esi
mov eax, dword [edi + 0x18]
mov dword [esp + 4], eax
lea eax, [ebp - 0xafc]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
test eax, eax
sete al
movzx eax, al
mov esi, dword [ebp - 0xb10]
mov dword [esp + 0xc], esi
mov esi, dword [ebp - 0xb14]
mov dword [esp], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str.Test___s__ld_:_Hash_comparison_failed_n
call fcn.00401ac0
lea eax, [ebp - 0xb0c]
mov edx, dword fs:[0x18]
mov dword [edx + 0x34], 0xdeadbeef
mov dword [ebp - 0xb18], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0xb08]
mov dword [esp + 8], eax
mov eax, dword [edi]
mov dword [esp + 4], eax
mov eax, dword [0x42b014]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDeriveKey]
sub esp, 0x14
mov esi, eax
test eax, eax
jne 0x403d1b
mov edx, dword [ebp - 0xb18]
mov eax, dword [edx + 0x34]
cmp dword [edi + 0x14], eax
je 0x403f9d
cmp eax, 0x57
je 0x403f9d
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf7c
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x34]
mov dword [ebp - 0xb18], edx
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0xb14]
mov dword [esp], esi
lea esi, [ebp - 0xb04]
mov dword [esp + 8], edx
mov dword [esp + 4], str.Test___s__ld_:_CryptDeriveKey_failed_with_error_0x_08lx_n
call fcn.00401ac0
lea eax, [ebp - 0xb00]
mov dword [ebp - 0xb04], 4
mov dword [ebp - 0xb00], 0xdeadbeef
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov eax, dword [ebp - 0xb0c]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptGetKeyParam]
sub esp, 0x14
mov esi, eax
call fcn.00412e10
mov edx, dword [ebp - 0xb18]
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf81
mov eax, dword [edx + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0xb14]
mov dword [esp], esi
mov dword [esp + 8], edx
mov dword [esp + 4], str.Test___s__ld_:_CryptGetKeyParam_failed_with_error__08lx_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov esi, dword [ebp - 0xb00]
mov dword [eax + 4], 0xf82
mov eax, dword [edi + 0x10]
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov ecx, dword [ebp - 0xb10]
cmp esi, eax
lea esi, [ebp - 0xb04]
sete al
mov dword [esp + 0xc], ecx
mov edx, dword [ebp - 0xb14]
movzx eax, al
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], str.Test___s__ld_:_Expected_chaining_mode__d__got__ld_n
call fcn.00401ac0
mov edx, dword [ebp - 0xb18]
mov dword [ebp - 0xb04], 4
mov dword [edx + 0x34], 0xdeadbeef
mov dword [esp + 0x14], esi
lea esi, [ebp - 0x98c]
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], 0x200
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0xb0c]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptEncrypt]
sub esp, 0x1c
mov esi, eax
call fcn.00412e10
mov edx, dword [ebp - 0xb18]
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf88
mov eax, dword [edx + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0xb14]
mov dword [esp], esi
mov dword [esp + 8], edx
mov dword [esp + 4], str.Test___s__ld_:_CryptEncrypt_failed_with_error_0x_08lx_n
call fcn.00401ac0
call fcn.00412e10
mov esi, dword [edi + 8]
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf89
mov eax, dword [ebp - 0xb04]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov ecx, dword [ebp - 0xb10]
cmp eax, esi
sete al
mov dword [esp + 0xc], ecx
mov edx, dword [ebp - 0xb14]
movzx eax, al
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], str.Test___s__ld_:_Expected_block_len__d__got__ld_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf8b
mov dword [esp + 8], esi
mov eax, dword [edi + 0x1c]
lea esi, [ebp - 0x98c]
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcmp
mov ecx, dword [ebp - 0xb10]
test eax, eax
sete al
mov dword [esp + 0xc], ecx
mov edx, dword [ebp - 0xb14]
movzx eax, al
mov dword [esp + 4], str.Test___s__ld_:_Encrypted_data_comparison_failed_n
mov dword [esp], eax
mov dword [esp + 8], edx
call fcn.00401ac0
mov eax, dword [ebp - 0xb0c]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDestroyKey]
sub esp, 4
mov eax, dword [ebp - 0xb08]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDestroyHash]
lea ecx, [ebp - 0x78c]
sub esp, 4
jmp 0x403a28
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xf66
mov eax, dword [esi + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xb10]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0xb14]
mov dword [esp + 4], str.Test___s__ld_:_Expected_NTE_BAD_ALGID__got_0x_08lx_n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [esi + 0x34], 0x80090008
sete al
mov dword [esp], eax
call fcn.00401ac0
lea ecx, [ebp - 0x78c]
jmp 0x403a28
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret