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

Disassembly:
push ecx
push ebx
mov ebx, ecx
push ebp
push esi
lea esi, [ebx + 0x594]
push edi
push esi
mov dword [esp + 0x14], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebx + 0x590]
push eax
call dword [sym.imp.MSVCRT.dll_time]
mov edi, dword [esp + 0x1c]
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x408269
mov edi, dword [esp + 0x1c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x408269
lea ebp, [ebx + 8]
push 0x104
push ebp
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
jne 0x408102
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret 0x10
cmp byte [ebp], 0x5c
je 0x408132
mov edi, 0x40e1d0
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
or ecx, 0xffffffff
xor eax, eax
push 0x40e9fc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebp
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebx + 4], eax
test eax, eax
je 0x40825e
lea eax, [ebx + 0x590]
push eax
call dword [sym.imp.MSVCRT.dll_localtime]
push eax
lea edi, [ebx + 0x50c]
push str._a___d__b__Y__H:_M:_S
push 0x80
push edi
mov dword [ebx + 0x58c], eax
call dword [sym.imp.MSVCRT.dll_strftime]
mov eax, dword [esp + 0x34]
add esp, 0x14
test eax, eax
lea esi, [ebx + 0x10c]
je 0x4081ce
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
push ecx
push eax
push edx
push edi
push str._s____s._t__s__t__d__n
push esi
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x18
jmp 0x4081e8
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
push eax
push ecx
push edi
push str._s____s._t__d__n
push esi
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x14
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [ebx + 4]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push edx
push ecx
push 1
push esi
call dword [sym.imp.MSVCRT.dll_fwrite]
mov edx, eax
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp edx, ecx
je 0x408239
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 0x10
mov edx, dword [ebx + 4]
push edx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x14]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
pop ecx
ret 0x10
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret 0x10