Function at 0x403be0
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 0x403f07
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
push 0
push 3
push ecx
push edx
call fcn.004078b0
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 0x403f07
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 0x403c61
mov eax, dword [edi]
mov eax, dword [eax + 0x20]
jmp 0x403c66
mov ecx, dword [edi]
mov eax, dword [ecx + 0x28]
push ebx
push eax
lea edi, [esp + 0x24]
call fcn.00402ac0
test al, al
je 0x403ef7
mov eax, esi
jmp 0x403c80
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x403c80
jmp 0x403c90
sub eax, 2
cmp eax, esi
je 0x403ca2
cmp word [eax], 0x5c
jne 0x403c90
lea ebx, [eax + 2]
jmp 0x403caf
cmp word [eax], 0x5c
jne 0x403cad
lea ebx, [eax + 2]
jmp 0x403caf
mov ebx, esi
mov eax, ebx
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403cb1
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 0x403cdf
mov edx, 0x10
sub edx, ecx
add eax, edx
mov dword [esp + 0x20], eax
test eax, eax
je 0x403ef3
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 0x403ef3
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.004040f0
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 0x403ee3
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 0x403ee3
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x20]
jb 0x403ee3
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x2c]
push edx
push ebp
call edi
test eax, eax
je 0x403ee3
cmp dword [esp + 0x18], 4
jb 0x403ee3
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 0x403ee3
cmp dword [esp + 0x18], 0x10
jb 0x403ee3
cmp byte [esp + 0x17], 1
mov ebx, dword [esp + 0x40]
jne 0x403e06
mov edx, dword [ebx]
mov eax, dword [edx + 0x24]
jmp 0x403e0f
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 0x403ee3
cmp dword [esp + 0x18], 0x80
jb 0x403ee3
push 0
lea eax, [esp + 0x1c]
push eax
push 4
push 0x419020
push ebp
call edi
test eax, eax
je 0x403ee3
cmp dword [esp + 0x18], 4
jb 0x403ee3
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
push 0x419014
push ebp
call edi
test eax, eax
je 0x403ee3
cmp dword [esp + 0x18], 4
jb 0x403ee3
cmp byte [esp + 0x17], 1
jne 0x403e83
mov edx, dword [ebx]
mov eax, dword [edx + 0x20]
jmp 0x403e88
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 0x403ee3
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 0x403ee3
lea eax, [esp + 0x28]
push eax
push edi
mov edi, ebx
mov ebx, ebp
call fcn.00403b00
add esp, 8
test al, al
je 0x403ee3
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 0x403f16
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