Function at 0x40b859
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x2c8]
sub esp, 0x348
mov eax, dword [0x42d43c]
xor eax, ebp
mov dword [ebp + 0x2c4], eax
cmp dword [ebp + 0x2dc], 3
push ebx
mov ebx, dword [ebp + 0x2d4]
push esi
push edi
mov esi, ecx
je 0x40b8ac
cmp dword [ebp + 0x2dc], 2
je 0x40b958
cmp dword [ebp + 0x2dc], 1
je 0x40b958
mov eax, 0x10000
jmp 0x40bbc1
mov eax, dword [esi + 4]
mov edi, dword [ebp + 0x2d0]
cmp edi, eax
je 0x40b8fe
cmp eax, 0xffffffff
je 0x40b8c6
push dword [esi]
call fcn.00409ba2
pop ecx
mov eax, dword [esi]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x40b8a2
cmp edi, dword [eax + 0x10]
jge 0x40b8e6
push eax
call fcn.00409964
jmp 0x40b8e5
push dword [esi]
call fcn.004099a2
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jl 0x40b8de
push dword [esi + 0x138]
push eax
call fcn.0040b41f
pop ecx
pop ecx
mov dword [esi + 4], edi
lea eax, [ebp - 0x71]
push eax
push dword [ebp + 0x2d8]
push ebx
push dword [esi]
call fcn.0040b57d
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x40b925
push dword [esi]
call fcn.00409ba2
or dword [esi + 4], 0xffffffff
pop ecx
cmp byte [ebp - 0x71], 0
je 0x40b932
xor eax, eax
jmp 0x40bbc1
test edi, edi
jle 0x40b940
mov eax, 0x600
jmp 0x40bbc1
xor eax, eax
cmp edi, 0xffffff96
setne al
dec eax
and eax, 0xfb001000
add eax, 0x5000000
jmp 0x40bbc1
cmp dword [esi + 4], 0xffffffff
je 0x40b966
push dword [esi]
call fcn.00409ba2
pop ecx
mov eax, dword [esi]
mov edi, dword [ebp + 0x2d0]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x40b8a2
cmp edi, dword [eax + 0x10]
jge 0x40b990
push eax
call fcn.00409964
jmp 0x40b98f
push dword [esi]
call fcn.004099a2
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jl 0x40b988
lea eax, [ebp - 0x70]
push eax
push edi
mov ecx, esi
call fcn.00409d10
test byte [ebp + 0x98], 0x10
je 0x40b9e7
cmp dword [ebp + 0x2dc], 1
je 0x40b92b
mov al, byte [ebx]
cmp al, 0x2f
je 0x40b9cd
cmp al, 0x5c
je 0x40b9cd
test al, al
je 0x40b9d2
cmp byte [ebx + 1], 0x3a
jne 0x40b9d2
push ebx
push 0
jmp 0x40b9da
push ebx
add esi, 0x140
push esi
call fcn.0040a163
pop ecx
xor eax, eax
jmp 0x40bbc0
cmp dword [ebp + 0x2dc], 1
jne 0x40b9f8
mov dword [ebp - 0x7c], ebx
jmp 0x40ba7f
mov al, byte [ebx]
mov edi, ebx
mov ecx, ebx
jmp 0x40ba0e
cmp al, 0x2f
je 0x40ba08
cmp al, 0x5c
jne 0x40ba0b
lea edi, [ecx + 1]
inc ecx
mov al, byte [ecx]
test al, al
jne 0x40ba00
lea eax, [ebp + 0x1c0]
push ebx
push eax
call fcn.0040fd90
cmp edi, ebx
pop ecx
pop ecx
jne 0x40ba8f
mov byte [ebp + 0x1c0], 0
push edi
lea eax, [ebp + 0x1c0]
push eax
lea ebx, [esi + 0x140]
push ebx
lea eax, [ebp + 0xbc]
push str._s_s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp + 0x1c0]
push eax
push ebx
call fcn.0040a163
add esp, 0x1c
xor eax, eax
push eax
push dword [ebp + 0x98]
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp + 0xbc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0xffffffff
jne 0x40baf7
mov eax, 0x200
jmp 0x40bbc1
mov eax, edi
sub eax, ebx
mov byte [ebp + eax + 0x1c0], 0
cmp byte [ebp + 0x1c0], 0x2f
je 0x40bac7
cmp byte [ebp + 0x1c0], 0x5c
je 0x40bac7
cmp byte [ebp + 0x1c0], 0
je 0x40ba2c
cmp byte [ebp + 0x1c1], 0x3a
jne 0x40ba2c
push edi
lea eax, [ebp + 0x1c0]
push eax
lea eax, [ebp + 0xbc]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp + 0x1c0]
push eax
push 0
call fcn.0040a163
add esp, 0x18
jmp 0x40ba5d
push dword [esi + 0x138]
push dword [esi]
call fcn.0040b41f
cmp dword [esi + 0x13c], 0
pop ecx
pop ecx
mov ebx, 0x4000
jne 0x40bb21
push ebx
call fcn.0040d547
pop ecx
mov dword [esi + 0x13c], eax
and dword [ebp - 0x78], 0
lea eax, [ebp - 0x71]
push eax
push ebx
push dword [esi + 0x13c]
push dword [esi]
call fcn.0040b57d
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x40bb74
test edi, edi
jl 0x40bb6b
jle 0x40bb61
push 0
lea eax, [ebp - 0x80]
push eax
push edi
push dword [esi + 0x13c]
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40bb7d
cmp byte [ebp - 0x71], 0
jne 0x40bb86
test edi, edi
jne 0x40bb25
mov dword [ebp - 0x78], 0x5000000
jmp 0x40bba4
mov dword [ebp - 0x78], 0x1000
jmp 0x40bba4
mov dword [ebp - 0x78], 0x400
jmp 0x40bba4
lea eax, [ebp + 0xac]
push eax
lea eax, [ebp + 0x9c]
push eax
lea eax, [ebp + 0xa4]
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x2dc], 1
je 0x40bbb6
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esi]
call fcn.00409ba2
mov eax, dword [ebp - 0x78]
pop ecx
mov ecx, dword [ebp + 0x2c4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040d7fc
add ebp, 0x2c8
leave
ret 0x10