Function at 0x6102ea20
Capabilities:
Write file on windows

Disassembly:
push ebp
mov eax, 0x404c
mov ebp, esp
push edi
push esi
push ebx
call sym.cygwin1.dll__alloca
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
cmp edx, eax
jae 0x6102ea52
lea esi, [esi]
movzx eax, byte [edx]
cmp byte [eax + 0x6102fbc0], 0
jne 0x6102ea52
inc edx
cmp edx, dword [ebp + 0x10]
jb 0x6102ea40
cmp edx, dword [ebp + 0xc]
je 0x6102eb13
mov eax, dword [ebp + 0xc]
mov edi, edx
sub edi, eax
lea esi, [esi]
lea edi, [edi]
cmp edi, 0x4000
mov esi, edi
jbe 0x6102ea7f
mov esi, 0x4000
mov dword [ebp - 0x4024], esi
mov eax, dword [0x610ee7b4]
cmp byte [eax + 0x41], 0
je 0x6102eed2
mov dword [esp + 8], esi
mov edx, dword [ebp + 0xc]
lea eax, [ebp - 0x4018]
mov dword [esp], eax
mov dword [esp + 4], edx
call sym.cygwin1.dll__memcpy
mov eax, dword [0x610ee7b4]
cmp byte [eax + 0x488], 0
jne 0x6102ee78
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], edx
call dword [eax + 0xc8]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x4024]
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x4018]
mov dword [esp + 8], esi
mov dword [esp + 4], edx
mov eax, dword [eax]
mov dword [esp], eax
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
test eax, eax
je 0x6102ee1e
mov eax, dword [ebp - 0x4024]
add dword [ebp + 0xc], eax
sub edi, eax
jne 0x6102ea70
mov eax, dword [ebp + 0x10]
cmp dword [ebp + 0xc], eax
jae 0x6102eb82
mov edx, dword [ebp + 0xc]
movzx eax, byte [edx]
movzx eax, byte [eax + 0x6102fbc0]
cmp al, 0xd
ja case.0x6102eb2f.3
movzx eax, al
jmp dword [eax*4 + 0x6102eb38]
mov dword [esp], 0xffffffff
call 0x610fe300
sub esp, 4
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], edx
call dword [eax + 0xc8]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x4024]
mov dword [esp + 0xc], edx
mov edx, dword [ebp + 0xc]
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov eax, dword [eax]
mov dword [esp], eax
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
jmp case.0x6102eb2f.3
mov dword [esp + 8], 0
mov eax, dword [ebp + 8]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call fcn.6102daa0
jmp case.0x6102eb2f.3
mov eax, dword [0x610ee7b4]
mov dword [eax + 0xc], 1
jmp case.0x6102eb2f.3
mov dword [esp + 8], 0
mov edx, dword [ebp + 8]
mov dword [esp + 4], 1
mov dword [esp], edx
jmp 0x6102ebe1
lea eax, [ebp - 0x4028]
mov dword [esp + 8], eax
lea eax, [ebp - 0x402c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.6102db00
mov ebx, dword [0x610ee7b4]
movzx edx, word [ebx + 0x466]
test dx, dx
js 0x6102ed83
movsx eax, word [ebx + 0x468]
movsx edx, dx
mov ecx, dword [ebp - 0x4028]
add eax, edx
cmp ecx, eax
jl 0x6102ece5
movsx eax, word [ebx + 0x46a]
cmp ecx, eax
jge 0x6102ed2d
movsx eax, word [ebx + 0x468]
movsx edx, word [ebx + 0x464]
mov dword [esp + 0x14], 0
add eax, edx
mov dword [esp + 0x18], eax
movzx eax, word [ebx + 0x466]
test ax, ax
js 0x6102ed21
movsx edx, word [ebx + 0x468]
cwde
lea eax, [eax + edx]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
movsx eax, word [ebx + 0x468]
movsx edx, word [ebx + 0x464]
mov dword [esp + 4], 0
lea eax, [edx + eax + 1]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.6102c880
mov ecx, dword [ebp - 0x4028]
dec ecx
mov dword [ebp - 0x4028], ecx
mov edx, dword [ebp + 8]
lea eax, [ecx + 1]
mov ecx, dword [ebp - 0x402c]
mov dword [esp + 0xc], eax
mov eax, dword [edx + 0x398]
test byte [eax + 0x1c], 8
mov dword [esp + 4], 0
setne al
movzx eax, al
dec eax
and eax, ecx
mov dword [esp + 8], eax
mov dword [esp], edx
call fcn.6102da00
jmp case.0x6102eb2f.3
movsx eax, word [ebx + 0x46a]
jmp 0x6102eca3
cmp word [ebx + 0x464], 0
jne 0x6102ec6c
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], edx
call dword [eax + 0xc8]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x4024]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x6102e9e0
mov eax, dword [eax]
mov dword [esp], eax
call sub.KERNEL32.dll_WriteFile
mov ecx, dword [ebp - 0x4028]
sub esp, 0x14
jmp 0x6102ece5
movsx eax, word [ebx + 0x46a]
mov ecx, dword [ebp - 0x4028]
cmp ecx, eax
jge 0x6102ed2d
jmp 0x6102ece5
lea eax, [ebp - 0x4028]
mov dword [esp + 8], eax
lea eax, [ebp - 0x402c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.6102db00
mov eax, dword [ebp - 0x4028]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x402c]
test eax, eax
js 0x6102ede6
and eax, 0xfffffff8
add eax, 8
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword [ebp + 8]
jmp 0x6102ed14
add eax, 7
jmp 0x6102edcc
lea eax, [ebp - 0x4028]
mov dword [esp + 8], eax
lea eax, [ebp - 0x402c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.6102db00
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x4028]
mov dword [esp + 0xc], eax
jmp 0x6102edd6
mov ebx, dword [0x610f08a0]
test ebx, ebx
jne 0x6102ee3e
mov edx, 0x5ab
mov eax, 0x6102bfa0
call fcn.61022e70
xor eax, eax
jmp 0x6102eb85
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], edx
call dword [eax + 0xc8]
mov eax, dword [eax]
mov dword [esp + 0xc], 0x6102e9e2
mov dword [esp + 8], 0x6102e980
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x40
mov dword [esp], 0x610f089c
call fcn.6108fd50
jmp 0x6102ee28
lea eax, [ebp - 0x401c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x4020]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.6102db00
mov dword [esp + 0xc], 0xffffffff
mov edx, dword [ebp - 0x401c]
mov ecx, dword [ebp - 0x4020]
mov dword [esp + 0x18], edx
lea eax, [esi + ecx]
mov dword [esp + 0x10], edx
mov dword [esp + 8], edx
mov edx, dword [ebp + 8]
mov dword [esp + 0x14], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.6102c880
jmp 0x6102eabf
call fcn.61055540
mov ebx, eax
call sub.KERNEL32.dll_GetConsoleOutputCP
mov dword [esp], eax
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x10], esi
mov dword [esp + 8], ebx
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x4018]
mov dword [esp + 4], edx
call fcn.6102b9a0
test al, al
jne 0x6102eaad
mov esi, dword [0x610f08a0]
test esi, esi
jne 0x6102ef1b
mov edx, 0x59d
jmp 0x6102ee2d
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], edx
call dword [eax + 0xc8]
mov eax, dword [eax]
mov dword [esp + 0xc], 0x6102e9fa
mov dword [esp + 8], 0x6102e980
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x40
mov dword [esp], 0x610f089c
call fcn.6108fd50
jmp 0x6102ef11