Function at 0x40daf0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x65c
mov eax, dword [0x4cdbb4]
xor eax, esp
mov dword [esp + 0x658], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov esi, edx
mov ebx, ecx
mov dword [esp + 0x14], esi
cmp edi, 3
je 0x40db4b
cmp edi, 2
je 0x40dc76
cmp edi, 1
je 0x40dc76
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x658]
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x40dbfa
cmp eax, 0xffffffff
je 0x40db68
mov edi, dword [ebx]
call fcn.0040d020
mov edi, dword [ebp + 8]
mov eax, dword [ebx]
mov dword [ebx + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x40db2f
cmp edi, dword [eax + 0x10]
jge 0x40db89
mov esi, eax
call fcn.0040c7f0
mov esi, dword [esp + 0x14]
mov edi, dword [ebp + 8]
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jge 0x40dbe6
mov esi, dword [ebx]
test esi, esi
je 0x40dbd6
cmp dword [esi + 0x18], 0
je 0x40dbd6
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x40dbd6
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.0040c390
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov ecx, dword [ebx]
mov edx, dword [ebp + 8]
cmp dword [ecx + 0x10], edx
jl 0x40db90
mov esi, dword [esp + 0x14]
mov edi, edx
mov eax, dword [ebx + 0x23c]
push eax
mov eax, dword [ebx]
call fcn.0040cc30
add esp, 4
mov dword [ebx + 4], edi
mov eax, dword [ebx]
lea ecx, [esp + 0x13]
push ecx
mov ecx, dword [ebp + 0xc]
push esi
call fcn.0040cdb0
mov esi, eax
add esp, 8
test esi, esi
jg 0x40dc21
mov edi, dword [ebx]
call fcn.0040d020
mov dword [ebx + 4], 0xffffffff
cmp byte [esp + 0x13], 0
jne 0x40dd7d
test esi, esi
jle 0x40dc4c
mov eax, 0x600
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x658]
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
mov eax, esi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x658]
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebx + 4], 0xffffffff
je 0x40dc86
mov edi, dword [ebx]
call fcn.0040d020
mov edi, dword [ebp + 0x10]
mov eax, dword [ebx]
mov ecx, dword [ebp + 8]
mov dword [ebx + 4], 0xffffffff
cmp ecx, dword [eax + 4]
jge 0x40db2f
cmp ecx, dword [eax + 0x10]
jge 0x40dcb1
mov esi, eax
call fcn.0040c7f0
mov esi, dword [esp + 0x14]
mov edi, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
mov edx, dword [ebx]
cmp dword [edx + 0x10], ecx
jge 0x40dd0f
mov esi, dword [ebx]
test esi, esi
je 0x40dd01
cmp dword [esi + 0x18], 0
je 0x40dd01
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x40dd01
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.0040c390
mov ecx, dword [ebp + 8]
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov edx, dword [ebx]
cmp dword [edx + 0x10], ecx
jl 0x40dcb8
mov esi, dword [esp + 0x14]
mov edi, dword [ebp + 0x10]
push ecx
lea edx, [esp + 0x24]
mov ecx, ebx
call fcn.0040d240
mov eax, dword [esp + 0x22c]
shr eax, 4
test al, 1
je 0x40dd96
cmp edi, 1
je 0x40dd7d
movzx eax, word [esi]
cmp ax, 0x2f
je 0x40dd49
cmp ax, 0x5c
je 0x40dd49
test ax, ax
je 0x40dd6d
cmp word [esi + 2], 0x3a
jne 0x40dd6d
push esi
push 0
call fcn.0040d940
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x658]
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
push esi
add ebx, 0x244
push ebx
call fcn.0040d940
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x658]
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
xor ecx, ecx
mov word [esp + 0x458], cx
cmp edi, 1
jne 0x40ddae
mov dword [esp + 0x14], esi
jmp 0x40de65
movzx eax, word [esi]
mov edi, esi
mov ecx, esi
test ax, ax
je 0x40dddb
movzx eax, ax
lea ecx, [ecx]
cmp ax, 0x2f
je 0x40ddcc
cmp ax, 0x5c
jne 0x40ddcf
lea edi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x40ddc0
push 0x104
push esi
lea edx, [esp + 0x258]
push 0x104
push edx
call fcn.0048810c
add esp, 0x10
cmp edi, esi
jne 0x40de8c
xor eax, eax
mov word [esp + 0x250], ax
push edi
lea eax, [esp + 0x254]
push eax
lea esi, [ebx + 0x244]
push esi
lea ecx, [esp + 0x464]
push str._s_s_s
push ecx
call fcn.0040e6b0
add esp, 0x14
lea edx, [esp + 0x250]
push edx
push esi
call fcn.0040d940
add esp, 8
mov eax, dword [esp + 0x22c]
push 0
push eax
push 2
push 0
push 0
push 0x40000000
lea ecx, [esp + 0x470]
push ecx
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [esp + 0x14], eax
cmp dword [esp + 0x14], 0xffffffff
jne 0x40defa
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x658]
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
mov ecx, edi
sub ecx, esi
sar ecx, 1
xor edx, edx
mov word [esp + ecx*2 + 0x250], dx
mov ax, word [esp + 0x250]
cmp ax, 0x2f
je 0x40dec8
cmp ax, 0x5c
je 0x40dec8
test ax, ax
je 0x40de08
cmp word [esp + 0x252], 0x3a
jne 0x40de08
push edi
lea eax, [esp + 0x254]
push eax
lea ecx, [esp + 0x460]
push str._s_s
push ecx
call fcn.0040e6b0
lea edx, [esp + 0x260]
push edx
push 0
call fcn.0040d940
add esp, 0x18
jmp 0x40de3e
mov edx, dword [ebx + 0x23c]
mov eax, dword [ebx]
push edx
call fcn.0040cc30
add esp, 4
cmp dword [ebx + 0x240], 0
jne 0x40df27
push 0x4000
call fcn.00441b61
add esp, 4
mov dword [ebx + 0x240], eax
mov esi, dword [sym.imp.KERNEL32.DLL_WriteFile]
mov dword [esp + 0x18], 0
mov ecx, dword [ebx + 0x240]
lea eax, [esp + 0x13]
push eax
mov eax, dword [ebx]
push ecx
mov ecx, 0x4000
call fcn.0040cdb0
mov edi, eax
add esp, 8
cmp edi, 0xffffff96
je 0x40dfea
test edi, edi
jl 0x40df86
jle 0x40df7b
mov eax, dword [ebx + 0x240]
mov ecx, dword [esp + 0x14]
push 0
lea edx, [esp + 0x20]
push edx
push edi
push eax
push ecx
call esi
test eax, eax
je 0x40dff4
cmp byte [esp + 0x13], 0
jne 0x40df8e
test edi, edi
jne 0x40df35
mov dword [esp + 0x18], 0x5000000
mov edi, dword [ebx]
call fcn.0040d020
mov esi, dword [esp + 0x18]
test esi, esi
jne 0x40dfc0
lea edx, [esp + 0x240]
push edx
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x234]
push eax
lea ecx, [esp + 0x240]
push ecx
push edx
call dword [sym.imp.KERNEL32.DLL_SetFileTime]
cmp dword [ebp + 0x10], 1
je 0x40dfd1
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov ecx, dword [esp + 0x664]
pop edi
mov eax, esi
pop esi
pop ebx
xor ecx, esp
call fcn.004874cc
mov esp, ebp
pop ebp
ret 0xc
mov dword [esp + 0x18], 0x1000
jmp 0x40df8e
mov dword [esp + 0x18], 0x400
jmp 0x40df8e