Function at 0x40bd10
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43ef58
mov eax, dword fs:[0]
push eax
sub esp, 0x28
mov eax, dword [0x458070]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov edi, dword [ebp + 8]
mov edx, 0xffff
cmp dx, di
jne 0x40bd51
xor eax, eax
jmp 0x40bf98
mov eax, dword [ebx + 0x20]
mov ecx, dword [eax]
test ecx, ecx
je 0x40bd85
mov edx, dword [ebx + 0x30]
mov esi, dword [edx]
lea eax, [ecx + esi*2]
cmp ecx, eax
jae 0x40bd80
lea ecx, [esi - 1]
mov ax, di
mov dword [edx], ecx
mov edx, dword [ebx + 0x20]
mov esi, dword [edx]
lea ecx, [esi + 2]
mov dword [edx], ecx
mov word [esi], di
jmp 0x40bf98
mov edx, 0xffff
cmp dword [ebx + 0x4c], 0
jne 0x40bd93
mov ax, dx
jmp 0x40bf98
mov esi, dword [ebx + 0xc]
lea eax, [ebx + 0x3c]
cmp dword [esi], eax
jne 0x40bdb3
mov edx, dword [ebx + 0x54]
mov ecx, dword [ebx + 0x50]
sub edx, ecx
mov dword [esi], ecx
mov eax, dword [ebx + 0x1c]
sar edx, 1
mov dword [eax], ecx
mov eax, dword [ebx + 0x2c]
mov dword [eax], edx
cmp dword [ebx + 0x38], 0
jne 0x40bddd
push dword [ebx + 0x4c]
push edi
call fcn.00424ff9
mov ecx, 0xffff
add esp, 8
cmp ax, cx
movzx eax, di
jne 0x40bf98
mov eax, ecx
jmp 0x40bf98
push 0
movzx eax, di
lea ecx, [ebp - 0x28]
push 8
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
call fcn.0040c620
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x14]
nop dword [eax + eax]
cmp ecx, 0x10
lea eax, [ebp - 0x28]
mov ecx, dword [ebx + 0x38]
lea edx, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
lea edi, [ebp - 0x30]
cmovae edx, dword [ebp - 0x28]
add eax, dword [ebp - 0x18]
mov esi, dword [ecx]
push edi
push eax
push edx
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x2a]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebx + 0x40]
push eax
call dword [esi + 0x1c]
test eax, eax
js 0x40bf88
cmp eax, 1
jg 0x40bf53
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x28]
mov edx, dword [ebp - 0x28]
cmp ecx, 0x10
mov esi, dword [ebp - 0x30]
cmovae eax, edx
sub esi, eax
je 0x40be8c
push dword [ebx + 0x4c]
cmp ecx, 0x10
lea eax, [ebp - 0x28]
push esi
cmovae eax, edx
push 1
push eax
call fcn.00428bb8
add esp, 0x10
cmp esi, eax
jne 0x40bf1b
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x2c]
mov byte [ebx + 0x3e], 1
cmp dword [ebp - 0x34], eax
jne 0x40bf42
test esi, esi
jne 0x40be10
mov edi, dword [ebp - 0x18]
cmp edi, 0x20
jae 0x40bf35
or eax, 0xffffffff
sub eax, edi
cmp eax, 8
jbe 0x40bf2b
lea esi, [edi + 8]
cmp esi, 0xfffffffe
ja 0x40bf2b
cmp ecx, esi
jae 0x40bf02
push edi
push esi
lea ecx, [ebp - 0x28]
call fcn.004052a0
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
test esi, esi
je 0x40be10
push 0
push 8
push edi
lea ecx, [ebp - 0x28]
call fcn.0040cd40
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
mov dword [ebp - 0x18], esi
cmovae eax, dword [ebp - 0x28]
mov byte [eax + esi], 0
jmp 0x40be08
test esi, esi
jne 0x40bede
cmp ecx, 0x10
mov dword [ebp - 0x18], esi
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
mov byte [eax], 0
jmp 0x40be08
mov eax, 0xffff
movzx eax, ax
movzx eax, ax
movzx esi, ax
jmp 0x40bf8d
push 0x44eca0
call fcn.0040e550
mov eax, 0xffff
movzx eax, ax
movzx esi, ax
jmp 0x40bf8d
mov eax, dword [ebp + 8]
movzx eax, ax
movzx eax, ax
movzx eax, ax
movzx esi, ax
jmp 0x40bf8d
cmp eax, 3
jne 0x40bf88
push dword [ebx + 0x4c]
push dword [ebp - 0x2c]
call fcn.00424ff9
mov ecx, 0xffff
add esp, 8
cmp ax, cx
je 0x40bf7e
mov eax, dword [ebp + 8]
movzx eax, ax
movzx eax, ax
movzx esi, ax
jmp 0x40bf8d
mov eax, ecx
movzx eax, ax
movzx esi, ax
jmp 0x40bf8d
mov esi, 0xffff
lea ecx, [ebp - 0x28]
call fcn.00402fa0
mov ax, si
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004102a3
mov esp, ebp
pop ebp
ret 4