Function at 0x416210
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes
Write file on windows

Disassembly:
mov eax, 0x1314
call fcn.0041eb90
mov eax, dword [0x4300b8]
xor eax, esp
mov dword [esp + 0x1310], eax
mov eax, dword [esp + 0x131c]
push ebx
mov ebx, ecx
push ebp
push esi
mov dword [esp + 0x10], eax
test ebx, ebx
je 0x416269
cmp dword [0x430470], 0xffffffff
jne 0x416269
call fcn.00415870
test eax, eax
je 0x416269
push 0
push 0
push 4
push 0
push 3
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [0x430470], eax
cmp dword [edi + 0xe8], 0xffffffff
jne 0x4163aa
lea ebx, [edi + 0xf8]
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ebp, dword [sym.imp.MSVCR90.dll__snprintf]
cmp eax, 0xffffffff
je 0x416292
test al, 0x10
jne 0x4162d4
push ebx
call fcn.00415970
test eax, eax
jne 0x4162d4
push ebx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x4165fb
push str.TSLOG
push ebx
push str._s_S_
push 0x104
push ebx
call ebp
add esp, 0x14
push ebx
call fcn.00415970
test eax, eax
je 0x4165fb
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x1e]
push edx
mov word [esp + 0x20], cx
call sub.MSVCR90.dll_memset
inc dword [edi + 0xec]
mov eax, dword [edi + 0xec]
add esp, 0xc
push 0
push eax
lea esi, [esp + 0x1c]
mov ecx, edi
call fcn.00415b80
inc dword [edi + 0x23c]
push 0
push 0
push 2
push 0
push 3
push 0x40000000
mov eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [edi + 0xe8], eax
cmp eax, 0xffffffff
jne 0x4163aa
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
je 0x4164ae
cmp eax, 5
jne 0x4165fb
push ebx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x4165fb
push str.TSLOG
push ebx
push str._sTSLOG_S_
push 0x104
push ebx
call ebp
mov ecx, dword [edi + 0xec]
add esp, 0x14
push 0
push ecx
mov ecx, edi
call fcn.00415b80
push 0
push 0
push 2
push 0
push 3
push 0x40000000
mov edx, esi
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [edi + 0xe8], eax
cmp eax, 0xffffffff
je 0x4165fb
push 0x10ff
lea eax, [esp + 0x221]
push 0
push eax
mov dword [esp + 0x18], 0
mov byte [esp + 0x228], 0
call sub.MSVCR90.dll_memset
mov ecx, dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
add esp, 0xc
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push ecx
push 0
push 0x3a8
call esi
lea edx, [eax - 1]
cmp edx, 0x10fe
ja 0x4165fb
mov ecx, dword [esp + 0x10]
push 0
push 0
push eax
lea eax, [esp + 0x228]
push eax
push 0xffffffffffffffff
push ecx
push 0
push 0x3a8
call esi
mov esi, eax
test esi, esi
jbe 0x4165fb
dec esi
cmp esi, 0x1000
jbe 0x416433
mov esi, 0x1000
mov eax, dword [0x430470]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, 0xffffffff
je 0x416482
push 2
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [0x430470]
push 0
lea edx, [esp + 0x10]
push edx
push esi
lea eax, [esp + 0x228]
push eax
push ecx
call ebx
mov edx, dword [0x430470]
push edx
call ebp
mov dword [0x430470], 0xffffffff
mov edx, dword [edi + 0xe8]
push 0
lea eax, [esp + 0x10]
push eax
push esi
lea ecx, [esp + 0x228]
push ecx
push edx
call ebx
test eax, eax
jne 0x4164d4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x4165fb
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x4265b8
push 0x4265c4
push str.Output
mov dword [edi + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x4165fb
mov eax, dword [edi + 0x23c]
mov ecx, dword [0x430e58]
cmp ecx, eax
jae 0x4164f2
mov esi, edi
mov dword [0x430e58], eax
call fcn.00415fd0
jmp 0x4164f9
jbe 0x4164f9
mov dword [0x430e58], eax
cmp dword [esp + 0x1324], 6
je 0x41650d
mov eax, dword [esp + 0xc]
add dword [edi + 0xf4], eax
mov ecx, dword [edi + 0xdc]
shl ecx, 0xa
cmp dword [edi + 0xf4], ecx
jb 0x4165fb
mov edx, dword [edi + 0xe8]
xor ebx, ebx
push edx
mov dword [edi + 0xf4], ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [edi + 0xe8]
push eax
call ebp
push 0x208
lea ecx, [esp + 0x18]
push ebx
push ecx
call sub.MSVCR90.dll_memset
mov eax, dword [edi + 0xec]
mov ecx, dword [edi + 0xe0]
add esp, 0xc
cmp eax, ecx
jl 0x41657c
sub eax, ecx
push ebx
inc eax
push eax
lea esi, [esp + 0x1c]
mov ecx, edi
call fcn.00415b80
mov edx, esi
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x208
lea eax, [esp + 0x18]
push ebx
push eax
call sub.MSVCR90.dll_memset
mov edx, dword [edi + 0xec]
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
push edx
xor esi, esi
mov ecx, edi
call fcn.00415b80
mov eax, 1
add dword [edi + 0xec], eax
cmp dword [edi + 0xec], 0x3e7
jl 0x4165c1
mov dword [edi + 0xec], ebx
add dword [edi + 0x23c], eax
push ebx
push ebx
push 2
push ebx
push 3
push 0x40000000
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [edi + 0x23c]
mov dword [edi + 0xe8], eax
mov dword [0x430e58], ecx
cmp eax, ebx
je 0x4165fb
mov esi, edi
call fcn.00415fd0
mov ecx, dword [esp + 0x131c]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041e4d2
add esp, 0x1314
ret 0xc