Function at 0x40dbb0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x660
mov eax, dword [0x586e90]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov ebx, ecx
cmp dword [ebx + 4], 0xffffffff
mov esi, edx
push edi
mov dword [ebp - 0x650], esi
je 0x40dbdd
mov edi, dword [ebx]
call fcn.0040d200
mov eax, dword [ebx]
mov edi, dword [ebp + 8]
mov dword [ebx + 4], 0xffffffff
cmp edi, dword [eax + 4]
jl 0x40dc06
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0050ec37
mov esp, ebp
pop ebp
ret 4
cmp edi, dword [eax + 0x10]
jge 0x40dc18
mov esi, eax
call fcn.0040cb40
mov esi, dword [ebp - 0x650]
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jge 0x40dc73
nop
mov esi, dword [ebx]
test esi, esi
je 0x40dc66
cmp dword [esi + 0x18], 0
je 0x40dc66
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x40dc66
mov ecx, dword [esi + 0x50]
add ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
push 0
lea ecx, [ecx + edx + 0x2e]
add dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
push 0
lea edx, [esi + 0x78]
push edx
lea eax, [esi + 0x28]
push eax
mov eax, esi
call fcn.0040c740
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], edi
jl 0x40dc20
mov esi, dword [ebp - 0x650]
push edi
lea edx, [ebp - 0x64c]
mov ecx, ebx
call fcn.0040d380
mov edx, dword [ebp - 0x440]
shr edx, 4
test dl, 1
je 0x40dced
movzx eax, word [esi]
cmp eax, 0x2f
je 0x40dca8
cmp eax, 0x5c
je 0x40dca8
test ax, ax
je 0x40dcc8
cmp word [esi + 2], 0x3a
jne 0x40dcc8
push esi
push 0
call fcn.0040da30
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0050ec37
mov esp, ebp
pop ebp
ret 4
push esi
add ebx, 0x244
push ebx
call fcn.0040da30
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0050ec37
mov esp, ebp
pop ebp
ret 4
xor eax, eax
mov word [ebp - 0x41c], ax
movzx eax, word [esi]
mov edi, esi
mov ecx, esi
test ax, ax
je 0x40dd1d
cmp ax, 0x2f
je 0x40dd0e
cmp ax, 0x5c
jne 0x40dd11
lea edi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x40dd02
push 0x104
lea ecx, [ebp - 0x214]
push esi
push ecx
call fcn.00510b59
add esp, 0xc
cmp edi, esi
jne 0x40ddbc
xor edx, edx
mov word [ebp - 0x214], dx
push edi
lea ecx, [ebp - 0x214]
push ecx
lea esi, [ebx + 0x244]
push esi
push str._s_s_s
lea edx, [ebp - 0x41c]
call fcn.00409b40
lea edx, [ebp - 0x214]
push edx
push esi
call fcn.0040da30
add esp, 0x18
mov eax, dword [ebp - 0x440]
push 0
push eax
push 2
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x41c]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x658], edi
cmp edi, 0xffffffff
jne 0x40de27
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0050ec37
mov esp, ebp
pop ebp
ret 4
mov eax, edi
sub eax, esi
sar eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x214], cx
mov ax, word [ebp - 0x214]
cmp ax, 0x2f
je 0x40ddf6
cmp ax, 0x5c
je 0x40ddf6
test ax, ax
je 0x40dd43
cmp word [ebp - 0x212], 0x3a
jne 0x40dd43
push edi
lea edx, [ebp - 0x214]
push edx
push str._s_s
lea edx, [ebp - 0x41c]
call fcn.00409b40
add esp, 0xc
lea eax, [ebp - 0x214]
push eax
push 0
call fcn.0040da30
add esp, 8
jmp 0x40dd72
mov edx, dword [ebx + 0x23c]
mov eax, dword [ebx]
push edx
call fcn.0040ce30
add esp, 4
cmp dword [ebx + 0x240], 0
jne 0x40de54
push 0x4000
call fcn.0040f609
add esp, 4
mov dword [ebx + 0x240], eax
mov dword [ebp - 0x650], 0
mov edi, edi
mov ecx, dword [ebx + 0x240]
lea eax, [ebp - 0x651]
push eax
mov eax, dword [ebx]
push ecx
mov ecx, 0x4000
call fcn.0040cfa0
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x40df16
test esi, esi
js 0x40deb7
jle 0x40deaa
mov eax, dword [ebx + 0x240]
push 0
lea edx, [ebp - 0x65c]
push edx
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40df22
cmp byte [ebp - 0x651], 0
jne 0x40dec1
test esi, esi
jne 0x40de60
mov dword [ebp - 0x650], 0x5000000
mov edi, dword [ebx]
call fcn.0040d200
mov esi, dword [ebp - 0x650]
test esi, esi
jne 0x40def4
lea ecx, [ebp - 0x42c]
push ecx
mov ecx, dword [ebp - 0x658]
lea edx, [ebp - 0x43c]
push edx
lea eax, [ebp - 0x434]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov edx, dword [ebp - 0x658]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0050ec37
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 0x650], 0x1000
jmp 0x40dec1
mov dword [ebp - 0x650], 0x400
jmp 0x40dec1