Function at 0x109679c
Capabilities:
Get common file path
Set current directory
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xe1c
mov eax, dword [0x10c671c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
test dword [0x10d14bc], ebx
jne 0x10967c9
test dword [0x10d14c0], ebx
je 0x1096a3d
inc dword [0x10d12b4]
mov eax, dword [0x10d12b4]
cmp eax, dword [0x10c6a50]
jne 0x10967e2
call dword [sym.imp.KERNEL32.dll_DebugBreak]
push esi
push edi
push dword [0x10d12b4]
mov esi, 0x400
push 0x10341ec
lea eax, [ebp - 0x804]
push esi
push eax
call sub.msvcrt.dll_swprintf_s
lea ecx, [ebp + 0x10]
push ecx
push dword [ebp + 0xc]
sub esi, eax
push 0xffffffffffffffff
lea eax, [ebp + eax*2 - 0x804]
push esi
push eax
call sub.msvcrt.dll__vsnwprintf_s
lea eax, [ebp - 0x804]
add esp, 0x24
lea ecx, [eax + 2]
xor edi, edi
mov dx, word [eax]
inc eax
inc eax
cmp dx, di
jne 0x1096828
sub eax, ecx
sar eax, 1
lea ecx, [eax + eax]
cmp word [ebp + ecx - 0x806], 0xa
je 0x109686c
push 0xa
cmp eax, 0x3ff
pop eax
jae 0x1096862
mov word [ebp + ecx - 0x804], ax
xor eax, eax
mov word [ebp + ecx - 0x802], ax
jmp 0x109686c
mov word [ebp - 8], ax
xor eax, eax
mov word [ebp - 6], ax
test dword [0x10d14bc], ebx
je 0x1096956
mov esi, 0x200
push esi
lea eax, [ebp - 0xe0c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, esi
jb 0x1096892
mov eax, esi
lea ecx, [eax - 1]
jmp 0x10968ac
movzx edx, word [ebp + ecx*2 - 0xe0c]
cmp dx, 0x2f
je 0x10968b2
cmp dx, 0x5c
je 0x10968b2
dec ecx
cmp ecx, eax
jbe 0x1096897
jmp 0x10968bc
xor eax, eax
mov word [ebp + ecx*2 - 0xe0c], ax
lea eax, [ebp - 0xa0c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea eax, [ebp - 0xe0c]
push eax
call esi
push edi
push 0x80
push 4
push edi
push edi
push 0x40000000
push 0x10341bc
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
lea eax, [ebp - 0xa0c]
push eax
call esi
cmp ebx, 0xffffffff
je 0x1096953
push 2
push edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
push dword [ebp + 8]
push ebx
call fcn.0109616e
lea eax, [ebp - 0x804]
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, di
jne 0x1096925
sub eax, ecx
push edi
sar eax, 1
lea ecx, [ebp - 0xe10]
push ecx
add eax, eax
push eax
lea eax, [ebp - 0x804]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp + 8]
test dword [0x10d14c0], ebx
je 0x1096a3b
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ebx, eax
mov dword [ebp - 0xe10], ebx
cmp ebx, edi
je 0x1096a3b
xor esi, esi
inc esi
push esi
push dword [ebp + 8]
push ebx
call fcn.0109616e
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
push 2
pop ebx
cmp eax, ebx
je 0x1096a08
push edi
push 0x80
push 3
lea eax, [ebp - 0xe1c]
push eax
push ebx
push 0xc0000000
push 0x1034090
mov dword [ebp - 0xe1c], 0xc
mov dword [ebp - 0xe18], edi
mov dword [ebp - 0xe14], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, edi
je 0x1096a3b
lea eax, [ebp - 0x804]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
cmp cx, di
jne 0x10969da
push edi
sub eax, edx
lea ecx, [ebp - 0xe10]
push ecx
sar eax, 1
push eax
lea eax, [ebp - 0x804]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1096a3b
lea eax, [ebp - 0x804]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
cmp cx, di
jne 0x1096a11
push edi
sub eax, edx
lea ecx, [ebp - 0xe10]
push ecx
sar eax, 1
push eax
lea eax, [ebp - 0x804]
push eax
push dword [ebp - 0xe10]
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0107591b
leave
ret