Function at 0x140003b60
Capabilities:
Create thread
Link many functions at runtime
Query environment variable

Disassembly:
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x560
mov qword [rsp + 0x550], 0xfffffffffffffffe
mov rax, qword [0x140021220]
xor rax, rsp
mov qword [rsp + 0x558], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x1400217a4], eax
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ole32.dll_CoInitializeEx]
mov dword [rsp + 0x538], eax
cmp dword [rsp + 0x538], 0
jge 0x140003c27
cmp dword [0x140020940], 0
jne 0x140003bcc
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140003c27
call fcn.140010ff0
mov edx, dword [rsp + 0x538]
lea rcx, str.ERROR:_0x_x__CoInitializeEx__
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4a3
lea rax, [0x1400181e0]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400181f0]
mov edx, 0xffffffff
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
lea rcx, [rsp + 0x78]
call fcn.140005fa0
nop
mov r8d, 1
xor edx, edx
lea rcx, [rsp + 0x78]
call fcn.140006060
lea rcx, [rsp + 0x78]
call fcn.140005f90
mov qword [rsp + 0x40], 0
mov dword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
mov edx, 0xffffffff
mov rcx, rax
call qword [sym.imp.ole32.dll_CoInitializeSecurity]
mov dword [rsp + 0x538], eax
cmp dword [rsp + 0x538], 0
jge 0x140003d12
cmp dword [0x140020940], 0
jne 0x140003cb7
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140003d12
call fcn.140010ff0
mov edx, dword [rsp + 0x538]
lea rcx, str.ERROR:_0x_x__CoInitializeSecurity__
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4ab
lea rax, [0x140018220]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400181f4]
mov edx, 0xffffffff
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
mov r8d, 1
mov edx, 0x14
lea rcx, [0x140021530]
call fcn.140005c80
mov dword [rsp + 0x538], eax
cmp dword [rsp + 0x538], 0
jge 0x140003daf
cmp dword [0x140020940], 0
jne 0x140003d54
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140003daf
call fcn.140010ff0
mov edx, dword [rsp + 0x538]
lea rcx, str.ERROR:_0x_x__RegisterClassObjects__
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4b0
lea rax, [0x140018258]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x140018268]
mov edx, 0xffffffff
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
movzx eax, word [0x14001826c]
mov word [rsp + 0x2f0], ax
lea rdi, [rsp + 0x2f2]
xor eax, eax
mov ecx, 0x206
rep stosb byte [rdi], al
mov edx, 1
mov rcx, qword [0x140020068]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x140003e6b
mov eax, dword [0x140020940]
and eax, 0x10
test eax, eax
jne 0x140003e07
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140003e5c
call fcn.140010ff0
lea rcx, str.InitializeSecurityDescriptor_failed___
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4bc
lea rax, [0x140018298]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400182a8]
mov edx, 0x10
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
nop
lea rcx, [rsp + 0x78]
call fcn.140005ff0
jmp 0x14000480c
xor r9d, r9d
xor r8d, r8d
mov edx, 1
mov rcx, qword [0x140020068]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x140003f0d
mov eax, dword [0x140020940]
and eax, 0x10
test eax, eax
jne 0x140003ea9
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140003efe
call fcn.140010ff0
lea rcx, str.SetSecurityDescriptorDacl_failed___
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4c1
lea rax, [0x1400182d8]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400182ac]
mov edx, 0x10
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
nop
lea rcx, [rsp + 0x78]
call fcn.140005ff0
jmp 0x14000480c
mov dword [0x1400214b0], 0x18
mov rax, qword [0x140020068]
mov qword [0x1400214b8], rax
mov dword [0x1400214c0], 1
lea rax, [0x1400214b0]
mov qword [0x1400214f8], rax
call fcn.140002eb0
lea r8, str.GlobalS7DOS_EPAAPI_64_WOW_MUTEX
xor edx, edx
mov rcx, qword [0x1400214f8]
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [0x140021500], rax
cmp qword [0x140021500], 0
jne 0x140003fdb
mov eax, dword [0x140020940]
and eax, 0x40
test eax, eax
jne 0x140003f87
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140003fdb
call fcn.140010ff0
lea rcx, str.ERROR_on_CreateMutex_S7DOS_EPAAPI_64_WOW_MUTEX____
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4d0
lea rax, [0x140018388]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400182d4]
mov edx, 0x40
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
lea r8, str.GlobalLISTS7DOS_EPAAPI_64_WOW_MUTEX_LIST
xor edx, edx
mov rcx, qword [0x1400214f8]
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [0x140021508], rax
cmp qword [0x140021508], 0
jne 0x140004074
mov eax, dword [0x140020940]
and eax, 0x40
test eax, eax
jne 0x140004020
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140004074
call fcn.140010ff0
lea rcx, str.ERROR_on_CreateMutex_GlobalLISTS7DOS_EPAAPI_64_WOW_MUTEX_LIST____
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4d5
lea rax, [0x140018488]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400183f4]
mov edx, 0x40
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
mov r8d, 0x104
lea rdx, [rsp + 0x2f0]
lea rcx, str._Simatic_OAM_
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [rsp + 0x60], eax
cmp dword [rsp + 0x60], 0
je 0x1400040b9
lea r8, [0x1400184b8]
mov edx, 0x104
lea rcx, [rsp + 0x2f0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
jmp 0x140004139
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x60], eax
mov eax, dword [0x140020940]
and eax, 0x10
test eax, eax
jne 0x1400040e1
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x140004139
call fcn.140010ff0
mov edx, dword [rsp + 0x60]
lea rcx, str.Cannot_find_Environment_Variable_Simatic_OAM:__d
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x4df
lea rax, [0x1400184c8]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400184b4]
mov edx, 0x10
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.S7onlinx64.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x530], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.S7epaapi64x.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x70], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.s7oniepgx64.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x2e8], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.s7ontcp.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0xa8], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.s7owpstx.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x540], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.s7otsiex64.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x2d0], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.s7pcadpsrv.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x2e0], rax
lea r8, [rsp + 0x2f0]
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscpy_s]
lea r8, str.RemoteS7.dll
mov edx, 0x104
lea rcx, [rsp + 0xc0]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea rcx, [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [rsp + 0x2d8], rax
cmp qword [rsp + 0x2e8], 0
jne 0x14000439e
call fcn.140002b80
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x68], 0
cmp qword [rsp + 0xa8], 0
je 0x1400043fb
lea rdx, [0x1400185d0]
mov rcx, qword [rsp + 0xa8]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x58], rax
lea rdx, [0x1400185e0]
mov rcx, qword [rsp + 0xa8]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x58], 0
je 0x1400043fb
call qword [rsp + 0x58]
mov qword [rsp + 0x548], 0
mov qword [rsp + 0xa0], 0
cmp qword [rsp + 0x2d8], 0
je 0x14000446a
lea rdx, str.StartThreads
mov rcx, qword [rsp + 0x2d8]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x548], rax
lea rdx, str.CloseThreads
mov rcx, qword [rsp + 0x2d8]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0xa0], rax
cmp qword [rsp + 0x548], 0
je 0x14000446a
call qword [rsp + 0x548]
cmp qword [rsp + 0x2e0], 0
je 0x140004504
lea rdx, str.s7pcadpsrv_init
mov rcx, qword [rsp + 0x2e0]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1400214d0], rax
lea rdx, str.s7pcadpsrv_cleanup
mov rcx, qword [rsp + 0x2e0]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1400214d8], rax
lea rdx, str.s7pcadpsrv_service_ctrl_handler
mov rcx, qword [rsp + 0x2e0]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1400214e0], rax
cmp qword [0x1400214d0], 0
je 0x140004504
mov qword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [0x140004830]
mov rdx, qword [rsp + 0x570]
mov rdx, qword [rdx + 0x250]
mov ecx, 0x10001
call qword [0x1400214d0]
cmp qword [rsp + 0x70], 0
je 0x14000464a
lea rdx, str.PGSP_GetParameterMetaData
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1400214e8], rax
cmp qword [0x1400214e8], 0
jne 0x1400045ad
mov eax, dword [0x140020940]
and eax, 0x10
test eax, eax
jne 0x140004551
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x1400045ad
call fcn.140010ff0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetProcAddress_PGSP_GetParameterMetaData_Failed:__d
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x525
lea rax, [0x1400186b0]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400184c4]
mov edx, 0x10
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
lea rdx, str.PGSP_SetParameterMetaData
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1400214f0], rax
cmp qword [0x1400214f0], 0
jne 0x14000464a
mov eax, dword [0x140020940]
and eax, 0x10
test eax, eax
jne 0x1400045ee
mov rcx, qword [0x140020948]
mov eax, dword [0x140025264]
cmp dword [rcx], eax
je 0x14000464a
call fcn.140010ff0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetProcAddress_PGSP_SetParameterMetaData_Failed:__d
call fcn.140012270
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x529
lea rax, [0x140018718]
mov qword [rsp + 0x28], rax
mov eax, dword [0x140020060]
mov dword [rsp + 0x20], eax
xor r9d, r9d
lea r8, [0x1400186ac]
mov edx, 0x10
lea rcx, str.Run__
call fcn.1400122d0
call fcn.1400110a0
call fcn.140002220
call fcn.1400034d0
lea rdx, [rsp + 0x64]
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [0x1400031c0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.MSVCR90.dll__beginthreadex]
mov qword [rsp + 0x50], rax
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x570]
cmp dword [rax + 0x278], 0
je 0x1400046ad
mov edx, 4
mov rcx, qword [rsp + 0x570]
call fcn.140003b10
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0x500]
call qword [sym.imp.USER32.dll_GetMessageW]
test eax, eax
je 0x1400046d7
lea rcx, [rsp + 0x500]
call qword [sym.imp.USER32.dll_DispatchMessageW]
jmp 0x1400046ad
lea rcx, [0x140021530]
call fcn.140005dd0
call qword [sym.imp.ole32.dll_CoUninitialize]
cmp qword [rsp + 0x2e0], 0
je 0x140004702
mov rcx, qword [rsp + 0x2e0]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0x2d0], 0
je 0x14000471b
mov rcx, qword [rsp + 0x2d0]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0x540], 0
je 0x140004734
mov rcx, qword [rsp + 0x540]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0xa8], 0
je 0x140004759
cmp qword [rsp + 0x68], 0
je 0x14000474b
call qword [rsp + 0x68]
mov rcx, qword [rsp + 0xa8]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0x2d8], 0
je 0x140004784
cmp qword [rsp + 0xa0], 0
je 0x140004776
call qword [rsp + QueryPathOfRegTypeLib]
mov rcx, qword [rsp + 0x2d8]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0x2e8], 0
je 0x14000479d
mov rcx, qword [rsp + 0x2e8]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0x70], 0
je 0x1400047b0
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp qword [rsp + 0x530], 0
je 0x1400047c9
mov rcx, qword [rsp + 0x530]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
call fcn.140002e20
cmp qword [0x140021500], 0
je 0x1400047e5
mov rcx, qword [0x140021500]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [0x140021508], 0
je 0x1400047fc
mov rcx, qword [0x140021508]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.140002eb0
nop
lea rcx, [rsp + 0x78]
call fcn.140005ff0
mov rcx, qword [rsp + 0x558]
xor rcx, rsp
call fcn.140015270
add rsp, 0x560
pop rdi
ret