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

Disassembly:
sub esp, 0xa30
mov eax, dword [0x5cab48]
xor eax, esp
mov dword [esp + 0xa2c], eax
push ebx
mov ebx, dword [esp + 0xa3c]
push ebp
push esi
push edi
mov edi, dword [esp + 0xa44]
push 0xff
mov ebp, dword [edi]
lea eax, [esp + 0x13d]
push 0
push eax
mov dword [esp + 0x40], edi
mov dword [esp + 0x20], ebp
mov dword [esp + 0x1c], 0xffffffff
mov byte [esp + 0x144], 0
call sub.MSVCR110.dll_memset
mov esi, dword [ebp + 0x96c]
mov dword [esp + 0x38], 0
mov ecx, dword [ebp + 0x96c]
add esp, 0xc
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 1
test ecx, ecx
je 0x53864e
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x538410
sub ecx, edx
cmp ecx, 1
jbe 0x53864e
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x538427
sub ecx, edx
cmp ecx, 0x41
jae 0x53843c
mov ecx, 0x41
jmp 0x53844a
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x538441
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x5ca760]
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x53846b
mov eax, 0x1b
jmp 0x538b86
mov cl, byte [esi]
mov eax, dword [sym.imp.MSVCR110.dll_strchr]
cmp cl, 0x5b
jne 0x538494
push 0x5d
push esi
call eax
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x5385a3
lea eax, [esi + 1]
mov ecx, ebp
sub ecx, eax
push ecx
push eax
jmp 0x5384f7
cmp cl, 0x3a
jne 0x53849d
mov ebp, esi
jmp 0x53850a
push 0x3a
push esi
call eax
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x538591
lea eax, [esp + 0x38]
push eax
push esi
push 0x17
call fcn.00527af0
add esp, 0xc
cmp eax, 1
jne 0x5384f1
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x24], 0
mov dword [esp + 0x1c], 0
sub ecx, esi
lea ebx, [ebx]
mov al, byte [esi]
mov byte [ecx + esi], al
lea esi, [esi + 1]
test al, al
jne 0x5384e0
jmp 0x5385a3
mov eax, ebp
sub eax, esi
push eax
push esi
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.MSVCR110.dll_strncpy]
mov eax, dword [sym.imp.MSVCR110.dll_strchr]
add esp, 0xc
test ebp, ebp
je 0x5385a3
push 0x3a
push ebp
call eax
mov esi, eax
add esp, 8
test esi, esi
je 0x5385a3
mov ebp, dword [sym.imp.MSVCR110.dll_strtoul]
push 0xa
lea ecx, [esi + 1]
push 0
push ecx
call ebp
push eax
call fcn.0051a040
movzx eax, ax
push 0x2d
push esi
mov dword [esp + 0x34], eax
call dword [sym.imp.MSVCR110.dll_strchr]
add esp, 0x18
test eax, eax
je 0x538584
push 0xa
inc eax
push 0
push eax
call ebp
push eax
call fcn.0051a040
movzx edx, ax
mov eax, dword [esp + 0x2c]
add esp, 0x10
mov dword [esp + 0x24], edx
cmp ax, dx
jbe 0x5385a3
mov dword [esp + 0x24], 0
mov dword [esp + 0x1c], 0
jmp 0x5385a3
mov eax, dword [esp + 0x1c]
movzx eax, ax
mov dword [esp + 0x24], eax
jmp 0x5385a3
mov ecx, dword [esp + 0x18]
sub ecx, esi
mov al, byte [esi]
mov byte [ecx + esi], al
lea esi, [esi + 1]
test al, al
jne 0x538597
mov esi, dword [esp + 0x18]
cmp byte [esi], 0
je 0x5385f0
push 0x401
lea eax, [esp + 0x23c]
push eax
mov eax, dword [edi + 0x50]
push esi
push dword [edi + 0x8c]
push dword [eax + 0x18]
call fcn.0053fa50
add esp, 4
push eax
mov eax, dword [edi + 0x50]
push dword [eax + 4]
call fcn.00431d90
add esp, 0x18
sub eax, 0
je 0x53864a
dec eax
je 0x538b81
dec eax
je 0x538694
mov ebp, dword [esp + 0x14]
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x3c]
push eax
push dword [edi + 0x1b8]
mov dword [esp + 0x2c], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x538652
push 0x80
lea eax, [esp + 0xbc]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00504ec0
push eax
push str.getsockname___failed:__s
push ebp
call fcn.00517c40
push esi
call dword [0x5ca754]
add esp, 0x1c
jmp 0x538b81
mov eax, esi
jmp 0x53869b
xor esi, esi
jmp 0x5385f4
mov ax, word [esp + 0x38]
push 0x401
cmp ax, 0x17
je 0x538675
lea ecx, [esp + 0x23c]
push ecx
lea ecx, [esp + 0x44]
movzx eax, ax
push ecx
push eax
jmp 0x538684
lea eax, [esp + 0x23c]
push eax
lea eax, [esp + 0x48]
push eax
push 0x17
call fcn.0053fb10
add esp, 0x10
mov dword [esp + 0x28], 0
lea eax, [esp + 0x238]
lea ecx, [esp + 0x2c]
push ecx
push 0
push 0
push eax
push edi
mov dword [esp + 0x2c], eax
call fcn.0051ffa0
add esp, 0x14
cmp eax, 1
jne 0x5386c5
lea eax, [esp + 0x2c]
push eax
push edi
call fcn.0050e3f0
add esp, 8
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x538b65
mov ebp, dword [eax]
push eax
push dword [esp + 0x18]
call fcn.00520200
add esp, 8
test ebp, ebp
je 0x538b65
push esi
call dword [0x5ca754]
add esp, 4
mov dword [esp + 0x10], 0xffffffff
xor esi, esi
lea esp, [esp]
lea eax, [esp + 0x10]
push eax
push 0
push ebp
push edi
call fcn.00519040
add esp, 0x10
mov dword [esp + 0x30], eax
test eax, eax
je 0x53872a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, dword [ebp + 0x1c]
mov esi, eax
test ebp, ebp
jne 0x538700
jmp 0x53872e
test ebp, ebp
jne 0x538758
push 0x80
lea eax, [esp + 0xbc]
push eax
push esi
call fcn.00504ec0
push eax
push str.socket_failure:__s
push dword [esp + 0x28]
call fcn.00517c40
add esp, 0x18
jmp 0x538b81
push dword [ebp + 0x10]
lea eax, [esp + 0x3c]
push dword [ebp + 0x18]
push eax
call sub.MSVCR110.dll_memcpy
mov eax, dword [ebp + 0x10]
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
movzx esi, ax
add esp, 0xc
movzx ecx, cx
movzx eax, ax
mov dword [esp + 0x18], eax
cmp eax, ecx
jg 0x5388c4
mov eax, dword [sym.imp.WS2_32.dll_htons]
push esi
call eax
push dword [esp + 0x20]
mov word [esp + 0x3e], ax
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x5388c4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [esp + 0x28], 0
je 0x538839
cmp eax, 0x2741
jne 0x538839
push 0x80
lea eax, [esp + 0xbc]
push eax
push 0x2741
call fcn.00504ec0
mov esi, dword [esp + 0x20]
push eax
push dword [esp + 0x28]
push str.bind_port_hu__on_non_local_address_failed:__s_n
push esi
call fcn.00517d30
add esp, 0x1c
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x3c]
push eax
push dword [edi + 0x1b8]
mov dword [esp + 0x2c], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x538855
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
movzx esi, ax
mov dword [esp + 0x28], 0
movzx eax, si
movzx ecx, dx
jmp 0x538783
cmp eax, 0x2740
je 0x538845
cmp eax, 0xd
jne 0x53888c
mov edx, dword [esp + 0x24]
inc esi
movzx eax, si
movzx ecx, dx
jmp 0x538783
push 0x80
lea eax, [esp + 0xbc]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00504ec0
push eax
push str.getsockname___failed:__s
push esi
call fcn.00517c40
push dword [esp + 0x28]
push edi
call fcn.00518630
add esp, 0x20
jmp 0x538b81
push 0x80
lea ecx, [esp + 0xbc]
push ecx
push eax
call fcn.00504ec0
push eax
movzx eax, si
push eax
push str.bind_port_hu__failed:__s
push dword [esp + 0x2c]
call fcn.00517c40
push dword [esp + 0x2c]
push edi
call fcn.00518630
add esp, 0x24
jmp 0x538b81
cmp si, word [esp + 0x24]
jbe 0x5388e8
push str.bind___failed__we_ran_out_of_ports_
push dword [esp + 0x18]
call fcn.00517c40
push dword [esp + 0x18]
push edi
call fcn.00518630
jmp 0x538b7e
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x18]
mov dword [esp + 0x2c], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x538930
push 0x80
lea eax, [esp + 0xbc]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00504ec0
push eax
push str.getsockname___failed:__s
push dword [esp + 0x28]
jmp 0x538875
push 1
push dword [esp + 0x14]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x538968
push 0x80
lea eax, [esp + 0xbc]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00504ec0
push eax
push str.socket_failure:__s
push dword [esp + 0x28]
jmp 0x538875
push 0x100
lea eax, [esp + 0x13c]
push eax
push ebp
call fcn.0051ff50
mov eax, dword [edi + 0x2a4]
add esp, 0xc
test eax, 0x40000
jne 0x53899d
test eax, 0x400
je 0x53899d
or eax, 0x40000
mov dword [edi + 0x2a4], eax
cmp ebx, 2
je 0x5389f9
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [esp + 0x38]
lea ecx, [ecx]
test dword [edi + 0x2a4], 0x40000
jne 0x5389c0
test ebx, ebx
je 0x5389f3
cmp ebx, 1
jne 0x5389cb
cmp cx, 2
jne 0x5389f3
movzx eax, cx
sub eax, 2
je 0x5389d8
sub eax, 0x15
jne 0x5389f3
push dword [esp + 0x3a]
call esi
movzx ebp, ax
test ebx, ebx
je 0x538af2
cmp ebx, 1
je 0x538a4a
mov cx, word [esp + 0x38]
inc ebx
cmp ebx, 2
jne 0x5389b0
mov ebp, dword [esp + 0x30]
lea esi, [edi + 0x4c0]
mov dword [esi + 0x78], ebx
mov eax, dword [edi + 0x1bc]
cmp eax, 0xffffffff
je 0x538a25
push eax
push edi
call fcn.00518630
add esp, 8
mov dword [edi + 0x1bc], 0xffffffff
mov eax, dword [esp + 0x10]
mov dword [edi + 0x1bc], eax
mov dword [edi + 0x2a0], 1
mov dword [edi + 0x544], 0x1c
mov eax, ebp
jmp 0x538b86
lea edx, [esp + 0x63c]
lea esi, [esp + 0x138]
mov edi, 0x2c
lea ecx, [ecx]
mov cl, byte [esi]
test cl, cl
je 0x538a75
movzx eax, cl
cmp cl, 0x2e
cmove eax, edi
mov byte [edx], al
inc edx
inc esi
jne 0x538a60
movzx ecx, bp
movzx eax, cl
push eax
shr ecx, 8
push ecx
push str.__d__d
push 0x14
push edx
mov byte [edx], 0
call fcn.0051a980
mov edi, dword [esp + 0x48]
lea eax, [esp + 0x650]
push eax
push str.PORT
push 0x55c290
lea esi, [edi + 0x4c0]
push esi
call fcn.00545f50
mov ebp, eax
add esp, 0x24
test ebp, ebp
je 0x538a03
push ebp
call fcn.00504fb0
push eax
push str.Failure_sending_PORT_command:__s
push dword [esp + 0x20]
call fcn.00517c40
push dword [esp + 0x20]
push edi
call fcn.00518630
add esp, 0x18
mov dword [edi + 0x544], 0
mov eax, ebp
jmp 0x538b86
movzx eax, bp
push eax
lea eax, [esp + 0x13c]
push eax
xor eax, eax
cmp word [esp + 0x40], 2
lea esi, [edi + 0x4c0]
setne al
inc eax
push eax
push str.EPRT
push str._s__d_s_hu
push esi
call fcn.00545f50
mov ebp, eax
add esp, 0x18
test ebp, ebp
je 0x538a03
push ebp
call fcn.00504fb0
push eax
push str.Failure_sending_EPRT_command:__s
push dword [esp + 0x20]
call fcn.00517c40
push dword [esp + 0x20]
push edi
call fcn.00518630
mov dword [esi + 0x78], 1
add esp, 0x18
mov dword [edi + 0x544], 0
mov eax, ebp
jmp 0x538b86
push dword [esp + 0x18]
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push dword [esp + 0x1c]
call fcn.00517c40
push esi
call dword [0x5ca754]
add esp, 0x10
mov eax, 0x1e
mov ecx, dword [esp + 0xa3c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0055423a
add esp, 0xa30
ret