Function at 0x1001ec84
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x1ae4
call fcn.10026090
mov eax, dword [0x10041510]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x1acc], eax
xor edi, edi
mov dword [ebp - 0x1ac8], edi
mov dword [ebp - 0x1ad0], edi
cmp dword [ebp + 0x10], edi
jne 0x1001ecc5
xor eax, eax
jmp 0x1001f373
cmp eax, edi
jne 0x1001ece8
call fcn.1001cf5f
mov dword [eax], edi
call fcn.1001cf4c
mov dword [eax], 0x16
call fcn.1001e899
or eax, 0xffffffff
jmp 0x1001f373
mov eax, esi
sar eax, 5
mov edi, esi
push ebx
lea ebx, [eax*4 + 0x10046a20]
mov eax, dword [ebx]
and edi, 0x1f
shl edi, 6
mov cl, byte [eax + edi + 0x24]
add cl, cl
sar cl, 1
mov dword [ebp - 0x1adc], ebx
mov byte [ebp - 0x1ac1], cl
cmp cl, 2
je 0x1001ed1d
cmp cl, 1
jne 0x1001ed44
mov ecx, dword [ebp + 0x10]
not ecx
test cl, 1
jne 0x1001ed44
call fcn.1001cf5f
and dword [eax], 0
call fcn.1001cf4c
mov dword [eax], 0x16
call fcn.1001e899
jmp 0x1001f361
test byte [eax + edi + 4], 0x20
je 0x1001ed5a
push 2
push 0
push 0
push esi
call fcn.10025f12
sub esp, 0xfffffff0
push esi
call fcn.10025ebc
or eax, eax
pop ecx
je 0x1001f002
mov eax, dword [ebx]
test byte [edi + eax + 4], 0x80
je 0x1001f002
call fcn.10021d47
mov eax, dword [eax + 0x6c]
xor ecx, ecx
cmp dword [eax + 0x14], ecx
sete cl
mov esi, ecx
lea eax, [ebp - 0x1ae0]
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
xor ecx, ecx
cmp eax, ecx
je 0x1001f004
cmp esi, ecx
je 0x1001edb4
cmp byte [ebp - 0x1ac1], cl
je 0x1001f004
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov ebx, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ae0], eax
xor eax, eax
mov dword [ebp - 0x1ad4], eax
cmp dword [ebp + 0x10], eax
jbe 0x1001f2fa
mov dword [ebp - 0x1ac0], eax
mov al, byte [ebp - 0x1ac1]
test al, al
jne 0x1001ef52
mov cl, byte [ebx]
mov esi, dword [ebp - 0x1adc]
xor eax, eax
cmp cl, 0xa
sete al
mov dword [ebp - 0x1ae4], eax
mov eax, dword [esi]
add eax, edi
cmp dword [eax + 0x38], 0
je 0x1001ee20
mov dl, byte [eax + 0x34]
mov byte [ebp - 0xc], dl
mov byte [ebp - 0xb], cl
and dword [eax + 0x38], 0
lea eax, [ebp - 0xc]
push 2
push eax
jmp 0x1001ee6b
movsx eax, cl
push eax
call fcn.10022d1c
or eax, eax
pop ecx
je 0x1001ee68
mov ecx, dword [ebp - 0x1acc]
sub ecx, ebx
add ecx, dword [ebp + 0x10]
xor eax, eax
inc eax
cmp ecx, eax
jbe 0x1001efe9
lea eax, [ebp - 0x1abc]
push 2
push ebx
push eax
call fcn.10025ea2
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x1001f2f1
inc ebx
inc dword [ebp - 0x1ac0]
jmp 0x1001ee83
push 1
push ebx
lea eax, [ebp - 0x1abc]
push eax
call fcn.10025ea2
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x1001f2f1
xor eax, eax
inc ebx
lea esi, [ebp - 0xc]
push eax
push eax
push 5
push esi
lea ecx, [ebp - 0x1abc]
push 1
push ecx
push eax
push dword [ebp - 0x1ae0]
inc dword [ebp - 0x1ac0]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
or esi, esi
je 0x1001f2f1
lea eax, [ebp - 0x1ad4]
push 0
push eax
push esi
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x1001f2e5
mov ecx, dword [ebp - 0x1ad0]
mov eax, dword [ebp - 0x1ac0]
add eax, ecx
mov dword [ebp - 0x1ac8], eax
cmp dword [ebp - 0x1ad4], esi
jl 0x1001f2f1
cmp dword [ebp - 0x1ae4], 0
je 0x1001efd5
push 0
lea eax, [ebp - 0x1ad4]
lea esi, [ebp - 0xc]
push eax
push 1
push esi
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
mov byte [ebp - 0xc], 0xd
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x1001f2e5
cmp dword [ebp - 0x1ad4], 1
jl 0x1001f2f1
inc dword [ebp - 0x1ad0]
inc dword [ebp - 0x1ac8]
jmp 0x1001efd5
cmp al, 1
je 0x1001ef5a
cmp al, 2
jne 0x1001ef7b
xor ecx, ecx
movzx esi, word [ebx]
cmp esi, 0xa
sete cl
sub ebx, 0xfffffffe
add dword [ebp - 0x1ac0], 2
mov dword [ebp - 0x1abc], esi
mov dword [ebp - 0x1ae4], ecx
cmp al, 1
je 0x1001ef83
cmp al, 2
jne 0x1001efd5
push dword [ebp - 0x1abc]
call fcn.10025d4a
pop ecx
cmp ax, word [ebp - 0x1abc]
jne 0x1001f2e5
add dword [ebp - 0x1ac8], 2
cmp dword [ebp - 0x1ae4], 0
je 0x1001efd5
push 0xd
pop eax
push eax
mov dword [ebp - 0x1abc], eax
call fcn.10025d4a
cmp ax, word [ebp - 0x1abc]
pop ecx
jne 0x1001f2e5
inc dword [ebp - 0x1ac8]
inc dword [ebp - 0x1ad0]
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x1ac0], eax
jb 0x1001eddd
jmp 0x1001f2f1
mov dl, byte [ebx]
mov ebx, dword [esi]
inc dword [ebp - 0x1ac8]
mov byte [edi + ebx + 0x34], dl
mov ecx, dword [esi]
mov dword [edi + ecx + 0x38], eax
jmp 0x1001f2f1
xor ecx, ecx
mov eax, dword [ebx]
test byte [eax + edi + 4], 0x80
je 0x1001f2b2
cmp byte [ebp - 0x1ac1], 0
mov dword [ebp - 0x1abc], ecx
jne 0x1001f0cc
mov ebx, dword [ebp - 0x1acc]
cmp dword [ebp + 0x10], ecx
jbe 0x1001f330
xor esi, esi
mov ecx, ebx
lea eax, [ebp - 0x1ab8]
sub ecx, dword [ebp - 0x1acc]
cmp ecx, dword [ebp + 0x10]
jae 0x1001f06e
mov dl, byte [ebx]
inc ebx
inc ecx
mov dword [ebp - 0x1ae0], ebx
cmp dl, 0xa
jne 0x1001f062
inc dword [ebp - 0x1ad0]
mov byte [eax], 0xd
inc eax
inc esi
mov byte [eax], dl
inc eax
inc esi
cmp esi, 0x13ff
jb 0x1001f043
mov esi, eax
lea eax, [ebp - 0x1ab8]
push 0
sub esi, eax
lea eax, [ebp - 0x1ad8]
push eax
lea eax, [ebp - 0x1ab8]
push esi
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1001f2e5
mov eax, dword [ebp - 0x1ad8]
add dword [ebp - 0x1ac8], eax
cmp eax, esi
jl 0x1001f2f1
mov eax, ebx
sub eax, dword [ebp - 0x1acc]
cmp eax, dword [ebp + 0x10]
jb 0x1001f033
jmp 0x1001f2f1
cmp byte [ebp - 0x1ac1], 2
jne 0x1001f1a6
mov ebx, dword [ebp - 0x1acc]
cmp dword [ebp + 0x10], ecx
jbe 0x1001f330
mov ecx, ebx
and dword [ebp - 0x1ac0], 0
sub ecx, dword [ebp - 0x1acc]
push 2
lea eax, [ebp - 0x1ab8]
pop esi
cmp ecx, dword [ebp + 0x10]
jae 0x1001f148
movzx edx, word [ebx]
add ebx, esi
add ecx, esi
mov dword [ebp - 0x1ae0], ebx
cmp edx, 0xa
jne 0x1001f131
add dword [ebp - 0x1ad0], esi
push 0xd
pop ebx
mov word [eax], bx
mov ebx, dword [ebp - 0x1ae0]
add eax, esi
add dword [ebp - 0x1ac0], esi
add dword [ebp - 0x1ac0], esi
mov word [eax], dx
add eax, esi
cmp dword [ebp - 0x1ac0], 0x13fe
jb 0x1001f100
mov esi, eax
lea eax, [ebp - 0x1ab8]
sub esi, eax
push 0
lea eax, [ebp - 0x1ad8]
push eax
lea eax, [ebp - 0x1ab8]
push esi
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1001f2e5
mov eax, dword [ebp - 0x1ad8]
add dword [ebp - 0x1ac8], eax
cmp eax, esi
jl 0x1001f2f1
mov eax, ebx
sub eax, dword [ebp - 0x1acc]
cmp eax, dword [ebp + 0x10]
jb 0x1001f0e8
jmp 0x1001f2f1
mov ebx, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ad4], ebx
cmp dword [ebp + 0x10], ecx
jbe 0x1001f330
lea eax, [ebp - 0x6b8]
mov esi, dword [ebp - 0x1ad4]
and dword [ebp - 0x1ac0], 0
sub esi, dword [ebp - 0x1acc]
push 2
pop ecx
cmp esi, dword [ebp + 0x10]
jae 0x1001f217
mov edx, dword [ebp - 0x1ad4]
movzx edx, word [edx]
add dword [ebp - 0x1ad4], ecx
add esi, ecx
cmp edx, 0xa
jne 0x1001f200
push 0xd
pop ebx
mov word [eax], bx
add eax, ecx
add dword [ebp - 0x1ac0], ecx
add dword [ebp - 0x1ac0], ecx
mov word [eax], dx
add eax, ecx
cmp dword [ebp - 0x1ac0], 0x6a8
jb 0x1001f1d7
lea ebx, [ebp - 0x1410]
xor esi, esi
push esi
push esi
push 0xd55
push ebx
lea ecx, [ebp - 0x6b8]
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 ebx, eax
cmp ebx, esi
je 0x1001f2e5
push 0
lea eax, [ebp - 0x1ad8]
push eax
mov eax, ebx
sub eax, esi
push eax
lea eax, [ebp + esi - 0x1410]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1001f285
add esi, dword [ebp - 0x1ad8]
cmp ebx, esi
jg 0x1001f24e
jmp 0x1001f291
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1abc], eax
cmp ebx, esi
jg 0x1001f2f1
mov eax, dword [ebp - 0x1ad4]
sub eax, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac8], eax
cmp eax, dword [ebp + 0x10]
jb 0x1001f1bb
jmp 0x1001f2f1
push ecx
lea ecx, [ebp - 0x1ad8]
push ecx
push dword [ebp + 0x10]
push dword [ebp - 0x1acc]
push dword [eax + edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x1001f2e5
mov eax, dword [ebp - 0x1ad8]
and dword [ebp - 0x1abc], 0
mov dword [ebp - 0x1ac8], eax
jmp 0x1001f2f1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1abc], eax
cmp dword [ebp - 0x1ac8], 0
jne 0x1001f366
cmp dword [ebp - 0x1abc], 0
je 0x1001f330
push 5
pop ebx
cmp dword [ebp - 0x1abc], ebx
jne 0x1001f322
call fcn.1001cf4c
mov dword [eax], 9
call fcn.1001cf5f
mov dword [eax], ebx
jmp 0x1001f361
push dword [ebp - 0x1abc]
call fcn.1001cf72
pop ecx
jmp 0x1001f361
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
test byte [edi + eax + 4], 0x40
je 0x1001f34e
mov eax, dword [ebp - 0x1acc]
cmp byte [eax], 0x1a
jne 0x1001f34e
xor eax, eax
jmp 0x1001f372
call fcn.1001cf4c
mov dword [eax], 0x1c
call fcn.1001cf5f
and dword [eax], 0
or eax, 0xffffffff
jmp 0x1001f372
mov eax, dword [ebp - 0x1ac8]
sub eax, dword [ebp - 0x1ad0]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop edi
pop esi
call fcn.1001fb45
leave
ret