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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1314
call fcn.00411500
mov eax, dword [0x4211a4]
push ebx
xor eax, ebp
push esi
push edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
cmp edi, ebx
mov esi, ecx
mov dword [ebp - 0x1314], eax
je 0x403ea8
cmp dword [0x421040], 0xffffffff
jne 0x403ea8
push edi
call fcn.00401bd7
test eax, eax
je 0x403ea8
push ebx
push ebx
push 4
push ebx
push 3
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [0x421040], eax
cmp dword [esi + 0xe8], 0xffffffff
jne 0x404003
lea edi, [esi + 0xf8]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x403ecb
test al, 0x10
jne 0x403f15
push edi
mov ecx, esi
call fcn.00401b2a
test eax, eax
jne 0x403f15
push edi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x40425c
push str.TSLOG
push edi
push str._s_S_
push 0x104
push edi
call dword [sym.imp.MSVCR71.dll__snprintf]
add esp, 0x14
push edi
mov ecx, esi
call fcn.00401b2a
test eax, eax
je 0x40425c
xor eax, eax
inc dword [esi + 0xec]
mov word [ebp - 0x20c], bx
mov ecx, 0x81
lea edi, [ebp - 0x20a]
rep stosd dword es:[edi], eax
push ebx
lea ecx, [ebp - 0x20c]
stosw word es:[edi], ax
mov eax, dword [esi + 0xec]
push ecx
push eax
mov ecx, esi
call fcn.00403244
inc dword [esi + 0x23c]
push ebx
push ebx
push 2
push ebx
push 3
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 0xe8], eax
jne 0x404003
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
je 0x4040fb
cmp eax, 5
jne 0x40425c
lea eax, [esi + 0xf8]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x40425c
push str.TSLOG
lea eax, [esi + 0xf8]
push eax
push str._sTSLOG_S_
push edi
push eax
call dword [sym.imp.MSVCR71.dll__snprintf]
add esp, 0x14
push ebx
lea eax, [ebp - 0x20c]
push eax
push dword [esi + 0xec]
mov ecx, esi
call fcn.00403244
push ebx
push ebx
push 2
push ebx
push 3
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 0xe8], eax
je 0x40425c
push ebx
push ebx
mov byte [ebp - 0x130c], bl
xor eax, eax
push ebx
mov ecx, 0x43f
lea edi, [ebp - 0x130b]
rep stosd dword es:[edi], eax
push ebx
push 0xffffffffffffffff
push dword [ebp - 0x1314]
stosw word es:[edi], ax
push ebx
stosb byte es:[edi], al
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0x3a8
mov dword [ebp - 0x1310], ebx
call edi
cmp eax, ebx
jle 0x40425c
cmp eax, 0x10ff
jg 0x40425c
push ebx
push ebx
push eax
lea eax, [ebp - 0x130c]
push eax
push 0xffffffffffffffff
push dword [ebp - 0x1314]
push ebx
push 0x3a8
call edi
mov ecx, eax
cmp ecx, ebx
jbe 0x40425c
dec ecx
mov eax, 0x1000
cmp ecx, eax
mov dword [ebp + 0x10], ecx
jbe 0x404082
mov dword [ebp + 0x10], eax
mov eax, dword [0x421040]
cmp eax, 0xffffffff
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x4040ca
push 2
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x1310]
push eax
push dword [ebp + 0x10]
lea eax, [ebp - 0x130c]
push eax
push dword [0x421040]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [0x421040]
call edi
or dword [0x421040], 0xffffffff
push ebx
lea eax, [ebp - 0x1310]
push eax
push dword [ebp + 0x10]
lea eax, [ebp - 0x130c]
push eax
push dword [esi + 0xe8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40411d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x40425c
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x414f7c
push str.FileLog
push str.Output
mov dword [esi + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x40425c
mov eax, dword [esi + 0x23c]
mov ecx, dword [0x4211cc]
cmp ecx, eax
jae 0x40413b
mov ecx, esi
mov dword [0x4211cc], eax
call fcn.004030dc
jmp 0x404142
jbe 0x404142
mov dword [0x4211cc], eax
cmp dword [ebp + 8], 6
je 0x404154
mov eax, dword [ebp - 0x1310]
add dword [esi + 0xf4], eax
mov ecx, dword [esi + 0xdc]
lea eax, [esi + 0xf4]
shl ecx, 0xa
cmp dword [eax], ecx
jb 0x40425c
push dword [esi + 0xe8]
mov dword [eax], ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [esi + 0xe8]
call edi
xor eax, eax
mov word [ebp - 0x20c], bx
mov ecx, 0x81
lea edi, [ebp - 0x20a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov edi, 0x208
push edi
lea eax, [ebp - 0x20c]
push ebx
push eax
call sub.MSVCR71.dll_memset
mov eax, dword [esi + 0xec]
mov ecx, dword [esi + 0xe0]
add esp, 0xc
cmp eax, ecx
jl 0x4041df
push ebx
sub eax, ecx
lea edx, [ebp - 0x20c]
push edx
inc eax
push eax
mov ecx, esi
call fcn.00403244
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push edi
lea eax, [ebp - 0x20c]
push ebx
push eax
call sub.MSVCR71.dll_memset
add esp, 0xc
lea eax, [ebp - 0x20c]
push eax
push ebx
push dword [esi + 0xec]
mov ecx, esi
call fcn.00403244
inc dword [esi + 0xec]
cmp dword [esi + 0xec], 0x3e7
jl 0x40421d
mov dword [esi + 0xec], ebx
inc dword [esi + 0x23c]
push ebx
push ebx
push 2
push ebx
push 3
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi + 0xe8], eax
mov eax, dword [esi + 0x23c]
mov dword [0x4211cc], eax
cmp dword [esi + 0xe8], ebx
je 0x40425c
mov ecx, esi
call fcn.004030dc
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004113e5
leave
ret 0x10