Function at 0x4044e0
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 0x404807
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
push 0
push 3
push ecx
push edx
call fcn.00408e80
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 0x404807
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 0x404561
mov eax, dword [edi]
mov eax, dword [eax + 0x20]
jmp 0x404566
mov ecx, dword [edi]
mov eax, dword [ecx + 0x28]
push ebx
push eax
lea edi, [esp + 0x24]
call fcn.00402ac0
test al, al
je 0x4047f7
mov eax, esi
jmp 0x404580
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x404580
jmp 0x404590
sub eax, 2
cmp eax, esi
je 0x4045a2
cmp word [eax], 0x5c
jne 0x404590
lea ebx, [eax + 2]
jmp 0x4045af
cmp word [eax], 0x5c
jne 0x4045ad
lea ebx, [eax + 2]
jmp 0x4045af
mov ebx, esi
mov eax, ebx
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4045b1
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 0x4045df
mov edx, 0x10
sub edx, ecx
add eax, edx
mov dword [esp + 0x20], eax
test eax, eax
je 0x4047f3
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 0x4047f3
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.00404a20
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 0x4047e3
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 0x4047e3
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x20]
jb 0x4047e3
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x2c]
push edx
push ebp
call edi
test eax, eax
je 0x4047e3
cmp dword [esp + 0x18], 4
jb 0x4047e3
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 0x4047e3
cmp dword [esp + 0x18], 0x10
jb 0x4047e3
cmp byte [esp + 0x17], 1
mov ebx, dword [esp + 0x40]
jne 0x404706
mov edx, dword [ebx]
mov eax, dword [edx + 0x24]
jmp 0x40470f
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 0x4047e3
cmp dword [esp + 0x18], 0x80
jb 0x4047e3
push 0
lea eax, [esp + 0x1c]
push eax
push 4
push 0x41a02c
push ebp
call edi
test eax, eax
je 0x4047e3
cmp dword [esp + 0x18], 4
jb 0x4047e3
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
push 0x41a020
push ebp
call edi
test eax, eax
je 0x4047e3
cmp dword [esp + 0x18], 4
jb 0x4047e3
cmp byte [esp + 0x17], 1
jne 0x404783
mov edx, dword [ebx]
mov eax, dword [edx + 0x20]
jmp 0x404788
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 0x4047e3
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 0x4047e3
lea eax, [esp + 0x28]
push eax
push edi
mov edi, ebx
mov ebx, ebp
call fcn.00404400
add esp, 8
test al, al
je 0x4047e3
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 0x404816
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