Function at 0x408738
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x1ae4
mov esi, esi
push ebp
mov ebp, esp
call fcn.0040cdc0
mov eax, dword [0x412008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push edi
xor edi, edi
mov dword [ebp - 0x1acc], eax
mov dword [ebp - 0x1ac8], edi
mov dword [ebp - 0x1ad0], edi
cmp dword [ebp + 0x10], edi
jne 0x408775
xor eax, eax
jmp 0x408e5e
cmp eax, edi
jne 0x4087a0
call fcn.00405825
mov dword [eax], edi
call fcn.00405812
push edi
push edi
push edi
push edi
push edi
mov dword [eax], 0x16
call fcn.004057aa
sub esp, 0xffffffec
or eax, 0xffffffff
jmp 0x408e5e
push ebx
push esi
mov esi, dword [ebp + 8]
mov eax, esi
sar eax, 5
lea edi, [eax*4 + 0x414820]
mov eax, dword [edi]
and esi, 0x1f
shl esi, 6
add eax, esi
mov bl, byte [eax + 0x24]
add bl, bl
mov dword [ebp - 0x1ad8], edi
sar bl, 1
cmp bl, 2
mov byte [ebp - 0x1ad9], bl
je 0x4087d8
cmp bl, 1
jne 0x408808
mov ecx, dword [ebp + 0x10]
not ecx
test cl, 1
jne 0x408808
call fcn.00405825
xor edi, edi
mov dword [eax], edi
call fcn.00405812
push edi
push edi
push edi
push edi
push edi
mov dword [eax], 0x16
call fcn.004057aa
sub esp, 0xffffffec
jmp 0x408e4b
test byte [eax + 4], 0x20
je 0x40881f
push 2
push 0
push 0
push dword [ebp + 8]
call fcn.00409faf
add esp, 0x10
push dword [ebp + 8]
call fcn.0040a196
test eax, eax
pop ecx
je 0x408acd
mov eax, dword [edi]
test byte [esi + eax + 4], 0x80
je 0x408acd
call fcn.00405b22
mov eax, dword [eax + 0x6c]
xor ecx, ecx
cmp dword [eax + 0x14], ecx
sete cl
lea eax, [ebp - 0x1ae4]
push eax
mov eax, dword [edi]
push dword [esi + eax]
mov dword [ebp - 0x1ae0], ecx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x408acd
xor ecx, ecx
cmp dword [ebp - 0x1ae0], ecx
je 0x40887f
or bl, bl
je 0x408acf
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov ebx, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ae4], eax
xor eax, eax
mov dword [ebp - 0x1ac4], eax
cmp dword [ebp + 0x10], eax
jbe 0x408de4
mov dword [ebp - 0x1abc], eax
mov al, byte [ebp - 0x1ad9]
test al, al
jne 0x408a1d
mov cl, byte [ebx]
xor eax, eax
mov edi, dword [ebp - 0x1ad8]
cmp cl, 0xa
sete al
mov dword [ebp - 0x1ae0], eax
mov eax, dword [edi]
add eax, esi
cmp dword [eax + 0x38], 0
je 0x4088eb
mov dl, byte [eax + 0x34]
mov byte [ebp - 0xc], dl
mov byte [ebp - 0xb], cl
and dword [eax + 0x38], 0
push 2
lea eax, [ebp - 0xc]
push eax
jmp 0x408936
movsx eax, cl
push eax
call fcn.0040af4c
or eax, eax
pop ecx
je 0x408933
mov ecx, dword [ebp - 0x1acc]
sub ecx, ebx
add ecx, dword [ebp + 0x10]
xor eax, eax
inc eax
cmp ecx, eax
jbe 0x408ab4
lea eax, [ebp - 0x1ac0]
push 2
push ebx
push eax
call fcn.0040cd9a
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x408ddb
inc ebx
inc dword [ebp - 0x1abc]
jmp 0x40894e
push 1
push ebx
lea eax, [ebp - 0x1ac0]
push eax
call fcn.0040cd9a
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x408ddb
lea ecx, [ebp - 0xc]
xor eax, eax
inc ebx
push eax
push eax
push 5
push ecx
push 1
lea ecx, [ebp - 0x1ac0]
push ecx
push eax
push dword [ebp - 0x1ae4]
inc dword [ebp - 0x1abc]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
test edi, edi
je 0x408ddb
push 0
lea eax, [ebp - 0x1ac4]
push eax
push edi
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408dcf
mov eax, dword [ebp - 0x1abc]
mov ecx, dword [ebp - 0x1ad0]
add eax, ecx
cmp dword [ebp - 0x1ac4], edi
mov dword [ebp - 0x1ac8], eax
jl 0x408ddb
cmp dword [ebp - 0x1ae0], 0
je 0x408aa0
lea eax, [ebp - 0x1ac4]
push 0
push eax
push 1
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax]
mov byte [ebp - 0xc], 0xd
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408dcf
cmp dword [ebp - 0x1ac4], 1
jl 0x408ddb
inc dword [ebp - 0x1ad0]
inc dword [ebp - 0x1ac8]
jmp 0x408aa0
cmp al, 1
je 0x408a25
cmp al, 2
jne 0x408a46
movzx edi, word [ebx]
xor ecx, ecx
cmp di, 0xa
sete cl
inc ebx
inc ebx
sub dword [ebp - 0x1abc], 0xfffffffe
mov dword [ebp - 0x1ac0], edi
mov dword [ebp - 0x1ae0], ecx
cmp al, 1
je 0x408a4e
cmp al, 2
jne 0x408aa0
push dword [ebp - 0x1ac0]
call fcn.0040cbbe
pop ecx
cmp ax, word [ebp - 0x1ac0]
jne 0x408dcf
sub dword [ebp - 0x1ac8], 0xfffffffe
cmp dword [ebp - 0x1ae0], 0
je 0x408aa0
push 0xd
pop eax
push eax
mov dword [ebp - 0x1ac0], eax
call fcn.0040cbbe
cmp ax, word [ebp - 0x1ac0]
pop ecx
jne 0x408dcf
inc dword [ebp - 0x1ac8]
inc dword [ebp - 0x1ad0]
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x1abc], eax
jb 0x4088a8
jmp 0x408ddb
mov dl, byte [ebx]
mov ecx, dword [edi]
inc dword [ebp - 0x1ac8]
mov byte [esi + ecx + 0x34], dl
mov ecx, dword [edi]
mov dword [esi + ecx + 0x38], eax
jmp 0x408ddb
xor ecx, ecx
mov eax, dword [edi]
add eax, esi
test byte [eax + 4], 0x80
je 0x408d9c
or bl, bl
mov eax, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac0], ecx
jne 0x408bbb
mov dword [ebp - 0x1ac4], eax
cmp dword [ebp + 0x10], ecx
jbe 0x408e20
jmp 0x408b08
mov edi, dword [ebp - 0x1ad8]
lea eax, [ebp - 0x1ab8]
mov ecx, dword [ebp - 0x1ac4]
and dword [ebp - 0x1abc], 0
sub ecx, dword [ebp - 0x1acc]
cmp ecx, dword [ebp + 0x10]
jae 0x408b5f
mov edx, dword [ebp - 0x1ac4]
inc dword [ebp - 0x1ac4]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x408b4a
inc dword [ebp - 0x1ad0]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x1abc]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x1abc]
cmp dword [ebp - 0x1abc], 0x13ff
jb 0x408b21
push 0
mov ebx, eax
lea eax, [ebp - 0x1ab8]
sub ebx, eax
lea eax, [ebp - 0x1ad4]
push eax
lea eax, [ebp - 0x1ab8]
push ebx
push eax
mov eax, dword [edi]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x408dcf
mov eax, dword [ebp - 0x1ad4]
add dword [ebp - 0x1ac8], eax
cmp eax, ebx
jl 0x408ddb
mov eax, dword [ebp - 0x1ac4]
sub eax, dword [ebp - 0x1acc]
cmp eax, dword [ebp + 0x10]
jb 0x408b02
jmp 0x408ddb
cmp bl, 2
mov dword [ebp - 0x1abc], eax
jne 0x408c9b
cmp dword [ebp + 0x10], ecx
jbe 0x408e20
jmp 0x408bdb
mov edi, dword [ebp - 0x1ad8]
mov ecx, dword [ebp - 0x1abc]
and dword [ebp - 0x1ac4], 0
sub ecx, dword [ebp - 0x1acc]
lea eax, [ebp - 0x1ab8]
cmp ecx, dword [ebp + 0x10]
jae 0x408c3f
mov edx, dword [ebp - 0x1abc]
sub dword [ebp - 0x1abc], 0xfffffffe
inc ecx
inc ecx
movzx edx, word [edx]
cmp dx, 0xa
jne 0x408c27
sub dword [ebp - 0x1ad0], 0xfffffffe
push 0xd
pop ebx
mov word [eax], bx
inc eax
inc eax
add dword [ebp - 0x1ac4], 2
add dword [ebp - 0x1ac4], 2
mov word [eax], dx
inc eax
inc eax
cmp dword [ebp - 0x1ac4], 0x13fe
jb 0x408bf4
push 0
mov ebx, eax
lea eax, [ebp - 0x1ab8]
sub ebx, eax
lea eax, [ebp - 0x1ad4]
push eax
push ebx
lea eax, [ebp - 0x1ab8]
push eax
mov eax, dword [edi]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408dcf
mov eax, dword [ebp - 0x1ad4]
add dword [ebp - 0x1ac8], eax
cmp eax, ebx
jl 0x408ddb
mov eax, dword [ebp - 0x1abc]
sub eax, dword [ebp - 0x1acc]
cmp eax, dword [ebp + 0x10]
jb 0x408bd5
jmp 0x408ddb
cmp dword [ebp + 0x10], ecx
jbe 0x408e20
lea eax, [ebp - 0x6b8]
mov ecx, dword [ebp - 0x1abc]
and dword [ebp - 0x1ac4], 0
sub ecx, dword [ebp - 0x1acc]
push 2
pop edi
cmp ecx, dword [ebp + 0x10]
jae 0x408d01
mov edx, dword [ebp - 0x1abc]
movzx edx, word [edx]
add dword [ebp - 0x1abc], edi
add ecx, edi
cmp dx, 0xa
jne 0x408cea
push 0xd
pop ebx
mov word [eax], bx
add eax, edi
add dword [ebp - 0x1ac4], edi
add dword [ebp - 0x1ac4], edi
mov word [eax], dx
add eax, edi
cmp dword [ebp - 0x1ac4], 0x6a8
jb 0x408cc0
lea ecx, [ebp - 0x1410]
xor edi, edi
push edi
push edi
push 0xd55
push ecx
lea ecx, [ebp - 0x6b8]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push edi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebx, eax
cmp ebx, edi
je 0x408dcf
lea eax, [ebp - 0x1ad4]
push 0
push eax
mov eax, ebx
sub eax, edi
push eax
lea eax, [ebp + edi - 0x1410]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408d6f
add edi, dword [ebp - 0x1ad4]
cmp ebx, edi
jg 0x408d38
jmp 0x408d7b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1ac0], eax
cmp ebx, edi
jg 0x408ddb
mov eax, dword [ebp - 0x1abc]
sub eax, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac8], eax
cmp eax, dword [ebp + 0x10]
jb 0x408ca4
jmp 0x408ddb
push 0
lea ecx, [ebp - 0x1ad4]
push ecx
push dword [ebp + 0x10]
push dword [ebp - 0x1acc]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408dcf
mov eax, dword [ebp - 0x1ad4]
and dword [ebp - 0x1ac0], 0
mov dword [ebp - 0x1ac8], eax
jmp 0x408ddb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1ac0], eax
cmp dword [ebp - 0x1ac8], 0
jne 0x408e50
cmp dword [ebp - 0x1ac0], 0
je 0x408e1a
push 5
pop edi
cmp dword [ebp - 0x1ac0], edi
jne 0x408e0c
call fcn.00405812
mov dword [eax], 9
call fcn.00405825
mov dword [eax], edi
jmp 0x408e4b
push dword [ebp - 0x1ac0]
call fcn.00405838
pop ecx
jmp 0x408e4b
mov edi, dword [ebp - 0x1ad8]
mov eax, dword [edi]
test byte [esi + eax + 4], 0x40
je 0x408e38
mov eax, dword [ebp - 0x1acc]
cmp byte [eax], 0x1a
jne 0x408e38
xor eax, eax
jmp 0x408e5c
call fcn.00405812
mov dword [eax], 0x1c
call fcn.00405825
and dword [eax], 0
or eax, 0xffffffff
jmp 0x408e5c
mov eax, dword [ebp - 0x1ac8]
sub eax, dword [ebp - 0x1ad0]
pop esi
pop ebx
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004033e4
leave
ret