Function at 0x51f230
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9a8
mov eax, dword [0x57c06c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x104]
push esi
push edi
mov edi, dword [ebp + 0xc]
mov esi, dword [ebx]
push 0x100
push 0
push eax
mov dword [ebp - 0x99c], ebx
mov dword [ebp - 0x990], esi
call fcn.004e5200
mov ecx, dword [ebp - 0x990]
xor eax, eax
mov esi, dword [esi + 0x354]
add esp, 0xc
mov dword [ebp - 0x9a8], 0
mov dword [ebp - 0x998], 0
mov ecx, dword [ecx + 0x354]
mov dword [ebp - 0x994], 0
mov dword [ebp - 0x98c], eax
test ecx, ecx
je 0x51f496
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x51f2b3
sub ecx, edx
cmp ecx, 1
jbe 0x51f496
mov ecx, esi
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x51f2d0
sub ecx, edx
cmp ecx, 0x16
jae 0x51f2e5
mov ecx, 0x16
jmp 0x51f2f9
mov ecx, esi
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x51f2f0
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x57c9e0]
add esp, 8
mov dword [ebp - 0x98c], eax
test eax, eax
jne 0x51f328
pop edi
pop esi
mov eax, 0x1b
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
cmp byte [esi], 0x3a
je 0x51f35f
push 0x3a
push esi
call fcn.004e46d0
add esp, 8
mov dword [ebp - 0x9a4], eax
test eax, eax
je 0x51f3d3
sub eax, esi
push eax
mov eax, dword [ebp - 0x98c]
push esi
push eax
call fcn.0052b360
mov esi, dword [ebp - 0x9a4]
add esp, 0xc
test esi, esi
je 0x51f3ed
push 0x3a
push esi
call fcn.004e46d0
mov esi, eax
add esp, 8
test esi, esi
je 0x51f3ed
push 0xa
lea eax, [esi + 1]
push 0
push eax
call fcn.004fa15b
push eax
call fcn.00525ab0
movzx eax, ax
push 0x2d
push esi
mov dword [ebp - 0x998], eax
call fcn.004e46d0
add esp, 0x18
test eax, eax
je 0x51f3c2
push 0xa
inc eax
push 0
push eax
call fcn.004fa15b
push eax
call fcn.00525ab0
movzx ecx, ax
add esp, 0x10
mov dword [ebp - 0x994], ecx
jmp 0x51f3ed
mov eax, dword [ebp - 0x998]
movzx ecx, ax
mov dword [ebp - 0x994], ecx
jmp 0x51f3ed
mov ecx, dword [ebp - 0x98c]
sub ecx, esi
nop dword [eax + eax]
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [ecx + esi - 1], al
test al, al
jne 0x51f3e0
mov esi, dword [ebp - 0x994]
xor ecx, ecx
cmp word [ebp - 0x998], si
movzx eax, si
cmovbe ecx, eax
mov eax, dword [ebp - 0x998]
movzx edx, cx
xor ecx, ecx
cmp word [ebp - 0x998], si
mov esi, dword [ebp - 0x98c]
movzx eax, ax
cmovbe ecx, eax
mov dword [ebp - 0x994], edx
movzx eax, cx
cmp byte [esi], 0
mov dword [ebp - 0x9a4], eax
je 0x51f482
push 0x401
lea eax, [ebp - 0x508]
push eax
mov eax, dword [ebx + 0x38]
push esi
push dword [eax + 4]
call fcn.0041c440
add esp, 0x10
lea ecx, [ebp - 0x508]
test eax, eax
mov eax, dword [ebp - 0x9a4]
movzx edx, ax
mov eax, dword [ebp - 0x994]
cmove ecx, esi
movzx eax, ax
mov dword [ebp - 0x998], edx
mov dword [ebp - 0x994], eax
test ecx, ecx
jne 0x51f521
jmp 0x51f498
movzx eax, ax
mov dword [ebp - 0x998], eax
movzx eax, dx
mov dword [ebp - 0x994], eax
jmp 0x51f498
xor esi, esi
lea eax, [ebp - 0x9a0]
mov dword [ebp - 0x9a0], 0x80
push eax
lea eax, [ebp - 0x988]
push eax
push dword [ebx + 0xc8]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x51f4f8
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebx
call fcn.005143f0
push eax
push str.getsockname___failed:__s
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 0x14
test esi, esi
je 0x51f6fc
push esi
call dword [0x57c9d4]
add esp, 4
jmp 0x51f6fc
push 0x401
lea eax, [ebp - 0x508]
push eax
lea eax, [ebp - 0x984]
push eax
movzx eax, word [ebp - 0x988]
push eax
call fcn.00514320
add esp, 0x10
lea ecx, [ebp - 0x508]
lea eax, [ebp - 0x9a8]
push eax
push 0
push ecx
push ebx
call fcn.0050f460
add esp, 0x10
cmp eax, 1
jne 0x51f549
lea eax, [ebp - 0x9a8]
push eax
push ebx
call fcn.00513fe0
add esp, 8
mov eax, dword [ebp - 0x9a8]
test eax, eax
je 0x51f566
mov esi, dword [eax]
push eax
push dword [ebp - 0x990]
call fcn.0050f5f0
add esp, 8
jmp 0x51f568
xor esi, esi
mov eax, dword [ebp - 0x98c]
test eax, eax
je 0x51f57c
push eax
call dword [0x57c9d4]
add esp, 4
test esi, esi
jne 0x51f598
push str.Curl_resolv_failed__we_can_not_recover_
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 8
jmp 0x51f6fc
cmp dword [esi + 8], 0
jne 0x51f5a4
mov eax, dword [ebx + 0x70]
mov dword [esi + 8], eax
push dword [esi + 0xc]
push dword [esi + 8]
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x98c], eax
cmp eax, 0xffffffff
jne 0x51f5eb
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x51f598
push eax
push ebx
call fcn.005143f0
push eax
push str.socket_failure:__s
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 0x14
jmp 0x51f6fc
push dword [esi + 0x10]
lea eax, [ebp - 0x988]
push dword [esi + 0x18]
push eax
call fcn.004e4c80
mov eax, dword [esi + 0x10]
add esp, 0xc
mov dword [ebp - 0x9a0], eax
mov eax, dword [ebp - 0x998]
movzx ebx, ax
cmp ax, word [ebp - 0x994]
ja 0x51f6dd
nop
cmp word [ebp - 0x988], 2
jne 0x51f638
push ebx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x986], ax
push dword [ebp - 0x9a0]
lea eax, [ebp - 0x988]
push eax
push dword [ebp - 0x98c]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x51f75b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2741
jne 0x51f6c3
push eax
push dword [ebp - 0x99c]
call fcn.005143f0
push eax
movzx eax, bx
push eax
push str.bind_port_hu__failed:__s
push dword [ebp - 0x990]
call fcn.0050ff00
mov ebx, dword [ebp - 0x99c]
lea eax, [ebp - 0x9a0]
add esp, 0x18
mov dword [ebp - 0x9a0], 0x80
push eax
lea eax, [ebp - 0x988]
push eax
push dword [ebx + 0xc8]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x51f712
mov eax, dword [ebp - 0x998]
movzx ebx, ax
jmp 0x51f6d0
cmp eax, 0x2740
je 0x51f6cf
cmp eax, 0xd
jne 0x51f735
inc ebx
cmp bx, word [ebp - 0x994]
jbe 0x51f620
push str.bind___failed__we_ran_out_of_ports_
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 8
push dword [ebp - 0x98c]
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebx
call fcn.005143f0
push eax
push str.getsockname___failed:__s
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 0x14
jmp 0x51f6f0
push eax
push dword [ebp - 0x99c]
call fcn.005143f0
push eax
movzx eax, bx
push eax
push str.bind_port_hu__failed:__s
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 0x18
jmp 0x51f6f0
cmp bx, word [ebp - 0x994]
ja 0x51f6dd
mov ebx, dword [ebp - 0x98c]
lea eax, [ebp - 0x9a0]
push eax
lea eax, [ebp - 0x988]
mov dword [ebp - 0x9a0], 0x80
push eax
push ebx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x51f7bd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [ebp - 0x99c]
call fcn.005143f0
push eax
push str.getsockname___failed:__s
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 0x14
push ebx
jmp 0x51f6f6
push 1
push ebx
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x51f7f6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [ebp - 0x99c]
call fcn.005143f0
push eax
push str.socket_failure:__s
push dword [ebp - 0x990]
call fcn.0050ff00
add esp, 0x14
push ebx
jmp 0x51f6f6
push 0x100
lea eax, [ebp - 0x104]
push eax
push esi
call fcn.0050f430
mov ebx, dword [ebp - 0x99c]
add esp, 0xc
cmp edi, 2
je 0x51f86e
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [ebp - 0x988]
cmp dword [ebx + 0x174], 0
jne 0x51f830
test edi, edi
je 0x51f868
cmp edi, 1
jne 0x51f83b
cmp cx, 2
jne 0x51f868
movzx eax, cx
sub eax, 2
jne 0x51f868
push dword [ebp - 0x986]
call esi
movzx eax, ax
mov dword [ebp - 0x9a4], eax
test edi, edi
je 0x51f94d
cmp edi, 1
je 0x51f8bc
mov cx, word [ebp - 0x988]
inc edi
cmp edi, 2
jne 0x51f823
xor esi, esi
mov dword [ebx + 0x3a4], edi
mov eax, dword [ebx + 0xcc]
cmp eax, 0xffffffff
je 0x51f888
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x98c]
push 0x1c
mov dword [ebx + 0xcc], eax
push ebx
mov dword [ebx + 0x154], 1
call fcn.00520450
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x908]
mov ebx, 0x2c
lea esi, [ebp - 0x104]
mov eax, edx
sub esi, eax
mov cl, byte [esi + edx]
test cl, cl
je 0x51f8eb
cmp cl, 0x2e
movzx eax, cl
cmove eax, ebx
mov byte [edx], al
inc edx
lea eax, [esi + edx]
test eax, eax
jne 0x51f8d1
mov eax, dword [ebp - 0x9a4]
movzx ecx, ax
movzx eax, cl
push eax
shr ecx, 8
push ecx
push str.__d__d
push 0x14
push edx
mov byte [edx], 0
call fcn.00511910
mov ebx, dword [ebp - 0x99c]
lea eax, [ebp - 0x908]
push eax
push str.PORT
push str._s__s
lea eax, [ebx + 0x340]
push eax
call fcn.00526f10
mov esi, eax
add esp, 0x24
test esi, esi
je 0x51f870
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
movzx eax, ax
push eax
lea eax, [ebp - 0x104]
push eax
xor eax, eax
cmp word [ebp - 0x988], 2
setne al
inc eax
push eax
push str.EPRT
lea eax, [ebx + 0x340]
push str._s__d_s_hu
push eax
call fcn.00526f10
mov esi, eax
add esp, 0x18
test esi, esi
je 0x51f870
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004e24d7
mov esp, ebp
pop ebp
ret