Function at 0x10022ea5
Capabilities:
Write file on windows

Disassembly:
push esi
mov esi, esp
mov eax, 0x1af0
call fcn.10023710
mov eax, dword [0x1002d178]
xor eax, esi
mov dword [esi - 4], eax
and dword [esi - 0x1abc], 0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
push ebp
xor ebp, ebp
mov dword [esi - 0x1ac8], eax
push edi
xor edi, edi
mov dword [esi - 0x1ad0], ecx
mov dword [esi - 0x1ac0], ebp
cmp dword [esi + 0x10], ebp
jne 0x10022eed
xor eax, eax
jmp 0x100236fa
or ecx, ecx
jne 0x10022f10
call fcn.10018147
and dword [eax], ebp
call fcn.1001817b
mov dword [eax], 0x16
call fcn.1001a66f
or eax, 0xffffffff
jmp 0x100236fa
mov edx, eax
mov ecx, eax
sar edx, 5
and ecx, 0x1f
shl ecx, 6
mov dword [esi - 0x1ad8], edx
push ebx
mov edx, dword [edx*4 + 0x10031a90]
mov dword [esi - 0x1adc], ecx
mov bl, byte [ecx + edx + 0x24]
add bl, bl
sar bl, 1
cmp bl, 2
je 0x10022f43
cmp bl, 1
jne 0x10022f6e
mov eax, dword [esi + 0x10]
not eax
test al, 1
jne 0x10022f68
call fcn.10018147
and dword [eax], ebp
call fcn.1001817b
mov dword [eax], 0x16
call fcn.1001a66f
jmp 0x100236f0
mov eax, dword [esi - 0x1ac8]
test byte [ecx + edx + 4], 0x20
je 0x10022f84
push 2
push 0
push 0
push eax
call fcn.10023b9f
sub esp, 0xfffffff0
push dword [esi - 0x1ac8]
call fcn.10020815
pop ecx
test eax, eax
je 0x100232e8
mov eax, dword [esi - 0x1ad8]
mov ecx, dword [esi - 0x1adc]
mov eax, dword [eax*4 + 0x10031a90]
test byte [ecx + eax + 4], 0x80
je 0x100232e8
call fcn.1001a815
xor ecx, ecx
mov eax, dword [eax + 0x6c]
cmp dword [eax + 0xa8], ecx
lea eax, [esi - 0x1ae8]
push eax
mov eax, dword [esi - 0x1ad8]
sete cl
mov dword [esi - 0x1ac4], ecx
mov ecx, dword [esi - 0x1adc]
mov eax, dword [eax*4 + 0x10031a90]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
or eax, eax
je 0x100232e8
cmp dword [esi - 0x1ac4], ebp
je 0x1002300a
or bl, bl
je 0x100232e8
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov edx, dword [esi - 0x1ad0]
xor ecx, ecx
and dword [esi - 0x1ac8], ecx
mov dword [esi - 0x1af0], eax
mov dword [esi - 0x1acc], ecx
mov dword [esi - 0x1ad4], edx
cmp dword [esi + 0x10], ecx
jbe 0x100236ba
mov eax, dword [esi - 0x1ad4]
xor edx, edx
mov dword [esi - 0x1ac0], edx
mov dword [esi - 0x1aec], 0xa
and dword [esi - 0x1ac4], edi
test bl, bl
jne 0x1002320d
mov dl, byte [eax]
xor eax, eax
mov ecx, dword [esi - 0x1adc]
cmp dl, 0xa
sete al
mov dword [esi - 0x1ae8], eax
mov eax, dword [esi - 0x1ad8]
mov eax, dword [eax*4 + 0x10031a90]
mov dword [esi - 0x1ac4], eax
cmp dword [ecx + eax + 0x38], edi
je 0x100230aa
mov al, byte [ecx + eax + 0x34]
mov byte [esi - 0xc], al
mov eax, dword [esi - 0x1ac4]
mov byte [esi - 0xb], dl
push 2
and dword [ecx + eax + 0x38], edi
lea eax, [esi - 0xc]
push eax
jmp 0x10023104
movsx eax, dl
push eax
call fcn.10021e06
pop ecx
or eax, eax
je 0x100230fc
mov eax, dword [esi - 0x1ad0]
mov edx, dword [esi - 0x1ad4]
sub eax, edx
add eax, dword [esi + 0x10]
cmp eax, 1
jbe 0x100232ad
push 2
push edx
lea eax, [esi - 0x1acc]
push eax
call fcn.10023d07
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x100233f2
mov eax, dword [esi - 0x1ad4]
inc eax
inc dword [esi - 0x1ac0]
jmp 0x10023122
push 1
push dword [esi - 0x1ad4]
lea eax, [esi - 0x1acc]
push eax
call fcn.10023d07
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x100233f2
mov eax, dword [esi - 0x1ad4]
xor ecx, ecx
inc eax
inc dword [esi - 0x1ac0]
push ecx
push ecx
push 5
mov dword [esi - 0x1ad4], eax
lea eax, [esi - 0xc]
push eax
push 1
lea eax, [esi - 0x1acc]
push eax
push ecx
push dword [esi - 0x1af0]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [esi - 0x1ac4], eax
test eax, eax
je 0x100233f2
push 0
lea ecx, [esi - 0x1ac8]
push ecx
mov ecx, dword [esi - 0x1adc]
push eax
lea eax, [esi - 0xc]
push eax
mov eax, dword [esi - 0x1ad8]
mov eax, dword [eax*4 + 0x10031a90]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x100232db
mov ebp, dword [esi - 0x1ac0]
mov ecx, dword [esi - 0x1abc]
add ebp, ecx
mov eax, dword [esi - 0x1ac4]
cmp dword [esi - 0x1ac8], eax
jl 0x100233f8
cmp dword [esi - 0x1ae8], edi
je 0x10023202
mov ecx, dword [esi - 0x1adc]
lea eax, [esi - 0x1ac8]
push 0
push eax
push 1
lea eax, [esi - 0xc]
mov byte [esi - 0xc], 0xd
push eax
mov eax, dword [esi - 0x1ad8]
mov eax, dword [eax*4 + 0x10031a90]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100232db
cmp dword [esi - 0x1ac8], 1
jl 0x100233f2
inc dword [esi - 0x1abc]
inc ebp
mov ecx, dword [esi - 0x1acc]
jmp 0x10023293
cmp bl, 1
je 0x10023217
cmp bl, 2
jne 0x1002324a
movzx ecx, word [eax]
xor edx, edx
cmp cx, word [esi - 0x1aec]
mov dword [esi - 0x1acc], ecx
sete dl
add eax, 2
mov dword [esi - 0x1ac4], edx
mov edx, dword [esi - 0x1ac0]
sub edx, 0xfffffffe
mov dword [esi - 0x1ad4], eax
mov dword [esi - 0x1ac0], edx
cmp bl, 1
je 0x10023254
cmp bl, 2
jne 0x1002329f
push ecx
call fcn.10023d1f
pop ecx
mov ecx, dword [esi - 0x1acc]
cmp ax, cx
jne 0x100232db
add ebp, 2
cmp dword [esi - 0x1ac4], edi
je 0x10023293
push 0xd
pop eax
push eax
mov dword [esi - 0x1acc], eax
call fcn.10023d1f
pop ecx
mov ecx, dword [esi - 0x1acc]
cmp ax, cx
jne 0x100232db
inc ebp
inc dword [esi - 0x1abc]
mov edx, dword [esi - 0x1ac0]
mov eax, dword [esi - 0x1ad4]
cmp edx, dword [esi + 0x10]
jb 0x10023051
jmp 0x100233f2
mov ebx, dword [esi - 0x1ad8]
inc ebp
mov al, byte [edx]
mov edx, dword [esi - 0x1adc]
mov ecx, dword [ebx*4 + 0x10031a90]
mov byte [edx + ecx + 0x34], al
mov eax, dword [ebx*4 + 0x10031a90]
mov dword [edx + eax + 0x38], 1
jmp 0x100233f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x100233f2
mov eax, dword [esi - 0x1ad8]
mov ecx, dword [eax*4 + 0x10031a90]
mov eax, dword [esi - 0x1adc]
test byte [eax + ecx + 4], 0x80
je 0x1002367b
mov edx, dword [esi - 0x1ad0]
xor edi, edi
mov dword [esi - 0x1acc], edi
test bl, bl
jne 0x1002342a
mov ebx, dword [esi + 0x10]
mov dword [esi - 0x1ac8], edx
or ebx, ebx
je 0x100236ba
xor ecx, ecx
lea edi, [esi - 0x140c]
mov eax, edx
mov dword [esi - 0x1ac4], ecx
sub eax, dword [esi - 0x1ad0]
cmp eax, ebx
jae 0x1002338b
mov cl, byte [edx]
inc edx
inc eax
mov byte [esi - 0x1ae1], cl
cmp cl, 0xa
mov dword [esi - 0x1ac8], edx
mov ecx, dword [esi - 0x1ac4]
jne 0x1002336d
inc dword [esi - 0x1abc]
mov byte [edi], 0xd
inc edi
inc ecx
mov dl, byte [esi - 0x1ae1]
mov byte [edi], dl
inc edi
mov edx, dword [esi - 0x1ac8]
inc ecx
mov dword [esi - 0x1ac4], ecx
cmp ecx, 0x13ff
jb 0x10023343
mov ecx, dword [esi - 0x1adc]
lea eax, [esi - 0x140c]
sub edi, eax
lea eax, [esi - 0x1ae0]
push 0
push eax
push edi
lea eax, [esi - 0x140c]
push eax
mov eax, dword [esi - 0x1ad8]
mov eax, dword [eax*4 + 0x10031a90]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x100232db
add ebp, dword [esi - 0x1ae0]
cmp dword [esi - 0x1ae0], edi
jl 0x100233ec
mov edx, dword [esi - 0x1ac8]
mov eax, edx
sub eax, dword [esi - 0x1ad0]
cmp eax, ebx
jb 0x1002332d
mov edi, dword [esi - 0x1acc]
mov ecx, dword [esi - 0x1abc]
or ebp, ebp
jne 0x100236f5
or edi, edi
je 0x100236b4
push 5
pop ebx
cmp edi, ebx
jne 0x100236ab
call fcn.1001817b
mov dword [eax], 9
call fcn.10018147
mov dword [eax], ebx
jmp 0x100236f0
mov ecx, edx
cmp bl, 2
jne 0x1002351f
cmp dword [esi + 0x10], ebp
jbe 0x100236ba
mov dword [esi - 0x1aec], 0xa
and dword [esi - 0x1ae8], 0
lea ebx, [esi - 0x140c]
mov eax, ecx
push 0xd
sub eax, edx
mov edx, dword [esi - 0x1ae8]
pop ebp
cmp eax, dword [esi + 0x10]
jae 0x1002349a
movzx edi, word [ecx]
add eax, 2
add ecx, 2
cmp di, word [esi - 0x1aec]
jne 0x10023489
add dword [esi - 0x1abc], 2
mov word [ebx], bp
add ebx, 2
sub edx, 0xfffffffe
mov word [ebx], di
sub edx, 0xfffffffe
add ebx, 2
cmp edx, 0x13fe
jb 0x10023462
lea eax, [esi - 0x140c]
mov dword [esi - 0x1ac4], ecx
mov ecx, dword [esi - 0x1adc]
sub ebx, eax
push 0
lea eax, [esi - 0x1ae0]
push eax
push ebx
lea eax, [esi - 0x140c]
push eax
mov eax, dword [esi - 0x1ad8]
mov eax, dword [eax*4 + 0x10031a90]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebp, dword [esi - 0x1ac0]
mov edi, dword [esi - 0x1acc]
test eax, eax
je 0x100232db
add ebp, dword [esi - 0x1ae0]
mov dword [esi - 0x1ac0], ebp
cmp dword [esi - 0x1ae0], ebx
jl 0x100233f2
mov ecx, dword [esi - 0x1ac4]
mov eax, ecx
mov edx, dword [esi - 0x1ad0]
sub eax, edx
cmp eax, dword [esi + 0x10]
jb 0x10023448
jmp 0x100233f2
mov ebx, dword [esi + 0x10]
mov dword [esi - 0x1ac8], ecx
test ebx, ebx
je 0x100236ba
mov dword [esi - 0x1aec], 0xa
and dword [esi - 0x1ae8], 0
lea eax, [esi - 0x1ab8]
mov edi, dword [esi - 0x1ac8]
sub ecx, edx
mov edx, dword [esi - 0x1ae8]
cmp ecx, ebx
jae 0x10023594
movzx ebp, word [edi]
sub ecx, 0xfffffffe
sub edi, 0xfffffffe
mov dword [esi - 0x1ac8], edi
cmp bp, word [esi - 0x1aec]
jne 0x10023583
push 0xd
pop edi
mov word [eax], di
sub eax, 0xfffffffe
mov edi, dword [esi - 0x1ac8]
add edx, 2
mov word [eax], bp
sub edx, 0xfffffffe
sub eax, 0xfffffffe
cmp edx, 0x6a8
jb 0x10023555
xor ebp, ebp
lea ecx, [esi - 0xd64]
push ebp
push ebp
push 0xd55
push ecx
lea ecx, [esi - 0x1ab8]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push ebp
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebp, dword [esi - 0x1ac0]
mov edi, dword [esi - 0x1acc]
mov dword [esi - 0x1ac4], eax
test eax, eax
je 0x100232db
xor ecx, ecx
mov dword [esi - 0x1ac0], ecx
push 0
sub eax, ecx
lea edx, [esi - 0x1ae0]
push edx
push eax
lea eax, [esi - 0xd64]
add eax, ecx
mov ecx, dword [esi - 0x1adc]
push eax
mov eax, dword [esi - 0x1ad8]
mov eax, dword [eax*4 + 0x10031a90]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10023636
mov ecx, dword [esi - 0x1ac0]
add ecx, dword [esi - 0x1ae0]
mov eax, dword [esi - 0x1ac4]
mov dword [esi - 0x1ac0], ecx
cmp eax, ecx
jg 0x100235e3
jmp 0x10023650
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esi - 0x1ac0]
mov edi, eax
mov eax, dword [esi - 0x1ac4]
mov dword [esi - 0x1acc], edi
cmp eax, ecx
jg 0x100233f2
mov ecx, dword [esi - 0x1ac8]
mov ebp, ecx
mov edx, dword [esi - 0x1ad0]
sub ebp, edx
mov dword [esi - 0x1ac0], ebp
cmp ebp, ebx
jb 0x1002353a
jmp 0x100233f2
push 0
lea edx, [esi - 0x1ae0]
push edx
push dword [esi + 0x10]
push dword [esi - 0x1ad0]
push dword [eax + ecx]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100232db
mov ebp, dword [esi - 0x1ae0]
xor edi, edi
jmp 0x100233f2
push edi
call fcn.1001815a
pop ecx
jmp 0x100236f0
mov edx, dword [esi - 0x1ad0]
mov eax, dword [esi - 0x1ad8]
mov ecx, dword [esi - 0x1adc]
mov eax, dword [eax*4 + 0x10031a90]
test byte [ecx + eax + 4], 0x40
je 0x100236dd
cmp byte [edx], 0x1a
jne 0x100236dd
xor eax, eax
jmp 0x100236f9
call fcn.1001817b
mov dword [eax], 0x1c
call fcn.10018147
and dword [eax], 0
or eax, 0xffffffff
jmp 0x100236f9
sub ebp, ecx
mov eax, ebp
pop ebx
mov ecx, dword [esi - 4]
pop edi
xor ecx, esi
pop ebp
call fcn.100171e4
mov esp, esi
pop esi
ret