Function at 0x1008fb40
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Create thread
Receive data
Receive data on socket

Disassembly:
push ebp
lea ebp, [esp - 0x850]
sub esp, 0x850
push 0xffffffffffffffff
push 0x1014813b
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x10189710]
xor eax, ebp
mov dword [ebp + 0x84c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
lea eax, [ebp - 0x18]
mov edi, ecx
xor ebx, ebx
push eax
push str.MWDebug
mov ecx, str.SoftwareMicroWorld
mov edx, reloc.WS2_32.dll_bind
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], 0xffffffff
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], ebx
call fcn.10059e30
jmp 0x1008fbb0
push 0x103
lea ecx, [ebp + 0x541]
push ebx
push ecx
mov byte [ebp + 0x540], bl
call fcn.1012e060
push 0x103
lea edx, [ebp + 0x645]
push ebx
push edx
mov byte [ebp + 0x644], bl
call fcn.1012e060
push 0x103
lea eax, [ebp + 0x749]
push ebx
push eax
mov byte [ebp + 0x748], bl
call fcn.1012e060
add esp, 0x24
mov dword [ebp + 4], ebx
mov dword [ebp + 0x110], ebx
cmp dword [ebp - 0x18], ebx
je 0x1008fc17
push str._MWD__StartDaemon__
push ebx
call fcn.1006ed90
add esp, 8
lea edx, [ebp - 0x1c]
lea ecx, [ebp + 0x540]
call fcn.10082570
test eax, eax
jne 0x1008fc75
cmp dword [ebp - 0x18], ebx
je 0x1008fc3c
push str._MWD__Failed_to_retrieve_HostName_and_ip_using_GetHostnameAndIP__
push ebx
call fcn.1006ed90
add esp, 8
cmp edi, ebx
je 0x1008fc4e
push str.Failed_to_retrieve_HostName_and_ip_using_GetHostnameAndIP__
push edi
call fcn.10127dc0
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x84c]
xor ecx, ebp
call fcn.10127db1
add ebp, 0x850
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x1c]
cmp dword [ebp - 0x18], ebx
je 0x1008fc93
push esi
lea ecx, [ebp + 0x540]
push ecx
push str._MWD__HN:__s___IPList:__s_
push ebx
call fcn.1006ed90
add esp, 0x10
cmp esi, ebx
je 0x1008fca3
push esi
call fcn.10128243
add esp, 4
mov dword [ebp - 0x1c], ebx
cmp dword [ebp - 0x18], ebx
je 0x1008fcb6
push str._MWD__Getting_IP_using_IOCTL
push ebx
call fcn.1006ed90
add esp, 8
lea edx, [ebp - 0x1c]
push edx
call fcn.100815a0
test eax, eax
jne 0x1008fce8
cmp dword [ebp - 0x18], ebx
je 0x1008fcd6
push str._MWD__Failed_to_get_IpList_using_GetIPUsingIoctlMethod__
push ebx
call fcn.1006ed90
add esp, 8
cmp edi, ebx
je 0x1008fc4e
push str.Failed_to_get_IpList_using_GetIPUsingIoctlMethod__
jmp 0x1008fc45
cmp dword [ebp - 0x18], ebx
je 0x1008fcff
mov eax, dword [ebp - 0x1c]
push eax
push str._MWD__IP_using_IOCTL:___s_
push ebx
call fcn.1006ed90
add esp, 0xc
lea ecx, [ebp + 0x644]
push edi
push ecx
lea ebx, [ebp - 0x28]
call fcn.10091be0
add esp, 8
test eax, eax
jne 0x1008fd56
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x1008fd26
push eax
call fcn.10128243
add esp, 4
cmp dword [ebp - 0x18], 0
je 0x1008fd3b
push str._MWD__GetCachedId_failed_
push 0
call fcn.1006ed90
add esp, 8
test edi, edi
je 0x1008fc4e
cmp byte [edi], 0
jne 0x1008fc4e
push str.GetCachedId_failed_
jmp 0x1008fc45
xor ebx, ebx
cmp dword [ebp - 0x18], ebx
je 0x1008fd72
lea edx, [ebp + 0x644]
push edx
push str._MWD__CachedID:__s_
push ebx
call fcn.1006ed90
add esp, 0xc
lea eax, [ebp + 0x644]
mov dword [ebp + 0x53c], 0xf
mov dword [ebp + 0x538], ebx
mov byte [ebp + 0x528], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x1008fd91
sub eax, edx
push eax
lea eax, [ebp + 0x644]
push eax
lea ecx, [ebp + 0x524]
call fcn.10009b30
mov eax, 0x101c29cc
mov dword [ebp - 4], ebx
call fcn.1008c830
mov eax, dword [0x101c29dc]
mov dword [ebp - 0x28], eax
cmp dword [0x101c29d8], eax
jbe 0x1008fdcf
call fcn.10128a71
mov ecx, dword [0x101c29cc]
mov edx, dword [ebp + 0x53c]
mov dword [ebp - 0x3c], ecx
mov ecx, dword [ebp + 0x528]
mov eax, ecx
cmp edx, 0x10
jae 0x1008fdf1
lea eax, [ebp + 0x528]
mov esi, dword [ebp + 0x538]
lea edi, [eax + esi]
cmp edi, ebx
je 0x1008fe22
mov eax, ecx
cmp edx, 0x10
jae 0x1008fe0b
lea eax, [ebp + 0x528]
cmp eax, edi
ja 0x1008fe22
mov eax, ecx
cmp edx, 0x10
jae 0x1008fe1c
lea eax, [ebp + 0x528]
add eax, esi
cmp edi, eax
jbe 0x1008fe33
call fcn.10128a71
mov edx, dword [ebp + 0x53c]
mov ecx, dword [ebp + 0x528]
cmp edx, 0x10
jb 0x1008ff17
mov esi, ecx
cmp ecx, ebx
je 0x1008fe6c
mov eax, ecx
cmp edx, 0x10
jae 0x1008fe4f
lea eax, [ebp + 0x528]
cmp eax, esi
ja 0x1008fe6c
mov eax, ecx
cmp edx, 0x10
jae 0x1008fe60
lea eax, [ebp + 0x528]
mov edx, dword [ebp + 0x538]
add eax, edx
cmp esi, eax
jbe 0x1008fe71
call fcn.10128a71
push edi
lea eax, [ebp + 0x524]
mov ecx, eax
push ecx
mov ecx, dword [ebp - 0x3c]
push esi
push eax
mov eax, dword [ebp - 0x28]
push eax
push ecx
mov esi, 0x101c29cc
call fcn.10093410
cmp dword [ebp - 0x18], ebx
je 0x1008fea2
push str._MWD__GetPROXYIP
push ebx
call fcn.1006ed90
add esp, 8
mov edx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x24]
push edx
mov ecx, esi
lea edx, [ebp + 0x748]
call fcn.100921b0
add esp, 4
cmp eax, ebx
jne 0x1008ff22
mov eax, dword [ebp - 0x1c]
cmp eax, ebx
je 0x1008fecd
push eax
call fcn.10128243
add esp, 4
cmp dword [ebp - 0x18], ebx
je 0x1008fee0
push str._MWD__GetESRaProxyIp_failed_
push ebx
call fcn.1006ed90
add esp, 8
cmp esi, ebx
je 0x1008fef6
cmp byte [esi], bl
jne 0x1008fef6
push str.GetESRaProxyIp_failed_
push esi
call fcn.10127dc0
add esp, 8
cmp dword [ebp + 0x53c], 0x10
jb 0x1008fc4e
mov eax, dword [ebp + 0x528]
push eax
call fcn.10128f9e
add esp, 4
jmp 0x1008fc4e
lea esi, [ebp + 0x528]
jmp 0x1008fe42
cmp eax, 1
jne 0x1008ffd6
cmp dword [ebp - 0x18], ebx
je 0x1008ff3e
push str._MWD__connection_on_all_the_server_IPs_for_port_8098_failed_
push ebx
call fcn.1006ed90
add esp, 8
mov edi, dword [ebp - 0x20]
mov eax, dword [0x101b7fcc]
cmp eax, ebx
je 0x1008ff59
push eax
call fcn.10129ad3
add esp, 4
mov dword [0x101b7fcc], ebx
mov eax, 0x101c29b4
call fcn.1008c830
mov eax, 0x101c29cc
call fcn.1008c830
or esi, 0xffffffff
cmp edi, esi
je 0x1008ff7d
push edi
call sub.WS2_32.dll_closesocket
mov dword [ebp - 0x20], esi
mov eax, dword [ebp - 0x1c]
cmp eax, ebx
je 0x1008ff90
push eax
call fcn.10128243
add esp, 4
mov dword [ebp - 0x1c], ebx
push 0x2710
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 4], esi
cmp dword [ebp + 0x53c], 0x10
jb 0x1008ffb6
mov ecx, dword [ebp + 0x528]
push ecx
call fcn.10128f9e
add esp, 4
mov edi, dword [ebp - 0x24]
mov dword [ebp + 0x538], ebx
mov byte [ebp + 0x528], bl
mov dword [ebp + 0x53c], 0xf
xor ebx, ebx
jmp 0x1008fbb0
cmp dword [ebp - 0x18], ebx
je 0x1008fff0
lea ecx, [ebp + 0x748]
push ecx
push str._MWD__ServerIP:__s_
push ebx
call fcn.1006ed90
add esp, 0xc
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov edi, eax
mov dword [ebp - 0x20], edi
cmp edi, 0xffffffff
jne 0x1009001e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str._MWD__Failed_to_create_socket__WSAGetLastError___:__d
call fcn.10017540
add esp, 8
jmp 0x1008ff41
movzx eax, word [0x10191bfc]
mov edx, 2
push eax
mov word [ebp + 0x514], dx
call sub.WS2_32.dll_htons
lea ecx, [ebp + 0x748]
push ecx
mov word [ebp + 0x516], ax
call sub.WS2_32.dll_inet_addr
mov dword [ebp + 0x518], eax
cmp dword [ebp - 0x18], ebx
je 0x10090063
push str._MWD__connect__
push ebx
call fcn.1006ed90
add esp, 8
push 0x10
lea edx, [ebp + 0x514]
push edx
push edi
call sub.WS2_32.dll_connect
cmp eax, ebx
jge 0x10090096
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
lea eax, [ebp + 0x748]
push eax
push str._MWD__Failed_to_connect_to_MWPROXY_on_IP_:__s___WSAGetLastError___:__d
call fcn.10017540
add esp, 0xc
jmp 0x1008ff41
cmp dword [ebp - 0x18], ebx
je 0x100900b0
lea ecx, [ebp + 0x748]
push ecx
push str._MWD__Connected_to_MWPROXY_on_IP___s__successfully.
push ebx
call fcn.1006ed90
add esp, 0xc
lea edx, [ebp + 0x748]
push edx
push str._MWD__Connected_to_MWPROXY_on_IP___s__successfully.
call fcn.10017540
add esp, 8
push ebx
push 1
push ebx
push ebx
xor ecx, ecx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], ebx
call fcn.100673e0
mov dword [ebp - 0x2c], eax
cmp eax, ebx
je 0x1009023b
lea eax, [ebp - 0x34]
push eax
push ebx
push 0x10091fb0
call fcn.10127f7d
add esp, 0xc
cmp eax, 0xffffffff
jne 0x10090110
push str._MWD__Failed_to_start_HeartBeatThd..
call fcn.10017540
add esp, 4
jmp 0x1009021b
push ebx
push 1
lea ecx, [ebp - 0x14]
push ecx
push edi
mov byte [ebp - 0x14], bl
mov byte [ebp - 0x13], bl
mov byte [ebp - 4], 1
call sub.WS2_32.dll_recv
mov esi, eax
cmp esi, ebx
jg 0x100901b9
jge 0x1009019b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push str._MWD__BytesRecv:__d__WSAGetLastError___:__d.._Will_Retry_1...
call fcn.10017540
add esp, 0xc
push 0x64
mov byte [ebp - 0x13], bl
mov byte [ebp - 0x14], bl
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push 1
lea edx, [ebp - 0x14]
push edx
push edi
call sub.WS2_32.dll_recv
mov esi, eax
cmp esi, ebx
jge 0x1009019d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push str._MWD__BytesRecv:__d__WSAGetLastError___:__d.._Will_Retry_2...
call fcn.10017540
add esp, 0xc
push 0x64
mov byte [ebp - 0x13], bl
mov byte [ebp - 0x14], bl
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push 1
lea eax, [ebp - 0x14]
push eax
push edi
call sub.WS2_32.dll_recv
mov esi, eax
cmp esi, ebx
jg 0x100901b9
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push str._MWD__Number_of_bytes_received__d__WSAGetLastError___:__d.._Reconnecting
call fcn.10017540
add esp, 0xc
mov byte [ebp - 4], bl
jmp 0x1009021b
mov ecx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x24]
push ecx
push esi
lea edx, [ebp]
push edx
mov dl, byte [ebp - 0x14]
lea eax, [ebp + 0x540]
push eax
push edi
lea ecx, [ebp - 0x1c]
call fcn.10090250
add esp, 0x14
cmp eax, ebx
jne 0x100901f7
movsx ecx, byte [ebp - 0x14]
push esi
push ecx
push str._MWD__Failed_to_Process_Command__c_.._Err_:__s
call fcn.10017540
add esp, 0xc
mov byte [ebp - 4], bl
jmp 0x1009021b
mov dword [ebp - 4], ebx
jmp 0x10090110
mov edx, dword [ebp - 0x2c]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x2c]
push eax
call fcn.10082e10
jmp 0x1008ff3e
push str._MWD__Failed_to_create_Event_for_HeartBeatThd..
call fcn.10017540
add esp, 4
jmp 0x1008ff41