Function at 0x46d640
Capabilities:
Encrypt or decrypt via wincrypt
Get file size
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
push 0xffffffffffffffff
push 0x489b20
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x4bc00c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x20], edx
cmp dword [ecx + 0x14], 8
jb 0x46d673
mov ecx, dword [ecx]
push 0
push 0x80
push 3
push 0
push 0
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x46d6df
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 0
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.Failed_to_open_input_file.
call fcn.0045fcf0
mov byte [ebp - 4], 1
mov dword [ebp - 4], ebx
or ecx, ebx
call fcn.00462c10
add esp, 8
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
push esi
call fcn.00471847
add esp, 4
mov edi, eax
lea eax, [ebp - 0x1c]
push 0
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x46d769
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 2
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.Failed_to_read_input_file.
call fcn.0045fcf0
mov byte [ebp - 4], 3
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.00471842
add esp, 4
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
lea eax, [ebp - 0x10]
push 0xf0000000
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
push 0
push eax
call ebx
test eax, eax
jne 0x46d819
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x80090016
je 0x46d7aa
call esi
cmp eax, 0x7ff6ffea
jne 0x46d819
push 0xf0000028
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
push 0
lea eax, [ebp - 0x10]
push eax
call ebx
test eax, eax
jne 0x46d819
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 4
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.CryptAcquireContext_failed.
call fcn.0045fcf0
mov byte [ebp - 4], 5
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
push edi
call fcn.00471842
add esp, 0xc
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push 0x8004
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x46d898
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 6
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.CryptCreateHash_failed.
call fcn.0045fcf0
mov byte [ebp - 4], 7
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
add esp, 8
push 0
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push edi
call fcn.00471842
add esp, 4
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x14], 8
mov eax, dword [ecx + 0x10]
jb 0x46d8a6
mov ecx, dword [ecx]
push 0
add eax, eax
push eax
push ecx
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
jne 0x46d927
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 8
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.CryptHashData_failed.
call fcn.0045fcf0
mov byte [ebp - 4], 9
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
add esp, 8
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
push 0
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push edi
call fcn.00471842
add esp, 4
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x18]
push eax
push 1
push dword [ebp - 0x14]
push 0x6602
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDeriveKey]
test eax, eax
jne 0x46d972
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 0xa
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.CryptDeriveKey_failed.
call fcn.0045fcf0
mov byte [ebp - 4], 0xb
jmp 0x46d8e4
lea eax, [ebp - 0x1c]
push eax
push edi
push 0
push 1
push 0
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x46d9d5
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 0xc
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.CryptDecrypt_failed.
call fcn.0045fcf0
mov byte [ebp - 4], 0xd
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
add esp, 8
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x46d8f6
mov ebx, dword [ebp - 0x20]
mov eax, ebx
cmp dword [ebx + 0x14], 8
jb 0x46d9e2
mov eax, dword [ebx]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
jne 0x46da30
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 0xe
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.Failed_to_create_output_file.
call fcn.0045fcf0
mov byte [ebp - 4], 0xf
jmp 0x46d9b5
mov eax, dword [ebp - 0x1c]
xor esi, esi
test eax, eax
je 0x46da59
mov ebx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isprint]
nop
movzx eax, byte [esi + edi]
push eax
call ebx
add esp, 4
test eax, eax
mov eax, dword [ebp - 0x1c]
jne 0x46da56
inc esi
cmp esi, eax
jb 0x46da40
mov ebx, dword [ebp - 0x20]
push 0
lea ecx, [ebp - 0x28]
sub eax, esi
push ecx
push eax
lea eax, [esi + edi]
mov esi, dword [ebp - 0x24]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x46dac7
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x48e2cc
call fcn.0045fcf0
mov dword [ebp - 4], 0x10
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.Failed_to_write_to_output_file.
call fcn.0045fcf0
mov byte [ebp - 4], 0x11
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 8
push esi
call eax
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x46d8f6
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call eax
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
push 0
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push edi
call fcn.00471842
add esp, 4
mov edx, ebx
mov ecx, ebx
call fcn.0046cff0
push ecx
mov dword [ebp - 0x24], esp
mov ecx, esp
push 0x48e2cc
test al, al
je 0x46db2f
call fcn.0045fcf0
mov dword [ebp - 4], 0x12
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.File_converted_to_UTF_8_and_saved_successfully.
call fcn.0045fcf0
mov byte [ebp - 4], 0x13
jmp 0x46db4f
call fcn.0045fcf0
mov dword [ebp - 4], 0x14
push ecx
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.Failed_to_convert_and_save_the_file.
call fcn.0045fcf0
mov byte [ebp - 4], 0x15
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
call fcn.00462c10
add esp, 8
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret