Function at 0x49d570
Capabilities:
Check for time delay via gettickcount
Create thread
Terminate thread

Disassembly:
push 0xffffffffffffffff
push 0x57f976
mov eax, dword fs:[0]
push eax
sub esp, 0xf8
mov eax, dword [0x62d414]
xor eax, esp
mov dword [esp + 0xf4], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x62d414]
xor eax, esp
push eax
lea eax, [esp + 0x10c]
mov dword fs:[0], eax
push str..PSTServer.cpp
xor ebp, ebp
push 0x499
mov esi, ecx
mov dword [esp + 0x24], ebp
mov ecx, dword [0x63dd80]
push str.CPSTServer::Run
call fcn.0041ac10
push ebp
push ebp
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esi + 0x324], eax
cmp eax, ebp
jne 0x49d68f
mov eax, dword [0x63dd80]
mov esi, dword [eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x63dd80]
mov edx, dword [esi]
push eax
push str.Could_not_create_shutdown_event_object___error__d
push str.CPSTServer::Run
push 1
push ecx
call edx
add esp, 0x14
push ebp
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 + 0x134], ebp
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x60], esp
push str.Could_not_create_shutdown_event_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 + 0x150], 1
push 0xfffffffffffffff5
mov dword [esp + 0x154], 0xffffffff
lea ecx, [esp + 0xc8]
call fcn.0044c400
mov dword [esp + 0x114], 2
lea eax, [esp + 0x88]
push eax
lea ecx, [esp + 0xcc]
call fcn.0044c4a0
push 0x6166fc
lea ecx, [esp + 0xcc]
push ecx
call sub.MSVCR90.dll__CxxThrowException
lea edx, [esp + 0x34]
push edx
push ebp
push esi
push 0x49cdd0
push ebp
push ebp
mov dword [esp + 0x4c], ebp
call dword [sym.imp.MSVCR90.dll__beginthreadex]
add esp, 0x18
mov dword [esp + 0x20], eax
cmp eax, ebp
jne 0x49d764
mov eax, dword [0x63dd80]
mov esi, dword [eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x63dd80]
mov edx, dword [esi]
push eax
push str.Could_not_create_event_scan_thread___error__d
push str.CPSTServer::Run
push 1
push ecx
call edx
add esp, 0x14
push ebp
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x44], 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 + 0x134], 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x5c], esp
push str.Could_not_create_event_scan_thread
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 + 0x150], 4
push 0xfffffffffffffff5
mov dword [esp + 0x154], 0xffffffff
lea ecx, [esp + 0x108]
call fcn.0044c400
mov dword [esp + 0x114], 5
lea eax, [esp + 0xc8]
push eax
lea ecx, [esp + 0x8c]
call fcn.0044c4a0
push 0x6166fc
lea ecx, [esp + 0x8c]
push ecx
call sub.MSVCR90.dll__CxxThrowException
push ebp
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateWaitableTimerW]
mov ecx, dword [0x63dd80]
push eax
push str.hTimer____d
mov dword [esp + 0x20], eax
mov edx, dword [ecx]
mov eax, dword [edx]
push str.CPSTServer::Run
push 3
push ecx
call eax
add esp, 0x14
cmp dword [esp + 0x18], ebp
jne 0x49d847
mov ecx, dword [0x63dd80]
mov esi, dword [ecx]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x63dd80]
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 ebp
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x44], 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 + 0x134], 6
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x5c], 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 + 0x150], 7
push 0xfffffffffffffff5
mov dword [esp + 0x154], 0xffffffff
lea ecx, [esp + 0x108]
call fcn.0044c400
mov dword [esp + 0x114], 8
lea ecx, [esp + 0xc8]
push ecx
lea ecx, [esp + 0x8c]
call fcn.0044c4a0
push 0x6166fc
lea edx, [esp + 0x8c]
push edx
call sub.MSVCR90.dll__CxxThrowException
lea eax, [esp + 0x6c]
push eax
mov ecx, esi
call fcn.00498540
lea ecx, [esp + 0x6c]
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.00498a40
cmp dword [0x63dd84], ebp
jne 0x49d901
push 0xa8
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
add esp, 4
mov dword [esp + 0x24], edi
mov ebx, 9
mov dword [esp + 0x114], ebx
cmp edi, ebp
je 0x49d8ee
sub esp, 0x1c
lea edx, [esi + 0x26c]
mov ecx, esp
mov dword [esp + 0x4c], 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 + 0x130], 0xa
sub esp, 0x1c
lea eax, [esi + 0x250]
mov ecx, esp
mov dword [esp + 0x60], 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 + 0x14c], 0xb
mov byte [esp + 0x14c], bl
mov ecx, edi
call fcn.004a1840
or ebx, 0xffffffff
mov dword [esp + 0x114], ebx
mov dword [0x63dd84], eax
jmp 0x49d904
xor eax, eax
or ebx, 0xffffffff
mov dword [esp + 0x114], ebx
mov dword [0x63dd84], eax
jmp 0x49d904
or ebx, 0xffffffff
call fcn.0041b470
push ebp
push 0x63c634
push 0x63c2ec
push ebp
push eax
mov dword [esi + 0x1d4], eax
call sub.MSVCR90.dll___RTDynamicCast
add esp, 0x14
mov dword [esi + 0x1d8], eax
cmp eax, ebp
je 0x49d937
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esi + 0x1d4]
call fcn.00455930
mov ecx, dword [esi + 0x1d4]
call fcn.00455ee0
mov ecx, dword [esi + 0x1d4]
mov dword [esi + 0x1dc], ecx
mov edx, dword [ecx]
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.OLEAUT32.dll_VariantClear]
lea edx, [esp + 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
push 0xa8
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
add esp, 4
mov dword [esp + 0x28], edi
mov dword [esp + 0x114], 0xc
cmp edi, ebp
je 0x49d9ce
push str.Clients
lea ecx, [esp + 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 byte [esp + 0x114], 0xd
mov ecx, dword [esi + 0x1d4]
lea eax, [esp + 0x6c]
push eax
push ecx
mov ecx, edi
mov dword [esp + 0x24], 1
call fcn.0041c410
mov edi, eax
jmp 0x49d9d0
xor edi, edi
mov dword [esp + 0x114], ebx
test byte [esp + 0x1c], 1
je 0x49d9ed
and dword [esp + 0x1c], 0xfffffffe
lea ecx, [esp + 0x6c]
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 edx, dword [edi]
mov eax, dword [edx + 4]
mov ecx, edi
call eax
push ebp
mov ecx, 0x2008
push ebp
mov word [edi + 0x60], cx
mov dword [edi + 0x64], 1
mov edx, ecx
push 8
mov dword [esi + 0x344], edi
mov word [esp + 0x4c], dx
call dword [sym.imp.OLEAUT32.dll_SafeArrayCopyData]
mov ecx, dword [esp + 0x38]
push ebp
push 0xc0
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x44]
push eax
push ecx
mov ecx, dword [esi + 0x344]
lea edx, [esp + 0x50]
push edx
call fcn.0044e860
mov ecx, dword [esi + 0x344]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
call edx
mov eax, dword [esi + 0x344]
mov ecx, dword [esi + 0x1d4]
push eax
call fcn.00459f80
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
lea eax, [esi + 0x68]
push eax
push 1
push 4
push esi
lea edx, [esi + 0x80]
push edx
call dword [sym.imp.ole32.dll_CoRegisterClassObject]
cmp eax, ebp
jge 0x49db28
mov ecx, dword [0x63dd80]
mov edx, dword [ecx]
push eax
mov eax, dword [edx]
push str.Could_not_register_class_factories___error_0x_08X
push str.CPSTServer::Run
push 1
push ecx
call eax
add esp, 0x14
push ebp
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x48], 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 + 0x134], 0xf
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x6c], esp
push str.Could_not_register_class_factories._Probably_Tunneller_CSC_is_configured_to_run_as_service
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 + 0x150], 0x10
push 0xfffffffffffffff4
mov dword [esp + 0x154], ebx
lea ecx, [esp + 0x108]
call fcn.0044c400
mov dword [esp + 0x114], 0x11
lea ecx, [esp + 0xc8]
push ecx
lea ecx, [esp + 0x8c]
call fcn.0044c4a0
push 0x6166fc
lea edx, [esp + 0x8c]
push edx
call sub.MSVCR90.dll__CxxThrowException
mov ecx, esi
call fcn.00498690
mov ecx, dword [esi + 0x1d4]
call fcn.00455930
mov ecx, esi
call fcn.00496e50
test al, al
je 0x49de31
cmp byte [esi + 0x24c], 0
je 0x49db64
mov ecx, dword [0x63dd84]
call fcn.004a1ba0
push str.DDE_Server_Started.
jmp 0x49db69
push str.DDE_Server_Not_Enabled.
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.CPSTServer::Run
push 2
push eax
call edx
xor bl, bl
add esp, 0x10
mov byte [esp + 0x17], 1
cmp byte [esi + 0x2c8], bl
je 0x49dbdd
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x44], 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 + 0x130], 0x12
mov dword [esp + 0x130], 0xffffffff
mov ecx, esi
call fcn.0049b700
mov ecx, dword [esi + 0x2a8]
lea eax, [esi + 0x2ac]
push eax
push ecx
mov dword [esi + 0x2b0], 4
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov ebp, dword [sym.imp.KERNEL32.dll_SetWaitableTimer]
xor eax, eax
push 0x1ff
test bl, bl
push 0x64
setne al
push 0
lea edx, [esp + 0x24]
push edx
push eax
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
cmp eax, 0x102
jne 0x49dcca
cmp byte [esi + 0x6d], 0
je 0x49dc30
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Hard_stop_requested___shutting_down
push str.CPSTServer::Run
push 2
push eax
call edx
add esp, 0x10
mov byte [esp + 0x17], 0
mov al, byte [esi + 0x6c]
test al, al
je 0x49dc95
test bl, bl
jne 0x49dc8d
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Shutdown_requested___starting_shutdown_timer
push str.CPSTServer::Run
push 2
push eax
call edx
mov edi, dword [esi + 0x224]
add esp, 0x10
push 0xffffffffffffffff
push 0xffffd8f0
push 0
push edi
call fcn.0051f170
mov ecx, dword [esp + 0x18]
push 0
push 0
push 0
mov dword [esp + 0x34], eax
push edi
lea eax, [esp + 0x38]
push eax
push ecx
mov dword [esp + 0x44], edx
call ebp
mov bl, 1
jmp 0x49df1d
test al, al
jne 0x49df1d
test bl, bl
je 0x49df1d
mov eax, dword [0x63dd80]
mov edx, dword [eax]
push str.Shutdown_request_cancelled___stopping_shutdown_timer
push str.CPSTServer::Run
push 2
push eax
mov eax, dword [edx]
call eax
mov ecx, dword [esp + 0x28]
add esp, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_CancelWaitableTimer]
xor bl, bl
jmp 0x49df1d
test eax, eax
jne 0x49decc
test bl, bl
je 0x49ded5
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Shutdown_timer_expired___shutting_down
push str.CPSTServer::Run
push 2
push eax
call edx
add esp, 0x10
mov eax, dword [esi + 0x324]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, esi
call fcn.0049c200
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
cmp dword [esi + 0x50], 0
mov ebx, eax
jbe 0x49dd8c
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
nop
call edi
sub eax, ebx
cdq
xor eax, edx
sub eax, edx
cmp eax, dword [esi + 0x228]
jae 0x49dd8c
push 1
push 0
push 0
push 0
lea ecx, [esp + 0x60]
push ecx
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x49dd7d
jmp 0x49dd50
lea edx, [esp + 0x50]
push edx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageW]
push 1
push 0
push 0
push 0
lea ecx, [esp + 0x60]
push ecx
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
jne 0x49dd50
mov edx, dword [esi + 0x1fc]
push edx
call ebp
cmp dword [esi + 0x50], 0
ja 0x49dd20
mov eax, dword [esi + 0x228]
mov edi, dword [esp + 0x20]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x49ddc6
mov eax, dword [0x63dd80]
mov ecx, dword [eax]
mov edx, dword [ecx]
push str.Event_thread_did_not_shut_down___terminating
push str.CPSTServer::Run
push 1
push eax
call edx
add esp, 0x10
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
mov eax, dword [esp + 0x18]
push eax
call edi
mov ecx, dword [esi + 0x324]
push ecx
call edi
cmp byte [esi + 0x24c], 0
je 0x49ddf3
mov ecx, dword [0x63dd84]
call fcn.004a01a0
mov ecx, dword [0x63dd84]
mov edi, ecx
test ecx, ecx
je 0x49de0d
call fcn.004a1720
push edi
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, esi
mov dword [0x63dd84], 0
call fcn.00496f50
mov edx, dword [esi + 0x68]
push edx
call dword [sym.imp.ole32.dll_CoRevokeClassObject]
mov ecx, esi
call fcn.004967c0
xor ebp, ebp
mov ecx, dword [esi + 0x1dc]
cmp ecx, ebp
je 0x49de48
mov eax, dword [ecx]
mov edx, dword [eax + 8]
call edx
mov dword [esi + 0x1dc], ebp
mov ecx, esi
call fcn.00498860
mov ecx, dword [esi + 0x1d4]
call fcn.0045a0b0
mov ecx, dword [esi + 0x1d8]
cmp ecx, ebp
je 0x49de71
mov eax, dword [ecx]
mov edx, dword [eax + 8]
call edx
mov dword [esi + 0x1d8], ebp
mov ecx, dword [esi + 0x1d4]
mov eax, dword [ecx]
mov edx, dword [eax + 8]
call edx
push ebp
push 0x5d1d25
push str..PSTServer.cpp
push 0x5b3
mov dword [esi + 0x1d4], ebp
mov ecx, dword [0x63dd80]
push str.CPSTServer::Run
call fcn.0041aca0
mov ecx, dword [esp + 0x10c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0051ed00
add esp, 0x104
ret
cmp eax, 1
jne 0x49df1d
test bl, bl
je 0x49df1d
push 0
push 0
push 0
push 0
lea edx, [esp + 0x60]
push edx
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x49df1d
push 0
push 0
push 0
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.USER32.dll_GetMessageW]
test eax, eax
je 0x49df19
lea ecx, [esp + 0x50]
push ecx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea edx, [esp + 0x50]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageW]
jmp 0x49df1d
mov byte [esi + 0x6c], 1
cmp byte [esp + 0x17], 0
jne 0x49dbe3
jmp 0x49dcf5