Function at 0x1006494e
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x594
mov eax, dword [0x1007bf74]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
xor esi, esi
cmp dword [ebp + 0x10], esi
mov dword [ebp - 0x574], eax
mov dword [ebp - 0x570], esi
mov dword [ebp - 0x578], esi
jne 0x10064987
xor eax, eax
jmp 0x1006501d
cmp eax, esi
jne 0x100649b2
call fcn.1005575c
mov dword [eax], esi
call fcn.10055749
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.100556b2
add esp, 0x14
or eax, 0xffffffff
jmp 0x1006501d
mov esi, dword [ebp + 8]
push ebx
mov ebx, esi
and ebx, 0x1f
imul ebx, ebx, 0x24
mov eax, esi
sar eax, 5
push edi
lea edi, [eax*4 + 0x1007f460]
mov eax, dword [edi]
add eax, ebx
mov ecx, dword [eax + 8]
and ecx, 3
cmp ecx, 2
mov dword [ebp - 0x580], edi
mov dword [ebp - 0x594], ebx
mov dword [ebp - 0x588], ecx
je 0x100649f1
cmp ecx, 1
jne 0x10064a21
mov ecx, dword [ebp + 0x10]
not ecx
test cl, 1
jne 0x10064a21
call fcn.1005575c
xor esi, esi
mov dword [eax], esi
call fcn.10055749
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.100556b2
add esp, 0x14
jmp 0x10065010
test byte [eax + 4], 0x20
je 0x10064a36
push 2
push 0
push 0
push esi
call fcn.100647b0
add esp, 0x10
push esi
call fcn.10065155
test eax, eax
pop ecx
je 0x10064ca2
mov eax, dword [edi]
test byte [ebx + eax + 4], 0x80
je 0x10064ca2
call fcn.100551c2
mov eax, dword [eax + 0x6c]
xor ecx, ecx
cmp dword [eax + 0x14], ecx
lea eax, [ebp - 0x58c]
sete cl
push eax
mov eax, dword [edi]
push dword [ebx + eax]
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x10064ca2
test esi, esi
je 0x10064a8f
cmp dword [ebp - 0x588], 0
je 0x10064ca2
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
and dword [ebp - 0x584], 0
cmp dword [ebp + 0x10], 0
mov esi, dword [ebp - 0x574]
mov dword [ebp - 0x594], eax
mov dword [ebp - 0x590], esi
jbe 0x10064fa9
and dword [ebp - 0x568], 0
jmp 0x10064ac7
mov esi, dword [ebp - 0x590]
mov eax, dword [ebp - 0x588]
test eax, eax
jne 0x10064c02
mov al, byte [esi]
xor ecx, ecx
cmp al, 0xa
sete cl
movsx eax, al
push eax
mov dword [ebp - 0x58c], ecx
call fcn.1005e35a
test eax, eax
pop ecx
jne 0x10064b0f
push 1
lea eax, [ebp - 0x56c]
push esi
push eax
call fcn.1006c36f
add esp, 0xc
cmp eax, 0xffffffff
je 0x10064f9f
jmp 0x10064b45
mov eax, dword [ebp - 0x574]
sub eax, esi
add eax, dword [ebp + 0x10]
cmp eax, 1
jbe 0x10064f9f
push 2
lea eax, [ebp - 0x56c]
push esi
push eax
call fcn.1006c36f
add esp, 0xc
cmp eax, 0xffffffff
je 0x10064f9f
inc esi
inc dword [ebp - 0x568]
xor eax, eax
push eax
push eax
push 5
lea ecx, [ebp - 0xc]
push ecx
push 1
lea ecx, [ebp - 0x56c]
push ecx
push eax
push dword [ebp - 0x594]
inc esi
inc dword [ebp - 0x568]
mov dword [ebp - 0x590], esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
test esi, esi
je 0x10064f9f
push 0
lea eax, [ebp - 0x584]
push eax
push esi
lea eax, [ebp - 0xc]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10064f93
mov eax, dword [ebp - 0x584]
add dword [ebp - 0x570], eax
cmp eax, esi
jl 0x10064f9f
cmp dword [ebp - 0x58c], 0
je 0x10064c8e
push 0
lea eax, [ebp - 0x584]
push eax
push 1
lea eax, [ebp - 0xc]
push eax
mov eax, dword [edi]
mov byte [ebp - 0xc], 0xd
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10064f93
cmp dword [ebp - 0x584], 1
jl 0x10064f9f
inc dword [ebp - 0x578]
inc dword [ebp - 0x570]
jmp 0x10064c8e
cmp eax, 1
je 0x10064c0c
cmp eax, 2
jne 0x10064c33
movzx ecx, word [esi]
xor edx, edx
cmp cx, 0xa
sete dl
inc esi
inc esi
add dword [ebp - 0x568], 2
mov dword [ebp - 0x56c], ecx
mov dword [ebp - 0x590], esi
mov dword [ebp - 0x58c], edx
cmp eax, 1
je 0x10064c3d
cmp eax, 2
jne 0x10064c8e
push dword [ebp - 0x56c]
call fcn.1006c0aa
cmp ax, word [ebp - 0x56c]
pop ecx
jne 0x10064f93
inc dword [ebp - 0x570]
cmp dword [ebp - 0x58c], 0
je 0x10064c8e
push 0xd
pop eax
push eax
mov dword [ebp - 0x56c], eax
call fcn.1006c0aa
cmp ax, word [ebp - 0x56c]
pop ecx
jne 0x10064f93
inc dword [ebp - 0x570]
inc dword [ebp - 0x578]
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x568], eax
jb 0x10064ac1
jmp 0x10064f9f
mov eax, dword [edi]
add eax, ebx
test byte [eax + 4], 0x80
je 0x10064f60
xor eax, eax
cmp dword [ebp - 0x588], eax
mov dword [ebp - 0x56c], eax
jne 0x10064d7f
cmp dword [ebp + 0x10], eax
mov ecx, dword [ebp - 0x574]
mov dword [ebp - 0x568], ecx
jbe 0x10064fdf
mov ecx, dword [ebp - 0x568]
xor esi, esi
sub ecx, dword [ebp - 0x574]
lea eax, [ebp - 0x564]
cmp ecx, dword [ebp + 0x10]
jae 0x10064d23
mov edx, dword [ebp - 0x568]
inc dword [ebp - 0x568]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x10064d11
inc dword [ebp - 0x578]
mov byte [eax], 0xd
inc eax
inc esi
mov edi, dword [ebp - 0x580]
mov byte [eax], dl
inc eax
inc esi
cmp esi, 0x400
jb 0x10064ced
mov esi, eax
lea eax, [ebp - 0x564]
sub esi, eax
push 0
lea eax, [ebp - 0x57c]
push eax
push esi
lea eax, [ebp - 0x564]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10064f93
mov eax, dword [ebp - 0x57c]
add dword [ebp - 0x570], eax
cmp eax, esi
jl 0x10064f9f
mov eax, dword [ebp - 0x568]
sub eax, dword [ebp - 0x574]
cmp eax, dword [ebp + 0x10]
jb 0x10064cd9
jmp 0x10064f9f
cmp dword [ebp - 0x588], 2
jne 0x10064e54
cmp dword [ebp + 0x10], eax
mov edi, dword [ebp - 0x574]
jbe 0x10064fdf
mov ecx, edi
xor esi, esi
sub ecx, dword [ebp - 0x574]
lea eax, [ebp - 0x564]
cmp ecx, dword [ebp + 0x10]
jae 0x10064dee
movzx edx, word [edi]
inc edi
inc edi
inc ecx
inc ecx
cmp dx, 0xa
jne 0x10064ddb
cmp esi, 0x3fd
ja 0x10064dec
add dword [ebp - 0x578], 2
mov ebx, dword [ebp - 0x594]
mov word [eax], 0xd
inc eax
inc eax
inc esi
inc esi
mov word [eax], dx
inc eax
inc eax
inc esi
inc esi
cmp esi, 0x3ff
jb 0x10064dab
jmp 0x10064dee
dec edi
dec edi
mov esi, eax
lea eax, [ebp - 0x564]
sub esi, eax
push 0
lea eax, [ebp - 0x57c]
push eax
push esi
lea eax, [ebp - 0x564]
push eax
mov eax, dword [ebp - 0x580]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10064f93
mov eax, dword [ebp - 0x57c]
add dword [ebp - 0x570], eax
cmp eax, esi
jl 0x10064f9f
test eax, eax
je 0x10064f9f
mov eax, edi
sub eax, dword [ebp - 0x574]
cmp eax, dword [ebp + 0x10]
jb 0x10064d9b
jmp 0x10064f9f
cmp dword [ebp + 0x10], eax
mov ecx, dword [ebp - 0x574]
mov dword [ebp - 0x568], ecx
jbe 0x10064fdf
mov ecx, dword [ebp - 0x568]
xor esi, esi
sub ecx, dword [ebp - 0x574]
lea eax, [ebp - 0x160]
cmp ecx, dword [ebp + 0x10]
jae 0x10064ec5
mov edx, dword [ebp - 0x568]
movzx edx, word [edx]
add dword [ebp - 0x568], 2
push 2
pop edi
add ecx, edi
cmp dx, 0xa
jne 0x10064eae
cmp esi, 0x150
ja 0x10064ebf
mov word [eax], 0xd
add eax, edi
add esi, edi
mov word [eax], dx
add esi, edi
add eax, edi
cmp esi, 0x152
jb 0x10064e7d
jmp 0x10064ec5
sub dword [ebp - 0x568], edi
xor esi, esi
push esi
push esi
push 0x2ab
lea ecx, [ebp - 0x410]
push ecx
lea ecx, [ebp - 0x160]
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 edi, eax
cmp edi, esi
je 0x10064f93
push 0
lea eax, [ebp - 0x57c]
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [ebp + esi - 0x410]
push eax
mov eax, dword [ebp - 0x580]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10064f33
add esi, dword [ebp - 0x57c]
cmp edi, esi
jg 0x10064efc
jmp 0x10064f3f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x56c], eax
cmp edi, esi
jg 0x10064f9f
mov eax, dword [ebp - 0x568]
sub eax, dword [ebp - 0x574]
cmp eax, dword [ebp + 0x10]
mov dword [ebp - 0x570], eax
jb 0x10064e69
jmp 0x10064f9f
push 0
lea ecx, [ebp - 0x57c]
push ecx
push dword [ebp + 0x10]
push dword [ebp - 0x574]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10064f93
mov eax, dword [ebp - 0x57c]
and dword [ebp - 0x56c], 0
mov dword [ebp - 0x570], eax
jmp 0x10064f9f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x56c], eax
mov eax, dword [ebp - 0x570]
test eax, eax
jne 0x10065015
cmp dword [ebp - 0x56c], 0
je 0x10064fdf
push 5
pop esi
cmp dword [ebp - 0x56c], esi
jne 0x10064fd1
call fcn.10055749
mov dword [eax], 9
call fcn.1005575c
mov dword [eax], esi
jmp 0x10065010
push dword [ebp - 0x56c]
call fcn.1005576f
pop ecx
jmp 0x10065010
mov eax, dword [ebp - 0x580]
mov eax, dword [eax]
test byte [ebx + eax + 4], 0x40
je 0x10064ffd
mov eax, dword [ebp - 0x574]
cmp byte [eax], 0x1a
jne 0x10064ffd
xor eax, eax
jmp 0x1006501b
call fcn.10055749
mov dword [eax], 0x1c
call fcn.1005575c
and dword [eax], 0
or eax, 0xffffffff
jmp 0x1006501b
sub eax, dword [ebp - 0x578]
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.10050c11
leave
ret