Function at 0x4013b0
Capabilities:
Get common file path

Disassembly:
push ebp
lea ebp, [esp - 0x3bc]
sub esp, 0x3bc
push 0xffffffffffffffff
push 0x594775
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x62d414]
xor eax, ebp
mov dword [ebp + 0x3b8], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, dword [ebp + 0x3cc]
xor esi, esi
mov dword [ebp - 0x14], esi
push esi
push esi
call dword [sym.imp.ole32.dll_CoInitializeEx]
test eax, eax
jge 0x4014a3
push 0x114
lea eax, [ebp + 0x190]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor ecx, ecx
mov word [ebp + 0x3b0], cx
push str._message.log
push 0x114
lea edx, [ebp + 0x190]
push edx
call dword [sym.imp.MSVCR90.dll_wcscat_s]
push 0x10
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
add esp, 0x10
mov dword [ebp - 0x18], eax
mov dword [ebp - 4], esi
cmp eax, esi
je 0x40145e
lea ecx, [ebp + 0x190]
push ecx
mov esi, eax
call fcn.00401000
mov esi, eax
mov dword [ebp - 4], 0xffffffff
mov edx, dword [esi]
push str.Error:Error_initializing_COM_
push str.WinMain
push 9
push esi
mov eax, dword [edx]
call eax
mov ecx, dword [esi]
push str.The_application_had_been_terminated_with_return_code:_9
push str.WinMain
push 9
push esi
mov edx, dword [ecx]
call edx
add esp, 0x20
mov eax, dword [esi]
push 1
mov ecx, esi
mov edx, dword [eax + 4]
call edx
mov eax, 0xfffffff7
jmp 0x401aa6
push str.Matrikon.OPC.TunnellerHDA.1
lea ecx, [ebp + 0x70]
call dword [sym.imp.MSVCP90.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 dword [ebp - 4], 1
push 0x5d18f8
push edi
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
call ebx
test eax, eax
je 0x40154f
push str._RegServer
push edi
call ebx
test eax, eax
je 0x40154f
push 0x5d1910
push edi
call ebx
test eax, eax
je 0x40154f
push str._UnregServer
push edi
call ebx
test eax, eax
je 0x40154f
push 0x5d1930
push edi
call ebx
test eax, eax
je 0x40154f
push str._Service
push edi
call ebx
test eax, eax
je 0x40154f
mov esi, 8
cmp dword [ebp + 0x88], esi
mov eax, dword [ebp + 0x74]
jae 0x40151d
lea eax, [ebp + 0x74]
push eax
push 1
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x401755
cmp dword [ebp + 0x88], esi
mov eax, dword [ebp + 0x74]
jae 0x401541
lea eax, [ebp + 0x74]
push eax
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x14], eax
push str.6.2.4.7840_MatrikonOPC_Tunneller_n
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [ebp - 4], 3
push 0
push 0x5d1a4c
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::find_char_const___unsigned_int_const]
push eax
push 0
lea eax, [ebp + 0x38]
push eax
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::substr_unsigned_int__unsigned_int_]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
mov byte [ebp - 4], 3
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
mov byte [ebp - 4], 5
lea ecx, [ebp + 0x54]
push ecx
push str.Version
lea edx, [ebp + 0x38]
push edx
call dword [sym.imp.MSVCP90.dll_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_std::operator_char__struct_std::char_traits_char___class_std::allocator_char___char_const___class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
add esp, 0xc
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
mov byte [ebp - 4], 5
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
push 0x5d1a60
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_char_const__]
lea eax, [ebp + 0x1c]
push eax
lea ecx, [ebp + 0x54]
push ecx
call fcn.0051ddc0
push 0x3a4
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
add esp, 0xc
mov esi, eax
mov dword [ebp - 0x18], esi
mov byte [ebp - 4], 7
test esi, esi
je 0x401813
push 0
push 1
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x38], esp
push 0x5d1a64
call dword [sym.imp.MSVCP90.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 [ebp - 4], 8
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x34], esp
lea edx, [ebp + 0x1c]
push edx
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [ebp - 4], 9
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x2c], esp
push str.OPCTunneller_HDA_
call dword [sym.imp.MSVCP90.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 [ebp - 4], 0xa
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x5d1aa8
call dword [sym.imp.MSVCP90.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 [ebp - 4], 0xb
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.Matrikon_Inc__780__448_1010_http:__www.matrikonopc.com
call dword [sym.imp.MSVCP90.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 [ebp - 4], 0xc
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x28], esp
push 0x5d1b20
call dword [sym.imp.MSVCP90.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 [ebp - 4], 0xd
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x3c], esp
push str.Matrikon.OPC.TunnellerHDA
call dword [sym.imp.MSVCP90.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 [ebp - 4], 0xe
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x1c], esp
lea eax, [ebp + 0x70]
push eax
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [ebp - 4], 0xf
sub esp, 0x10
mov eax, esp
mov ecx, dword [0x5d176c]
mov dword [eax], ecx
mov edx, dword [0x5d1770]
mov dword [eax + 4], edx
mov ecx, dword [0x5d1774]
mov dword [eax + 8], ecx
mov edx, dword [0x5d1778]
mov dword [eax + 0xc], edx
sub esp, 0x10
mov eax, esp
mov ecx, dword [0x5d177c]
mov dword [eax], ecx
mov edx, dword [0x5d1780]
mov dword [eax + 4], edx
mov ecx, dword [0x5d1784]
mov dword [eax + 8], ecx
mov edx, dword [0x5d1788]
mov dword [eax + 0xc], edx
sub esp, 0x10
mov eax, esp
mov ecx, dword [0x5d175c]
mov dword [eax], ecx
mov edx, dword [0x5d1760]
mov dword [eax + 4], edx
mov ecx, dword [0x5d1764]
mov dword [eax + 8], ecx
mov edx, dword [0x5d1768]
mov dword [eax + 0xc], edx
mov byte [ebp - 4], 7
mov ecx, esi
call fcn.0049cde0
jmp 0x401815
push 0x114
lea eax, [ebp + 0x190]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor ecx, ecx
mov word [ebp + 0x3b0], cx
push str._message.log
push 0x114
lea edx, [ebp + 0x190]
push edx
call dword [sym.imp.MSVCR90.dll_wcscat_s]
push 0x10
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
add esp, 0x10
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 2
test eax, eax
je 0x4017b0
lea ecx, [ebp + 0x190]
push ecx
mov esi, eax
call fcn.00401000
mov esi, eax
jmp 0x4017b2
xor esi, esi
mov byte [ebp - 4], 1
mov edx, dword [esi]
push str.Warning:Instance_of_the_application_is_already_running_
push str.WinMain
push 9
push esi
mov eax, dword [edx]
call eax
mov ecx, dword [esi]
push str.The_application_had_been_terminated_with_return_code:_1
push str.WinMain
push 9
push esi
mov edx, dword [ecx]
call edx
add esp, 0x20
mov eax, dword [esi]
push 1
mov ecx, esi
mov edx, dword [eax + 4]
call edx
mov esi, dword [ebp - 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x70]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
or eax, 0xffffffff
jmp 0x401aa6
xor eax, eax
mov byte [ebp - 4], 5
mov dword [0x680b30], eax
mov ecx, dword [eax]
push eax
mov edx, dword [ecx + 4]
call edx
mov eax, dword [0x680b30]
mov byte [eax + 0x2ca], 0
mov ecx, dword [0x680b30]
mov byte [ecx + 0x2c9], 0
mov edx, dword [0x680b30]
mov byte [edx + 0x2cb], 1
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
push str.OPC_Tunneller_HDA_Version_Info:
push str.WinMain
push 9
push eax
mov edx, dword [ecx]
call edx
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
push str.6.2.4.7840_MatrikonOPC_Tunneller_n
push 0x5d1bd0
push str.WinMain
push 9
push eax
mov edx, dword [ecx]
call edx
add esp, 0x24
push 1
push 0x401120
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x1c], esp
push str.TunnelPrefix:
call dword [sym.imp.MSVCP90.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 [ebp - 4], 0x10
mov byte [ebp - 4], 5
call fcn.004010b0
push 0x5d18f8
push edi
call ebx
test eax, eax
je 0x401920
push str._RegServer
push edi
call ebx
test eax, eax
je 0x401920
push 0x5d1910
push edi
call ebx
test eax, eax
je 0x401910
push str._UnregServer
push edi
call ebx
test eax, eax
je 0x401910
push 0x5d1930
push edi
call ebx
test eax, eax
je 0x4018f9
push str._Service
push edi
call ebx
test eax, eax
jne 0x401924
push 1
mov ecx, dword [0x680b30]
call fcn.004999a0
call fcn.00401150
jmp 0x401a52
mov ecx, dword [0x680b30]
call fcn.0049b200
jmp 0x401a52
push 0
jmp 0x4018fb
push str.C:Documents_and_SettingsAll_UsersApplication_Data_
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [ebp - 4], 0x11
push str.MatrikonLicensesTunnellerlservrc
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ebx, 0x12
mov byte [ebp - 4], bl
lea eax, [ebp + 0x8c]
push eax
push 0
push 0
push 0x23
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
jl 0x401975
lea ecx, [ebp + 0x8c]
push ecx
lea ecx, [ebp + 0x38]
call dword [0x5983b0]
lea edx, [ebp]
push edx
lea eax, [ebp + 0x38]
push eax
lea ecx, [ebp - 0x58]
push ecx
call dword [sym.imp.MSVCP90.dll_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_std::operator_char__struct_std::char_traits_char___class_std::allocator_char___class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
add esp, 0xc
mov byte [ebp - 4], 0x13
push eax
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
call fcn.004193f0
test al, al
je 0x4019dc
call fcn.00419270
test al, al
je 0x4019dc
mov edx, dword [0x680b30]
mov byte [edx + 0x2c9], 0
mov eax, dword [0x680b30]
mov byte [eax + 0x2cb], 1
mov ecx, dword [0x680b30]
mov byte [ecx + 0x2ca], 0
push 0x44c5f0
mov esi, dword [sym.imp.MSVCR90.dll_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS_____cdecl__set_se_translator_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS___]
call esi
add esp, 4
mov edi, eax
mov dword [ebp - 0x18], edi
mov byte [ebp - 4], 0x14
call fcn.0041b2f0
mov ecx, dword [0x680b30]
call fcn.0049e160
call fcn.0041b430
push edi
call esi
add esp, 4
mov dword [ebp - 4], ebx
mov ecx, dword [0x68cb50]
call fcn.00519f20
mov ecx, dword [0x68cb50]
mov esi, ecx
test ecx, ecx
je 0x401a38
call fcn.00518190
push esi
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
mov byte [ebp - 4], 0x11
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov byte [ebp - 4], 5
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
call dword [sym.imp.ole32.dll_CoUninitialize]
mov eax, dword [0x680b30]
mov ecx, dword [eax]
push eax
mov edx, dword [ecx + 8]
call edx
mov esi, dword [ebp - 0x14]
test esi, esi
je 0x401a7a
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 3
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov byte [ebp - 4], 1
lea ecx, [ebp + 0x54]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x70]
call dword [sym.imp.MSVCP90.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
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x3b8]
xor ecx, ebp
call fcn.0051ed00
add ebp, 0x3bc
mov esp, ebp
pop ebp
ret 0x10