Function at 0x409e40
Capabilities:
Copy file
Move file
Read .ini file
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x421c72
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, 0x10cc
call fcn.004167d0
mov eax, dword [0x42c17c]
push ebx
push esi
mov dword [esp + 0x10d0], eax
push edi
lea eax, [esp + 0x3c]
push eax
push str.C:TSLOG_CONFIGTSLOG.ini
mov ebx, ecx
call fcn.00416ea5
add esp, 8
test eax, eax
je 0x409f17
lea ecx, [esp + 0x3c]
push ecx
push str.C:TSLOG_CONFIGTSLOG.txt
call fcn.00416ea5
add esp, 8
test eax, eax
je 0x409f07
lea edx, [esp + 0x3c]
push edx
push str.C:TSLOG_CONFIGTSLOG.ini
call fcn.00416ea5
add esp, 8
test eax, eax
je 0x409ef3
lea eax, [esp + 0x3c]
push eax
push str.C:TSLOG_CONFIGTSLOG.txt
call fcn.00416ea5
add esp, 8
test eax, eax
je 0x409ee3
push 0
mov ecx, ebx
call fcn.004081c0
xor eax, eax
jmp 0x40a996
push str.C:TSLOG_CONFIGTSLOG.ini
push str.C:TSLOG_CONFIGTSLOG.txt
call dword [sym.imp.KERNEL32.dll_MoveFileW]
push 0
push str.C:TSLOG_CONFIGTSLOG.ini
push str.C:TSLOG_CONFIGTSLOG.ini
call dword [sym.imp.KERNEL32.dll_CopyFileW]
jmp 0x409f17
push str.C:TSLOG_CONFIGTSLOG.ini
push str.C:TSLOG_CONFIGTSLOG.txt
call dword [sym.imp.KERNEL32.dll_MoveFileW]
mov eax, dword [esp + 0x50]
mov ecx, dword [ebx + 0x2c]
xor esi, esi
test eax, eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], ecx
jne 0x409f83
push esi
push esi
push 4
push esi
push 1
push 0x40000000
push str.C:TSLOG_CONFIGTSLOG.ini
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x409f83
mov eax, str.__Output__r_n_DebugView__________________ON______ON
mov dword [esp + 0x14], esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409f56
push 0
sub eax, edx
lea edx, [esp + 0x18]
push edx
push eax
push str.__Output__r_n_DebugView__________________ON______ON
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, 1
mov dword [esp + 0x18], esi
xor eax, eax
mov word [esp + 0xd0], 0
mov ecx, 0x3ff
lea edi, [esp + 0xd2]
rep stosd dword es:[edi], eax
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x800
stosw word es:[edi], ax
mov edi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xd8]
push eax
push 0x42587c
push 0x425868
push 0x425074
call edi
lea ecx, [esp + 0xd0]
push 0x42587c
push ecx
call fcn.00416caa
add esp, 8
test eax, eax
je 0x40a035
lea edx, [esp + 0xd0]
push 0x425864
push edx
call fcn.00416caa
add esp, 8
test eax, eax
je 0x40a035
lea eax, [esp + 0xd0]
push 0x425094
push eax
call fcn.00416caa
add esp, 8
test eax, eax
je 0x40a02c
lea ecx, [esp + 0xd0]
push 0x425860
push ecx
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a03c
mov dword [ebx + 0x28], 0
jmp 0x40a03c
mov dword [ebx + 0x28], 1
test esi, esi
je 0x40a067
mov eax, dword [ebx + 0x28]
test eax, eax
mov eax, 0x42587c
jne 0x40a051
mov eax, 0x425094
push str.C:TSLOG_CONFIGTSLOG.ini
push eax
push 0x425868
push 0x425074
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x800
lea edx, [esp + 0xd8]
push edx
push 0x42587c
push str.FileLog
push 0x425074
call edi
lea eax, [esp + 0xd0]
push 0x42587c
push eax
call fcn.00416caa
add esp, 8
test eax, eax
je 0x40a0f7
lea ecx, [esp + 0xd0]
push 0x425864
push ecx
call fcn.00416caa
add esp, 8
test eax, eax
je 0x40a0f7
lea edx, [esp + 0xd0]
push 0x425094
push edx
call fcn.00416caa
add esp, 8
test eax, eax
je 0x40a0ee
lea eax, [esp + 0xd0]
push 0x425860
push eax
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a0fe
mov dword [ebx + 0x2c], 0
jmp 0x40a0fe
mov dword [ebx + 0x2c], 1
test esi, esi
je 0x40a129
mov eax, dword [ebx + 0x2c]
test eax, eax
mov eax, 0x42587c
jne 0x40a113
mov eax, 0x425094
push str.C:TSLOG_CONFIGTSLOG.ini
push eax
push str.FileLog
push 0x425074
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x800
lea ecx, [esp + 0xd8]
push ecx
push str.TRACE
push str.Level
push str.Common
call edi
lea edx, [esp + 0xd0]
push str.TRACE
push edx
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a16d
mov dword [ebx + 0x30], eax
jmp 0x40a218
lea eax, [esp + 0xd0]
push str.DEBUG
push eax
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a192
mov dword [ebx + 0x30], 1
jmp 0x40a218
lea ecx, [esp + 0xd0]
push str.INFO
push ecx
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a1b4
mov dword [ebx + 0x30], 2
jmp 0x40a218
lea edx, [esp + 0xd0]
push str.WARN
push edx
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a1d6
mov dword [ebx + 0x30], 3
jmp 0x40a218
lea eax, [esp + 0xd0]
push str.ERROR
push eax
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a1f8
mov dword [ebx + 0x30], 4
jmp 0x40a218
lea ecx, [esp + 0xd0]
push str.FATAL
push ecx
call fcn.00416caa
add esp, 8
test eax, eax
jne 0x40a218
mov dword [ebx + 0x30], 5
test esi, esi
je 0x40a278
mov eax, dword [ebx + 0x30]
test eax, eax
je 0x40a25d
cmp eax, 1
jne 0x40a22f
mov eax, str.DEBUG
jmp 0x40a262
cmp eax, 2
jne 0x40a23b
mov eax, str.INFO
jmp 0x40a262
cmp eax, 3
jne 0x40a247
mov eax, str.WARN
jmp 0x40a262
cmp eax, 4
jne 0x40a253
mov eax, str.ERROR
jmp 0x40a262
cmp eax, 5
mov eax, str.FATAL
je 0x40a262
mov eax, str.TRACE
push str.C:TSLOG_CONFIGTSLOG.ini
push eax
push str.Level
push str.Common
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
xor eax, eax
mov ecx, 7
mov dword [esp + 0xcc], ecx
mov dword [esp + 0xc8], eax
mov word [esp + 0xb8], ax
mov dword [esp + 0x10e4], eax
mov dword [esp + 0xb0], ecx
mov dword [esp + 0xac], eax
mov word [esp + 0x9c], ax
lea edi, [ebx + 0x34]
mov ecx, edi
mov byte [esp + 0x10e4], 1
call fcn.00403450
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x800
lea edx, [esp + 0xd8]
push edx
push 0x425070
push str.Include
push str.Common
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xd0]
push eax
call fcn.0041630e
add esp, 4
push eax
lea ecx, [esp + 0xd4]
push ecx
lea ecx, [esp + 0xbc]
call fcn.00406560
lea edx, [esp + 0xd0]
push 0x4257e4
push edx
call fcn.00416c05
mov esi, eax
add esp, 8
test esi, esi
je 0x40a390
jmp 0x40a330
push 0x425070
push esi
call fcn.00416caa
add esp, 8
test eax, eax
mov ecx, edi
je 0x40a361
push esi
call fcn.00407dc0
push 0x4257e4
push 0
call fcn.00416c05
mov esi, eax
add esp, 8
test esi, esi
jne 0x40a330
jmp 0x40a390
call fcn.00403450
push esi
mov ecx, edi
call fcn.00407dc0
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40a390
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x425070
push str.Include
push str.Common
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
lea edi, [ebx + 0x88]
mov ecx, edi
call fcn.00403450
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x800
lea eax, [esp + 0xd8]
push eax
push 0x42333c
push 0x4257d4
push str.Common
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea ecx, [esp + 0xd0]
push ecx
call fcn.0041630e
add esp, 4
push eax
lea edx, [esp + 0xd4]
push edx
lea ecx, [esp + 0xa0]
call fcn.00406560
lea eax, [esp + 0xd0]
push 0x4257d0
push eax
call fcn.00416c05
mov esi, eax
add esp, 8
test esi, esi
jne 0x40a430
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40a46e
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x42333c
push 0x4257d4
push str.Common
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x40a46e
push 0x425070
push esi
call fcn.00416caa
add esp, 8
test eax, eax
mov ecx, edi
je 0x40a461
push esi
call fcn.00407dc0
push 0x4257e4
push 0
call fcn.00416c05
mov esi, eax
add esp, 8
test esi, esi
jne 0x40a430
jmp 0x40a46e
call fcn.00403450
push esi
mov ecx, edi
call fcn.00407dc0
xor eax, eax
mov dword [esp + 0x78], 0xf
mov dword [esp + 0x74], eax
mov byte [esp + 0x64], al
push str.C:TSLOG_CONFIGTSLOG.ini
mov byte [esp + 0x10e8], 2
mov dword [esp + 0x3c], 7
mov dword [esp + 0x38], eax
mov word [esp + 0x28], ax
call fcn.0041630e
add esp, 4
push eax
push str.C:TSLOG_CONFIGTSLOG.ini
lea ecx, [esp + 0x28]
call fcn.00406560
lea ecx, [esp + 0x60]
push ecx
lea edx, [esp + 0x24]
push edx
mov byte [esp + 0x10ec], 3
call fcn.00406e30
mov eax, dword [esp + 0x40]
add esp, 8
cmp eax, 8
jb 0x40a4e5
mov eax, dword [esp + 0x24]
push eax
call fcn.0041599c
add esp, 4
cmp dword [esp + 0x78], 0x10
mov esi, dword [esp + 0x64]
jae 0x40a4f4
lea esi, [esp + 0x64]
xor eax, eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x94], 7
mov dword [esp + 0x90], eax
mov word [esp + 0x80], ax
lea edi, [ebx + 0xf8]
mov dword [esp + 0x34], eax
mov byte [esp + 0x24], al
mov eax, edi
mov byte [esp + 0x10e4], 4
mov dword [esp + 0x38], 0xf
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a537
sub eax, edx
push eax
push edi
lea ecx, [esp + 0x28]
call fcn.00401d40
lea ecx, [esp + 0x7c]
push ecx
lea edx, [esp + 0x24]
push edx
mov byte [esp + 0x10ec], 5
call fcn.00406f30
mov eax, dword [esp + 0x40]
add esp, 8
cmp eax, 0x10
mov byte [esp + 0x10e4], 4
jb 0x40a583
mov eax, dword [esp + 0x24]
push eax
call fcn.0041599c
add esp, 4
cmp dword [esp + 0x94], 8
jb 0x40a59a
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x14], ecx
jmp 0x40a5a5
lea edx, [esp + 0x80]
mov dword [esp + 0x14], edx
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x40a7d6
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40a5c6
mov eax, dword [ebx + 0x23c]
test eax, eax
jne 0x40a666
push esi
push 0x104
push edi
push str.C:TSLOG_
push str.LogFilePath
push str.FileLogOption
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a5e7
sub eax, edx
mov dword [esp + 0x1c], eax
je 0x40a610
mov eax, edi
lea edx, [eax + 1]
jmp 0x40a600
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a600
sub eax, edx
cmp eax, 0x104
jb 0x40a623
push 0x104
push str.C:TSLOG_
push edi
call fcn.004168a0
add esp, 0xc
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a628
sub eax, edx
cmp byte [eax + ebx + 0xf7], 0x5c
je 0x40a64e
push 0x104
push 0x4257b0
push edi
call fcn.00416ad0
add esp, 0xc
mov eax, dword [ebp + 8]
test eax, eax
mov dword [0x42d050], 0xffffffff
jne 0x40a666
mov ecx, ebx
call fcn.00407060
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x5000
push str.MaxLogFileSize
push 0x425774
call esi
cmp eax, 1
mov dword [ebx + 0xdc], eax
jb 0x40a694
cmp eax, 0x1f4000
jbe 0x40a6b8
push str.C:TSLOG_CONFIGTSLOG.ini
push str.20480
push str.MaxLogFileSize
push 0x425774
mov dword [ebx + 0xdc], 0x5000
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x14
push str.MaxLogFileCnt
push 0x425774
call esi
cmp eax, 1
mov dword [ebx + 0xe0], eax
jl 0x40a6dd
cmp eax, 0x3e8
jle 0x40a701
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x425744
push str.MaxLogFileCnt
push 0x425774
mov dword [ebx + 0xe0], 0x14
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push str.C:TSLOG_CONFIGTSLOG.ini
push 0xa
push str.MaxCountOfHistroyProcess
push 0x425774
call esi
cmp eax, 0xffffffff
mov dword [ebx + 0xe4], eax
jl 0x40a724
cmp eax, 0x64
jle 0x40a74c
mov esi, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x425708
push str.MaxCountOfHistroyProcess
push 0x425774
mov dword [ebx + 0xe4], 0xa
call esi
jmp 0x40a752
mov esi, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40a7fc
mov eax, dword [esp + 0x10]
push eax
push edi
push str.LogFilePath
push str.FileLogOption
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
cmp dword [ebx + 0xdc], 0x5000
jne 0x40a796
push str.C:TSLOG_CONFIGTSLOG.ini
push str.20480
push str.MaxLogFileSize
push 0x425774
call esi
cmp dword [ebx + 0xe0], 0x14
jne 0x40a7b5
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x425744
push str.MaxLogFileCnt
push 0x425774
call esi
cmp dword [ebx + 0xe4], 0xa
jne 0x40a7fc
push str.C:TSLOG_CONFIGTSLOG.ini
push 0x425708
push str.MaxCountOfHistroyProcess
push 0x425774
call esi
jmp 0x40a7fc
mov eax, dword [ebx + 0xe8]
cmp eax, 0xffffffff
je 0x40a7fc
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 0xe8], 0xffffffff
mov dword [ebx + 0xf4], 0
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40a8e2
mov eax, dword [ebx + 0x30]
test eax, eax
je 0x40a848
cmp eax, 1
jne 0x40a81a
mov eax, str.DEBUG
jmp 0x40a84d
cmp eax, 2
jne 0x40a826
mov eax, str.INFO
jmp 0x40a84d
cmp eax, 3
jne 0x40a832
mov eax, str.WARN
jmp 0x40a84d
cmp eax, 4
jne 0x40a83e
mov eax, str.ERROR
jmp 0x40a84d
cmp eax, 5
mov eax, str.FATAL
je 0x40a84d
mov eax, str.TRACE
mov ecx, dword [ebx + 0x2c]
test ecx, ecx
mov dword [esp + 0x10], 0x42587c
jne 0x40a864
mov dword [esp + 0x10], 0x425094
mov ecx, dword [ebx + 0x28]
test ecx, ecx
mov edx, 0x42587c
jne 0x40a875
mov edx, 0x425094
cmp dword [esp + 0xb0], 8
mov esi, dword [esp + 0x9c]
jae 0x40a88d
lea esi, [esp + 0x9c]
cmp dword [esp + 0xcc], 8
mov ecx, dword [esp + 0xb8]
jae 0x40a8a5
lea ecx, [esp + 0xb8]
mov edi, dword [ebx + 0xe4]
push edi
mov edi, dword [ebx + 0xe0]
push edi
mov edi, dword [ebx + 0xdc]
push edi
mov edi, dword [esp + 0x20]
push edi
push esi
push ecx
mov ecx, dword [esp + 0x28]
push eax
push ecx
push edx
push str.C:TSLOG_CONFIGTSLOG.ini
push str.TSLog_Config_File_:__s_:__r_n00000000_t00:00:00.000_t_0000___Output__r_n00000000_t00:00:00.000_t_0000__DebugView_s_r_n00000000_t00:00:00.000_t_0000__FileLog_s_r_n00000000_t00:00:00.000_t_0000___Common__r_n00000000_t00:00:00.000_t_0000__Level_s_r_n00000000_t00:00:00.000_t_0000__Include_s_r_n00000000_t00:00:00.000_t_0000__Exclude_s_r_n00000000_t00:00:00.000_t_0000___FileLogOption__r_n00000000_t00:00:00.000_t_0000__LogFilePath_s_r_n00000000_t00:00:00.000_t_0000__MaxLogFileSize_d_r_n00000000_t00:00:00.000_t_0000__MaxLogFileCnt_d_r_n00000000_t00:00:00.000_t_0000__MaxCountOfHistroyProcess_d_r_n
push ebx
call fcn.0040b480
add esp, 0x30
mov ecx, ebx
call fcn.004099b0
cmp dword [esp + 0x94], 8
jb 0x40a8fc
mov edx, dword [esp + 0x80]
push edx
call fcn.0041599c
add esp, 4
xor eax, eax
mov dword [esp + 0x90], eax
mov word [esp + 0x80], ax
cmp dword [esp + 0x78], 0x10
mov dword [esp + 0x94], 7
jb 0x40a92c
mov eax, dword [esp + 0x64]
push eax
call fcn.0041599c
add esp, 4
cmp dword [esp + 0xb0], 8
mov dword [esp + 0x78], 0xf
mov dword [esp + 0x74], 0
mov byte [esp + 0x64], 0
jb 0x40a95b
mov ecx, dword [esp + 0x9c]
push ecx
call fcn.0041599c
add esp, 4
xor eax, eax
mov dword [esp + 0xac], eax
mov word [esp + 0x9c], ax
cmp dword [esp + 0xcc], 8
mov dword [esp + 0xb0], 7
jb 0x40a991
mov edx, dword [esp + 0xb8]
push edx
call fcn.0041599c
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x10dc]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x10d4]
call fcn.0041575b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4