Function at 0x1021cac
Capabilities:
Write file on windows

Disassembly:
push 0x824
mov eax, 0x1037288
call fcn.010371b3
lea eax, [ebp - 0x414]
mov dword [ebp - 0x820], eax
mov edi, 0x200
xor ebx, ebx
mov dword [ebp - 0x824], ebx
mov dword [ebp - 0x81c], ebx
cmp dword [ebp + 8], ebx
jne 0x1021ce6
mov dword [ebp + 8], 0x10053f4
xor eax, eax
mov ecx, dword [ebp + 8]
cmp ax, word [ecx]
jne 0x1021d48
mov dword [ebp - 0x828], ebx
cmp dword [ebp - 0x820], 0
je 0x1021d19
lea eax, [ebp - 0x414]
cmp eax, dword [ebp - 0x820]
je 0x1021d19
push dword [ebp - 0x820]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x824], 0
je 0x1021d3c
lea eax, [ebp - 0x814]
cmp eax, dword [ebp - 0x824]
je 0x1021d3c
push dword [ebp - 0x824]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x828]
call fcn.0103721e
ret
cmp dword [0x103bf2c], ebx
jne 0x1021d94
push 0x10053e0
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
call esi
test eax, eax
je 0x1021d72
push 0x10053d4
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x103bf2c], eax
xor ebx, ebx
cmp dword [0x103bf2c], ebx
jne 0x1021d94
push 0x10053bc
call esi
push 0x10053d4
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x103bf2c], eax
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 0x818], eax
cmp eax, ebx
jne 0x1021dc1
or dword [ebp - 0x818], 0xffffffff
push 0x80004003
push 0x2ff01a1
push 0x1005398
call fcn.0101ddb2
mov eax, dword [0x103bf2c]
cmp eax, ebx
je 0x1021dd2
cmp dword [0x103bf28], ebx
je 0x1021dd9
or dword [ebp - 0x818], 0xffffffff
cmp dword [ebp - 0x818], 0xffffffff
je 0x1021ed9
lea ecx, [ebp + 0xc]
push ecx
push dword [ebp + 8]
push edi
lea ecx, [ebp - 0x414]
push ecx
call eax
add esp, 0x10
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x1021e88
mov esi, 0x10000
cmp edi, esi
jae 0x1021e61
lea eax, [ebp - 0x414]
cmp dword [ebp - 0x820], eax
je 0x1021e28
push dword [ebp - 0x820]
call dword [sym.imp.KERNEL32.dll_LocalFree]
add edi, edi
cmp edi, esi
jbe 0x1021e30
mov edi, esi
lea eax, [edi + edi]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x820], eax
test eax, eax
je 0x1021e72
lea ecx, [ebp + 0xc]
push ecx
push dword [ebp + 8]
push edi
push eax
call dword [0x103bf2c]
add esp, 0x10
mov ebx, eax
cmp ebx, 0xffffffff
je 0x1021e0a
jmp 0x1021e88
push 0x8007006f
push 0x31701a1
call fcn.0101dd77
jmp 0x1021ed2
push 0x8007000e
push 0x32701a1
call fcn.0101dd77
or dword [ebp - 0x818], 0xffffffff
cmp dword [ebp - 0x818], 0xffffffff
je 0x1021ed9
push dword [ebp - 0x818]
call dword [sym.imp.KERNEL32.dll_GetFileType]
and eax, 0xffff7fff
sub eax, 0
je 0x1021eb7
dec eax
dec eax
je 0x1021ed9
mov dword [ebp - 0x81c], 1
jmp 0x1021ed9
mov eax, 0x8000ffff
push eax
push eax
push 0x34001a1
call fcn.0101dd94
mov dword [0x103bf28], 1
or dword [ebp - 0x818], 0xffffffff
xor edi, edi
mov dword [ebp - 0x828], edi
cmp dword [ebp - 0x818], 0xffffffff
je 0x102209d
cmp dword [ebp - 0x81c], edi
jne 0x1021f33
push edi
lea eax, [ebp - 0x828]
push eax
push ebx
push dword [ebp - 0x820]
push dword [ebp - 0x818]
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
jne 0x1022090
call fcn.010231b9
push 0x80070006
push eax
push 0x35201a1
call fcn.0101dd94
jmp 0x1022089
lea esi, [ebx + ebx + 2]
cmp esi, 0x400
ja 0x1021f4d
lea eax, [ebp - 0x814]
mov dword [ebp - 0x824], eax
jmp 0x1021f75
push esi
push edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x824], eax
cmp eax, edi
jne 0x1021f75
push 0x8007000e
push 0x36801a1
call fcn.0101dd77
or dword [ebp - 0x818], 0xffffffff
cmp dword [ebp - 0x818], 0xffffffff
je 0x102209d
mov edi, ebx
xor eax, eax
cmp ebx, eax
je 0x1021fe3
push eax
push eax
push esi
push dword [ebp - 0x824]
push ebx
push dword [ebp - 0x820]
push eax
mov esi, dword [sym.imp.KERNEL32.dll_GetACP]
call esi
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
test edi, edi
jne 0x1021fea
call fcn.010231b9
push eax
push 0x38401a1
call fcn.0101dd77
call esi
push eax
push 0x38501a1
push dword [ebp - 0x820]
call fcn.0101ddb2
push ebx
push 0x38601a1
push 0x100538c
call fcn.0101ddb2
or dword [ebp - 0x818], 0xffffffff
cmp dword [ebp - 0x818], 0xffffffff
je 0x102209d
mov esi, dword [ebp - 0x824]
mov dword [ebp - 0x828], ebx
and dword [ebp - 0x81c], 0
test edi, edi
jbe 0x1022045
cmp byte [esi], 0xa
jne 0x1022036
lea ebx, [esi + 1]
mov eax, edi
sub eax, dword [ebp - 0x81c]
push eax
push esi
push ebx
call dword [sym.imp.msvcrt.dll_memmove]
add esp, 0xc
mov byte [esi], 0xd
mov esi, ebx
inc dword [ebp - 0x81c]
inc edi
inc dword [ebp - 0x81c]
inc esi
cmp dword [ebp - 0x81c], edi
jb 0x102200e
push 0
lea eax, [ebp - 0x82c]
push eax
push edi
push dword [ebp - 0x824]
push dword [ebp - 0x818]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1022090
call fcn.010231b9
mov esi, eax
push esi
push 0x3ab01a1
call fcn.0101dd77
cmp esi, 0x80070006
jne 0x1022090
mov dword [0x103bf28], 1
or dword [ebp - 0x818], 0xffffffff
cmp dword [ebp - 0x818], 0xffffffff
jne 0x1021cf6
and dword [ebp - 4], 0
push 0x1020362
lea ecx, [ebp - 0x81c]
call fcn.0101d7bc
mov byte [ebp - 4], 1
lea eax, [ebp + 0xc]
push eax
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x20
push eax
call dword [sym.imp.msvcrt.dll_vfwprintf]
mov dword [ebp - 0x828], eax
mov byte [ebp - 4], 0
push dword [ebp - 0x81c]
call dword [sym.imp.msvcrt.dll_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS_____cdecl__set_se_translator_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS___]
add esp, 0x10
or dword [ebp - 4], 0xffffffff
jmp 0x1021cf6