Function at 0x411068
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x1af0
call fcn.004120c0
mov eax, dword [0x416040]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x10]
xor ebx, ebx
mov dword [ebp - 0x1ac0], ecx
mov dword [ebp - 0x1abc], eax
mov dword [ebp - 0x1ad8], ebx
push edi
mov edi, ebx
test esi, esi
jne 0x4110ae
xor eax, eax
jmp 0x41187d
test eax, eax
jne 0x4110d9
call fcn.0040b9be
mov dword [eax], ebx
call fcn.0040b9fe
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], 0x16
call fcn.0040ba5e
add esp, 0x14
or eax, 0xffffffff
jmp 0x41187d
mov eax, ecx
mov edx, ecx
sar edx, 5
and eax, 0x1f
imul eax, eax, 0x24
mov dword [ebp - 0x1adc], edx
mov edx, dword [edx*4 + 0x418da0]
mov dword [ebp - 0x1ad0], eax
mov ebx, dword [eax + edx + 8]
and ebx, 3
cmp ebx, 2
je 0x41110a
cmp ebx, 1
jne 0x411121
mov eax, esi
not eax
test al, 1
jne 0x41111b
call fcn.0040b9be
xor ebx, ebx
jmp 0x4110b7
mov eax, dword [ebp - 0x1ad0]
test byte [eax + edx + 4], 0x20
je 0x41113d
push 2
push 0
push 0
push ecx
call fcn.004123e3
mov ecx, dword [ebp - 0x1ac0]
add esp, 0x10
push ecx
call fcn.0040fa08
pop ecx
mov ecx, dword [ebp - 0x1ad0]
test eax, eax
je 0x411428
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
test byte [ecx + eax + 4], 0x80
je 0x411428
call fcn.00409b15
xor ecx, ecx
mov eax, dword [eax + 0x6c]
cmp dword [eax + 0x14], ecx
lea eax, [ebp - 0x1ae4]
push eax
mov eax, dword [ebp - 0x1adc]
sete cl
mov dword [ebp - 0x1ac0], ecx
mov ecx, dword [ebp - 0x1ad0]
mov eax, dword [eax*4 + 0x418da0]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x411422
cmp dword [ebp - 0x1ac0], edi
je 0x4111bb
test ebx, ebx
je 0x411422
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov edx, dword [ebp - 0x1abc]
mov ecx, edx
and dword [ebp - 0x1ac4], edi
mov dword [ebp - 0x1af0], eax
mov dword [ebp - 0x1ad4], ecx
test esi, esi
je 0x411417
xor eax, eax
mov dword [ebp - 0x1ae8], 0xa
mov dword [ebp - 0x1ac8], eax
test ebx, ebx
jne 0x411368
mov al, byte [ecx]
xor ecx, ecx
cmp al, 0xa
movsx eax, al
push eax
sete cl
mov dword [ebp - 0x1ac0], ecx
call fcn.0040fc5d
pop ecx
mov ecx, dword [ebp - 0x1ad4]
test eax, eax
jne 0x411249
push 1
push ecx
lea eax, [ebp - 0x1acc]
push eax
call fcn.0040ff52
add esp, 0xc
cmp eax, 0xffffffff
je 0x41140c
mov eax, dword [ebp - 0x1ad4]
mov ecx, dword [ebp - 0x1ac8]
jmp 0x411285
mov eax, dword [ebp - 0x1abc]
sub eax, ecx
add eax, esi
cmp eax, 1
jbe 0x41140c
push 2
push ecx
lea eax, [ebp - 0x1acc]
push eax
call fcn.0040ff52
add esp, 0xc
cmp eax, 0xffffffff
je 0x41140c
mov eax, dword [ebp - 0x1ad4]
mov ecx, dword [ebp - 0x1ac8]
inc eax
inc ecx
inc eax
inc ecx
mov dword [ebp - 0x1ac8], ecx
xor ecx, ecx
push ecx
push ecx
push 5
mov dword [ebp - 0x1ad4], eax
lea eax, [ebp - 0xc]
push eax
push 1
lea eax, [ebp - 0x1acc]
push eax
push ecx
push dword [ebp - 0x1af0]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x1ae4], eax
test eax, eax
je 0x41140c
push 0
lea ecx, [ebp - 0x1ac4]
push ecx
mov ecx, dword [ebp - 0x1ad0]
push eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4117fa
add edi, dword [ebp - 0x1ac4]
mov eax, dword [ebp - 0x1ae4]
cmp dword [ebp - 0x1ac4], eax
jl 0x41140c
cmp dword [ebp - 0x1ac0], 0
je 0x4113f8
mov ecx, dword [ebp - 0x1ad0]
lea eax, [ebp - 0x1ac4]
push 0
push eax
push 1
lea eax, [ebp - 0xc]
mov byte [ebp - 0xc], 0xd
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4117fa
cmp dword [ebp - 0x1ac4], 1
jl 0x41140c
inc dword [ebp - 0x1ad8]
inc edi
jmp 0x4113f8
cmp ebx, 1
je 0x411372
cmp ebx, 2
jne 0x4113a5
movzx eax, word [ecx]
xor edx, edx
cmp ax, word [ebp - 0x1ae8]
mov dword [ebp - 0x1acc], eax
mov eax, dword [ebp - 0x1ac8]
sete dl
add ecx, 2
mov dword [ebp - 0x1ac0], edx
add eax, 2
mov dword [ebp - 0x1ad4], ecx
mov dword [ebp - 0x1ac8], eax
cmp ebx, 1
je 0x4113af
cmp ebx, 2
jne 0x411404
push dword [ebp - 0x1acc]
call fcn.0041246d
pop ecx
cmp ax, word [ebp - 0x1acc]
jne 0x4117fa
add edi, 2
cmp dword [ebp - 0x1ac0], 0
je 0x4113f8
push 0xd
pop eax
push eax
mov dword [ebp - 0x1acc], eax
call fcn.0041246d
pop ecx
cmp ax, word [ebp - 0x1acc]
jne 0x4117fa
inc edi
inc dword [ebp - 0x1ad8]
mov eax, dword [ebp - 0x1ac8]
mov ecx, dword [ebp - 0x1ad4]
cmp eax, esi
jb 0x4111f5
mov esi, dword [ebp - 0x1ac0]
jmp 0x411802
mov esi, dword [ebp - 0x1ac0]
jmp 0x41180c
mov ecx, dword [ebp - 0x1ad0]
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
test byte [ecx + eax + 4], 0x80
je 0x4117d3
mov edx, dword [ebp - 0x1abc]
xor esi, esi
mov dword [ebp - 0x1acc], esi
test ebx, ebx
jne 0x41152f
mov dword [ebp - 0x1ac0], edx
cmp dword [ebp + 0x10], esi
jbe 0x41183a
xor ecx, ecx
lea ebx, [ebp - 0x140c]
mov eax, edx
mov dword [ebp - 0x1ae8], ecx
sub eax, dword [ebp - 0x1abc]
cmp eax, dword [ebp + 0x10]
jae 0x4114c4
mov cl, byte [edx]
inc edx
inc eax
mov byte [ebp - 0x1ae9], cl
cmp cl, 0xa
mov dword [ebp - 0x1ac0], edx
mov ecx, dword [ebp - 0x1ae8]
jne 0x4114a6
inc dword [ebp - 0x1ad8]
mov byte [ebx], 0xd
inc ebx
inc ecx
mov dl, byte [ebp - 0x1ae9]
mov byte [ebx], dl
inc ebx
mov edx, dword [ebp - 0x1ac0]
inc ecx
mov dword [ebp - 0x1ae8], ecx
cmp ecx, 0x13ff
jb 0x41147b
mov ecx, dword [ebp - 0x1ad0]
lea eax, [ebp - 0x140c]
sub ebx, eax
lea eax, [ebp - 0x1ae0]
push 0
push eax
push ebx
lea eax, [ebp - 0x140c]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4117fa
add edi, dword [ebp - 0x1ae0]
cmp dword [ebp - 0x1ae0], ebx
jl 0x411802
mov edx, dword [ebp - 0x1ac0]
mov eax, edx
sub eax, dword [ebp - 0x1abc]
cmp eax, dword [ebp + 0x10]
jb 0x411465
jmp 0x411802
cmp ebx, 2
jne 0x411656
mov eax, edx
mov dword [ebp - 0x1ac4], eax
cmp dword [ebp + 0x10], esi
jbe 0x41183a
mov dword [ebp - 0x1ae8], 0xa
mov dword [ebp - 0x1ac0], eax
lea ebx, [ebp - 0x140c]
xor ecx, ecx
sub dword [ebp - 0x1ac0], edx
mov edx, dword [ebp - 0x1ac0]
cmp edx, dword [ebp + 0x10]
jae 0x4115df
movzx esi, word [eax]
add edx, 2
add eax, 2
mov dword [ebp - 0x1ae4], esi
cmp si, word [ebp - 0x1ae8]
mov esi, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac4], eax
jne 0x4115b7
cmp ecx, 0x13fc
ja 0x4115d6
add dword [ebp - 0x1ad8], 2
push 0xd
pop eax
mov word [ebx], ax
add ebx, 2
mov eax, dword [ebp - 0x1ac4]
add ecx, 2
mov esi, dword [ebp - 0x1ae4]
add ecx, 2
mov word [ebx], si
add ebx, 2
mov esi, dword [ebp - 0x1acc]
cmp ecx, 0x13fe
jb 0x41156d
jmp 0x4115df
sub eax, 2
mov dword [ebp - 0x1ac4], eax
mov ecx, dword [ebp - 0x1ad0]
lea eax, [ebp - 0x140c]
sub ebx, eax
lea eax, [ebp - 0x1ae0]
push 0
push eax
push ebx
lea eax, [ebp - 0x140c]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4117fa
mov eax, dword [ebp - 0x1ae0]
add edi, eax
cmp eax, ebx
jl 0x411802
mov edx, dword [ebp - 0x1abc]
test eax, eax
je 0x411808
mov eax, dword [ebp - 0x1ac4]
sub eax, edx
cmp eax, dword [ebp + 0x10]
mov eax, dword [ebp - 0x1ac4]
jb 0x411553
jmp 0x411808
mov ebx, dword [ebp + 0x10]
mov ecx, edx
mov dword [ebp - 0x1ac8], ecx
test ebx, ebx
je 0x41183a
mov dword [ebp - 0x1ae8], 0xa
and dword [ebp - 0x1ae4], 0
lea eax, [ebp - 0x1ab8]
mov dword [ebp - 0x1ac4], ecx
sub dword [ebp - 0x1ac4], edx
mov edx, dword [ebp - 0x1ae4]
cmp dword [ebp - 0x1ac4], ebx
jae 0x411704
movzx esi, word [ecx]
add ecx, 2
add dword [ebp - 0x1ac4], 2
cmp si, word [ebp - 0x1ae8]
mov dword [ebp - 0x1ae4], esi
mov esi, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac8], ecx
jne 0x4116dc
cmp edx, 0x6a6
ja 0x4116fb
push 0xd
pop ecx
mov word [eax], cx
add eax, 2
mov ecx, dword [ebp - 0x1ac8]
add edx, 2
mov esi, dword [ebp - 0x1ae4]
add edx, 2
mov word [eax], si
add eax, 2
mov esi, dword [ebp - 0x1acc]
cmp edx, 0x6a8
jb 0x411692
jmp 0x411704
sub ecx, 2
mov dword [ebp - 0x1ac8], ecx
push 0
push 0
push 0xd55
lea ecx, [ebp - 0xd64]
push ecx
lea ecx, [ebp - 0x1ab8]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x1ac4], eax
test eax, eax
je 0x4117fa
xor ecx, ecx
mov dword [ebp - 0x1ac0], ecx
push 0
sub eax, ecx
lea edx, [ebp - 0x1ae0]
push edx
push eax
lea eax, [ebp - 0xd64]
add eax, ecx
mov ecx, dword [ebp - 0x1ad0]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x418da0]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41179b
mov ecx, dword [ebp - 0x1ac0]
add ecx, dword [ebp - 0x1ae0]
mov eax, dword [ebp - 0x1ac4]
mov dword [ebp - 0x1ac0], ecx
cmp eax, ecx
jg 0x411748
jmp 0x4117b5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x1ac0]
mov esi, eax
mov eax, dword [ebp - 0x1ac4]
mov dword [ebp - 0x1acc], esi
cmp eax, ecx
jg 0x411802
mov ecx, dword [ebp - 0x1ac8]
mov edi, ecx
mov edx, dword [ebp - 0x1abc]
sub edi, edx
cmp edi, ebx
jb 0x411673
jmp 0x411808
push 0
lea edx, [ebp - 0x1ae0]
push edx
push esi
push dword [ebp - 0x1abc]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4117fa
mov edi, dword [ebp - 0x1ae0]
xor esi, esi
jmp 0x411802
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov edx, dword [ebp - 0x1abc]
test edi, edi
jne 0x411875
test esi, esi
je 0x41183a
push 5
pop ebx
cmp esi, ebx
jne 0x41182e
call fcn.0040b9fe
mov dword [eax], 9
call fcn.0040b9be
mov dword [eax], ebx
jmp 0x4110d1
push esi
call fcn.0040b9d6
pop ecx
jmp 0x4110d1
mov eax, dword [ebp - 0x1adc]
mov ebx, dword [ebp - 0x1ad0]
mov eax, dword [eax*4 + 0x418da0]
test byte [ebx + eax + 4], 0x40
je 0x41185d
cmp byte [edx], 0x1a
je 0x4110a7
call fcn.0040b9fe
mov dword [eax], 0x1c
call fcn.0040b9be
and dword [eax], 0
jmp 0x4110d1
sub edi, dword [ebp - 0x1ad8]
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00408929
mov esp, ebp
pop ebp
ret