Function at 0x418937
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1af0
call fcn.0041b140
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 0x41890c
xor eax, eax
jmp 0x419119
test ecx, ecx
jne 0x41892f
call fcn.00412eb4
and dword [eax], esi
call fcn.00412ee8
mov dword [eax], 0x16
call fcn.0041212d
or eax, 0xffffffff
jmp 0x419119
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 0x418962
cmp bl, 1
jne 0x41898d
mov eax, dword [ebp + 0x10]
not eax
test al, 1
jne 0x418987
call fcn.00412eb4
and dword [eax], esi
call fcn.00412ee8
mov dword [eax], 0x16
call fcn.0041212d
jmp 0x41910f
mov eax, dword [ebp - 0x1ac8]
test byte [ecx + edx + 4], 0x20
je 0x4189a3
push 2
push 0
push 0
push eax
call fcn.00419225
add esp, 0x10
push dword [ebp - 0x1ac8]
call fcn.00418781
pop ecx
test eax, eax
je 0x418d07
mov eax, dword [ebp - 0x1ad8]
mov ecx, dword [ebp - 0x1adc]
mov eax, dword [eax*4 + 0x42c868]
test byte [ecx + eax + 4], 0x80
je 0x418d07
call fcn.00412ce7
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 0x418d07
cmp dword [ebp - 0x1ac4], esi
je 0x418a29
test bl, bl
je 0x418d07
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 0x4190d9
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 0x418c2c
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 0x418ac9
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 0x418b23
movsx eax, dl
push eax
call fcn.00419318
pop ecx
test eax, eax
je 0x418b1b
mov eax, dword [ebp - 0x1ad0]
mov edx, dword [ebp - 0x1ad4]
sub eax, edx
add eax, dword [ebp + 0x10]
cmp eax, 1
jbe 0x418ccc
push 2
push edx
lea eax, [ebp - 0x1acc]
push eax
call fcn.0041964b
add esp, 0xc
cmp eax, 0xffffffff
je 0x418e11
mov eax, dword [ebp - 0x1ad4]
inc eax
inc dword [ebp - 0x1ac0]
jmp 0x418b41
push 1
push dword [ebp - 0x1ad4]
lea eax, [ebp - 0x1acc]
push eax
call fcn.0041964b
add esp, 0xc
cmp eax, 0xffffffff
je 0x418e11
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 0x418e11
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 0x418cfa
mov esi, dword [ebp - 0x1ac0]
mov ecx, dword [ebp - 0x1abc]
add esi, ecx
mov eax, dword [ebp - 0x1ac4]
cmp dword [ebp - 0x1ac8], eax
jl 0x418e17
cmp dword [ebp - 0x1ae8], edi
je 0x418c21
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 0x418cfa
cmp dword [ebp - 0x1ac8], 1
jl 0x418e11
inc dword [ebp - 0x1abc]
inc esi
mov ecx, dword [ebp - 0x1acc]
jmp 0x418cb2
cmp bl, 1
je 0x418c36
cmp bl, 2
jne 0x418c69
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 0x418c73
cmp bl, 2
jne 0x418cbe
push ecx
call fcn.0041b0f5
pop ecx
mov ecx, dword [ebp - 0x1acc]
cmp ax, cx
jne 0x418cfa
add esi, 2
cmp dword [ebp - 0x1ac4], edi
je 0x418cb2
push 0xd
pop eax
push eax
mov dword [ebp - 0x1acc], eax
call fcn.0041b0f5
pop ecx
mov ecx, dword [ebp - 0x1acc]
cmp ax, cx
jne 0x418cfa
inc esi
inc dword [ebp - 0x1abc]
mov edx, dword [ebp - 0x1ac0]
mov eax, dword [ebp - 0x1ad4]
cmp edx, dword [ebp + 0x10]
jb 0x418a70
jmp 0x418e11
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 0x418e11
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x418e11
mov eax, dword [ebp - 0x1ad8]
mov ecx, dword [eax*4 + 0x42c868]
mov eax, dword [ebp - 0x1adc]
test byte [eax + ecx + 4], 0x80
je 0x41909a
mov edx, dword [ebp - 0x1ad0]
xor edi, edi
mov dword [ebp - 0x1acc], edi
test bl, bl
jne 0x418e49
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x1ac8], edx
test ebx, ebx
je 0x4190d9
xor ecx, ecx
lea edi, [ebp - 0x140c]
mov eax, edx
mov dword [ebp - 0x1ac4], ecx
sub eax, dword [ebp - 0x1ad0]
cmp eax, ebx
jae 0x418daa
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 0x418d8c
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 0x418d62
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 0x418cfa
add esi, dword [ebp - 0x1ae0]
cmp dword [ebp - 0x1ae0], edi
jl 0x418e0b
mov edx, dword [ebp - 0x1ac8]
mov eax, edx
sub eax, dword [ebp - 0x1ad0]
cmp eax, ebx
jb 0x418d4c
mov edi, dword [ebp - 0x1acc]
mov ecx, dword [ebp - 0x1abc]
test esi, esi
jne 0x419114
test edi, edi
je 0x4190d3
push 5
pop ebx
cmp edi, ebx
jne 0x4190ca
call fcn.00412ee8
mov dword [eax], 9
call fcn.00412eb4
mov dword [eax], ebx
jmp 0x41910f
mov ecx, edx
cmp bl, 2
jne 0x418f3e
cmp dword [ebp + 0x10], esi
jbe 0x4190d9
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 0x418eb9
movzx edi, word [ecx]
add eax, 2
add ecx, 2
cmp di, word [ebp - 0x1aec]
jne 0x418ea8
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 0x418e81
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 0x418cfa
add esi, dword [ebp - 0x1ae0]
mov dword [ebp - 0x1ac0], esi
cmp dword [ebp - 0x1ae0], ebx
jl 0x418e11
mov ecx, dword [ebp - 0x1ac4]
mov eax, ecx
mov edx, dword [ebp - 0x1ad0]
sub eax, edx
cmp eax, dword [ebp + 0x10]
jb 0x418e67
jmp 0x418e11
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x1ac8], ecx
test ebx, ebx
je 0x4190d9
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 0x418fb3
movzx esi, word [edi]
add ecx, 2
add edi, 2
mov dword [ebp - 0x1ac8], edi
cmp si, word [ebp - 0x1aec]
jne 0x418fa2
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 0x418f74
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 0x418cfa
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 0x419055
mov ecx, dword [ebp - 0x1ac0]
add ecx, dword [ebp - 0x1ae0]
mov eax, dword [ebp - 0x1ac4]
mov dword [ebp - 0x1ac0], ecx
cmp eax, ecx
jg 0x419002
jmp 0x41906f
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 0x418e11
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 0x418f59
jmp 0x418e11
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 0x418cfa
mov esi, dword [ebp - 0x1ae0]
xor edi, edi
jmp 0x418e11
push edi
call fcn.00412ec7
pop ecx
jmp 0x41910f
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 0x4190fc
cmp byte [edx], 0x1a
jne 0x4190fc
xor eax, eax
jmp 0x419118
call fcn.00412ee8
mov dword [eax], 0x1c
call fcn.00412eb4
and dword [eax], 0
or eax, 0xffffffff
jmp 0x419118
sub esi, ecx
mov eax, esi
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0040fef5
mov esp, ebp
pop ebp
ret