Function at 0x487770
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
add esp, 0xfffffb84
push ebp
push ebx
push esi
push edi
push 0x3e8
push 2
push 6
call fcn.0047b9e0
sub esp, 0xfffffff4
mov ebp, eax
mov dword [esp + 0x14], ebp
cmp ebp, 0xffffffff
jne 0x4877a6
pop edi
pop esi
pop ebx
pop ebp
sub esp, 0xfffffb84
mov eax, 0x3f
ret
push ebp
call fcn.00487680
sub esp, 0xfffffffc
push 1
call fcn.00487670
push eax
call fcn.00488d70
add esp, 8
cmp eax, 0xffffffff
jne 0x4877d4
pop edi
mov eax, 0x41
pop esi
pop ebx
pop ebp
add esp, 0x47c
ret
xor ebx, ebx
mov eax, dword [0x4eb400]
cmp eax, ebx
je 0x4878aa
push 0x4fd530
call fcn.00482fc0
push 0xe
call fcn.004a8093
mov esi, eax
sub esp, 0xfffffff8
cmp esi, ebx
jne 0x487822
push ebx
call fcn.00487670
push eax
call fcn.00488d70
add esp, 8
push ebp
call sub.WS2_32.dll_closesocket
mov eax, 0x40
pop edi
pop esi
pop ebx
pop ebp
sub esp, 0xfffffb84
ret
xor eax, eax
mov ecx, esi
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov word [ecx + 0xc], ax
mov word [esi], 6
call fcn.00487690
push eax
call fcn.0047bb10
lea ecx, [esi + 6]
mov word [esi + 0xc], ax
lea edx, [esi + 2]
mov dword [edx], ebx
or eax, 0xffffffff
push esi
mov dword [ecx], eax
push 0x4fd530
mov word [ecx + 4], ax
call fcn.00482fd0
mov edx, dword [0x4fd530]
mov dword [0x4fda28], 0x4fd530
push edx
call fcn.00482f90
sub esp, 0xfffffff0
or eax, eax
je 0x4878a4
push ebx
call fcn.00487670
push eax
call fcn.00488d70
add esp, 8
push ebp
call sub.WS2_32.dll_closesocket
pop edi
mov eax, 0x41
pop esi
pop ebx
pop ebp
add esp, 0x47c
ret
mov dword [0x4eb400], ebx
push ebx
call fcn.004beed4
add esp, 4
test eax, eax
jge 0x4878c7
pop edi
pop esi
pop ebx
mov eax, 0x4a
pop ebp
sub esp, 0xfffffb84
ret
push ebx
call fcn.004beed4
add esp, 4
and eax, 0x80001fff
jns 0x4878de
dec eax
or eax, 0xffffe000
inc eax
mov ecx, 0x64
mov dword [esp + 0x150], eax
xor eax, eax
mov esi, dword [esp + 0x494]
mov dword [esp + 0x158], 0xffffffff
lea edi, [esp + 0x15c]
mov dword [esp + 0x14c], 0x294
mov dword [esp + 0x154], ebx
rep stosd dword es:[edi], eax
or ecx, 0xffffffff
mov edi, esi
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x190
ja 0x48793f
lea edi, [esp + 0x15c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [0x4fd530]
mov dword [esp + 0x18], ebx
push esi
call fcn.00482f90
sub esp, 0xfffffffc
test eax, eax
jne 0x487a14
push esi
call fcn.00482fa0
add esp, 4
push 0x10
push eax
call fcn.00487670
push eax
call sub.WS2_32.dll_connect
push ebx
lea ecx, [esp + 0x150]
push 0x1a0
push ecx
call fcn.00487670
push eax
call sub.WS2_32.dll_send
cmp eax, 0x1a0
jne 0x487997
inc dword [esp + 0x18]
jmp 0x4879f5
push 0x10
mov dword [esp + 0x14], 0xe
call fcn.004a8093
mov edi, eax
sub esp, 0xfffffffc
cmp edi, ebx
je 0x487a39
mov word [edi], 6
call fcn.00487690
push eax
call fcn.0047bb10
add esp, 4
lea edx, [esp + 0x10]
mov word [edi + 0xc], ax
mov dword [esp + 0x10], 0x10
push edx
push edi
call fcn.00487670
push eax
call sub.WS2_32.dll_getsockname
or eax, eax
push edi
jne 0x487a5e
push 0x4fd6d8
call fcn.00482fd0
sub esp, 0xfffffff8
push esi
call fcn.00482fb0
mov esi, eax
push esi
call fcn.00482f90
add esp, 8
or eax, eax
je 0x48795a
cmp dword [esp + 0x18], ebx
jne 0x487a7c
push ebx
call fcn.00487670
push eax
call fcn.00488d70
add esp, 8
push ebp
call sub.WS2_32.dll_closesocket
pop edi
pop esi
mov eax, 0x3e
pop ebx
pop ebp
add esp, 0x47c
ret
push ebx
call fcn.00487670
push eax
call fcn.00488d70
add esp, 8
push ebp
call sub.WS2_32.dll_closesocket
mov eax, 1
pop edi
pop esi
pop ebx
pop ebp
sub esp, 0xfffffb84
ret
call fcn.004a7a46
sub esp, 0xfffffffc
push ebp
call sub.WS2_32.dll_closesocket
pop edi
mov eax, 1
pop esi
pop ebx
pop ebp
add esp, 0x47c
ret
push ebx
call fcn.004beed4
mov ebp, dword [esp + 0x4a8]
mov edi, dword [esp + 0x4a0]
mov ebx, dword [esp + 0x4a4]
mov ecx, dword [esp + 0x49c]
mov esi, dword [esp + 0x4ac]
add esp, 4
add eax, ecx
mov dword [esp + 0x10], eax
push 0
mov dword [esp + 0x28], 0
call fcn.004beed4
mov edx, dword [esp + 0x14]
sub esp, 0xfffffffc
sub edx, eax
mov dword [esp + 0x20], edx
jns 0x487ad4
mov dword [esp + 0x20], 0
mov dword [esp + 0x48], 0
call fcn.00487670
mov ecx, dword [esp + 0x48]
mov dword [esp + ecx*4 + 0x4c], eax
mov edx, dword [esp + 0x48]
lea eax, [esp + 0x20]
lea ecx, [esp + 0x48]
inc edx
push eax
push 0
push 0
push ecx
mov dword [esp + 0x58], edx
call fcn.00487670
inc eax
push eax
call fcn.0047ba10
sub esp, 0xffffffec
cmp eax, 0xffffffff
je 0x487ba3
or eax, eax
je 0x487bfc
push 0
lea edx, [esp + 0x2f0]
push 0x1a0
push edx
mov dword [esp + 0x28], 0xe
call fcn.00487670
push eax
call sub.WS2_32.dll_recv
cmp eax, 0x1a0
jne 0x487aae
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38]
push eax
push ecx
mov dword [esp + 0x24], 0x10
call fcn.00487670
push eax
call sub.WS2_32.dll_getpeername
lea edx, [esp + 0x28]
push edx
call fcn.0047b430
push esi
push ebp
push ebx
push edi
push eax
lea eax, [esp + 0x314]
push eax
call fcn.00487c30
add esp, 0x1c
cmp edi, 4
jne 0x487b95
cmp word [esi + 0x20], 0
ja 0x487bfc
cmp eax, 0x40
je 0x487bb4
or eax, eax
je 0x487bfc
jmp 0x487aae
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x487bce
jmp 0x487aae
mov ecx, dword [esp + 0x14]
push ecx
call sub.WS2_32.dll_closesocket
pop edi
mov eax, 0x40
pop esi
pop ebx
pop ebp
add esp, 0x47c
ret
push 0
call fcn.00487670
push eax
call fcn.00488d70
mov edx, dword [esp + 0x1c]
sub esp, 0xfffffff8
push edx
call sub.WS2_32.dll_closesocket
mov ecx, dword [ebx]
xor eax, eax
pop edi
pop esi
test ecx, ecx
pop ebx
pop ebp
setle al
add esp, 0x47c
ret
push 0
call fcn.00487670
push eax
call fcn.00488d70
mov eax, dword [esp + 0x1c]
sub esp, 0xfffffff8
push eax
call sub.WS2_32.dll_closesocket
pop edi
xor eax, eax
pop esi
pop ebx
pop ebp
add esp, 0x47c
ret