Function at 0x4fed30
Capabilities:
Initialize winsock library
Print debug messages
Resolve dns

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x579a96
mov eax, dword fs:[0]
push eax
sub esp, 0x7a0
mov eax, dword [0x5d72e0]
xor eax, esp
mov dword [esp + 0x798], eax
push ebx
push esi
push edi
mov eax, dword [0x5d72e0]
xor eax, esp
push eax
lea eax, [esp + 0x7b0]
mov dword fs:[0], eax
mov ecx, 0x16e
lea esi, [ebp + 8]
lea edi, [esp + 0x1c]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp + 0x5c0]
push 3
xor esi, esi
push 0x3a98
mov dword [esp + 0x1c], esi
call dword [sym.imp.NetSDK.dll_Ordinal_4]
cmp dword [esp + 0x544], 0xc
jne 0x4fee25
cmp dword [esp + 0x1f0], 3
lea eax, [esp + 0x14]
lea ecx, [edi + 0x1f8]
lea edx, [esp + 0x160]
jne 0x4fedf5
push 1
push eax
push 5
push ecx
mov ecx, dword [esp + 0x208]
push edx
lea eax, [esp + 0x134]
push eax
push ecx
lea edx, [esp + 0xbc]
push edx
mov dword [esp + 0x56c], 1
call dword [sym.imp.NetSDK.dll_Ordinal_104]
jmp 0x4ff093
push esi
push eax
push 5
push ecx
mov ecx, dword [esp + 0x208]
push edx
lea eax, [esp + 0x134]
push eax
push ecx
lea edx, [esp + 0xbc]
push edx
mov dword [esp + 0x56c], esi
call dword [sym.imp.NetSDK.dll_Ordinal_104]
jmp 0x4ff093
mov eax, dword [esp + 0x1f0]
cmp eax, 3
jne 0x4feeb0
push 2
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x200]
lea ebx, [edi + 0x1f8]
push ebx
lea ecx, [esp + 0x16c]
push ecx
lea edx, [esp + 0x130]
push edx
push eax
lea ecx, [esp + 0xb8]
push ecx
mov dword [esp + 0x568], 2
call dword [sym.imp.NetSDK.dll_Ordinal_5_1]
cmp dword [esp + 0x14], 2
mov esi, eax
jne 0x4ff095
mov edx, dword [esp + 0x54c]
push edx
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x200]
push ebx
lea ecx, [esp + 0x16c]
push ecx
lea edx, [esp + 0x130]
push edx
push eax
lea ecx, [esp + 0xb8]
push ecx
jmp 0x4ff08d
cmp eax, esi
jne 0x4fef03
lea edx, [esp + 0x5d4]
push edx
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
lea eax, [esp + 0xa0]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, esi
jne 0x4feee0
xor eax, eax
jmp 0x4ff1fe
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
lea edx, [esp + 0xa0]
mov cl, byte [eax]
mov byte [edx], cl
add eax, 1
add edx, 1
test cl, cl
jne 0x4feef5
mov eax, dword [esp + 0x54c]
push eax
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x200]
lea ebx, [edi + 0x1f8]
push ebx
lea edx, [esp + 0x16c]
push edx
lea eax, [esp + 0x130]
push eax
push ecx
lea edx, [esp + 0xb8]
push edx
call dword [sym.imp.NetSDK.dll_Ordinal_5_1]
mov esi, eax
test esi, esi
jg 0x4fefaa
cmp dword [esp + 0x1ec], 1
jne 0x4fefaa
mov eax, dword [esp + 0x14]
cmp eax, 0xffffd3d9
je 0x4fefaa
cmp eax, 0xffffd3d8
je 0x4fefaa
cmp eax, 0xffffd3dc
je 0x4fefaa
cmp eax, 0xffffd3db
je 0x4fefaa
cmp eax, 0xffffd3da
je 0x4fefaa
mov eax, dword [esp + 0x54c]
push eax
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x200]
push ebx
lea edx, [esp + 0x16c]
push edx
lea eax, [esp + 0x130]
push eax
push ecx
lea edx, [esp + 0xf8]
push edx
call dword [sym.imp.NetSDK.dll_Ordinal_5_1]
mov esi, eax
cmp dword [esp + 0x14], 2
jne 0x4ff095
push 0x40
lea eax, [esp + 0x768]
push 0
push eax
call fcn.00530d30
movzx ecx, byte [esp + 0x12c]
movzx edx, byte [esp + 0x12d]
movzx eax, byte [esp + 0x12e]
add cl, 3
mov byte [esp + 0x770], cl
movzx ecx, byte [esp + 0x12f]
add dl, 3
add al, 3
mov byte [esp + 0x771], dl
movzx edx, byte [esp + 0x130]
add cl, 3
mov byte [esp + 0x772], al
movzx eax, byte [esp + 0x131]
mov byte [esp + 0x773], cl
movzx ecx, byte [esp + 0x132]
add dl, 3
add esp, 0xc
add al, 3
mov byte [esp + 0x768], dl
movzx edx, byte [esp + 0x127]
add cl, 3
mov byte [esp + 0x769], al
mov eax, dword [esp + 0x54c]
push eax
mov byte [esp + 0x76e], cl
add dl, 3
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x200]
push ebx
mov byte [esp + 0x777], dl
lea edx, [esp + 0x16c]
push edx
lea eax, [esp + 0x774]
push eax
push ecx
lea edx, [esp + 0xb8]
mov byte [esp + 0x784], 0
push edx
call dword [sym.imp.NetSDK.dll_Ordinal_5_1]
mov esi, eax
mov eax, dword [edi + 0x33c]
add eax, dword [edi + 0x318]
mov ecx, dword [esp + 0x334]
mov edx, dword [esp + 0x358]
add edx, ecx
test esi, esi
mov dword [edi + 0x1c4], eax
mov dword [esp + 0x1e0], edx
jle 0x4ff164
cmp dword [esp + 0x1f0], 3
jne 0x4ff164
call dword [sym.imp.NetSDK.dll_Ordinal_3_1]
mov dword [esp + 0x14], eax
call fcn.00518333
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4ff0f8
push 0x80004005
call fcn.00401000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x14]
push ecx
lea edx, [esp + 0xa4]
push edx
lea eax, [esp + 0x20]
push str.DeviceIp:_s___nTyep:Serial__nError:_d
push eax
mov dword [esp + 0x7c8], 0
call fcn.004020e0
mov ebx, dword [esp + 0x28]
add esp, 0x10
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebx - 0x10]
mov dword [esp + 0x7b8], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4ff164
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x14]
mov dword [edi + 0x1cc], ecx
call fcn.00518333
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4ff188
push 0x80004005
call fcn.00401000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov ecx, dword [edi + 0x344]
mov edx, dword [esp + 0x14]
push ecx
push edx
push esi
lea eax, [esp + 0xac]
push eax
lea ecx, [esp + 0x28]
push str.DeviceIp:_s__LoginID:_d__nError:_d_DeviceType:_d
push ecx
mov dword [esp + 0x7d0], 1
call fcn.004020e0
mov edi, dword [esp + 0x30]
add esp, 0x18
push edi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [edi - 0x10]
mov dword [esp + 0x7b8], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4ff1fc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x7b0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x798]
xor ecx, esp
call fcn.0053042b
mov esp, ebp
pop ebp
ret 0x5bc