Function at 0x109642f
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
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xe10], eax
mov eax, dword [ebp + 8]
test dword [0x10d14bc], eax
jne 0x1096464
test dword [0x10d14c0], eax
je 0x109678b
inc dword [0x10d12b4]
push ebx
push esi
push edi
push dword [0x10d12b4]
mov ebx, 0x10341ec
push ebx
mov edi, 0x400
lea eax, [ebp - 0x804]
push edi
push eax
call sub.msvcrt.dll_swprintf_s
mov esi, eax
xor eax, eax
add esp, 0x10
cmp dword [ebp - 0xe10], eax
je 0x10964d1
cmp dword [ebp + 0xc], eax
mov eax, edi
je 0x10964c4
push dword [ebp + 0xc]
sub eax, esi
push dword [ebp - 0xe10]
push 0x10341d8
push eax
lea eax, [ebp + esi*2 - 0x804]
push eax
call sub.msvcrt.dll_swprintf_s
add esp, 0x14
jmp 0x10964ef
push dword [ebp - 0xe10]
push 0x10341cc
jmp 0x10964dc
cmp dword [ebp + 0xc], eax
je 0x1096538
push dword [ebp + 0xc]
mov eax, edi
push ebx
sub eax, esi
push eax
lea eax, [ebp + esi*2 - 0x804]
push eax
call sub.msvcrt.dll_swprintf_s
add esp, 0x10
add esi, eax
mov eax, dword [ebp - 0xe10]
test eax, eax
je 0x1096538
mov ecx, 0x10d12b8
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x109651e
test dl, dl
je 0x109651a
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x109651e
inc eax
inc eax
inc ecx
inc ecx
test dl, dl
jne 0x1096500
xor eax, eax
jmp 0x1096523
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x1096538
mov eax, dword [ebp + 0xc]
cmp eax, dword [0x10c6a4c]
jne 0x1096538
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, dword [0x10d12b4]
cmp eax, dword [0x10c6a50]
jne 0x109654b
call dword [sym.imp.KERNEL32.dll_DebugBreak]
lea eax, [ebp + 0x18]
push eax
push dword [ebp + 0x14]
sub edi, esi
push 0xffffffffffffffff
lea eax, [ebp + esi*2 - 0x804]
push edi
push eax
call sub.msvcrt.dll__vsnwprintf_s
lea eax, [ebp - 0x804]
add esp, 0x14
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
test dx, dx
jne 0x1096570
sub eax, ecx
sar eax, 1
lea ecx, [eax + eax]
cmp word [ebp + ecx - 0x806], 0xa
je 0x10965b4
push 0xa
cmp eax, 0x3ff
pop eax
jae 0x10965aa
mov word [ebp + ecx - 0x804], ax
xor eax, eax
mov word [ebp + ecx - 0x802], ax
jmp 0x10965b4
mov word [ebp - 8], ax
xor eax, eax
mov word [ebp - 6], ax
mov eax, dword [ebp + 8]
xor edi, edi
test dword [0x10d14bc], eax
je 0x10966a0
mov esi, 0x200
push esi
lea eax, [ebp - 0xe0c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, esi
jb 0x10965df
mov eax, esi
lea ecx, [eax - 1]
jmp 0x10965f9
movzx edx, word [ebp + ecx*2 - 0xe0c]
cmp dx, 0x2f
je 0x10965ff
cmp dx, 0x5c
je 0x10965ff
dec ecx
cmp ecx, eax
jbe 0x10965e4
jmp 0x1096609
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 0x10966a0
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 0x1096672
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 eax, dword [ebp + 8]
test dword [0x10d14c0], eax
je 0x1096788
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ebx, eax
mov dword [ebp - 0xe10], ebx
cmp ebx, edi
je 0x1096788
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 0x1096755
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 0x1096788
lea eax, [ebp - 0x804]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
cmp cx, di
jne 0x1096727
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 0x1096788
lea eax, [ebp - 0x804]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
cmp cx, di
jne 0x109675e
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
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0107591b
leave
ret