Function at 0x40eec0
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55312e
mov eax, dword fs:[0]
push eax
sub esp, 0x124
push ebx
push esi
push edi
mov eax, dword [0x5ba318]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
xor ebx, ebx
mov dword [ebp - 4], ebx
call fcn.0043cc81
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40ef0c
push 0x80004005
call fcn.004013d0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x14], edi
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 1
call fcn.0044a9a7
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 2
call fcn.0043c264
mov dword [ebp - 0x70], vtable.CFileException.0
call fcn.0043cc81
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40ef57
push 0x80004005
call fcn.004013d0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x60], eax
lea ecx, [ebp - 0x60]
mov dword [ebp - 0x68], ebx
mov dword [ebp - 0x64], 0xffffffff
call fcn.00401580
push ebx
lea ecx, [ebp - 0x130]
mov byte [ebp - 4], 4
call fcn.004291d0
mov byte [ebp - 4], 5
call fcn.0043cba2
mov ebx, dword [eax + 4]
mov ecx, ebx
mov dword [ebp - 0x10], ebx
call fcn.0041b310
test eax, eax
je 0x40effd
lea ecx, [ebp - 0x130]
call fcn.00433704
lea ecx, [ebp - 0x130]
mov byte [ebp - 4], 4
call fcn.00432ece
mov eax, dword [ebp - 0x60]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov dword [ebp - 0x70], vtable.CFileException.0
mov byte [ebp - 4], 2
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40efe6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 1
call fcn.0044ab99
lea eax, [edi - 0x10]
jmp 0x40f490
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x70]
push ecx
push 0
push edx
lea ecx, [ebp - 0x9c]
call fcn.0044afb0
test eax, eax
jne 0x40f024
push eax
push eax
push str.File_Open_Error
call fcn.0044023c
jmp 0x40efad
mov ecx, ebx
call fcn.00419d30
mov ecx, esi
call fcn.0040d570
push 0
push 0x1000
push 1
lea ecx, [ebp - 0x9c]
push ecx
lea ecx, [ebp - 0x5c]
call fcn.00449d6e
test byte [ebp - 0x44], 1
mov byte [ebp - 4], 6
jne 0x40f05f
mov edx, dword [ebp - 0x48]
push edx
push 4
call fcn.00449fc5
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
lea edx, [eax + 2]
cmp edx, ecx
jbe 0x40f080
sub eax, ecx
add eax, 2
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
movzx edx, word [eax]
add eax, 2
test byte [ebp - 0x44], 1
mov dword [ebp - 0x88], edx
mov dword [ebp - 0x34], eax
jne 0x40f0a0
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 2]
cmp edx, ecx
jbe 0x40f0bb
sub eax, ecx
add eax, 2
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
movzx ebx, word [eax]
add eax, 2
xor edi, edi
mov dword [ebp - 0x34], eax
test ebx, ebx
jle 0x40f125
lea ebx, [ebx]
test byte [ebp - 0x44], 1
je 0x40f136
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f0ee
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0x10c], eax
add dword [ebp - 0x34], 4
lea edx, [ebp - 0x14]
push edx
lea ecx, [ebp - 0x5c]
call fcn.004099e0
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx]
mov edx, dword [ebp - 0x14]
mov eax, dword [eax + 0xa4]
push edx
call eax
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
inc edi
cmp edi, ebx
jl 0x40f0d0
test byte [ebp - 0x44], 1
jne 0x40f141
mov edx, dword [ebp - 0x48]
push edx
push 4
call fcn.00449fc5
mov ecx, dword [ebp - 0x48]
push ecx
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f15c
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
add eax, 4
test byte [ebp - 0x44], 1
mov dword [esi + 0x410], edx
mov dword [ebp - 0x34], eax
jne 0x40f17b
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f196
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
add eax, 4
test byte [ebp - 0x44], 1
mov dword [esi + 0x16c], edx
mov dword [ebp - 0x34], eax
jne 0x40f1b5
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f1d0
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
mov ebx, dword [eax]
add eax, 4
test byte [ebp - 0x44], 1
mov dword [ebp - 0x34], eax
jne 0x40f1e9
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f204
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
add eax, 4
cmp word [ebp - 0x88], 2
mov dword [esi + 0x174], edx
mov dword [ebp - 0x34], eax
jne 0x40f256
test byte [ebp - 0x44], 1
jne 0x40f22d
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f248
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
add eax, 4
mov dword [esi + 0x178], edx
mov dword [ebp - 0x34], eax
test byte [ebp - 0x44], 1
jne 0x40f267
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f282
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
add eax, 4
test byte [ebp - 0x44], 1
mov dword [esi + 0x170], edx
mov dword [ebp - 0x34], eax
jne 0x40f2a1
mov eax, dword [ebp - 0x48]
push eax
push 4
call fcn.00449fc5
lea edx, [eax + 4]
cmp edx, ecx
jbe 0x40f2b9
sub eax, ecx
add eax, 4
push eax
lea ecx, [ebp - 0x5c]
call fcn.00449823
mov eax, dword [ebp - 0x34]
mov ecx, dword [eax]
mov dword [esi + 0x42c], ecx
add eax, 4
lea edi, [esi + 0x430]
push edi
lea ecx, [ebp - 0x5c]
mov dword [ebp - 0x34], eax
call fcn.004099e0
push 0x1c
lea edx, [esi + 0x3f4]
push edx
lea ecx, [ebp - 0x5c]
call fcn.0044967a
test ebx, ebx
je 0x40f423
cmp dword [esi + 0x174], 0
je 0x40f37e
mov eax, dword [edi]
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
mov dword [esi + 0x5dc], eax
cmp eax, 0xffffffff
je 0x40f3e0
mov dx, word [esi + 0x16c]
mov ecx, dword [esi + 0x20]
mov word [ebp - 0x78], dx
lea edx, [ebp - 0x84]
mov dword [ebp - 0x84], ecx
mov ecx, dword [esi + 0x410]
push edx
push eax
mov dword [ebp - 0x80], 0x402
mov dword [ebp - 0x7c], 0x401
mov dword [ebp - 0x74], ecx
call sub.modbusm.dll__ConnectTCP_8
mov dword [esi + 0x114], eax
cmp eax, 0xffffffff
jne 0x40f36a
push 0
push 0
push str.modbus_TCP_Connection_Failed
call fcn.0044023c
jmp 0x40f423
mov ecx, dword [ebp - 0x10]
add ecx, 0xc0
push edi
call fcn.00403590
jmp 0x40f423
cmp dword [esi + 0x178], 0
je 0x40f3f0
mov eax, dword [edi]
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
mov dword [esi + 0x5dc], eax
cmp eax, 0xffffffff
je 0x40f3e0
mov ecx, dword [esi + 0x20]
mov dx, word [esi + 0x16c]
mov dword [ebp - 0x84], ecx
mov ecx, dword [esi + 0x410]
mov word [ebp - 0x78], dx
mov dword [ebp - 0x74], ecx
movzx ecx, word [esi + 0x434]
lea edx, [ebp - 0x84]
push edx
push ecx
push eax
mov dword [ebp - 0x80], 0x402
mov dword [ebp - 0x7c], 0x401
call sub.modbusm.dll__ConnectTelNet_12
jmp 0x40f34c
push 0
push 0
push str.Invalid_IP_Address
call fcn.0044023c
jmp 0x40f423
cmp dword [esi + 0x170], 0
mov ecx, esi
je 0x40f402
call fcn.0040d290
jmp 0x40f423
call fcn.0040d160
mov dword [esi + 0x114], eax
cmp eax, 0xffffffff
je 0x40f423
mov edx, dword [esi + 0x20]
push 0
push 0x402
push edx
push eax
call sub.modbusm.dll__HookRspNotification_16
lea ecx, [ebp - 0x5c]
call fcn.00449bb6
lea ecx, [ebp - 0x9c]
call fcn.0044a942
lea ecx, [ebp - 0x5c]
mov byte [ebp - 4], 5
call fcn.00449d2c
lea ecx, [ebp - 0x130]
mov byte [ebp - 4], 4
call fcn.00432ece
mov eax, dword [ebp - 0x60]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
mov dword [ebp - 0x70], vtable.CFileException.0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f47b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 1
call fcn.0044ab99
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f4ad
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f4d3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4