Function at 0x41b9f0
Capabilities:
Query environment variable
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x51e16a
mov eax, dword fs:[0]
push eax
sub esp, 0x4b4
mov eax, dword [0x5b339c]
xor eax, esp
mov dword [esp + 0x4b0], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5b339c]
xor eax, esp
push eax
lea eax, [esp + 0x4c8]
mov dword fs:[0], eax
cmp dword [0x5b6bb0], 0
mov esi, ecx
jne 0x41c133
push 0x10
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x18], eax
mov dword [esp + 0x4d0], 0
test eax, eax
je 0x41ba60
mov ecx, eax
call fcn.00414f70
jmp 0x41ba62
xor eax, eax
mov dword [esp + 0x4d0], 0xffffffff
lea edi, [esi + 0x148]
push edi
mov dword [0x5b6bb0], eax
lea eax, [esp + 0x3c]
push str.PSTCFG
mov ebp, 1
push eax
mov byte [esp + 0x21], 1
mov dword [esp + 0x3c], ebp
mov byte [esp + 0x23], 0
mov byte [esp + 0x22], 0
mov byte [esp + 0x20], 1
mov dword [esp + 0x40], 0xa00000
call dword [sym.imp.MSVCP90.dll_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_std::operator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___wchar_t_const___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov dword [esp + 0x4dc], ebp
mov ebp, dword [sym.imp.MSVCP90.dll_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_std::operator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const___wchar_t_const__]
push str..LOG
push eax
lea ecx, [esp + 0x68]
push ecx
call ebp
add esp, 0x18
mov byte [esp + 0x4d0], 3
lea ecx, [esp + 0x38]
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_]
lea ecx, [esp + 0xa8]
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 [esp + 0x4d0], 4
lea ecx, [esp + 0x8c]
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 [esp + 0x4d0], 5
lea edx, [esp + 0x20]
push edx
call dword [sym.imp.OLEAUT32.dll_VariantClear]
lea eax, [esp + 0x20]
push eax
push 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x3c], esp
push str.LogLevel
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 + 0x4f4], 6
mov edx, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x5c], 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_wchar_t_const__]
mov byte [esp + 0x510], 7
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
mov ebx, dword [sym.imp.OLEAUT32.dll_VariantCopy]
test al, al
je 0x41bb7b
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x20]
push ecx
mov dword [esp + 0x34], eax
call ebx
lea edx, [esp + 0x20]
push edx
push 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.LogToScreen
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 + 0x4f4], 8
mov eax, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 9
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bbdf
cmp dword [esp + 0x28], 0
lea ecx, [esp + 0x20]
push ecx
setne byte [esp + 0x1b]
call ebx
lea edx, [esp + 0x20]
push edx
push 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.CommitWrites
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 + 0x4f4], 0xa
mov eax, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0xb
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bc43
cmp dword [esp + 0x28], 0
lea ecx, [esp + 0x20]
push ecx
setne byte [esp + 0x1a]
call ebx
lea edx, [esp + 0x20]
push edx
push 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.Overwrite
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 + 0x4f4], 0xc
mov eax, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0xd
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bca7
cmp dword [esp + 0x28], 0
lea ecx, [esp + 0x20]
push ecx
setne byte [esp + 0x18]
call ebx
lea edx, [esp + 0x20]
push edx
push 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.LogSize
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 + 0x4f4], 0xe
mov eax, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0xf
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bd09
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x20]
push edx
mov dword [esp + 0x38], ecx
call ebx
lea eax, [esp + 0x20]
push eax
push 8
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.LogFilter
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 + 0x4f4], 0x10
mov edx, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0x11
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bd76
mov eax, dword [esp + 0x28]
push eax
lea ecx, [esp + 0xac]
call dword [sym.imp.MSVCP90.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 ecx, [esp + 0x20]
push ecx
call ebx
lea edx, [esp + 0x20]
push edx
push 8
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.LogFilterFilename
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 + 0x4f4], 0x12
mov eax, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0x13
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bde2
mov ecx, dword [esp + 0x28]
push ecx
lea ecx, [esp + 0x90]
call dword [sym.imp.MSVCP90.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 edx, [esp + 0x20]
push edx
call ebx
lea eax, [esp + 0x20]
push eax
push 8
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push str.LogFilename
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 + 0x4f4], 0x14
mov edx, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0x15
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41be51
mov eax, dword [esp + 0x28]
push eax
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP90.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 ecx, [esp + 0x20]
push ecx
call ebx
jmp 0x41bf37
push 0x200
lea edx, [esp + 0xc8]
push edx
push str.CommonProgramFiles
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x41becf
lea eax, [esp + 0xc4]
push eax
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP90.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__]
push str.MatrikonOPCCommon_
lea ecx, [esp + 0x58]
call dword [0x539464]
push edi
lea ecx, [esi + 0x384]
push ecx
lea edx, [esp + 0x78]
push edx
call dword [sym.imp.MSVCP90.dll_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_std::operator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov bl, 0x16
mov byte [esp + 0x4dc], bl
push str..LOG
push eax
lea eax, [esp + 0x4c]
push eax
call ebp
add esp, 0x18
mov byte [esp + 0x4d0], 0x17
push eax
lea ecx, [esp + 0x58]
call dword [0x539434]
jmp 0x41bf0e
push edi
lea ecx, [esi + 0x384]
push ecx
lea edx, [esp + 0x78]
push edx
call dword [sym.imp.MSVCP90.dll_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_std::operator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov bl, 0x18
mov byte [esp + 0x4dc], bl
push str..LOG
push eax
lea eax, [esp + 0x4c]
push eax
call ebp
add esp, 0x18
mov byte [esp + 0x4d0], 0x19
push eax
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP90.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_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [esp + 0x4d0], bl
lea ecx, [esp + 0x38]
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 [esp + 0x4d0], 5
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__::destructor_void_]
mov ebx, dword [sym.imp.OLEAUT32.dll_VariantCopy]
lea ecx, [esp + 0x20]
push ecx
push 3
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x40], esp
push 0x53e4c8
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 + 0x4f4], 0x1a
mov edx, dword [str.Logging]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x58], 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_wchar_t_const__]
mov byte [esp + 0x510], 0x1b
mov byte [esp + 0x510], 5
mov ecx, esi
call fcn.00416090
test al, al
je 0x41bfa9
cmp dword [esp + 0x28], 0
jne 0x41bf97
mov byte [esp + 0x15], 0
lea eax, [esp + 0x20]
push eax
call ebx
cmp byte [esp + 0x15], 1
jne 0x41c0c4
movzx ecx, byte [esp + 0x16]
movzx ebp, byte [esp + 0x17]
movzx ebx, byte [esp + 0x14]
xor edi, edi
mov dword [esp + 0x18], ecx
mov edi, edi
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x30]
push ebp
push ebx
push edx
push eax
push ecx
lea ecx, [esp + 0x68]
call dword [sym.imp.MSVCP90.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]
mov ecx, dword [0x5b6bb0]
push eax
call fcn.004010b0
add edi, 0x64
cmp eax, 1
je 0x41bfff
cmp edi, 0x1388
jb 0x41bfc0
lea ecx, [esp + 0xa8]
call dword [sym.imp.MSVCP90.dll_public:_unsigned_int___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::length_void_const]
test eax, eax
jbe 0x41c0c4
lea ecx, [esp + 0x8c]
call dword [sym.imp.MSVCP90.dll_public:_unsigned_int___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::length_void_const]
test eax, eax
jbe 0x41c0c4
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
mov bl, 0x1c
mov byte [esp + 0x4d0], bl
lea ecx, [esp + 0x70]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
mov byte [esp + 0x4d0], 0x1d
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0xac]
push eax
call fcn.00517960
lea ecx, [esp + 0x78]
push ecx
lea edx, [esp + 0x98]
push edx
call fcn.00517960
add esp, 0x10
lea ecx, [esp + 0x70]
call dword [sym.imp.MSVCP90.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
mov ecx, dword [0x5b6bb0]
push eax
mov eax, dword [esp + 0x38]
push eax
call fcn.00414fb0
mov dword [esi + 0x42c], eax
mov byte [esp + 0x4d0], bl
lea ecx, [esp + 0x70]
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 [esp + 0x4d0], 5
lea ecx, [esp + 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_]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x38], esp
push str.CFGi
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 + 0x4ec], 0x1e
mov byte [esp + 0x4ec], 5
mov ecx, esi
call fcn.00417d60
mov dword [0x5b6bb4], eax
mov byte [esp + 0x4d0], 4
lea ecx, [esp + 0x8c]
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 [esp + 0x4d0], 3
lea ecx, [esp + 0xa8]
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 dword [esp + 0x4d0], 0xffffffff
lea ecx, [esp + 0x54]
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, dword [esp + 0x4c8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4b0]
xor ecx, esp
call fcn.0051973e
add esp, 0x4c0
ret