Function at 0x41e520
Capabilities:
Check for time delay via gettickcount

Disassembly:
push 0xffffffffffffffff
push 0x51e871
mov eax, dword fs:[0]
push eax
sub esp, 0xbc
mov eax, dword [0x5b339c]
xor eax, esp
mov dword [esp + 0xb8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5b339c]
xor eax, esp
push eax
lea eax, [esp + 0xd0]
mov dword fs:[0], eax
push str..PSTServer.cpp
push 0x781
mov esi, ecx
mov ecx, dword [0x5b6bb0]
push str.CPSTServer::Run
call fcn.00402490
lea eax, [esp + 0x28]
push eax
mov ecx, esi
call fcn.00414900
lea ecx, [esp + 0x28]
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 ecx, esi
call fcn.00416920
mov ecx, esi
call fcn.004187c0
mov ecx, esi
call fcn.00416db0
mov ecx, esi
call fcn.00416b10
mov ecx, esi
call fcn.00416bb0
mov eax, dword [esi + 0x484]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esi + 0x180]
push edx
push eax
mov ecx, esi
mov dword [esp + 0x20], 0
call fcn.00416510
cmp al, 1
jne 0x41ecf6
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateWaitableTimerW]
mov dword [esp + 0x24], eax
test eax, eax
jne 0x41e6a1
mov ecx, dword [0x5b6bb0]
mov esi, dword [ecx]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x5b6bb0]
push eax
mov eax, dword [esi]
push str.Could_not_create_stop_server_timer_object___error__d
push str.CPSTServer::Run
push 1
push edx
call eax
add esp, 0x14
push 0
push 0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.PXPOLE_for_OPC::PSTServer::Run
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 [esp + 0xfc], 0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x54], esp
push str.Could_not_create_stop_server_timer_object
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 [esp + 0x118], 1
push 0xfffffffffffffff5
mov dword [esp + 0x11c], 0xffffffff
lea ecx, [esp + 0x88]
call fcn.00415090
mov dword [esp + 0xd8], 2
lea ecx, [esp + 0x44]
push ecx
lea ecx, [esp + 0x8c]
call fcn.00415130
push 0x588a98
lea edx, [esp + 0x8c]
push edx
call sub.MSVCR90.dll__CxxThrowException
mov ecx, esi
call fcn.0041b7f0
or ebp, 0xffffffff
cmp dword [0x5b6bb8], 0
jne 0x41e731
push 0xec
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
add esp, 4
mov dword [esp + 0x1c], edi
mov ebx, 3
mov dword [esp + 0xd8], ebx
test edi, edi
je 0x41e723
sub esp, 0x1c
lea eax, [esi + 0x318]
mov ecx, esp
mov dword [esp + 0x3c], esp
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 [esp + 0xf4], 4
sub esp, 0x1c
lea edx, [esi + 0x2fc]
mov ecx, esp
mov dword [esp + 0x50], esp
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 [esp + 0x110], 5
mov byte [esp + 0x110], bl
mov ecx, edi
call fcn.004265e0
jmp 0x41e725
xor eax, eax
mov dword [esp + 0xd8], ebp
mov dword [0x5b6bb8], eax
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Creating_IL_Root_Device_Link.
push str.CPSTServer::Run
push 7
push eax
call edx
add esp, 0x10
call fcn.00413590
mov ecx, esi
mov dword [esi + 0x27c], eax
call fcn.00417100
mov ecx, esi
call fcn.004167a0
mov ecx, esi
call fcn.00417a60
mov eax, dword [esi + 0x27c]
push 0
push 0x5b0214
push 0x5b0098
push 0
push eax
call sub.MSVCR90.dll___RTDynamicCast
add esp, 0x14
mov dword [esi + 0x280], eax
test eax, eax
je 0x41e79a
mov ecx, eax
call fcn.004f6710
mov ecx, dword [esi + 0x27c]
mov dword [esi + 0x284], ecx
call fcn.004f6710
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.IL_Scanning_Begins.
push str.CPSTServer::Run
push 7
push eax
call edx
mov ecx, dword [esi + 0x27c]
add esp, 0x10
call fcn.004f5190
mov ecx, esi
call fcn.0041aba0
mov ecx, esi
call fcn.00415640
lea eax, [esi + 0x110]
push eax
push 1
push 4
push esi
lea eax, [esi + 0x128]
push eax
call dword [sym.imp.ole32.dll_CoRegisterClassObject]
test eax, eax
jge 0x41e959
cmp eax, 0x80004015
jne 0x41e8bd
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.ERROR:_The_PST_Config_class_object_could_not_be_registered.
push str.CPSTServer::Run
push 1
push eax
call edx
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.ERROR:_The_OPC_Server_was_started_as_an_application__but_is_registered_as_a_service.
push str.CPSTServer::Run
push 1
push eax
call edx
add esp, 0x20
push 0
push 0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x3c], esp
push str.Application_Error
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 [esp + 0xfc], 6
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x60], esp
push str.The_OPC_Server_could_not_run_because_it_must_be_started_using_the_service_control_panel.
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 [esp + 0x118], 7
push 0xfffffffffffffff4
mov dword [esp + 0x11c], ebp
lea ecx, [esp + 0xcc]
call fcn.00415090
mov dword [esp + 0xd8], 8
lea eax, [esp + 0x88]
push eax
lea ecx, [esp + 0x48]
call fcn.00415130
push 0x588a98
lea ecx, [esp + 0x48]
push ecx
call sub.MSVCR90.dll__CxxThrowException
mov ecx, dword [0x5b6bb0]
mov edx, dword [ecx]
push eax
mov eax, dword [edx]
push str.ERROR:_The_PST_Config_class_object_could_not_be_registered___hresult_0x_08X
push str.CPSTServer::Run
push 1
push ecx
call eax
add esp, 0x14
push 0
push 0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x3c], esp
push str.PXPOLE_for_OPC::PSTServer::Run
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 [esp + 0xfc], 9
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x60], esp
push str.Could_not_register_PST_Config_class_object
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 [esp + 0x118], 0xa
push 0xfffffffffffffff4
mov dword [esp + 0x11c], ebp
lea ecx, [esp + 0xcc]
call fcn.00415090
mov dword [esp + 0xd8], 0xb
lea ecx, [esp + 0x88]
push ecx
lea ecx, [esp + 0x48]
call fcn.00415130
push 0x588a98
lea edx, [esp + 0x48]
push edx
call sub.MSVCR90.dll__CxxThrowException
cmp byte [esi + 0x434], 0
jne 0x41e969
mov ecx, esi
call fcn.00414b50
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Loading_Default_Configuration__if_used_.
push str.CPSTServer::Run
push 7
push eax
call edx
add esp, 0x10
mov ecx, esi
call fcn.00418460
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Root_devlink_is_enabled.
push str.CPSTServer::Run
push 7
push eax
call edx
mov eax, dword [str.System]
add esp, 0x10
push eax
lea ecx, [esp + 0x2c]
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 [esp + 0xd8], 0xc
push 0
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [esi + 0x27c]
push 1
call fcn.004f20b0
mov dword [esp + 0xd8], ebp
lea ecx, [esp + 0x28]
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 ecx, esi
call fcn.00415b60
cmp al, 1
jne 0x41ec27
cmp byte [esi + 0x2f8], al
jne 0x41ea22
mov ecx, dword [0x5b6bb8]
call fcn.00426940
mov eax, dword [0x5b6bb0]
mov edx, dword [eax]
push str.DDE_Server_Started.
push str.CPSTServer::Run
push 2
push eax
mov eax, dword [edx]
call eax
jmp 0x41ea3a
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.DDE_Server_Not_Enabled.
push str.CPSTServer::Run
push 2
push eax
call edx
add esp, 0x10
cmp byte [esi + 0x374], 1
jne 0x41ea91
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x34], esp
push str.Service_started
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 [esp + 0xf4], 0xd
mov dword [esp + 0xf4], ebp
mov ecx, esi
call fcn.00415570
mov ecx, dword [esi + 0x354]
lea eax, [esi + 0x358]
push eax
push ecx
mov dword [esi + 0x35c], 4
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
lea edx, [esp + 0x24]
push edx
mov ecx, esi
call fcn.0041a920
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Closing_OPC_Class_Factory.
push str.CPSTServer::Run
push 7
push eax
call edx
add esp, 0x10
mov ecx, esi
call fcn.00415cb0
test al, al
jne 0x41eae9
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Warning:_Could_not_close_OPC_Class_Factory.
push str.CPSTServer::Run
push 2
push eax
call edx
add esp, 0x10
mov ecx, esi
call fcn.0041e350
mov edx, dword [esi + 0x2d4]
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
push edx
push str.BEGIN___OPC_Client_Release._Max_wait_time___d__ms.
push str.CPSTServer::Run
push 7
push eax
mov eax, dword [ecx]
call eax
add esp, 0x14
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [esi + 0xf8], 0
mov dword [esp + 0x1c], eax
jbe 0x41ebcb
mov edi, dword [sym.imp.USER32.dll_PeekMessageW]
mov ebp, dword [sym.imp.USER32.dll_TranslateMessage]
mov ebx, dword [sym.imp.USER32.dll_DispatchMessageW]
jmp 0x41eb40
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x1c]
cdq
xor eax, edx
sub eax, edx
cmp eax, dword [esi + 0x2d4]
jae 0x41eba7
push 1
push 0
push 0
push 0
lea ecx, [esp + 0x38]
push ecx
call edi
test eax, eax
je 0x41eb91
lea ebx, [ebx]
lea edx, [esp + 0x28]
push edx
call ebp
lea eax, [esp + 0x28]
push eax
call ebx
push 1
push 0
push 0
push 0
lea ecx, [esp + 0x38]
push ecx
call edi
test eax, eax
jne 0x41eb70
mov edx, dword [esi + 0x2a4]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [esi + 0xf8], 0
ja 0x41eb40
cmp dword [esi + 0xf8], 0
jbe 0x41ebcb
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Warning:_OPC_Clients_are_still_connected.
push str.CPSTServer::Run
push 2
push eax
call edx
add esp, 0x10
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.END___OPC_Client_Release.
push str.CPSTServer::Run
push 7
push eax
call edx
add esp, 0x10
cmp byte [esi + 0x2f8], 1
jne 0x41ebfa
mov ecx, dword [0x5b6bb8]
call fcn.004251a0
mov ecx, dword [0x5b6bb8]
mov edi, ecx
test ecx, ecx
je 0x41ec14
call fcn.00426520
push edi
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, esi
mov dword [0x5b6bb8], 0
call fcn.00417a10
jmp 0x41ec42
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.ERROR:_Could_not_open_OPC_Class_Factory.
push str.CPSTServer::Run
push 1
push eax
call edx
add esp, 0x10
mov ecx, esi
call fcn.00414e40
mov ecx, esi
call fcn.004185e0
mov eax, dword [esi + 0x110]
push eax
call dword [sym.imp.ole32.dll_CoRevokeClassObject]
mov ecx, esi
call fcn.004171c0
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.BEGIN___IL_Shutdown.
push str.CPSTServer::Run
push 7
push eax
call edx
mov ecx, dword [esi + 0x27c]
add esp, 0x10
push 1
call fcn.004f2d70
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.END___IL_Shutdown.
push str.CPSTServer::Run
push 7
push eax
call edx
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Destroy_IL_Root_Device_Link.
push str.CPSTServer::Run
push 7
push eax
call edx
mov ecx, dword [esi + 0x284]
add esp, 0x20
test ecx, ecx
je 0x41ecce
call fcn.004f6830
mov ecx, dword [esi + 0x280]
test ecx, ecx
je 0x41ecdd
call fcn.004f6830
mov ecx, dword [esi + 0x27c]
call fcn.004f6830
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call fcn.00416760
jmp 0x41ed1b
mov eax, dword [0x5b6bb0]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.ERROR:_Failed_to_run_OPC_Server_because_Mutex_could_not_be_reserved.
push str.CPSTServer::Run
push 1
push eax
call edx
add esp, 0x10
mov dword [esi + 0x364], 0xfffffffd
mov ecx, dword [0x5b6bb0]
push 0
push 0x57ef93
push str..PSTServer.cpp
push 0x850
push str.CPSTServer::Run
call fcn.00402520
mov ecx, dword [esp + 0xd0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xb8]
xor ecx, esp
call fcn.0051973e
add esp, 0xc8
ret