Function at 0x405270
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration
Terminate process

Disassembly:
sub esp, 0xc
push ebp
push esi
push edi
push dword [esp + 0x28]
lea eax, [esp + 0x14]
push eax
push 1
xor ebp, ebp
push ecx
mov dword [esp + 0x1c], edx
or edi, 0xffffffff
mov dword [esp + 0x24], ebp
xor esi, esi
call dword [sym.imp.php5.dll_php_network_getaddresses]
add esp, 0x10
test eax, eax
jne 0x4052a7
or eax, edi
pop edi
pop esi
pop ebp
add esp, 0xc
ret
push ebx
mov ebx, dword [esp + 0x14]
cmp dword [ebx], esi
je 0x40549e
test esi, esi
je 0x4052c4
push esi
call dword [sym.imp.MSVCR110.dll_free]
add esp, 4
xor esi, esi
mov eax, dword [ebx]
push 0
movzx eax, word [eax]
push 1
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x405401
mov ebp, dword [ebx]
movzx eax, word [ebp]
sub eax, 2
je 0x40535f
sub eax, 0x15
je 0x405309
mov eax, dword [esp + 0x28]
push edi
mov dword [eax], 0
call dword [sym.imp.WS2_32.dll_closesocket]
mov ebp, dword [esp + 0x18]
jmp 0x405401
push 0x1c
call dword [sym.imp.MSVCR110.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
je 0x40540f
movq xmm0, qword [ebp]
movq qword [esi], xmm0
movq xmm0, qword [ebp + 8]
movq qword [esi + 8], xmm0
movq xmm0, qword [ebp + 0x10]
movq qword [esi + 0x10], xmm0
mov eax, dword [ebp + 0x18]
mov dword [esi + 0x18], eax
mov eax, dword [esp + 0x10]
movzx eax, word [eax]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esi + 2], ax
mov eax, dword [esp + 0x28]
mov dword [eax], 0x1c
jmp 0x4053a3
push 0x10
call dword [sym.imp.MSVCR110.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
je 0x40540f
movq xmm0, qword [ebp]
mov eax, dword [esp + 0x10]
movq qword [esi], xmm0
movzx eax, word [eax]
movq xmm0, qword [ebp + 8]
push eax
movq qword [esi + 8], xmm0
call dword [sym.imp.WS2_32.dll_htons]
mov word [esi + 2], ax
mov eax, dword [esp + 0x28]
mov dword [eax], 0x10
push 4
lea eax, [esp + 0x1c]
push eax
push 4
push 0xffff
push edi
mov dword [esp + 0x2c], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
mov eax, dword [esp + 0x28]
push dword [eax]
push esi
push edi
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x40542f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
mov dword [esp + 0x18], ebp
cmp ebp, 0x2726
je 0x40548c
cmp ebp, 0x2740
je 0x40548c
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
or edi, 0xffffffff
add ebx, 4
cmp dword [ebx], 0
jne 0x4052b4
jmp 0x40546f
push str.Out_of_memory_n
call dword [sym.imp.MSVCR110.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR110.dll_fprintf]
add esp, 8
push 1
call dword [sym.imp.MSVCR110.dll_exit]
movzx ecx, word [esi]
mov ebx, dword [esp + 0x10]
mov eax, dword [esp + 0x24]
xor ebp, ebp
mov dword [eax], ecx
cmp dword [ebx], ebp
jne 0x40546f
push dword [esp + 0x28]
push esi
push edi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x405484
movzx eax, word [esi]
sub eax, 2
je 0x40545f
sub eax, 0x15
jne 0x40546f
movzx eax, word [esi + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
mov dword [ebx], eax
cmp edi, 0xffffffff
je 0x40548c
push accept
push edi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x40548c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
test esi, esi
je 0x40549a
push esi
call dword [sym.imp.MSVCR110.dll_free]
add esp, 4
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x4054ac
push ebx
call dword [sym.imp.php5.dll_php_network_freeaddresses]
add esp, 4
test ebp, ebp
je 0x4054de
test edi, edi
js 0x4054bb
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ebx, dword [esp + 0x2c]
test ebx, ebx
je 0x4054d3
push 0
push 0
push ebp
call dword [sym.imp.php5.dll_php_socket_strerror]
add esp, 0xc
mov dword [ebx], eax
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret
pop ebx
mov eax, edi
pop edi
pop esi
pop ebp
add esp, 0xc
ret