Function at 0x495720
Capabilities:
Get local ipv4 addresses
Get socket information
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x628
mov eax, dword [0x508040]
xor eax, esp
mov dword [esp + 0x624], eax
push ebx
push ebp
mov ebp, dword [esp + 0x634]
push esi
push edi
mov edi, dword [esp + 0x640]
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x10], eax
add eax, 0x3d0
push 0x2f
mov dword [esp + 0x30], eax
lea eax, [esp + 0xc0]
push 0
push eax
mov dword [esp + 0x44], ebp
mov dword [esp + 0x2c], 0xffffffff
call fcn.004b25e0
mov esi, dword [ebp + 0x538]
xor eax, eax
add esp, 0xc
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], eax
mov byte [esp + 0x17], 1
mov dword [esp + 0x18], eax
test esi, esi
je 0x49599a
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4957a4
sub ecx, edx
cmp ecx, 1
jbe 0x49599a
mov ecx, esi
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4957c0
sub ecx, edx
cmp ecx, 0x41
jae 0x4957d5
mov ecx, 0x41
jmp 0x4957e9
mov ecx, esi
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4957e0
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x508010]
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x495808
lea ebx, [eax + 0x1b]
jmp 0x495e55
mov al, byte [esi]
cmp al, 0x5b
jne 0x49582c
push 0x5d
push esi
call fcn.004b23d0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4958ee
lea ecx, [esi + 1]
sub eax, ecx
push eax
push ecx
jmp 0x495879
cmp al, 0x3a
jne 0x495834
mov ebx, esi
jmp 0x495885
push 0x3a
push esi
call fcn.004b23d0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4958db
lea eax, [esp + 0x3c]
push eax
push esi
push 0x17
call fcn.0049e940
add esp, 0xc
cmp eax, 1
jne 0x495873
mov ecx, dword [esp + 0x18]
sub ecx, esi
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [esi + ecx - 1], al
test al, al
jne 0x495864
jmp 0x4958ee
mov eax, ebx
sub eax, esi
push eax
push esi
push dword [esp + 0x20]
call fcn.004ba090
add esp, 0xc
push 0x3a
push ebx
call fcn.004b23d0
mov ebx, eax
add esp, 8
xor esi, esi
xor edx, edx
test ebx, ebx
je 0x4958f2
push 0xa
push edx
lea eax, [ebx + 1]
push eax
call fcn.004c0df9
push eax
call fcn.00475800
push 0x2d
push ebx
movzx esi, ax
call fcn.004b23d0
add esp, 0x18
test eax, eax
je 0x4958d7
push 0xa
inc eax
push 0
push eax
call fcn.004c0df9
push eax
call fcn.00475800
add esp, 0x10
movzx edx, ax
jmp 0x4958f2
mov edx, esi
jmp 0x4958f2
mov ecx, dword [esp + 0x18]
sub ecx, esi
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [esi + ecx - 1], al
test al, al
jne 0x4958e1
xor esi, esi
xor edx, edx
xor ecx, ecx
movzx eax, dx
cmp si, dx
cmovbe ecx, eax
movzx eax, si
movzx ebx, cx
xor ecx, ecx
cmp si, dx
cmovbe ecx, eax
mov eax, dword [esp + 0x18]
movzx esi, cx
cmp byte [eax], 0
je 0x49598e
push 0x401
lea ecx, [esp + 0x234]
push ecx
push eax
mov eax, dword [esp + 0x1c]
push dword [eax + 0x4ac]
mov eax, dword [eax + 0x40]
push dword [eax + 0x18]
call fcn.0049e500
add esp, 4
push eax
mov eax, dword [esp + 0x24]
mov eax, dword [eax + 0x40]
push dword [eax + 4]
call fcn.00448900
add esp, 0x18
sub eax, 0
je 0x495970
sub eax, 1
je 0x495e50
sub eax, 1
jne 0x49597a
lea eax, [esp + 0x230]
mov dword [esp + 0x30], eax
jmp 0x49597c
mov eax, dword [esp + 0x18]
mov dword [esp + 0x30], eax
jmp 0x49597c
xor eax, eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x24], ebx
test eax, eax
jne 0x495a3d
jmp 0x49599a
mov eax, esi
mov dword [esp + 0x28], eax
mov eax, ebx
mov dword [esp + 0x24], eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0x80
push eax
lea eax, [esp + 0x40]
push eax
mov eax, dword [esp + 0x18]
push dword [eax + 0x128]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x4959ed
push 0x100
lea eax, [esp + 0x134]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.0045e830
push eax
push str.getsockname___failed:__s
push ebp
call fcn.004727e0
add esp, 0x18
jmp 0x495e50
mov ax, word [esp + 0x3c]
cmp ax, 0x17
je 0x495a01
lea ecx, [esp + 0x40]
movzx eax, ax
jmp 0x495a0a
lea ecx, [esp + 0x44]
mov eax, 0x17
push 0x401
lea edx, [esp + 0x234]
movzx eax, ax
push edx
push ecx
push eax
call fcn.0049e5c0
add esp, 0x10
test eax, eax
je 0x495e50
lea eax, [esp + 0x230]
xor cl, cl
mov dword [esp + 0x30], eax
mov byte [esp + 0x17], cl
lea ecx, [esp + 0x34]
push ecx
push 0
push 0
push eax
push ebp
call fcn.0047c4b0
add esp, 0x14
cmp eax, 1
jne 0x495a63
lea eax, [esp + 0x34]
push eax
push ebp
call fcn.00468680
add esp, 8
mov eax, dword [esp + 0x34]
test eax, eax
je 0x495e3d
mov ebx, dword [eax]
push eax
push ebp
call fcn.0047c9b0
add esp, 8
test ebx, ebx
je 0x495e3d
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
nop dword [eax]
lea eax, [esp + 0x20]
push eax
push 0
push ebx
push ebp
call fcn.00474220
add esp, 0x10
test eax, eax
je 0x495ad5
call esi
mov ebx, dword [ebx + 0x1c]
test ebx, ebx
jne 0x495a90
push 0x100
lea ecx, [esp + 0x134]
push ecx
push eax
call fcn.0045e830
push eax
push str.socket_failure:__s
push ebp
call fcn.004727e0
add esp, 0x18
jmp 0x495e50
push dword [ebx + 0x10]
lea eax, [esp + 0x40]
push dword [ebx + 0x18]
push eax
call fcn.004b2880
mov eax, dword [ebx + 0x10]
add esp, 0xc
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x28]
movzx esi, ax
cmp ax, word [esp + 0x24]
ja 0x495e2d
mov eax, dword [sym.imp.WS2_32.dll_htons]
push esi
call eax
push dword [esp + 0x1c]
movzx eax, ax
mov word [esp + 0x42], ax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x28]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x495c1b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov cl, byte [esp + 0x17]
test cl, cl
je 0x495ba3
cmp eax, 0x2741
jne 0x495ba3
push 0x100
lea eax, [esp + 0x134]
push eax
push 0x2741
call fcn.0045e830
push eax
movzx eax, si
push eax
push str.bind_port_hu__on_non_local_address_failed:__s
push ebp
call fcn.004728b0
mov esi, dword [esp + 0x2c]
lea eax, [esp + 0x38]
add esp, 0x1c
mov dword [esp + 0x1c], 0x80
push eax
lea eax, [esp + 0x40]
push eax
push dword [esi + 0x128]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x495bbe
mov eax, dword [esp + 0x28]
xor cl, cl
movzx esi, ax
mov byte [esp + 0x17], cl
jmp 0x495b01
cmp eax, 0x2740
je 0x495baf
cmp eax, 0xd
jne 0x495bf0
inc esi
mov byte [esp + 0x17], cl
movzx eax, si
mov esi, eax
jmp 0x495af6
push 0x100
lea eax, [esp + 0x134]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.0045e830
push eax
push str.getsockname___failed:__s
push ebp
call fcn.004727e0
add esp, 0x18
mov ebx, 0x1e
jmp 0x495e59
push 0x100
lea ecx, [esp + 0x134]
push ecx
push eax
call fcn.0045e830
push eax
movzx eax, si
push eax
push str.bind_port_hu__failed:__s
push ebp
call fcn.004727e0
add esp, 0x1c
jmp 0x495e50
cmp si, word [esp + 0x24]
ja 0x495e2d
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0x80
push eax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x28]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x4959c0
push 1
push dword [esp + 0x24]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x495c87
push 0x100
lea eax, [esp + 0x134]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.0045e830
push eax
push str.socket_failure:__s
push ebp
call fcn.004727e0
add esp, 0x18
jmp 0x495e50
push 0x2f
lea eax, [esp + 0xc0]
push eax
push ebx
call fcn.0047c460
mov eax, dword [esp + 0x1c]
add esp, 0xc
cmp byte [eax + 0x20a], 0
jne 0x495cb7
cmp byte [eax + 0x204], 0
je 0x495cb7
mov byte [eax + 0x20a], 1
cmp edi, 2
je 0x495d11
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [esp + 0x3c]
cmp byte [eax + 0x20a], 0
jne 0x495cd4
test edi, edi
je 0x495d0b
cmp edi, 1
jne 0x495cdf
cmp cx, 2
jne 0x495d0b
movzx eax, cx
sub eax, 2
je 0x495cec
sub eax, 0x15
jne 0x495d07
push dword [esp + 0x3e]
call esi
movzx ebx, ax
test edi, edi
je 0x495ddb
cmp edi, 1
je 0x495d51
mov cx, word [esp + 0x3c]
mov eax, dword [esp + 0x10]
inc edi
cmp edi, 2
jne 0x495cc7
mov esi, dword [esp + 0x2c]
lea eax, [esp + 0x20]
mov dword [esi + 0x78], edi
mov esi, dword [esp + 0x10]
push eax
push 1
push esi
push ebp
call fcn.004739a0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x495e59
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x20], 0xffffffff
mov dword [eax + 0x454], 0x1c
jmp 0x495e66
lea edx, [esp + 0xec]
mov ebp, 0x2c
lea esi, [esp + 0xbc]
mov cl, byte [esi]
test cl, cl
je 0x495d7b
cmp cl, 0x2e
movzx eax, cl
cmove eax, ebp
mov byte [edx], al
inc edx
add esi, 1
jne 0x495d64
movzx ecx, bx
movzx eax, cl
push eax
shr ecx, 8
push ecx
push str.__d__d
push 0x14
push edx
mov byte [edx], 0
call fcn.00477780
mov esi, dword [esp + 0x40]
lea eax, [esp + 0x100]
mov ebp, dword [esp + 0x4c]
push eax
push str.PORT
push str._s__s
push esi
push ebp
call fcn.004a9ec0
mov ebx, eax
add esp, 0x28
test ebx, ebx
je 0x495d15
push ebx
call fcn.0045e9a0
push eax
push str.Failure_sending_PORT_command:__s
push ebp
call fcn.004727e0
add esp, 0x10
jmp 0x495e55
mov esi, dword [esp + 0x2c]
movzx eax, bx
push eax
lea eax, [esp + 0xc0]
push eax
xor eax, eax
cmp word [esp + 0x44], 2
setne al
inc eax
push eax
push str.EPRT
push str._s__d_s_hu
push esi
push ebp
call fcn.004a9ec0
mov ebx, eax
add esp, 0x1c
test ebx, ebx
je 0x495d15
push ebx
call fcn.0045e9a0
push eax
push str.Failure_sending_EPRT_command:__s
push ebp
call fcn.004727e0
add esp, 0x10
jmp 0x495e55
push str.bind___failed__we_ran_out_of_ports
push ebp
call fcn.004727e0
add esp, 8
jmp 0x495e50
mov eax, dword [esp + 0x30]
push eax
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push ebp
call fcn.004727e0
add esp, 0xc
mov ebx, 0x1e
mov esi, dword [esp + 0x10]
mov eax, dword [ebp + 0xc]
mov dword [eax + 0x454], 0
mov eax, dword [esp + 0x20]
cmp eax, 0xffffffff
je 0x495e7a
push eax
push esi
push ebp
call fcn.00473920
add esp, 0xc
push dword [esp + 0x18]
call dword [0x508004]
mov ecx, dword [esp + 0x638]
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004af2b0
add esp, 0x628
ret