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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x1314
call fcn.004167d0
mov eax, dword [0x42c17c]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x14]
test edi, edi
mov dword [esp + 0x131c], eax
mov esi, ecx
je 0x4082c6
cmp dword [0x42c0e4], 0xffffffff
jne 0x4082c6
push edi
call fcn.004038b0
test eax, eax
je 0x4082c6
push 0
push 0
push 4
push 0
push 3
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [0x42c0e4], eax
cmp dword [esi + 0xe8], 0xffffffff
jne 0x40841d
lea ebx, [esi + 0xf8]
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4082e9
test al, 0x10
jne 0x408332
push ebx
mov ecx, esi
call fcn.004037d0
test eax, eax
jne 0x408332
push ebx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x408680
push str.TSLOG
push ebx
push str._s_S_
push 0x104
push ebx
call fcn.004169c4
add esp, 0x14
push ebx
mov ecx, esi
call fcn.004037d0
test eax, eax
je 0x408680
xor eax, eax
mov word [esp + 0x10], 0
mov ecx, 0x81
lea edi, [esp + 0x12]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [esi + 0xec]
push 0
lea ecx, [esp + 0x14]
inc eax
push ecx
push eax
mov ecx, esi
mov dword [esi + 0xec], eax
call fcn.00407240
mov edx, dword [esi + 0x23c]
push 0
push 0
push 2
push 0
inc edx
push 3
mov dword [esi + 0x23c], edx
push 0x40000000
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 0xe8], eax
jne 0x40841d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
je 0x408519
cmp eax, 5
jne 0x408680
push ebx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x408680
push str.TSLOG
push ebx
push str._sTSLOG_S_
push 0x104
push ebx
call fcn.004169c4
mov ecx, dword [esi + 0xec]
add esp, 0x14
push 0
lea eax, [esp + 0x14]
push eax
push ecx
mov ecx, esi
call fcn.00407240
push 0
push 0
push 2
push 0
push 3
push 0x40000000
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 0xe8], eax
je 0x408680
mov ebx, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov byte [esp + 0x218], 0
xor eax, eax
push 0
mov ecx, 0x43f
lea edi, [esp + 0x21d]
rep stosd dword es:[edi], eax
push 0
push 0
stosw word es:[edi], ax
push 0
push 0xffffffffffffffff
stosb byte es:[edi], al
mov edi, dword [ebp + 0xc]
push edi
push 0
push 0x3a8
mov dword [esp + 0x2c], 0
call ebx
test eax, eax
jle 0x408680
cmp eax, 0x10ff
jg 0x408680
push 0
push 0
push eax
lea eax, [esp + 0x224]
push eax
push 0xffffffffffffffff
push edi
push 0
push 0x3a8
call ebx
mov edi, eax
test edi, edi
jbe 0x408680
dec edi
cmp edi, 0x1000
jbe 0x4084a1
mov edi, 0x1000
mov eax, dword [0x42c0e4]
cmp eax, 0xffffffff
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x4084ed
push 2
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [0x42c0e4]
push 0
lea ecx, [esp + 0x10]
push ecx
push edi
lea edx, [esp + 0x224]
push edx
push eax
call ebx
mov ecx, dword [0x42c0e4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x42c0e4], 0xffffffff
mov ecx, dword [esi + 0xe8]
push 0
lea edx, [esp + 0x10]
push edx
push edi
lea eax, [esp + 0x224]
push eax
push ecx
call ebx
test eax, eax
jne 0x40854f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x408680
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x425094
push str.FileLog
push 0x425074
mov dword [esi + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov ecx, dword [esp + 0x131c]
call fcn.0041575b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [esi + 0x23c]
mov ecx, dword [0x42d050]
cmp ecx, eax
jae 0x40856d
mov ecx, esi
mov dword [0x42d050], eax
call fcn.00407060
jmp 0x408574
jbe 0x408574
mov dword [0x42d050], eax
cmp dword [ebp + 8], 6
je 0x40858c
mov eax, dword [esi + 0xf4]
mov edx, dword [esp + 0xc]
add eax, edx
mov dword [esi + 0xf4], eax
mov eax, dword [esi + 0xdc]
mov ecx, dword [esi + 0xf4]
shl eax, 0xa
cmp ecx, eax
jb 0x408680
mov ecx, dword [esi + 0xe8]
xor ebx, ebx
push ecx
mov dword [esi + 0xf4], ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov edx, dword [esi + 0xe8]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, 0x82
lea edi, [esp + 0x10]
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0xec]
mov ecx, dword [esi + 0xe0]
cmp eax, ecx
jl 0x4085fe
push ebx
sub eax, ecx
lea edx, [esp + 0x14]
push edx
inc eax
push eax
mov ecx, esi
call fcn.00407240
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [esi + 0xec]
xor eax, eax
mov ecx, 0x82
lea edi, [esp + 0x10]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x10]
push ecx
push ebx
push edx
mov ecx, esi
call fcn.00407240
mov ecx, dword [esi + 0xec]
inc ecx
mov eax, ecx
cmp eax, 0x3e7
mov dword [esi + 0xec], ecx
jl 0x40863b
mov dword [esi + 0xec], ebx
mov eax, dword [esi + 0x23c]
push ebx
push ebx
push 2
push ebx
inc eax
push 3
mov dword [esi + 0x23c], eax
push 0x40000000
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [esi + 0x23c]
mov dword [esi + 0xe8], eax
mov dword [0x42d050], ecx
cmp dword [esi + 0xe8], ebx
je 0x408680
mov ecx, esi
call fcn.00407060
mov ecx, dword [esp + 0x131c]
call fcn.0041575b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10