Function at 0x401491
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using aes via winapi
Encrypt or decrypt via wincrypt
Hash data using sha1
Hash data using sha1 via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov dword [esp + 4], 0x40b068
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4014c4
mov dword [esp], str.Failed_to_open_input_file
call sub.msvcrt.dll_perror
jmp 0x401745
mov dword [esp + 0x10], 0xf0000000
mov dword [esp + 0xc], 0x18
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptAcquireContextA
sub esp, 0x14
test eax, eax
jne 0x401502
mov dword [esp], str.Error_in_CryptAcquireContext
call fcn.00401460
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x24]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x8004
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptCreateHash
sub esp, 0x14
test eax, eax
jne 0x40153f
mov dword [esp], str.Error_in_CryptCreateHash
call fcn.00401460
mov eax, dword [ebp - 0x24]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0x40a004
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptHashData
sub esp, 0x10
test eax, eax
jne 0x401575
mov dword [esp], str.Error_in_CryptHashData
call fcn.00401460
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x1c]
lea ecx, [ebp - 0x20]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
mov dword [esp + 4], 0x660e
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptDeriveKey
sub esp, 0x14
test eax, eax
jne 0x4015b1
mov dword [esp], str.Error_in_CryptDeriveKey
call fcn.00401460
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x40a014
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptSetKeyParam
sub esp, 0x10
test eax, eax
jne 0x4015e7
mov dword [esp], str.Error_in_CryptSetKeyParam
call fcn.00401460
mov dword [ebp - 0xc], 0
jmp 0x4016b1
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x10]
mov edx, dword [edx + 0xc]
and edx, 0x10
mov ecx, edx
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x18], 0x10
lea edx, [ebp - 0x38]
mov dword [esp + 0x14], edx
lea edx, [ebp - 0x34]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptEncrypt
sub esp, 0x1c
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x401651
mov dword [esp], str.Error_in_CryptEncrypt
call fcn.00401460
mov dword [esp + 8], 0
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x10]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
lea eax, [ebp - 0x34]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x38]
add eax, edx
mov dword [ebp - 0xc], eax
mov dword [esp + 8], 0
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp - 0x10]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x10
mov dword [esp + 4], 1
lea eax, [ebp - 0x34]
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4015f3
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Successfully_encrypted__s_n
call sub.msvcrt.dll_printf
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x401713
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptDestroyHash
sub esp, 4
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x401728
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptDestroyKey
sub esp, 4
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x401745
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.ADVAPI32.DLL_CryptReleaseContext
sub esp, 8
leave
ret