Function at 0x40edb0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x3c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x4c]
push edi
cmp dword [esi + 0x28], 2
jne 0x40edda
mov al, byte [esi + 0x41]
test al, al
jne 0x40edda
mov dword [esp + 0x10], 0x18
mov dword [esp + 0x50], 0
jmp 0x40edea
mov dword [esp + 0x10], 8
mov dword [esp + 0x50], 0x100
mov ecx, dword [esp + 0x54]
mov ebp, dword [esi + 0x58]
mov eax, dword [esp + 0x50]
lea edi, [esp + 0x24]
mov edx, dword [ecx + 0x24]
mov ecx, 0xa
imul edx, ebp
lea ebx, [eax*4 + 0x36]
xor eax, eax
mov dword [esp + 0x14], eax
add edx, ebx
mov dword [esp + 0x18], eax
mov byte [esp + 0x16], dl
mov dword [esp + 0x1c], eax
mov byte [esp + 0x1e], bl
rep stosd dword es:[edi], eax
mov word [esp + 0x20], ax
mov ecx, edx
mov eax, edx
mov byte [esp + 0x14], 0x42
sar ecx, 8
sar eax, 0x10
sar edx, 0x18
mov byte [esp + 0x17], cl
mov byte [esp + 0x18], al
mov al, byte [esi + 0x54]
mov byte [esp + 0x19], dl
mov ecx, ebx
mov edx, ebx
sar ecx, 8
sar edx, 0x10
mov byte [esp + 0x28], al
mov eax, dword [esi + 0x54]
mov byte [esp + 0x1f], cl
mov byte [esp + 0x20], dl
mov ecx, eax
mov edx, eax
shr eax, 0x18
mov byte [esp + 0x2b], al
mov al, byte [esi + 0x58]
mov byte [esp + 0x2c], al
mov eax, ebp
shr eax, 0x18
mov byte [esp + 0x2f], al
mov eax, dword [esp + 0x10]
shr ecx, 8
shr edx, 0x10
mov byte [esp + 0x32], al
mov byte [esp + 0x29], cl
sar eax, 8
mov byte [esp + 0x2a], dl
mov ecx, ebp
mov edx, ebp
mov byte [esp + 0x33], al
mov al, byte [esi + 0xe5]
mov byte [esp + 0x15], 0x4d
sar ebx, 0x18
shr ecx, 8
shr edx, 0x10
cmp al, 2
mov byte [esp + 0x21], bl
mov byte [esp + 0x24], 0x28
mov byte [esp + 0x25], 0
mov byte [esp + 0x2d], cl
mov byte [esp + 0x2e], dl
mov byte [esp + 0x30], 1
mov byte [esp + 0x31], 0
jne 0x40ef4a
mov al, byte [esi + 0xe6]
mov cl, 0x64
imul cl
mov byte [esp + 0x3c], al
xor eax, eax
mov ax, word [esi + 0xe6]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 2
mov edx, eax
mov ecx, eax
sar edx, 8
sar eax, 0x18
mov byte [esp + 0x3d], dl
mov byte [esp + 0x3f], al
mov al, byte [esi + 0xe8]
mov dl, 0x64
imul dl
mov byte [esp + 0x40], al
xor eax, eax
mov ax, word [esi + 0xe8]
sar ecx, 0x10
lea eax, [eax + eax*4]
mov byte [esp + 0x3e], cl
lea eax, [eax + eax*4]
shl eax, 2
mov ecx, eax
mov edx, eax
sar ecx, 8
sar edx, 0x10
sar eax, 0x18
mov byte [esp + 0x41], cl
mov byte [esp + 0x42], dl
mov byte [esp + 0x43], al
mov ebx, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, ebx
sar eax, 8
lea ecx, [esp + 0x54]
push 0
mov byte [esp + 0x49], al
mov eax, dword [edi + 0xc]
push ecx
lea edx, [esp + 0x1c]
push 0xe
push edx
push eax
mov byte [esp + 0x58], bl
call ebp
cmp eax, 1
je 0x40ef8f
mov ecx, dword [esi]
push esi
mov dword [ecx + 0x14], 0x1f
mov edx, dword [esi]
call dword [edx]
add esp, 4
mov edx, dword [edi + 0xc]
lea eax, [esp + 0x54]
push 0
push eax
lea ecx, [esp + 0x2c]
push 0x28
push ecx
push edx
call ebp
cmp eax, 1
je 0x40efb9
mov eax, dword [esi]
push esi
mov dword [eax + 0x14], 0x1f
mov ecx, dword [esi]
call dword [ecx]
add esp, 4
test ebx, ebx
jle 0x40efca
push 4
push ebx
push edi
push esi
call fcn.0040f140
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret