Function at 0x10037aa
Capabilities:
Write file on windows

Disassembly:
test ebx, ebx
jbe 0x1003763
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, 0x3fff
cmp ebx, eax
ja 0x1002976
mov eax, ebx
push 0
lea ecx, [ebp - 0x210]
push ecx
push eax
push edi
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x100749b
mov eax, dword [ebp - 0x210]
lea edi, [edi + eax*2]
sub ebx, eax
test ebx, ebx
jbe 0x1003763
jmp 0x100296b
push 1
lea eax, [ebp - 0x20c]
push eax
lea ecx, [ebp - 0x228]
mov dword [ebp - 0x20c], esi
call fcn.010016e4
test eax, eax
mov dword [ebp - 0x208], eax
jl 0x1003763
push 1
lea eax, [ebp - 0x20c]
push eax
lea ecx, [ebp - 0x228]
mov dword [ebp - 0x20c], 0xa
call fcn.010016e4
test eax, eax
mov dword [ebp - 0x208], eax
jl 0x1003763
cmp byte [0x1016001], 0
mov edi, dword [ebp - 0x228]
mov ebx, dword [ebp - 0x224]
je 0x10036cc
mov eax, dword [ebp - 0x21c]
cmp byte [eax + 0x25], 0
jne 0x100295d
push dword [ebp - 0x214]
call fcn.0100378a
test al, al
jne 0x100295d
mov esi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
xor eax, eax
push eax
push eax
push eax
push eax
push ebx
push edi
push eax
push 1
call esi
test eax, eax
mov dword [ebp - 0x21c], eax
jbe 0x10074fc
cmp eax, 0x200
jae 0x1007504
lea ecx, [ebp - 0x204]
mov dword [ebp - 0x20c], ecx
xor ecx, ecx
push ecx
push ecx
push eax
push dword [ebp - 0x20c]
push ebx
push edi
push ecx
push 1
call esi
mov esi, eax
test esi, esi
je 0x10038ae
jbe 0x1003756
push 0
lea eax, [ebp - 0x210]
push eax
push esi
push dword [ebp - 0x20c]
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10038ae
mov eax, dword [ebp - 0x210]
add dword [ebp - 0x20c], eax
sub esi, eax
jne 0x1003722
cmp dword [ebp - 0x218], 0
jne 0x1007564
pop ebx
lea ecx, [ebp - 0x228]
call fcn.01001521
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x208]
pop edi
xor ecx, ebp
pop esi
call fcn.01001339
leave
ret 8
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x234
mov eax, dword [0x1016008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x21c], ecx
push edi
lea ecx, [ebp - 0x234]
mov dword [ebp - 0x214], eax
call fcn.010016a1
lea ecx, [ebp - 0x228]
call fcn.010015c5
and dword [ebp - 0x218], 0
test esi, esi
je 0x1007464
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, eax
lea eax, [esi + edi*2]
push eax
push esi
lea ecx, [ebp - 0x234]
call fcn.010016b3
test eax, eax
mov dword [ebp - 0x208], eax
jl 0x1003764
add edi, 0xa
push edi
lea ecx, [ebp - 0x228]
call fcn.010015d7
test eax, eax
mov dword [ebp - 0x208], eax
jl 0x1003764
push ebx
push 0xd
xor edi, edi
pop esi
mov eax, dword [ebp - 0x234]
cmp eax, dword [ebp - 0x230]
jae 0x1003640
lea ecx, [ebp - 0x234]
call fcn.0100389a
mov ebx, eax
cmp ebx, 0xa
je 0x10038a5
movzx eax, bx
mov dword [ebp - 0x20c], eax
push 1
lea eax, [ebp - 0x20c]
push eax
lea ecx, [ebp - 0x228]
call fcn.010016e4
test eax, eax
mov dword [ebp - 0x208], eax
jl 0x1003763
mov edi, ebx
jmp 0x1003842
cmp edi, esi
je 0x1003866
jmp 0x100746e
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x100754b
mov esi, 0x1009940
jmp 0x10037f8
push 1
lea eax, [ebp - 0x20c]
push eax
lea ecx, [ebp - 0x228]
mov dword [ebp - 0x20c], esi
call fcn.010016e4
test eax, eax
mov dword [ebp - 0x208], eax
jge 0x1003866
jmp 0x1003763
call esi
cmp eax, 6
jne 0x10074e3
test ebx, ebx
jbe 0x1003763
push 0
lea eax, [ebp - 0x210]
push eax
lea eax, [ebx + ebx]
push eax
push edi
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10074e1
shr dword [ebp - 0x210], 1
mov eax, dword [ebp - 0x210]
sub ebx, eax
lea edi, [edi + eax*2]
je 0x10029a0
jmp 0x10074aa
call esi
test eax, eax
jle 0x10074f1
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x208], eax
jmp 0x1003763
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x10074e3
lea ecx, [eax + 1]
cmp ecx, eax
jae 0x100751a
mov dword [ebp - 0x208], 0x8007000e
jmp 0x1003763
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [ebp - 0x218], eax
jne 0x100753a
mov dword [ebp - 0x208], 0x8007000e
jmp 0x1003756
mov dword [ebp - 0x20c], eax
mov eax, dword [ebp - 0x21c]
jmp 0x1003704
test eax, eax
jle 0x1007559
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x208], eax
jmp 0x1003756
push dword [ebp - 0x218]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
pop ecx
jmp 0x1003763