Function at 0x1004e42
Capabilities:
Get common file path
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x7c
or dword [ebp - 8], 0xffffffff
or dword [ebp - 0xc], 0xffffffff
push ebx
push esi
push edi
push 0x208
xor ebx, ebx
push 8
push dword [0x100f098]
xor edi, edi
inc edi
mov esi, ecx
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x24], 0xfeff
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x18], eax
cmp eax, ebx
jne 0x1004eba
mov dword [esi + 4], edi
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x10051a4
test byte [eax + 0x1c], 1
je 0x10051a4
push 0x8007000e
push 0x1001724
push 0xa
jmp 0x1005199
push dword [ebp + 0xc]
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
mov ecx, esi
call fcn.01004a49
cmp eax, ebx
je 0x1004f06
mov dword [esi + 4], edi
mov ecx, dword [0x100f004]
cmp ecx, 0x100f004
je 0x10051a4
test byte [ecx + 0x1c], 1
je 0x10051a4
push eax
push 0x1001724
push 0xb
push dword [ecx + 0x14]
push dword [ecx + 0x10]
jmp 0x100519f
mov eax, dword [ebp + 0x10]
mov dword [esi + 8], ebx
mov dword [esi + 4], ebx
push dword [eax + 4]
call dword [sym.imp.USER32.dll_SetCursor]
lea eax, [ebp - 0xc]
push eax
push 8
mov dword [ebp - 4], 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x1004f80
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x18]
push dword [ebp - 0xc]
call dword [sym.imp.USERENV.dll_GetUserProfileDirectoryW]
mov dword [ebp - 0x20], eax
cmp eax, ebx
jne 0x1004f80
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x1004f80
test byte [eax + 0x1c], 1
je 0x1004f80
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [0x100f004]
mov ebx, 0x1001724
push ebx
push 0xc
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01003f79
jmp 0x1004f85
mov ebx, 0x1001724
push 0x58
pop edi
push edi
lea eax, [ebp - 0x7c]
push 0
push eax
call sub.msvcrt.dll_memset
mov eax, dword [ebp + 8]
mov dword [ebp - 0x78], eax
mov eax, dword [0x100f09c]
mov dword [ebp - 0x74], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x7c], edi
mov edi, dword [ebp - 0x10]
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x1c]
add esp, 0xc
cmp dword [ebp - 0x20], 0
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x40], 0x100176c
mov dword [ebp - 0x48], 4
je 0x1004fd4
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp + 0x10]
push dword [eax + 8]
call dword [sym.imp.USER32.dll_SetCursor]
lea eax, [ebp - 0x7c]
push eax
call fcn.01004cf5
test eax, eax
jne 0x1005024
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x1005018
test byte [eax + 0x1c], 1
je 0x1005018
call fcn.01004d9e
push eax
mov eax, dword [0x100f004]
push ebx
push 0xd
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01003f79
mov dword [esi + 8], 1
jmp 0x10051a4
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x1005045
test byte [eax + 0x1c], 4
je 0x1005045
push edi
push ebx
push 0xe
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.0100484d
mov ecx, dword [ebp + 0xc]
call fcn.010065b8
push eax
push edi
mov ecx, esi
call fcn.010048cc
test eax, eax
jne 0x100507d
mov ecx, dword [ebp + 0xc]
push 0x30
call fcn.010065b0
push dword [eax + 0x28]
mov ecx, dword [ebp + 0xc]
call fcn.010065b0
push dword [eax + 0x2c]
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x10050e1
mov eax, dword [ebp + 0x10]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_SetCursor]
xor eax, eax
push eax
push 0x80
push 2
push eax
push eax
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
jne 0x10050ed
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10050bd
and eax, 0xffff
or eax, 0x80070000
mov ecx, eax
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x10050e1
test byte [eax + 0x1c], 1
je 0x10050e1
push ecx
push edi
push ebx
push 0xf
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010090ed
mov dword [esi + 4], 1
jmp 0x10051a4
mov ecx, dword [ebp + 0xc]
call fcn.01006640
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
and dword [ebp - 4], 0
push 0
lea ebx, [eax + eax + 2]
lea eax, [ebp - 4]
push eax
push 4
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x1005162
cmp dword [ebp - 4], 4
jne 0x1005162
mov ecx, dword [ebp + 0xc]
push 0
lea eax, [ebp - 4]
push eax
push ebx
call fcn.01006637
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x1005162
cmp dword [ebp - 4], ebx
jne 0x1005162
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x10051a4
test byte [eax + 0x1c], 4
je 0x10051a4
push 0x1001724
push 0x10
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01002205
jmp 0x10051a4
mov dword [esi + 4], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x100517d
and eax, 0xffff
or eax, 0x80070000
mov ecx, eax
mov eax, dword [0x100f004]
cmp eax, 0x100f004
je 0x10051a4
test byte [eax + 0x1c], 1
je 0x10051a4
push ecx
push 0x1001724
push 0x11
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01003f79
mov ebx, dword [ebp + 0x10]
push dword [ebx + 8]
call dword [sym.imp.USER32.dll_SetCursor]
cmp dword [ebp - 8], 0xffffffff
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x10051c1
push dword [ebp - 8]
call edi
cmp dword [ebp - 0xc], 0xffffffff
je 0x10051cc
push dword [ebp - 0xc]
call edi
mov eax, dword [esi + 8]
push dword [ebp + 8]
mov dword [ebx + 0xc], eax
mov eax, dword [esi + 4]
mov dword [ebx + 0x10], eax
call dword [sym.imp.USER32.dll_SetFocus]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
xor edi, edi
cmp dword [ebp - 0x10], edi
je 0x10051fa
push dword [ebp - 0x10]
push edi
push dword [0x100f098]
call esi
cmp dword [ebp - 0x14], edi
je 0x100520b
push dword [ebp - 0x14]
push edi
push dword [0x100f098]
call esi
cmp dword [ebp - 0x18], edi
je 0x100521c
push dword [ebp - 0x18]
push edi
push dword [0x100f098]
call esi
pop edi
pop esi
pop ebx
leave
ret 0xc