Function at 0x1001e176
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x514]
sub esp, 0x590
mov eax, dword [0x1005a214]
xor eax, ebp
mov dword [ebp + 0x510], eax
mov eax, dword [ebp + 0x520]
push edi
xor edi, edi
cmp dword [ebp + 0x524], edi
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], edi
jne 0x1001e1b2
xor eax, eax
jmp 0x1001e6bd
cmp eax, edi
jne 0x1001e1dd
call fcn.100119b5
mov dword [eax], edi
call fcn.100119a2
push edi
push edi
push edi
push edi
push edi
mov dword [eax], 0x16
call fcn.1000d330
add esp, 0x14
or eax, 0xffffffff
jmp 0x1001e6bd
push ebx
push esi
mov esi, dword [ebp + 0x51c]
mov ebx, esi
and ebx, 0x1f
imul ebx, ebx, 0x28
mov eax, esi
sar eax, 5
lea eax, [eax*4 + 0x1005e220]
mov dword [ebp - 0x70], eax
mov eax, dword [eax]
add eax, ebx
mov cl, byte [eax + 0x24]
cmp cl, 2
mov byte [ebp - 0x51], cl
je 0x1001e210
cmp cl, 1
jne 0x1001e23d
and dword [ebp + 0x524], 0xfffffffe
jne 0x1001e23d
call fcn.100119b5
mov dword [eax], edi
call fcn.100119a2
push edi
push edi
push edi
push edi
push edi
mov dword [eax], 0x16
call fcn.1000d330
add esp, 0x14
jmp 0x1001e6b3
test byte [eax + 4], 0x20
je 0x1001e250
push 2
push edi
push edi
push esi
call fcn.1000d330
add esp, 0x10
push esi
call fcn.1001e7e7
test eax, eax
pop ecx
je 0x1001e3ec
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
test byte [ebx + eax + 4], 0x80
je 0x1001e3ec
call fcn.10015545
mov eax, dword [eax + 0x6c]
xor ecx, ecx
cmp dword [eax + 0x14], edi
setne cl
mov eax, ecx
cmp eax, edi
je 0x1001e3ec
call dword [sym.imp.kernel32.dll_GetConsoleCP]
and dword [ebp - 0x60], edi
cmp dword [ebp + 0x524], 0
mov edi, dword [ebp - 0x64]
mov dword [ebp - 0x7c], eax
jbe 0x1001e65b
and dword [ebp - 0x5c], 0
cmp byte [ebp - 0x51], 0
jne 0x1001e319
mov al, byte [edi]
xor ecx, ecx
cmp al, 0xa
sete cl
movsx eax, al
push eax
mov dword [ebp - 0x78], ecx
call fcn.1001ea6b
test eax, eax
pop ecx
jne 0x1001e2e3
push 1
lea eax, [ebp - 0x58]
push edi
push eax
call fcn.10024835
add esp, 0xc
cmp eax, 0xffffffff
je 0x1001e654
jmp 0x1001e313
mov eax, dword [ebp - 0x64]
sub eax, edi
add eax, dword [ebp + 0x524]
cmp eax, 1
jbe 0x1001e654
push 2
lea eax, [ebp - 0x58]
push edi
push eax
call fcn.10024835
add esp, 0xc
cmp eax, 0xffffffff
je 0x1001e654
inc edi
inc dword [ebp - 0x5c]
inc edi
inc dword [ebp - 0x5c]
jmp 0x1001e33d
cmp byte [ebp - 0x51], 1
je 0x1001e325
cmp byte [ebp - 0x51], 2
jne 0x1001e33d
movzx eax, word [edi]
xor ecx, ecx
cmp ax, 0xa
sete cl
inc edi
inc edi
add dword [ebp - 0x5c], 2
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x78], ecx
xor eax, eax
push eax
push eax
push 5
lea ecx, [ebp + 0x508]
push ecx
push 1
lea ecx, [ebp - 0x58]
push ecx
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov esi, eax
test esi, esi
je 0x1001e654
push 0
lea eax, [ebp - 0x60]
push eax
push esi
lea eax, [ebp + 0x508]
push eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x1001e64b
mov eax, dword [ebp - 0x60]
add dword [ebp - 0x68], eax
cmp eax, esi
jl 0x1001e654
cmp dword [ebp - 0x78], 0
je 0x1001e3d8
push 0
lea eax, [ebp - 0x60]
push eax
push 1
lea eax, [ebp + 0x508]
push eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
mov byte [ebp + 0x508], 0xd
push dword [ebx + eax]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x1001e64b
cmp dword [ebp - 0x60], 1
jl 0x1001e654
inc dword [ebp - 0x6c]
inc dword [ebp - 0x68]
mov eax, dword [ebp + 0x524]
cmp dword [ebp - 0x5c], eax
jb 0x1001e2a9
jmp 0x1001e654
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
add eax, ebx
test byte [eax + 4], 0x80
je 0x1001e626
cmp byte [ebp - 0x51], 0
mov eax, dword [ebp - 0x64]
mov dword [ebp - 0x5c], edi
jne 0x1001e49a
cmp dword [ebp + 0x524], edi
mov dword [ebp - 0x58], eax
jbe 0x1001e688
mov ecx, dword [ebp - 0x58]
xor esi, esi
sub ecx, dword [ebp - 0x64]
lea eax, [ebp - 0x50]
cmp ecx, dword [ebp + 0x524]
jae 0x1001e451
mov edx, dword [ebp - 0x58]
inc dword [ebp - 0x58]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x1001e445
inc dword [ebp - 0x6c]
mov byte [eax], 0xd
inc eax
inc esi
mov byte [eax], dl
inc eax
inc esi
cmp esi, 0x400
jb 0x1001e427
mov esi, eax
lea eax, [ebp - 0x50]
sub esi, eax
push 0
lea eax, [ebp - 0x74]
push eax
push esi
lea eax, [ebp - 0x50]
push eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x1001e64b
mov eax, dword [ebp - 0x74]
add dword [ebp - 0x68], eax
cmp eax, esi
jl 0x1001e654
mov eax, dword [ebp - 0x58]
sub eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x524]
jb 0x1001e41c
jmp 0x1001e654
cmp byte [ebp - 0x51], 2
jne 0x1001e546
cmp dword [ebp + 0x524], edi
mov dword [ebp - 0x60], eax
jbe 0x1001e688
mov ecx, dword [ebp - 0x60]
and dword [ebp - 0x58], edi
sub ecx, dword [ebp - 0x64]
push 2
lea eax, [ebp - 0x50]
pop esi
cmp ecx, dword [ebp + 0x524]
jae 0x1001e4f9
mov edx, dword [ebp - 0x60]
movzx edx, word [edx]
add dword [ebp - 0x60], esi
add ecx, esi
cmp dx, 0xa
jne 0x1001e4e8
add dword [ebp - 0x6c], esi
mov word [eax], 0xd
add eax, esi
add dword [ebp - 0x58], esi
add dword [ebp - 0x58], esi
mov word [eax], dx
add eax, esi
cmp dword [ebp - 0x58], 0x3ff
jb 0x1001e4c2
mov esi, eax
lea eax, [ebp - 0x50]
sub esi, eax
push 0
lea eax, [ebp - 0x74]
push eax
push esi
lea eax, [ebp - 0x50]
push eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x1001e64b
mov eax, dword [ebp - 0x74]
add dword [ebp - 0x68], eax
cmp eax, esi
jl 0x1001e654
mov eax, dword [ebp - 0x60]
sub eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x524]
jb 0x1001e4b3
jmp 0x1001e654
cmp dword [ebp + 0x524], edi
mov dword [ebp - 0x58], eax
jbe 0x1001e688
mov ecx, dword [ebp - 0x58]
and dword [ebp - 0x60], 0
sub ecx, dword [ebp - 0x64]
push 2
lea eax, [ebp + 0x3b4]
pop esi
cmp ecx, dword [ebp + 0x524]
jae 0x1001e59f
mov edx, dword [ebp - 0x58]
movzx edx, word [edx]
add dword [ebp - 0x58], esi
add ecx, esi
cmp dx, 0xa
jne 0x1001e58e
add dword [ebp - 0x6c], esi
mov word [eax], 0xd
add eax, esi
add dword [ebp - 0x60], esi
add dword [ebp - 0x60], esi
mov word [eax], dx
add eax, esi
cmp dword [ebp - 0x60], 0x152
jb 0x1001e568
xor esi, esi
push esi
push esi
push 0x2ab
lea ecx, [ebp + 0x104]
push ecx
lea ecx, [ebp + 0x3b4]
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 0x1001e64b
push 0
lea eax, [ebp - 0x74]
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [ebp + esi + 0x104]
push eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x1001e605
mov eax, dword [ebp - 0x74]
add dword [ebp - 0x68], eax
add esi, eax
cmp edi, esi
jg 0x1001e5d2
jmp 0x1001e60e
call dword [sym.imp.kernel32.dll_GetLastError]
mov dword [ebp - 0x5c], eax
cmp edi, esi
jg 0x1001e654
mov eax, dword [ebp - 0x58]
sub eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x524]
jb 0x1001e555
jmp 0x1001e654
push edi
lea ecx, [ebp - 0x74]
push ecx
push dword [ebp + 0x524]
push dword [ebp - 0x64]
push dword [eax]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x1001e64b
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x68], eax
jmp 0x1001e654
call dword [sym.imp.kernel32.dll_GetLastError]
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x68]
test eax, eax
jne 0x1001e6b8
cmp dword [ebp - 0x5c], 0
je 0x1001e688
push 5
pop esi
cmp dword [ebp - 0x5c], esi
jne 0x1001e67d
call fcn.100119a2
mov dword [eax], 9
call fcn.100119b5
mov dword [eax], esi
jmp 0x1001e6b3
push dword [ebp - 0x5c]
call fcn.100119c8
pop ecx
jmp 0x1001e6b3
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
test byte [ebx + eax + 4], 0x40
je 0x1001e6a0
mov eax, dword [ebp - 0x64]
cmp byte [eax], 0x1a
jne 0x1001e6a0
xor eax, eax
jmp 0x1001e6bb
call fcn.100119a2
mov dword [eax], 0x1c
call fcn.100119b5
and dword [eax], 0
or eax, 0xffffffff
jmp 0x1001e6bb
sub eax, dword [ebp - 0x6c]
pop esi
pop ebx
mov ecx, dword [ebp + 0x510]
xor ecx, ebp
pop edi
call fcn.1000cef6
add ebp, 0x514
leave
ret