Function at 0x513560
Capabilities:
Get local ipv4 addresses
Get socket information
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0xb8
push ebx
push ebp
push esi
push edi
xor edi, edi
mov esi, ecx
mov dword [esp + 0x1c], edi
mov eax, dword [esi + 4]
mov ebx, 1
xor ebp, ebp
cmp eax, edi
mov dword [esp + 0x34], edx
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x38], ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], edi
je 0x513648
cmp byte [eax], 0x2d
jne 0x513648
push 0x74
push eax
call fcn.00563730
add esp, 8
test eax, eax
je 0x5135c0
mov dword [esp + 0x38], edi
mov eax, dword [esi + 4]
push 0x6e
push eax
call fcn.00563730
add esp, 8
test eax, eax
mov ebx, 1
je 0x5135db
mov dword [esp + 0x30], ebx
mov ecx, dword [esi + 4]
push 0x62
push ecx
call fcn.00563730
add esp, 8
test eax, eax
je 0x5135f1
mov dword [esp + 0x18], ebx
mov edx, dword [esi + 4]
push 0x6b
push edx
call fcn.00563730
add esp, 8
test eax, eax
je 0x513607
mov dword [esp + 0x20], ebx
mov eax, dword [esi + 4]
push 0x64
push eax
call fcn.00563730
add esp, 8
test eax, eax
je 0x51361b
mov ebp, ebx
cmp ebp, edi
mov ebx, 2
je 0x513648
mov eax, dword [esi + 8]
cmp eax, edi
je 0x5136c5
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
je 0x5136ef
mov dword [esp + 0x14], ebx
mov ebx, 3
mov eax, dword [esi + ebx*4]
cmp eax, edi
je 0x5136c5
mov dword [esp + 0x28], ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x513656
sub eax, edx
cmp eax, 0x5a
jbe 0x513679
xor edx, edx
mov ecx, 0x1452
call fcn.0041c9e0
mov ecx, dword [esi + ebx*4]
push eax
jmp 0x513bbe
mov ecx, dword [esi + ebx*4 + 4]
inc ebx
mov dword [esp + 0x10], ebx
call fcn.004ed210
test eax, eax
je 0x5136a5
mov edx, dword [esi + ebx*4]
push edx
call fcn.00563a14
add esp, 4
cmp ax, di
mov dword [esp + 0x24], eax
jbe 0x5136ef
inc ebx
mov dword [esp + 0x10], ebx
mov eax, dword [esi + ebx*4]
cmp eax, edi
je 0x51370d
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x5136ef
mov eax, dword [esi + ebx*4 + 4]
inc ebx
cmp eax, edi
jne 0x5136dd
mov edx, dword [esi]
push edi
push edi
xor ecx, ecx
call fcn.00475f10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
push eax
call fcn.00563a14
add esp, 4
cmp ax, di
mov dword [esp + 0x2c], eax
ja 0x513708
mov edx, dword [esi]
push 3
push edi
xor ecx, ecx
call fcn.00475f10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
inc ebx
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x28]
mov ecx, dword [esi + ebx*4]
call fcn.00513240
mov ebp, eax
cmp ebp, edi
je 0x513778
cmp dword [ebp + 0x158], edi
jne 0x51373d
xor edx, edx
mov ecx, 0x1453
call fcn.0041c9e0
push eax
mov eax, dword [esi + ebx*4]
push eax
jmp 0x513bbf
mov ecx, dword [esp + 0x24]
cmp cx, di
je 0x513a4b
mov ax, word [ebp + 0xc8]
cmp ax, cx
je 0x513a4b
mov edx, dword [esp + 0x28]
movzx ecx, ax
mov eax, dword [esi + edx*4]
push ecx
push eax
xor edx, edx
mov ecx, 0x1451
call fcn.0041c9e0
push eax
jmp 0x513bc4
call fcn.00513010
mov ebp, eax
cmp ebp, edi
jne 0x51379c
mov edx, dword [esi]
push 2
push edi
xor ecx, ecx
call fcn.00475f10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
mov ecx, dword [esi + ebx*4]
mov edx, ebp
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x5137a1
mov eax, dword [esp + 0xd0]
add eax, 0x1510
lea edx, [ebp + 0x64]
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x5137c0
mov cx, word [esp + 0x24]
lea ebx, [ebp + 0xc8]
push edi
mov word [ebx], cx
mov dword [ebp + 0x14c], 2
call fcn.00563e36
mov edx, dword [esp + 0x24]
mov cx, word [esp + 0x30]
mov dword [ebp + 0x178], eax
mov dword [ebp + 0x17c], eax
mov dword [ebp + 0x180], eax
mov dword [ebp + 0x158], 1
mov dword [ebp + 0x15c], edx
mov eax, dword [esp + 0x20]
mov dword [ebp + 0x160], eax
mov eax, dword [esp + 0x18]
add esp, 4
cmp eax, edi
mov word [ebp + 0x164], cx
mov dword [ebp + 0x168], edi
mov word [ebp + 0x16c], di
je 0x513852
mov edx, eax
mov eax, dword [esi + edx*4]
push eax
lea ecx, [ebp + 0xca]
mov edx, 0x64
call fcn.0041e120
cmp word [esp + 0x24], di
mov ecx, dword [esp + 0xd0]
mov dword [ebp + 0x190], ecx
jne 0x513930
push 0x59c9f8
mov edx, 0x64
lea ecx, [esp + 0x68]
call fcn.0041e120
mov al, byte [ebp + 0xca]
test al, al
mov edx, dword [0x59c9f4]
lea edi, [ebp + 0xca]
mov dword [esp + 0x14], edx
je 0x5138b1
push edi
mov edx, 0x64
mov ecx, 0x59c9f8
call fcn.0041e120
mov dword [0x59c9f4], 2
mov dx, word [0x589910]
mov cx, word [0x58990c]
push 0
push 1
push ebx
call fcn.004fd380
mov dword [ebp + 0x18c], eax
lea eax, [esp + 0x64]
push eax
mov edx, 0x64
mov ecx, 0x59c9f8
call fcn.0041e120
mov ecx, dword [esp + 0x14]
mov dword [0x59c9f4], ecx
cmp dword [ebp + 0x18c], 0xffffffff
jne 0x5139de
mov ecx, ebp
call fcn.00513140
mov ecx, 0x1454
xor edx, edx
call fcn.0041c9e0
push eax
push 0x57b740
push 0x595d60
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xb8
ret 8
push edi
push 2
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [ebp + 0x18c], eax
jne 0x513954
mov ecx, ebp
call fcn.00513140
mov ecx, 0x1455
jmp 0x513906
push 0x59c9f8
mov edx, 0x64
lea ecx, [esp + 0x68]
call fcn.0041e120
mov al, byte [ebp + 0xca]
test al, al
mov edx, dword [0x59c9f4]
lea edi, [ebp + 0xca]
mov dword [esp + 0x14], edx
je 0x51399b
push edi
mov edx, 0x64
mov ecx, 0x59c9f8
call fcn.0041e120
mov dword [0x59c9f4], 2
mov dx, word [ebx]
mov ecx, dword [ebp + 0x18c]
call fcn.004fd2b0
mov ebx, eax
lea eax, [esp + 0x64]
push eax
mov edx, 0x64
mov ecx, 0x59c9f8
call fcn.0041e120
test ebx, ebx
mov ecx, dword [esp + 0x14]
mov dword [0x59c9f4], ecx
jne 0x5139de
mov ecx, ebp
call fcn.00513140
mov ecx, 0x1456
jmp 0x513906
mov edx, dword [0x5a1b00]
mov eax, dword [ebp + 0x18c]
push 0x23
push 0x8038
push edx
push eax
call dword [sym.imp.WSOCK32.dll_WSAAsyncSelect]
mov eax, dword [ebp + 0x18c]
cmp eax, 0xffffffff
je 0x513a4b
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x58]
push edx
push eax
mov dword [esp + 0x2c], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jne 0x513a4b
mov eax, dword [esp + 0x58]
push eax
call dword [sym.imp.WSOCK32.dll_inet_ntoa]
push eax
mov edx, 0x64
mov ecx, edi
call fcn.0041e120
mov ecx, dword [esp + 0x56]
push ecx
call dword [sym.imp.WSOCK32.dll_ntohs]
mov word [ebp + 0x12e], ax
mov eax, dword [esp + 0x18]
test eax, eax
mov ebx, dword [esp + 0x10]
je 0x513a78
mov eax, dword [esi + ebx*4]
test eax, eax
je 0x513a78
push eax
call fcn.00563a6c
add esp, 4
test eax, eax
mov dword [esp + 0x18], eax
jg 0x513a77
mov dword [esp + 0x18], 0
inc ebx
mov ecx, dword [esi + ebx*4]
test ecx, ecx
jne 0x513ac1
mov eax, dword [esp + 0x30]
test eax, eax
jne 0x513a94
mov eax, dword [ebp + 0x15c]
test eax, eax
jmp 0x513e0c
mov ebx, dword [esp + 0x34]
mov ax, word [0x574b0c]
mov edx, ebx
mov word [edx], ax
mov cl, byte [0x574b0e]
mov byte [edx + 2], cl
mov dword [esp + 0x10], ebx
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x513ab3
sub ebx, ecx
jmp 0x513b7b
mov eax, dword [esp + 0x38]
test eax, eax
je 0x513b15
cmp byte [ecx], 0x26
jne 0x513b15
mov edx, dword [esp + 0xcc]
call fcn.0041af50
test eax, eax
jne 0x513b05
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x513aef
mov ecx, ebp
call fcn.00513140
xor edx, edx
mov ecx, 0x1457
call fcn.0041c9e0
mov edx, dword [esi + ebx*4]
push eax
push edx
jmp 0x513bbf
mov ecx, dword [eax + 0xc]
mov edx, dword [eax]
mov ebx, dword [eax + 8]
add ecx, edx
mov dword [esp + 0x10], ecx
jmp 0x513b6d
mov edi, dword [esp + 0x34]
push esi
mov edx, edi
mov ecx, ebx
mov byte [edi], 0
call fcn.004ed300
mov eax, edi
mov dword [esp + 0x10], edi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x513b30
sub eax, edx
mov ebx, eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x513b6d
mov edi, dword [esp + 0x34]
cmp byte [ebx + edi - 1], 0xa
je 0x513b6d
dec edi
nop
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x513b50
mov ax, word [0x574b0c]
mov word [edi], ax
mov cl, byte [0x574b0e]
mov byte [edi + 2], cl
add ebx, 2
mov eax, dword [esp + 0x18]
test eax, eax
je 0x513b7b
cmp eax, ebx
jge 0x513b7b
mov ebx, eax
mov ecx, dword [ebp + 0x140]
test ecx, ecx
je 0x513c47
mov edx, dword [ebp + 0x144]
lea eax, [edx + ebx]
cmp eax, 0x4000
jle 0x513be1
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x513baa
mov ecx, ebp
call fcn.00513140
xor edx, edx
mov ecx, 0x1458
call fcn.0041c9e0
push eax
mov eax, dword [esp + 0x2c]
mov ecx, dword [esi + eax*4]
push ecx
push str.__sockudp:__s__s
push 0x595d60
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xb8
ret 8
add eax, 0xa
push eax
push ecx
call fcn.00564c59
add esp, 8
test eax, eax
jne 0x513c1d
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x513c03
mov ecx, ebp
call fcn.00513140
mov edx, dword [esi]
push 2
push 0
xor ecx, ecx
call fcn.00475f10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
mov edi, dword [ebp + 0x144]
mov esi, dword [esp + 0x10]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
add edi, eax
mov dword [ebp + 0x140], eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [ebp + 0x144], ebx
jmp 0x513ca4
lea eax, [ebx + 0xa]
push eax
call fcn.005635a3
add esp, 4
test eax, eax
mov dword [ebp + 0x140], eax
jne 0x513c88
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x513c6e
mov ecx, ebp
call fcn.00513140
mov edx, dword [esi]
push 2
push 0
xor ecx, ecx
call fcn.00475f10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
mov esi, dword [esp + 0x10]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0x144], ebx
mov edx, dword [esp + 0x1c]
xor ecx, ecx
mov dword [esp + 0x3c], ecx
lea eax, [esp + 0x1c]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x44], ecx
xor edi, edi
push eax
mov dword [esp + 0x54], edi
mov dword [esp + 0x4c], ecx
mov word [esp + 0x40], 2
mov dword [esp + 0x44], edx
call dword [sym.imp.WSOCK32.dll_htons]
mov ecx, dword [esp + 0x4c]
mov word [esp + 0x3e], ax
mov edx, dword [ecx]
mov dword [esp + 0x40], edx
mov eax, dword [ebp + 0x144]
cmp eax, 0x2000
jle 0x513cff
mov eax, 0x2000
mov edx, dword [ebp + 0x140]
push 0x10
lea ecx, [esp + 0x40]
push ecx
push edi
push eax
mov eax, dword [ebp + 0x18c]
push edx
push eax
call dword [sym.imp.WSOCK32.dll_sendto]
mov esi, eax
cmp esi, 0xffffffff
jne 0x513d6e
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x513e15
mov edx, dword [ebp + 0x18c]
movzx ecx, ax
shl ecx, 0x10
or ecx, 2
push ecx
push edx
mov dword [ebp + 0x184], eax
mov eax, dword [0x5a1b00]
push 0x8038
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 8
push edi
call fcn.00563e36
add esp, 4
cmp esi, edi
mov dword [ebp + 0x17c], eax
jle 0x513dc7
mov edx, dword [ebp + 0x170]
mov eax, dword [ebp + 0x144]
add edx, esi
cmp esi, eax
mov dword [ebp + 0x170], edx
jge 0x513dc7
sub eax, esi
mov dword [ebp + 0x144], eax
mov ebp, dword [ebp + 0x140]
push eax
lea ecx, [esi + ebp]
push ecx
push ebp
call fcn.005641d0
add esp, 0xc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 8
mov edx, dword [ebp + 0x140]
push edx
call fcn.005635b5
mov dword [ebp + 0x140], edi
mov dword [ebp + 0x144], edi
mov eax, dword [0x59ca60]
add esp, 4
cmp eax, edi
je 0x513e06
cmp dword [ebp + 0x15c], edi
je 0x513e0e
mov eax, dword [0x5a1b00]
push ebp
push edi
push 0x803a
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
cmp dword [ebp + 0x15c], edi
jne 0x513e15
mov ecx, ebp
call fcn.00513140
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 8