Function at 0x40516e
Capabilities:
Copy file
Move file
Read .ini file
Write file on windows

Disassembly:
mov eax, 0x41206e
call fcn.004114d0
mov eax, 0x10c4
call fcn.00411500
mov eax, dword [0x4211a4]
xor eax, esp
push ebx
push ebp
push esi
mov dword [esp + 0x10cc], eax
push edi
mov edi, dword [sym.imp.MSVCR71.dll__wstat]
lea eax, [esp + 0x3c]
push eax
mov esi, str.C:TSLOG_CONFIGTSLOG.ini
push esi
mov ebp, ecx
call edi
test eax, eax
pop ecx
pop ecx
je 0x40520b
lea eax, [esp + 0x3c]
push eax
mov ebx, str.C:TSLOG_CONFIGTSLOG.txt
push ebx
call edi
test eax, eax
pop ecx
pop ecx
je 0x405203
lea eax, [esp + 0x3c]
push eax
push esi
call edi
test eax, eax
pop ecx
pop ecx
je 0x4051f6
lea eax, [esp + 0x3c]
push eax
push ebx
call edi
test eax, eax
pop ecx
pop ecx
je 0x4051ee
push 0
mov ecx, ebp
call fcn.00402910
xor eax, eax
jmp 0x405a44
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
xor ebx, ebx
push ebx
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CopyFileW]
jmp 0x40520d
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
xor ebx, ebx
cmp dword [esp + 0x50], ebx
mov eax, dword [ebp + 0x2c]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], eax
jne 0x405266
push ebx
push ebx
push 4
push ebx
push 1
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x405266
push ebx
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
push eax
mov ebx, str.__Output__r_n_DebugView__________________ON______ON
push ebx
call sub.MSVCR71.dll_strlen
pop ecx
push eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], 1
and word [esp + 0xd0], 0
xor eax, eax
mov ecx, 0x3ff
lea edi, [esp + 0xd2]
rep stosd dword es:[edi], eax
push esi
push 0x800
stosw word es:[edi], ax
lea eax, [esp + 0xd8]
push eax
mov edi, 0x415728
push edi
push 0x415714
push str.Output
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov ebx, dword [sym.imp.MSVCR71.dll__wcsicmp]
lea eax, [esp + 0xd0]
push edi
push eax
call ebx
test eax, eax
pop ecx
pop ecx
je 0x405301
lea eax, [esp + 0xd0]
push 0x415710
push eax
call ebx
test eax, eax
pop ecx
pop ecx
je 0x405301
lea eax, [esp + 0xd0]
push 0x414f7c
push eax
call ebx
test eax, eax
pop ecx
pop ecx
je 0x4052fb
lea eax, [esp + 0xd0]
push 0x41570c
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x405308
and dword [ebp + 0x28], 0
jmp 0x405308
mov dword [ebp + 0x28], 1
cmp dword [esp + 0x14], 0
je 0x40532e
cmp dword [ebp + 0x28], 0
mov eax, edi
jne 0x40531c
mov eax, 0x414f7c
push esi
push eax
push 0x415714
push str.Output
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push esi
push 0x800
lea eax, [esp + 0xd8]
push eax
push edi
push str.FileLog
push str.Output
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xd0]
push edi
push eax
call ebx
test eax, eax
pop ecx
pop ecx
je 0x4053a3
lea eax, [esp + 0xd0]
push 0x415710
push eax
call ebx
test eax, eax
pop ecx
pop ecx
je 0x4053a3
lea eax, [esp + 0xd0]
push 0x414f7c
push eax
call ebx
test eax, eax
pop ecx
pop ecx
je 0x40539d
lea eax, [esp + 0xd0]
push 0x41570c
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x4053aa
and dword [ebp + 0x2c], 0
jmp 0x4053aa
mov dword [ebp + 0x2c], 1
cmp dword [esp + 0x14], 0
je 0x4053ce
cmp dword [ebp + 0x2c], 0
jne 0x4053bc
mov edi, 0x414f7c
push esi
push edi
push str.FileLog
push str.Output
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push esi
push 0x800
lea eax, [esp + 0xd8]
push eax
push str.TRACE
push str.Level
mov edi, str.Common
push edi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xd0]
push str.TRACE
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x40540f
and dword [ebp + 0x30], eax
jmp 0x4054a3
lea eax, [esp + 0xd0]
push str.DEBUG
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x40542d
mov dword [ebp + 0x30], 1
jmp 0x4054a3
lea eax, [esp + 0xd0]
push str.INFO
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x40544b
mov dword [ebp + 0x30], 2
jmp 0x4054a3
lea eax, [esp + 0xd0]
push str.WARN
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x405469
mov dword [ebp + 0x30], 3
jmp 0x4054a3
lea eax, [esp + 0xd0]
push str.ERROR
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x405487
mov dword [ebp + 0x30], 4
jmp 0x4054a3
lea eax, [esp + 0xd0]
push str.FATAL
push eax
call ebx
test eax, eax
pop ecx
pop ecx
jne 0x4054a3
mov dword [ebp + 0x30], 5
cmp dword [esp + 0x14], 0
je 0x4054fe
mov eax, dword [ebp + 0x30]
test eax, eax
je 0x4054eb
cmp eax, 1
jne 0x4054bd
mov eax, str.DEBUG
jmp 0x4054f0
cmp eax, 2
jne 0x4054c9
mov eax, str.INFO
jmp 0x4054f0
cmp eax, 3
jne 0x4054d5
mov eax, str.WARN
jmp 0x4054f0
cmp eax, 4
jne 0x4054e1
mov eax, str.ERROR
jmp 0x4054f0
cmp eax, 5
mov eax, str.FATAL
je 0x4054f0
mov eax, str.TRACE
push esi
push eax
push str.Level
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
lea ecx, [esp + 0xb4]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
and dword [esp + 0x10dc], 0
lea ecx, [esp + 0x98]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
mov byte [esp + 0x10dc], 1
lea ecx, [ebp + 0x34]
call fcn.00401788
push esi
push 0x800
lea eax, [esp + 0xd8]
push eax
push 0x414940
push str.Include
push edi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xd0]
push eax
lea ecx, [esp + 0xb8]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_wchar_t_const__]
mov ebx, dword [sym.imp.MSVCR71.dll_wcstok]
push 0x415690
lea eax, [esp + 0xd4]
push eax
jmp 0x4055a1
push 0x414940
push dword [esp + 0x14]
call dword [sym.imp.MSVCR71.dll__wcsicmp]
test eax, eax
pop ecx
pop ecx
lea ecx, [ebp + 0x34]
je 0x4055af
push dword [esp + 0x10]
call fcn.00402568
push 0x415690
push 0
call ebx
test eax, eax
pop ecx
pop ecx
mov dword [esp + 0x10], eax
jne 0x405579
jmp 0x4055d9
call fcn.00401788
push dword [esp + 0x10]
lea ecx, [ebp + 0x34]
call fcn.00402568
cmp dword [esp + 0x14], 0
je 0x4055d9
push esi
push 0x414940
push str.Include
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
lea ecx, [ebp + 0x88]
call fcn.00401788
push esi
push 0x800
lea eax, [esp + 0xd8]
push eax
push 0x41568c
push 0x41567c
push edi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xd0]
push eax
lea ecx, [esp + 0x9c]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_wchar_t_const__]
lea eax, [esp + 0xd0]
push 0x415678
push eax
call ebx
test eax, eax
pop ecx
pop ecx
mov dword [esp + 0x10], eax
jne 0x40564b
cmp dword [esp + 0x14], eax
je 0x405695
push esi
push 0x41568c
push 0x41567c
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x405695
mov edi, dword [esp + 0x10]
push 0x414940
push edi
call dword [sym.imp.MSVCR71.dll__wcsicmp]
test eax, eax
pop ecx
pop ecx
je 0x405680
push edi
lea ecx, [ebp + 0x88]
call fcn.00402568
push 0x415690
push 0
call ebx
mov edi, eax
test edi, edi
pop ecx
pop ecx
jne 0x40564f
jmp 0x405695
lea ebx, [ebp + 0x88]
mov ecx, ebx
call fcn.00401788
push edi
mov ecx, ebx
call fcn.00402568
lea ecx, [esp + 0x60]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
mov byte [esp + 0x10dc], 2
push esi
lea ecx, [esp + 0x24]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov byte [esp + 0x10dc], 3
lea eax, [esp + 0x60]
push eax
lea eax, [esp + 0x24]
push eax
call fcn.004017b1
pop ecx
pop ecx
mov byte [esp + 0x10dc], 2
lea ecx, [esp + 0x20]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x60]
call dword [sym.imp.MSVCP71.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
lea ecx, [esp + 0x7c]
mov dword [esp + 0x10], eax
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
mov byte [esp + 0x10dc], 4
lea edi, [ebp + 0xf8]
push edi
lea ecx, [esp + 0x24]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [esp + 0x10dc], 5
lea eax, [esp + 0x7c]
push eax
lea eax, [esp + 0x24]
push eax
call fcn.00402feb
pop ecx
pop ecx
mov byte [esp + 0x10dc], 4
lea ecx, [esp + 0x20]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x7c]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
xor ebx, ebx
cmp dword [ebp + 0x2c], ebx
mov dword [esp + 0x1c], eax
je 0x40590f
cmp dword [esp + 0x18], ebx
je 0x405760
cmp dword [ebp + 0x23c], ebx
jne 0x4057df
push dword [esp + 0x10]
mov ebx, 0x104
push ebx
push edi
push str.C:TSLOG_
push str.LogFilePath
push str.FileLogOption
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push edi
call sub.MSVCR71.dll_strlen
test eax, eax
pop ecx
je 0x405796
push edi
call sub.MSVCR71.dll_strlen
cmp eax, ebx
pop ecx
jb 0x4057a6
push ebx
push str.C:TSLOG_
push edi
call dword [sym.imp.MSVCR71.dll_strncpy]
add esp, 0xc
push edi
call sub.MSVCR71.dll_strlen
cmp byte [eax + ebp + 0xf7], 0x5c
pop ecx
je 0x4057c7
push ebx
push 0x415658
push edi
call dword [sym.imp.MSVCR71.dll_strncat]
add esp, 0xc
or dword [0x4211cc], 0xffffffff
cmp dword [esp + 0x10e8], 0
jne 0x4057df
mov ecx, ebp
call fcn.004030dc
mov ebx, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
push esi
push 0x5000
push str.MaxLogFileSize
mov edi, 0x41561c
push edi
call ebx
cmp eax, 1
mov dword [ebp + 0xdc], eax
jb 0x40580a
cmp eax, 0x1f4000
jbe 0x405826
push esi
push str.20480
push str.MaxLogFileSize
push edi
mov dword [ebp + 0xdc], 0x5000
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push esi
push 0x14
push str.MaxLogFileCnt
push edi
call ebx
cmp eax, 1
mov dword [ebp + 0xe0], eax
jl 0x405843
cmp eax, 0x3e8
jle 0x40585f
push esi
push 0x4155ec
push str.MaxLogFileCnt
push edi
mov dword [ebp + 0xe0], 0x14
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push esi
push 0xa
push str.MaxCountOfHistroyProcess
push edi
call ebx
cmp eax, 0xffffffff
mov dword [ebp + 0xe4], eax
mov ebx, 0x4155b0
jl 0x40587f
cmp eax, 0x64
jle 0x405897
push esi
push ebx
push str.MaxCountOfHistroyProcess
push edi
mov dword [ebp + 0xe4], 0xa
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [esp + 0x14], 0
je 0x40592c
push dword [esp + 0x10]
lea eax, [ebp + 0xf8]
push eax
push str.LogFilePath
push str.FileLogOption
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
cmp dword [ebp + 0xdc], 0x5000
jne 0x4058db
push esi
push str.20480
push str.MaxLogFileSize
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp + 0xe0], 0x14
jne 0x4058f6
push esi
push 0x4155ec
push str.MaxLogFileCnt
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp + 0xe4], 0xa
jne 0x40592c
push esi
push ebx
push str.MaxCountOfHistroyProcess
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x40592c
lea edi, [ebp + 0xe8]
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40592c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [edi], 0xffffffff
mov dword [ebp + 0xf4], ebx
xor ecx, ecx
cmp dword [esp + 0x10e8], ecx
jne 0x4059f3
mov eax, dword [ebp + 0x30]
cmp eax, ecx
je 0x40597c
cmp eax, 1
jne 0x40594e
mov edi, str.DEBUG
jmp 0x405981
cmp eax, 2
jne 0x40595a
mov edi, str.INFO
jmp 0x405981
cmp eax, 3
jne 0x405966
mov edi, str.WARN
jmp 0x405981
cmp eax, 4
jne 0x405972
mov edi, str.ERROR
jmp 0x405981
cmp eax, 5
mov edi, str.FATAL
je 0x405981
mov edi, str.TRACE
cmp dword [ebp + 0x2c], ecx
mov dword [esp + 0x10], 0x415728
jne 0x405996
mov dword [esp + 0x10], 0x414f7c
cmp dword [ebp + 0x28], ecx
mov ebx, 0x415728
jne 0x4059a5
mov ebx, 0x414f7c
push dword [ebp + 0xe4]
lea ecx, [esp + 0x9c]
push dword [ebp + 0xe0]
push dword [ebp + 0xdc]
push dword [esp + 0x28]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
lea ecx, [esp + 0xc8]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push edi
push dword [esp + 0x2c]
push ebx
push esi
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 ebp
call fcn.00401de6
add esp, 0x30
mov ecx, ebp
call fcn.00404d99
mov byte [esp + 0x10dc], 2
lea ecx, [esp + 0x7c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov byte [esp + 0x10dc], 1
lea ecx, [esp + 0x60]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov byte [esp + 0x10dc], 0
lea ecx, [esp + 0x98]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
or dword [esp + 0x10dc], 0xffffffff
lea ecx, [esp + 0xb4]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
xor eax, eax
inc eax
mov ecx, dword [esp + 0x10d4]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x10c4]
pop ebx
xor ecx, esp
call fcn.004113e5
leave
ret 4