Function at 0x4eb190
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
mov eax, 0x51a8
call fcn.004a2fa0
mov eax, dword [0x58f2d4]
push esi
mov esi, ecx
mov dword [esp + 0x51a8], eax
mov eax, dword [esi + 4]
test eax, eax
je 0x4eb5c7
mov eax, dword [esi + 8]
test eax, eax
je 0x4eb5c7
push edi
mov edi, dword [esp + 0x51b4]
test edi, edi
jl 0x4eb5ab
cmp edi, dword [esi + 0x10]
jge 0x4eb5ab
call fcn.004eae40
lea eax, [esp + 0x1c]
push eax
push 0x101
call dword [sym.imp.ws2_32.dll_WSAStartup]
test eax, eax
je 0x4eb210
call dword [sym.imp.ws2_32.dll_WSACleanup]
pop edi
xor eax, eax
pop esi
mov ecx, dword [esp + 0x51a4]
call fcn.004a5518
add esp, 0x51a8
ret 8
push ebx
push ebp
push 0
push 1
mov ebp, 2
push ebp
call dword [sym.imp.ws2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x10], ebx
je 0x4eb4e6
mov eax, dword [esi + 0x14]
test eax, eax
je 0x4eb310
mov ecx, dword [esi + 0x1c]
test ecx, ecx
je 0x4eb310
push eax
call dword [sym.imp.ws2_32.dll_inet_addr]
cmp eax, 0xffffffff
jne 0x4eb26c
mov ecx, dword [esi + 0x14]
push ecx
call dword [sym.imp.ws2_32.dll_gethostbyname]
test eax, eax
je 0x4eb4df
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov eax, dword [eax]
xor ecx, ecx
mov cx, word [esi + 0x18]
mov word [esp + 0x14], bp
mov dword [esp + 0x18], eax
push ecx
call dword [sym.imp.ws2_32.dll_htons]
mov word [esp + 0x16], ax
push 0x10
lea eax, [esp + 0x18]
xor edx, edx
push eax
mov dword [esp + 0x24], edx
push ebx
mov dword [esp + 0x2c], edx
call dword [sym.imp.ws2_32.dll_connect]
cmp eax, 0xffffffff
je 0x4eb4df
mov ecx, dword [esi + 4]
mov eax, dword [ecx + edi*4]
mov edx, dword [esi + 8]
mov ecx, dword [edx + edi*4]
mov ebp, dword [sym.imp.user32.dll_wsprintfA]
push eax
push ecx
push eax
lea edx, [esp + 0x1c0]
push 0x570230
push edx
call ebp
mov eax, dword [esi + 0x20]
add esp, 0x14
test eax, eax
je 0x4eb3a3
mov ecx, dword [esi + 0x24]
test ecx, ecx
je 0x4eb3a3
mov dl, byte [esp + 0x1b4]
test dl, dl
lea eax, [esp + 0x1b4]
je 0x4eb2ff
mov dl, byte [eax + 1]
inc eax
test dl, dl
jne 0x4eb2f7
push ecx
push 0x570210
push eax
call ebp
add esp, 0xc
jmp 0x4eb3a3
mov eax, dword [esi + 4]
mov ecx, dword [eax + edi*4]
push ecx
call dword [sym.imp.ws2_32.dll_inet_addr]
cmp eax, 0xffffffff
jne 0x4eb33e
mov edx, dword [esi + 4]
mov eax, dword [edx + edi*4]
push eax
call dword [sym.imp.ws2_32.dll_gethostbyname]
test eax, eax
je 0x4eb4df
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0xc]
xor ecx, ecx
mov word [esp + 0x14], bp
mov cx, word [eax + edi*2]
push ecx
call dword [sym.imp.ws2_32.dll_htons]
mov word [esp + 0x16], ax
push 0x10
lea eax, [esp + 0x18]
xor edx, edx
push eax
mov dword [esp + 0x24], edx
push ebx
mov dword [esp + 0x2c], edx
call dword [sym.imp.ws2_32.dll_connect]
cmp eax, 0xffffffff
je 0x4eb4df
mov ecx, dword [esi + 4]
mov edx, dword [ecx + edi*4]
mov eax, dword [esi + 8]
mov ecx, dword [eax + edi*4]
mov ebp, dword [sym.imp.user32.dll_wsprintfA]
push edx
push ecx
lea edx, [esp + 0x1bc]
push 0x5701f0
push edx
call ebp
add esp, 0x10
mov al, byte [esp + 0x1b4]
test al, al
lea edi, [esp + 0x1b4]
je 0x4eb3bd
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4eb3b5
mov eax, dword [esp + 0x51c0]
push eax
call dword [sym.imp.kernel32.dll_lstrlen]
push eax
push 0x5701d8
push edi
call ebp
lea eax, [esp + 0x1c0]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4eb3e1
mov edi, dword [sym.imp.ws2_32.dll_send]
push 0
sub eax, edx
push eax
lea ecx, [esp + 0x1bc]
push ecx
push ebx
call edi
cmp eax, 0xffffffff
je 0x4eb4d6
mov edx, dword [esp + 0x51c0]
mov eax, edx
lea ebp, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4eb413
push 0
sub eax, ebp
push eax
push edx
push ebx
call edi
cmp eax, 0xffffffff
je 0x4eb4d6
mov ebp, dword [sym.imp.ws2_32.dll_recv]
push 0
push 0x3fff
lea edx, [esp + 0x11bc]
push edx
push ebx
call ebp
mov edi, eax
cmp edi, 0xffffffff
je 0x4eb4d6
nop
test edi, edi
je 0x4eb507
mov eax, dword [esi + 0xfc8]
mov byte [esp + edi + 0x11b4], 0
mov eax, dword [esi + eax*4 + 0x28]
test eax, eax
je 0x4eb477
push eax
call fcn.004fb3dc
add esp, 4
inc edi
push edi
call fcn.004fb3b1
mov ecx, dword [esi + 0xfc8]
mov dword [esi + ecx*4 + 0x28], eax
mov eax, dword [esi + 0xfc8]
mov ecx, dword [esi + eax*4 + 0x28]
add esp, 4
lea edx, [esp + 0x11b4]
push edx
push ecx
call dword [sym.imp.kernel32.dll_lstrcpy]
mov eax, dword [esi + 0xfc8]
inc eax
cdq
mov ecx, 0x3e8
idiv ecx
push 0
push 0x3fff
mov dword [esi + 0xfc8], edx
lea edx, [esp + 0x11bc]
push edx
push ebx
call ebp
mov edi, eax
cmp edi, 0xffffffff
jne 0x4eb450
push 2
push ebx
call dword [sym.imp.ws2_32.dll_shutdown]
push ebx
call dword [sym.imp.ws2_32.dll_closesocket]
call dword [sym.imp.ws2_32.dll_WSACleanup]
xor eax, eax
pop ebp
pop ebx
pop edi
pop esi
mov ecx, dword [esp + 0x51a4]
call fcn.004a5518
add esp, 0x51a8
ret 8
mov eax, dword [esi + 0x28]
lea edi, [esi + 0x28]
xor ebp, ebp
xor ebx, ebx
test eax, eax
je 0x4eb53b
cmp ebx, 0x3e8
jge 0x4eb533
mov eax, dword [edi]
push eax
call dword [sym.imp.kernel32.dll_lstrlen]
add ebp, eax
mov eax, dword [edi + 4]
add edi, 4
inc ebx
test eax, eax
jne 0x4eb515
cmp ebp, 0x2710
jge 0x4eb57f
inc ebp
push ebp
call fcn.004fb3b1
mov dword [esi + 0xfcc], eax
lea edi, [esi + 0x28]
mov byte [eax], 0
mov eax, dword [edi]
add esp, 4
xor ebx, ebx
test eax, eax
je 0x4eb57f
mov ebp, dword [sym.imp.kernel32.dll_lstrcat]
nop
cmp ebx, 0x3e8
jge 0x4eb57f
mov ecx, dword [edi]
mov edx, dword [esi + 0xfcc]
push ecx
push edx
call ebp
mov eax, dword [edi + 4]
add edi, 4
inc ebx
test eax, eax
jne 0x4eb560
mov edi, dword [esp + 0x10]
push 2
push edi
call dword [sym.imp.ws2_32.dll_shutdown]
push edi
call dword [sym.imp.ws2_32.dll_closesocket]
call dword [sym.imp.ws2_32.dll_WSACleanup]
mov ecx, dword [esi + 0xfcc]
xor eax, eax
test ecx, ecx
setne al
jmp 0x4eb4ee
pop edi
mov eax, 0xfffffffd
pop esi
mov ecx, dword [esp + 0x51a4]
call fcn.004a5518
add esp, 0x51a8
ret 8
mov ecx, dword [esp + 0x51a8]
mov eax, 0xfffffffe
pop esi
call fcn.004a5518
add esp, 0x51a8
ret 8