Function at 0x103ffc5
Capabilities:
Write file on windows

Disassembly:
push ebp
mov eax, dword [0x1066c80]
lea ebp, [esp - 0x518]
sub esp, 0x594
xor eax, ebp
mov dword [ebp + 0x514], eax
mov eax, dword [ebp + 0x524]
push esi
xor esi, esi
cmp dword [ebp + 0x528], esi
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x68], esi
jne 0x1040001
xor eax, eax
jmp 0x1040575
cmp eax, esi
jne 0x104002c
call fcn.0103ab94
mov dword [eax], esi
call fcn.0103ab81
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.01036505
sub esp, 0xffffffec
or eax, 0xffffffff
jmp 0x1040575
mov esi, dword [ebp + 0x520]
push ebx
mov ebx, esi
mov eax, esi
and ebx, 0x1f
imul ebx, ebx, 0x38
sar eax, 5
push edi
lea edi, [eax*4 + 0x106adc0]
mov eax, dword [edi]
add eax, ebx
mov cl, byte [eax + 0x24]
add cl, cl
mov dword [ebp - 0x70], edi
sar cl, 1
cmp cl, 2
mov byte [ebp - 0x55], cl
je 0x1040063
cmp cl, 1
jne 0x1040096
mov ecx, dword [ebp + 0x528]
not ecx
test cl, 1
jne 0x1040096
call fcn.0103ab94
xor esi, esi
mov dword [eax], esi
call fcn.0103ab81
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.01036505
sub esp, 0xffffffec
jmp 0x104056b
test byte [eax + 4], 0x20
je 0x10400ab
push 2
push 0
push 0
push esi
call fcn.0103fe29
sub esp, 0xfffffff0
push esi
call fcn.010406ab
test eax, eax
pop ecx
je 0x10402b0
mov eax, dword [edi]
test byte [ebx + eax + 4], 0x80
je 0x10402b0
call fcn.01038ab5
xor ecx, ecx
mov eax, dword [eax + 0x6c]
cmp dword [eax + 0x14], ecx
lea eax, [ebp - 0x7c]
sete cl
mov esi, ecx
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x10402b0
or esi, esi
je 0x10400fe
cmp byte [ebp - 0x55], 0
je 0x10402b0
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
and dword [ebp - 0x50], 0
cmp dword [ebp + 0x528], 0
mov esi, dword [ebp - 0x64]
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0x74], esi
jbe 0x104051d
and dword [ebp - 0x5c], 0
jmp 0x1040127
mov esi, dword [ebp - 0x74]
mov al, byte [ebp - 0x55]
or al, al
jne 0x1040238
mov al, byte [esi]
xor ecx, ecx
cmp al, 0xa
movsx eax, al
sete cl
push eax
mov dword [ebp - 0x78], ecx
call fcn.01036e3b
pop ecx
test eax, eax
jne 0x1040166
push 1
push esi
lea eax, [ebp - 0x54]
push eax
call fcn.01040bde
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x1040513
jmp 0x1040196
mov eax, dword [ebp - 0x64]
sub eax, esi
add eax, dword [ebp + 0x528]
cmp eax, 1
jbe 0x1040513
push 2
lea eax, [ebp - 0x54]
push esi
push eax
call fcn.01040bde
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x1040513
inc esi
inc dword [ebp - 0x5c]
lea ecx, [ebp + 0x50c]
xor eax, eax
push eax
push eax
push 5
inc esi
push ecx
push 1
lea ecx, [ebp - 0x54]
push ecx
push eax
push dword [ebp - 0x7c]
inc dword [ebp - 0x5c]
mov dword [ebp - 0x74], esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
or esi, esi
je 0x1040513
lea eax, [ebp - 0x50]
push 0
push eax
push esi
lea eax, [ebp + 0x50c]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x104050a
mov eax, dword [ebp - 0x50]
add dword [ebp - 0x60], eax
cmp eax, esi
jl 0x1040513
cmp dword [ebp - 0x78], 0
je 0x104029c
lea eax, [ebp - 0x50]
push 0
push eax
push 1
lea eax, [ebp + 0x50c]
push eax
mov eax, dword [edi]
mov byte [ebp + 0x50c], 0xd
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x104050a
cmp dword [ebp - 0x50], 1
jl 0x1040513
inc dword [ebp - 0x68]
inc dword [ebp - 0x60]
jmp 0x104029c
cmp al, 1
je 0x1040240
cmp al, 2
jne 0x104025b
xor edx, edx
movzx ecx, word [esi]
cmp cx, 0xa
sete dl
inc esi
inc esi
add dword [ebp - 0x5c], 2
mov dword [ebp - 0x54], ecx
mov dword [ebp - 0x74], esi
mov dword [ebp - 0x78], edx
cmp al, 1
je 0x1040263
cmp al, 2
jne 0x104029c
push dword [ebp - 0x54]
call fcn.0104206f
pop ecx
cmp ax, word [ebp - 0x54]
jne 0x104050a
inc dword [ebp - 0x60]
cmp dword [ebp - 0x78], 0
je 0x104029c
push 0xd
pop eax
push eax
mov dword [ebp - 0x54], eax
call fcn.0104206f
pop ecx
cmp ax, word [ebp - 0x54]
jne 0x104050a
inc dword [ebp - 0x60]
inc dword [ebp - 0x68]
mov eax, dword [ebp + 0x528]
cmp dword [ebp - 0x5c], eax
jb 0x1040124
jmp 0x1040513
mov eax, dword [edi]
add eax, ebx
test byte [eax + 4], 0x80
je 0x10404e3
xor esi, esi
mov eax, dword [ebp - 0x64]
cmp byte [ebp - 0x55], 0
mov dword [ebp - 0x54], esi
jne 0x1040361
cmp dword [ebp + 0x528], esi
mov dword [ebp - 0x50], eax
jbe 0x1040544
lea eax, [ebp - 0x4c]
mov ecx, dword [ebp - 0x50]
and dword [ebp - 0x5c], 0
sub ecx, dword [ebp - 0x64]
cmp ecx, dword [ebp + 0x528]
jae 0x104031b
mov edx, dword [ebp - 0x50]
inc dword [ebp - 0x50]
inc ecx
mov dl, byte [edx]
cmp dl, 0xa
jne 0x104030c
inc dword [ebp - 0x68]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x5c]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x5c]
cmp dword [ebp - 0x5c], 0x400
jb 0x10402ec
mov esi, eax
push 0
lea eax, [ebp - 0x4c]
sub esi, eax
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x4c]
push esi
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x104050a
mov eax, dword [ebp - 0x6c]
add dword [ebp - 0x60], eax
cmp eax, esi
jl 0x1040513
mov eax, dword [ebp - 0x50]
sub eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x528]
jb 0x10402df
jmp 0x1040513
cmp byte [ebp - 0x55], 2
jne 0x1040408
cmp dword [ebp + 0x528], esi
mov dword [ebp - 0x50], eax
jbe 0x1040544
xor esi, esi
lea eax, [ebp - 0x4c]
mov ecx, dword [ebp - 0x50]
sub ecx, dword [ebp - 0x64]
cmp ecx, dword [ebp + 0x528]
jae 0x10403be
mov edx, dword [ebp - 0x50]
sub dword [ebp - 0x50], 0xfffffffe
movzx edx, word [edx]
inc ecx
inc ecx
cmp dx, 0xa
jne 0x10403ac
add dword [ebp - 0x68], 2
mov word [eax], 0xd
inc eax
inc eax
inc esi
inc esi
mov edi, dword [ebp - 0x70]
mov word [eax], dx
inc eax
inc eax
inc esi
inc esi
cmp esi, 0x3ff
jb 0x1040385
push 0
mov esi, eax
lea eax, [ebp - 0x4c]
sub esi, eax
lea eax, [ebp - 0x6c]
push eax
push esi
lea eax, [ebp - 0x4c]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x104050a
mov eax, dword [ebp - 0x6c]
add dword [ebp - 0x60], eax
cmp eax, esi
jl 0x1040513
mov eax, dword [ebp - 0x50]
sub eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x528]
jb 0x104037a
jmp 0x1040513
cmp dword [ebp + 0x528], esi
mov dword [ebp - 0x5c], eax
jbe 0x1040544
mov ecx, dword [ebp - 0x5c]
and dword [ebp - 0x50], 0
sub ecx, dword [ebp - 0x64]
lea eax, [ebp + 0x3b8]
push 2
pop esi
cmp ecx, dword [ebp + 0x528]
jae 0x104045e
mov edx, dword [ebp - 0x5c]
movzx edx, word [edx]
add dword [ebp - 0x5c], esi
add ecx, esi
cmp dx, 0xa
jne 0x104044d
mov word [eax], 0xd
add eax, esi
add dword [ebp - 0x50], esi
add dword [ebp - 0x50], esi
mov word [eax], dx
add eax, esi
cmp dword [ebp - 0x50], 0x152
jb 0x104042a
lea ecx, [ebp + 0x108]
xor esi, esi
push esi
push esi
push 0x2ab
push ecx
lea ecx, [ebp + 0x3b8]
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 0x104050a
lea eax, [ebp - 0x6c]
push 0
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [ebp + esi + 0x108]
push eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x10404bf
add esi, dword [ebp - 0x6c]
cmp edi, esi
jg 0x1040491
jmp 0x10404c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x54], eax
cmp edi, esi
jg 0x1040513
mov eax, dword [ebp - 0x5c]
sub eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x528]
mov dword [ebp - 0x60], eax
jb 0x1040417
jmp 0x1040513
push 0
lea ecx, [ebp - 0x6c]
push ecx
push dword [ebp + 0x528]
push dword [ebp - 0x64]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x104050a
mov eax, dword [ebp - 0x6c]
and dword [ebp - 0x54], 0
mov dword [ebp - 0x60], eax
jmp 0x1040513
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x60]
test eax, eax
jne 0x1040570
mov edi, dword [ebp - 0x70]
xor esi, esi
cmp dword [ebp - 0x54], esi
je 0x1040544
push 5
pop esi
cmp dword [ebp - 0x54], esi
jne 0x1040539
call fcn.0103ab81
mov dword [eax], 9
jmp 0x1040564
push dword [ebp - 0x54]
call fcn.0103aba7
pop ecx
jmp 0x104056b
mov eax, dword [edi]
test byte [ebx + eax + 4], 0x40
je 0x1040559
mov eax, dword [ebp - 0x64]
cmp byte [eax], 0x1a
jne 0x1040559
xor eax, eax
jmp 0x1040573
call fcn.0103ab81
mov dword [eax], 0x1c
call fcn.0103ab94
mov dword [eax], esi
or eax, 0xffffffff
jmp 0x1040573
sub eax, dword [ebp - 0x68]
pop edi
pop ebx
pop esi
mov ecx, dword [ebp + 0x514]
xor ecx, ebp
call fcn.01034b54
sub ebp, 0xfffffae8
leave
ret