Function at 0x418937
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1af0
call fcn.0041b1b0
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
and dword [ebp - 0x1abc], 0
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
push esi
xor esi, esi
mov dword [ebp - 0x1ac8], eax
push edi
xor edi, edi
mov dword [ebp - 0x1ad0], ecx
mov dword [ebp - 0x1ac0], esi
cmp dword [ebp + 0x10], esi
jne 0x41897c
xor eax, eax
jmp 0x419189
test ecx, ecx
jne 0x41899f
call fcn.00412f24
and dword [eax], esi
call fcn.00412f58
mov dword [eax], 0x16
call fcn.0041219d
or eax, 0xffffffff
jmp 0x419189
mov edx, eax
mov ecx, eax
sar edx, 5
and ecx, 0x1f
shl ecx, 6
mov dword [ebp - 0x1ad8], edx
push ebx
mov edx, dword [edx*4 + 0x42c868]
mov dword [ebp - 0x1adc], ecx
mov bl, byte [ecx + edx + 0x24]
add bl, bl
sar bl, 1
cmp bl, 2
je 0x4189d2
cmp bl, 1
jne 0x4189fd
mov eax, dword [ebp + 0x10]
not eax
test al, 1
jne 0x4189f7
call fcn.00412f24
and dword [eax], esi
call fcn.00412f58
mov dword [eax], 0x16
call fcn.0041219d
jmp 0x41917f
mov eax, dword [ebp - 0x1ac8]
test byte [ecx + edx + 4], 0x20
je 0x418a13
push 2
push 0
push 0
push eax
call fcn.00419295
add esp, 0x10
push dword [ebp - 0x1ac8]
call fcn.004187f1
pop ecx
test eax, eax
je 0x418d77
mov eax, dword [ebp - 0x1ad8]
mov ecx, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x42c868]
test byte [ecx + eax + 4], 0x80
je 0x418d77
call fcn.00412d57
xor ecx, ecx
mov eax, dword [eax + 0x6c]
cmp dword [eax + 0xa8], ecx
lea eax, [ebp - 0x1ae8]
push eax
mov eax, dword [ebp - 0x1ad8]
sete cl
mov dword [ebp - 0x1ac4], ecx
mov ecx, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x42c868]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x418d77
cmp dword [ebp - 0x1ac4], esi
je 0x418a99
test bl, bl
je 0x418d77
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov edx, dword [ebp - 0x1ad0]
xor ecx, ecx
and dword [ebp - 0x1ac8], ecx
mov dword [ebp - 0x1af0], eax
mov dword [ebp - 0x1acc], ecx
mov dword [ebp - 0x1ad4], edx
cmp dword [ebp + 0x10], ecx
jbe 0x419149
mov eax, dword [ebp - 0x1ad4]
xor edx, edx
mov dword [ebp - 0x1ac0], edx
mov dword [ebp - 0x1aec], 0xa
and dword [ebp - 0x1ac4], edi
test bl, bl
jne 0x418c9c
mov dl, byte [eax]
xor eax, eax
mov ecx, dword [ebp - 0x1adc]
cmp dl, 0xa
sete al
mov dword [ebp - 0x1ae8], eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax*4 + 0x42c868]
mov dword [ebp - 0x1ac4], eax
cmp dword [ecx + eax + 0x38], edi
je 0x418b39
mov al, byte [ecx + eax + 0x34]
mov byte [ebp - 0xc], al
mov eax, dword [ebp - 0x1ac4]
mov byte [ebp - 0xb], dl
push 2
and dword [ecx + eax + 0x38], edi
lea eax, [ebp - 0xc]
push eax
jmp 0x418b93
movsx eax, dl
push eax
call fcn.00419388
pop ecx
test eax, eax
je 0x418b8b
mov eax, dword [ebp - 0x1ad0]
mov edx, dword [ebp - 0x1ad4]
sub eax, edx
add eax, dword [ebp + 0x10]
cmp eax, 1
jbe 0x418d3c
push 2
push edx
lea eax, [ebp - 0x1acc]
push eax
call fcn.004196bb
add esp, 0xc
cmp eax, 0xffffffff
je 0x418e81
mov eax, dword [ebp - 0x1ad4]
inc eax
inc dword [ebp - 0x1ac0]
jmp 0x418bb1
push 1
push dword [ebp - 0x1ad4]
lea eax, [ebp - 0x1acc]
push eax
call fcn.004196bb
add esp, 0xc
cmp eax, 0xffffffff
je 0x418e81
mov eax, dword [ebp - 0x1ad4]
xor ecx, ecx
inc eax
inc dword [ebp - 0x1ac0]
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 - 0x1ac4], eax
test eax, eax
je 0x418e81
push 0
lea ecx, [ebp - 0x1ac8]
push ecx
mov ecx, dword [ebp - 0x1adc]
push eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax*4 + 0x42c868]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x418d6a
mov esi, dword [ebp - 0x1ac0]
mov ecx, dword [ebp - 0x1abc]
add esi, ecx
mov eax, dword [ebp - 0x1ac4]
cmp dword [ebp - 0x1ac8], eax
jl 0x418e87
cmp dword [ebp - 0x1ae8], edi
je 0x418c91
mov ecx, dword [ebp - 0x1adc]
lea eax, [ebp - 0x1ac8]
push 0
push eax
push 1
lea eax, [ebp - 0xc]
mov byte [ebp - 0xc], 0xd
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax*4 + 0x42c868]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x418d6a
cmp dword [ebp - 0x1ac8], 1
jl 0x418e81
inc dword [ebp - 0x1abc]
inc esi
mov ecx, dword [ebp - 0x1acc]
jmp 0x418d22
cmp bl, 1
je 0x418ca6
cmp bl, 2
jne 0x418cd9
movzx ecx, word [eax]
xor edx, edx
cmp cx, word [ebp - 0x1aec]
mov dword [ebp - 0x1acc], ecx
sete dl
add eax, 2
mov dword [ebp - 0x1ac4], edx
mov edx, dword [ebp - 0x1ac0]
add edx, 2
mov dword [ebp - 0x1ad4], eax
mov dword [ebp - 0x1ac0], edx
cmp bl, 1
je 0x418ce3
cmp bl, 2
jne 0x418d2e
push ecx
call fcn.0041b165
pop ecx
mov ecx, dword [ebp - 0x1acc]
cmp ax, cx
jne 0x418d6a
add esi, 2
cmp dword [ebp - 0x1ac4], edi
je 0x418d22
push 0xd
pop eax
push eax
mov dword [ebp - 0x1acc], eax
call fcn.0041b165
pop ecx
mov ecx, dword [ebp - 0x1acc]
cmp ax, cx
jne 0x418d6a
inc esi
inc dword [ebp - 0x1abc]
mov edx, dword [ebp - 0x1ac0]
mov eax, dword [ebp - 0x1ad4]
cmp edx, dword [ebp + 0x10]
jb 0x418ae0
jmp 0x418e81
mov ebx, dword [ebp - 0x1ad8]
inc esi
mov al, byte [edx]
mov edx, dword [ebp - 0x1adc]
mov ecx, dword [ebx*4 + 0x42c868]
mov byte [edx + ecx + 0x34], al
mov eax, dword [ebx*4 + 0x42c868]
mov dword [edx + eax + 0x38], 1
jmp 0x418e81
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x418e81
mov eax, dword [ebp - 0x1ad8]
mov ecx, dword [eax*4 + 0x42c868]
mov eax, dword [ebp - 0x1adc]
test byte [eax + ecx + 4], 0x80
je 0x41910a
mov edx, dword [ebp - 0x1ad0]
xor edi, edi
mov dword [ebp - 0x1acc], edi
test bl, bl
jne 0x418eb9
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x1ac8], edx
test ebx, ebx
je 0x419149
xor ecx, ecx
lea edi, [ebp - 0x140c]
mov eax, edx
mov dword [ebp - 0x1ac4], ecx
sub eax, dword [ebp - 0x1ad0]
cmp eax, ebx
jae 0x418e1a
mov cl, byte [edx]
inc edx
inc eax
mov byte [ebp - 0x1ae1], cl
cmp cl, 0xa
mov dword [ebp - 0x1ac8], edx
mov ecx, dword [ebp - 0x1ac4]
jne 0x418dfc
inc dword [ebp - 0x1abc]
mov byte [edi], 0xd
inc edi
inc ecx
mov dl, byte [ebp - 0x1ae1]
mov byte [edi], dl
inc edi
mov edx, dword [ebp - 0x1ac8]
inc ecx
mov dword [ebp - 0x1ac4], ecx
cmp ecx, 0x13ff
jb 0x418dd2
mov ecx, dword [ebp - 0x1adc]
lea eax, [ebp - 0x140c]
sub edi, eax
lea eax, [ebp - 0x1ae0]
push 0
push eax
push edi
lea eax, [ebp - 0x140c]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax*4 + 0x42c868]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x418d6a
add esi, dword [ebp - 0x1ae0]
cmp dword [ebp - 0x1ae0], edi
jl 0x418e7b
mov edx, dword [ebp - 0x1ac8]
mov eax, edx
sub eax, dword [ebp - 0x1ad0]
cmp eax, ebx
jb 0x418dbc
mov edi, dword [ebp - 0x1acc]
mov ecx, dword [ebp - 0x1abc]
test esi, esi
jne 0x419184
test edi, edi
je 0x419143
push 5
pop ebx
cmp edi, ebx
jne 0x41913a
call fcn.00412f58
mov dword [eax], 9
call fcn.00412f24
mov dword [eax], ebx
jmp 0x41917f
mov ecx, edx
cmp bl, 2
jne 0x418fae
cmp dword [ebp + 0x10], esi
jbe 0x419149
mov dword [ebp - 0x1aec], 0xa
and dword [ebp - 0x1ae8], 0
lea ebx, [ebp - 0x140c]
mov eax, ecx
push 0xd
sub eax, edx
mov edx, dword [ebp - 0x1ae8]
pop esi
cmp eax, dword [ebp + 0x10]
jae 0x418f29
movzx edi, word [ecx]
add eax, 2
add ecx, 2
cmp di, word [ebp - 0x1aec]
jne 0x418f18
add dword [ebp - 0x1abc], 2
mov word [ebx], si
add ebx, 2
add edx, 2
mov word [ebx], di
add edx, 2
add ebx, 2
cmp edx, 0x13fe
jb 0x418ef1
lea eax, [ebp - 0x140c]
mov dword [ebp - 0x1ac4], ecx
mov ecx, dword [ebp - 0x1adc]
sub ebx, eax
push 0
lea eax, [ebp - 0x1ae0]
push eax
push ebx
lea eax, [ebp - 0x140c]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax*4 + 0x42c868]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [ebp - 0x1ac0]
mov edi, dword [ebp - 0x1acc]
test eax, eax
je 0x418d6a
add esi, dword [ebp - 0x1ae0]
mov dword [ebp - 0x1ac0], esi
cmp dword [ebp - 0x1ae0], ebx
jl 0x418e81
mov ecx, dword [ebp - 0x1ac4]
mov eax, ecx
mov edx, dword [ebp - 0x1ad0]
sub eax, edx
cmp eax, dword [ebp + 0x10]
jb 0x418ed7
jmp 0x418e81
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x1ac8], ecx
test ebx, ebx
je 0x419149
mov dword [ebp - 0x1aec], 0xa
and dword [ebp - 0x1ae8], 0
lea eax, [ebp - 0x1ab8]
mov edi, dword [ebp - 0x1ac8]
sub ecx, edx
mov edx, dword [ebp - 0x1ae8]
cmp ecx, ebx
jae 0x419023
movzx esi, word [edi]
add ecx, 2
add edi, 2
mov dword [ebp - 0x1ac8], edi
cmp si, word [ebp - 0x1aec]
jne 0x419012
push 0xd
pop edi
mov word [eax], di
add eax, 2
mov edi, dword [ebp - 0x1ac8]
add edx, 2
mov word [eax], si
add edx, 2
add eax, 2
cmp edx, 0x6a8
jb 0x418fe4
xor esi, esi
lea ecx, [ebp - 0xd64]
push esi
push esi
push 0xd55
push ecx
lea ecx, [ebp - 0x1ab8]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, dword [ebp - 0x1ac0]
mov edi, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac4], eax
test eax, eax
je 0x418d6a
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 - 0x1adc]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax*4 + 0x42c868]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4190c5
mov ecx, dword [ebp - 0x1ac0]
add ecx, dword [ebp - 0x1ae0]
mov eax, dword [ebp - 0x1ac4]
mov dword [ebp - 0x1ac0], ecx
cmp eax, ecx
jg 0x419072
jmp 0x4190df
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x1ac0]
mov edi, eax
mov eax, dword [ebp - 0x1ac4]
mov dword [ebp - 0x1acc], edi
cmp eax, ecx
jg 0x418e81
mov ecx, dword [ebp - 0x1ac8]
mov esi, ecx
mov edx, dword [ebp - 0x1ad0]
sub esi, edx
mov dword [ebp - 0x1ac0], esi
cmp esi, ebx
jb 0x418fc9
jmp 0x418e81
push 0
lea edx, [ebp - 0x1ae0]
push edx
push dword [ebp + 0x10]
push dword [ebp - 0x1ad0]
push dword [eax + ecx]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x418d6a
mov esi, dword [ebp - 0x1ae0]
xor edi, edi
jmp 0x418e81
push edi
call fcn.00412f37
pop ecx
jmp 0x41917f
mov edx, dword [ebp - 0x1ad0]
mov eax, dword [ebp - 0x1ad8]
mov ecx, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x42c868]
test byte [ecx + eax + 4], 0x40
je 0x41916c
cmp byte [edx], 0x1a
jne 0x41916c
xor eax, eax
jmp 0x419188
call fcn.00412f58
mov dword [eax], 0x1c
call fcn.00412f24
and dword [eax], 0
or eax, 0xffffffff
jmp 0x419188
sub esi, ecx
mov eax, esi
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0040ff65
mov esp, ebp
pop ebp
ret