Function at 0x406170
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4340
call fcn.00439f40
mov eax, dword [0x4580b4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov ebx, ecx
or esi, 0xffffffff
push edi
mov dword [ebp - 0x4340], eax
cmp dword [ebx + 4], esi
je 0x4061a4
mov edi, dword [ebx]
call fcn.004059e0
mov edi, dword [ebp + 8]
mov dword [ebx + 4], esi
mov esi, dword [ebx]
cmp edi, dword [esi + 4]
jl 0x4061c9
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043561f
mov esp, ebp
pop ebp
ret 8
cmp edi, dword [esi + 0x10]
jge 0x4061d3
call fcn.00405440
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], edi
jge 0x40622d
lea ebx, [ebx]
mov esi, dword [ebx]
test esi, esi
je 0x406226
cmp dword [esi + 0x18], 0
je 0x406226
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x406226
mov edx, dword [esi + 0x50]
add edx, dword [esi + 0x4c]
mov ecx, dword [esi + 0x48]
push 0
mov dword [esi + 0x10], eax
lea edx, [edx + ecx + 0x2e]
add dword [esi + 0x14], edx
push 0
lea eax, [esi + 0x78]
push eax
lea ecx, [esi + 0x28]
push ecx
mov eax, esi
call fcn.00404fe0
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov edx, dword [ebx]
cmp dword [edx + 0x10], edi
jl 0x4061e0
push edi
lea edx, [ebp - 0x4338]
mov ecx, ebx
call fcn.00405a70
test byte [ebp - 0x4230], 0x10
je 0x4062a4
push 0x206
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.00436cb0
add esp, 0xc
push 0x103
lea ecx, [ebp - 0x20c]
push ecx
push 0xffffffffffffffff
lea edx, [ebp - 0x4334]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebp - 0x20c]
push eax
add ebx, 0x138
push ebx
call fcn.00406070
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043561f
mov esp, ebp
pop ebp
ret 8
mov edi, dword [ebp - 0x4340]
movzx eax, word [edi]
mov esi, edi
mov ecx, edi
test ax, ax
je 0x406388
lea ebx, [ebx]
cmp ax, 0x2f
je 0x4062cc
cmp ax, 0x5c
jne 0x4062cf
lea esi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x4062c0
cmp esi, edi
je 0x406388
lea edx, [ebp - 0x20c]
mov eax, edi
sub edx, edi
lea ecx, [ecx]
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4062f0
sub esi, edi
sar esi, 1
xor ecx, ecx
mov word [ebp + esi*2 - 0x20e], cx
mov ax, word [ebp - 0x20c]
cmp ax, 0x2f
je 0x406330
cmp ax, 0x5c
je 0x406330
cmp word [ebp - 0x20a], 0x3a
mov byte [ebp - 0x4339], cl
jne 0x406337
mov byte [ebp - 0x4339], 1
lea edx, [ebp - 0x20c]
push 0x4554a0
push edx
call fcn.004364d9
mov esi, eax
lea eax, [ebp - 0x20c]
push 0x4554a8
push eax
call fcn.004364d9
add esp, 0x10
test eax, eax
setne cl
test esi, esi
setne dl
or cl, dl
or cl, byte [ebp - 0x4339]
jne 0x406388
lea eax, [ebp - 0x20c]
push eax
lea ecx, [ebx + 0x138]
push ecx
call fcn.00406070
add esp, 8
mov edx, dword [ebp - 0x4230]
push 0
push edx
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4063c2
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043561f
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebx]
call fcn.00405730
lea eax, [ebp - 0x420c]
push eax
mov eax, dword [ebx]
mov ecx, 0x4000
mov byte [ebp - 0x4339], 0
call fcn.00405840
add esp, 4
test eax, eax
js 0x406424
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x40642b
push 0
lea ecx, [ebp - 0x4340]
push ecx
push eax
lea edx, [ebp - 0x420c]
push edx
push esi
call edi
test eax, eax
je 0x406424
lea eax, [ebp - 0x420c]
push eax
mov eax, dword [ebx]
mov ecx, 0x4000
call fcn.00405840
add esp, 4
test eax, eax
jns 0x4063f0
mov byte [ebp - 0x4339], 1
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x40645c
cmp byte [ebp - 0x4339], 0
jne 0x40645c
lea ecx, [ebp - 0x421c]
push ecx
lea edx, [ebp - 0x422c]
push edx
lea eax, [ebp - 0x4224]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebx]
call fcn.004059e0
movzx eax, byte [ebp - 0x4339]
mov ecx, dword [ebp - 4]
neg eax
pop edi
sbb eax, eax
pop esi
xor ecx, ebp
and eax, 0x400
pop ebx
call fcn.0043561f
mov esp, ebp
pop ebp
ret 8