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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa44
mov eax, dword [0x5c1334]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
lea eax, [ebp - 0x108]
push 0x100
push 0
push eax
mov esi, dword [edi]
mov ebx, edx
mov dword [ebp - 0xa44], edi
mov dword [ebp - 0xa2c], esi
call sub.VCRUNTIME140.dll_memset
mov esi, dword [esi + 0x3ec]
xor eax, eax
add esp, 0xc
mov dword [ebp - 0xa24], 0
mov dword [ebp - 0xa30], 0
mov dword [ebp - 0xa34], 0
mov dword [ebp - 0xa40], 1
mov dword [ebp - 0xa28], eax
test esi, esi
je 0x4ba96f
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4ba7e1
sub ecx, edx
cmp ecx, 1
jbe 0x4ba96f
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4ba7f8
sub ecx, edx
cmp ecx, 0x16
jae 0x4ba80d
mov ecx, 0x16
jmp 0x4ba81b
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4ba812
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x5c1c84]
add esp, 8
mov dword [ebp - 0xa28], eax
test eax, eax
jne 0x4ba84a
mov eax, 0x1b
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
cmp byte [esi], 0x3a
mov eax, dword [sym.imp.VCRUNTIME140.dll_strchr]
je 0x4ba88b
push 0x3a
push esi
call eax
add esp, 8
mov dword [ebp - 0xa3c], eax
test eax, eax
je 0x4ba8f2
mov ecx, eax
mov eax, dword [ebp - 0xa28]
sub ecx, esi
push ecx
push esi
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
mov esi, dword [ebp - 0xa3c]
add esp, 0xc
mov eax, dword [sym.imp.VCRUNTIME140.dll_strchr]
test esi, esi
je 0x4ba90d
push 0x3a
push esi
call eax
mov esi, eax
add esp, 8
test esi, esi
je 0x4ba90d
push 0xa
lea ecx, [esi + 1]
push 0
push ecx
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtoul]
add esp, 0xc
movzx eax, ax
mov dword [ebp - 0xa30], eax
push 0x2d
push esi
call dword [sym.imp.VCRUNTIME140.dll_strchr]
add esp, 8
test eax, eax
je 0x4ba8e1
push 0xa
inc eax
push 0
push eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtoul]
movzx ecx, ax
add esp, 0xc
mov dword [ebp - 0xa34], ecx
jmp 0x4ba90d
mov eax, dword [ebp - 0xa30]
movzx ecx, ax
mov dword [ebp - 0xa34], ecx
jmp 0x4ba90d
mov ecx, dword [ebp - 0xa28]
sub ecx, esi
nop word [eax + eax]
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [esi + ecx - 1], al
test al, al
jne 0x4ba900
mov esi, dword [ebp - 0xa34]
xor ecx, ecx
cmp word [ebp - 0xa30], si
movzx eax, si
cmovbe ecx, eax
mov eax, dword [ebp - 0xa30]
movzx edx, cx
xor ecx, ecx
cmp word [ebp - 0xa30], si
mov esi, dword [ebp - 0xa28]
movzx eax, ax
cmovbe ecx, eax
movzx ecx, cx
cmp byte [esi], 0
je 0x4ba95d
mov dword [ebp - 0xa30], ecx
mov eax, esi
mov ecx, edx
mov dword [ebp - 0xa34], ecx
jmp 0x4ba9f9
mov eax, ecx
mov dword [ebp - 0xa30], eax
mov eax, edx
mov dword [ebp - 0xa34], eax
jmp 0x4ba971
xor esi, esi
lea eax, [ebp - 0xa38]
mov dword [ebp - 0xa38], 0x80
push eax
lea eax, [ebp - 0x990]
push eax
push dword [edi + 0x154]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x4ba9ca
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, edi
call fcn.00490350
push eax
push str.getsockname___failed:__s
push dword [ebp - 0xa2c]
call fcn.00494100
add esp, 0xc
test esi, esi
je 0x4baf99
push esi
jmp 0x4baf90
movzx ecx, word [ebp - 0x990]
lea eax, [ebp - 0x910]
push 0x401
push eax
lea edx, [ebp - 0x98c]
call fcn.004ade60
add esp, 8
lea eax, [ebp - 0x910]
xor ecx, ecx
mov dword [ebp - 0xa40], ecx
lea ecx, [ebp - 0xa24]
mov dword [ebp - 0xa3c], eax
push ecx
push 0
mov edx, eax
mov ecx, edi
call fcn.004971f0
add esp, 8
cmp eax, 1
jne 0x4baa26
lea edx, [ebp - 0xa24]
mov ecx, edi
call fcn.004a1140
mov edx, dword [ebp - 0xa24]
test edx, edx
je 0x4baf6c
mov ecx, dword [ebp - 0xa2c]
mov esi, dword [edx]
call fcn.00497480
test esi, esi
je 0x4baf6c
mov eax, dword [ebp - 0xa28]
test eax, eax
je 0x4baa60
push eax
call dword [0x5c1c7c]
add esp, 4
nop dword [eax]
mov eax, dword [esi + 4]
mov dword [ebp - 0xa20], eax
mov eax, dword [edi + 0x8c]
cmp eax, 2
mov dword [ebp - 0xa1c], eax
mov eax, 0x11
je 0x4baa82
mov eax, dword [esi + 0xc]
mov dword [ebp - 0xa18], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0xa14], eax
cmp eax, 0x80
jbe 0x4baaa7
mov dword [ebp - 0xa14], 0x80
mov eax, 0x80
push eax
push dword [esi + 0x18]
lea eax, [ebp - 0xa10]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [edi]
add esp, 0xc
mov eax, dword [ecx + 0x1f8]
test eax, eax
je 0x4baadc
lea edx, [ebp - 0xa20]
push edx
push 0
push dword [ecx + 0x1fc]
call eax
add esp, 0xc
jmp 0x4baaf4
push dword [ebp - 0xa18]
push dword [ebp - 0xa1c]
push dword [ebp - 0xa20]
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0xa24], eax
cmp eax, 0xffffffff
jne 0x4bab32
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x4baa60
mov edx, eax
mov ecx, edi
call fcn.00490350
push eax
push str.socket_failure:__s
push dword [ebp - 0xa2c]
call fcn.00494100
add esp, 0xc
jmp 0x4baf99
push dword [esi + 0x10]
lea eax, [ebp - 0x990]
push dword [esi + 0x18]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esi + 0x10]
add esp, 0xc
mov ecx, dword [ebp - 0xa30]
mov dword [ebp - 0xa38], eax
movzx eax, cx
mov dword [ebp - 0xa28], eax
cmp cx, word [ebp - 0xa34]
ja 0x4bac47
nop dword [eax]
cmp word [ebp - 0x990], 2
jne 0x4bab88
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x98e], ax
push dword [ebp - 0xa38]
lea eax, [ebp - 0x990]
push eax
push dword [ebp - 0xa24]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x4bacda
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [ebp - 0xa40], 0
je 0x4bac21
cmp eax, 0x2741
jne 0x4bac21
mov edx, eax
mov ecx, edi
call fcn.00490350
push eax
mov eax, dword [ebp - 0xa28]
movzx eax, ax
push eax
push str.bind_port_hu__on_non_local_address_failed:__s_n
push dword [ebp - 0xa2c]
call fcn.00494040
add esp, 0x10
mov dword [ebp - 0xa38], 0x80
lea eax, [ebp - 0xa38]
push eax
lea eax, [ebp - 0x990]
push eax
push dword [edi + 0x154]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x4bac6c
mov eax, dword [ebp - 0xa30]
xor ecx, ecx
movzx eax, ax
mov dword [ebp - 0xa40], ecx
jmp 0x4bac34
cmp eax, 0x2740
je 0x4bac2d
cmp eax, 0xd
jne 0x4baca1
mov eax, dword [ebp - 0xa28]
inc eax
mov dword [ebp - 0xa28], eax
cmp ax, word [ebp - 0xa34]
jbe 0x4bab70
push str.bind___failed__we_ran_out_of_ports_
push dword [ebp - 0xa2c]
call fcn.00494100
mov edx, dword [ebp - 0xa24]
add esp, 8
mov ecx, edi
call fcn.00496410
jmp 0x4baf99
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, edi
call fcn.00490350
push eax
push str.getsockname___failed:__s
push dword [ebp - 0xa2c]
call fcn.00494100
mov edx, dword [ebp - 0xa24]
add esp, 0xc
mov ecx, edi
call fcn.00496410
jmp 0x4baf99
mov edx, eax
mov ecx, edi
call fcn.00490350
push eax
mov eax, dword [ebp - 0xa28]
movzx eax, ax
push eax
push str.bind_port_hu__failed:__s
push dword [ebp - 0xa2c]
call fcn.00494100
mov edx, dword [ebp - 0xa24]
add esp, 0x10
mov ecx, edi
call fcn.00496410
jmp 0x4baf99
mov eax, dword [ebp - 0xa28]
cmp ax, word [ebp - 0xa34]
ja 0x4bac47
lea eax, [ebp - 0xa38]
mov dword [ebp - 0xa38], 0x80
push eax
lea eax, [ebp - 0x990]
push eax
push dword [ebp - 0xa24]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x4bac6c
push 1
push dword [ebp - 0xa24]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x4bad45
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, edi
call fcn.00490350
push eax
push str.socket_failure:__s
jmp 0x4bac81
mov eax, dword [esi + 4]
sub eax, 2
jne 0x4bad6c
mov edx, dword [esi + 0x18]
lea eax, [ebp - 0x108]
push 0x100
push eax
add edx, 4
mov ecx, 2
call fcn.004ade60
add esp, 8
cmp ebx, 2
je 0x4badcb
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [ebp - 0x990]
nop
cmp dword [edi + 0x290], 0
jne 0x4bad8d
test ebx, ebx
je 0x4badc5
cmp ebx, 1
jne 0x4bad98
cmp cx, 2
jne 0x4badc5
movzx eax, cx
sub eax, 2
jne 0x4badc5
push dword [ebp - 0x98e]
call esi
movzx eax, ax
mov dword [ebp - 0xa3c], eax
test ebx, ebx
je 0x4baee0
cmp ebx, 1
je 0x4bae18
mov cx, word [ebp - 0x990]
inc ebx
cmp ebx, 2
jne 0x4bad80
xor esi, esi
mov dword [edi + 0x538], ebx
mov edx, dword [edi + 0x158]
cmp edx, 0xffffffff
je 0x4bade5
mov ecx, edi
call fcn.00496410
mov eax, dword [ebp - 0xa24]
mov dword [edi + 0x158], eax
mov eax, esi
mov dword [edi + 0x274], 1
mov dword [edi + 0x544], 0x1c
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x508]
mov edi, 0x2c
lea esi, [ebp - 0x108]
nop dword [eax]
mov cl, byte [esi]
test cl, cl
je 0x4bae47
cmp cl, 0x2e
movzx eax, cl
cmove eax, edi
mov byte [edx], al
inc edx
add esi, 1
jne 0x4bae30
mov eax, dword [ebp - 0xa3c]
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.004a4150
mov edi, dword [ebp - 0xa44]
lea eax, [ebp - 0x508]
add esp, 0x14
push eax
push str.PORT
lea eax, [edi + 0x4d0]
push 0x59c928
push eax
call fcn.004cf140
mov esi, eax
add esp, 0x10
test esi, esi
je 0x4badcd
mov ecx, esi
call fcn.0048fbe0
push eax
push str.Failure_sending_PORT_command:__s
push dword [ebp - 0xa2c]
call fcn.00494100
mov edx, dword [ebp - 0xa24]
add esp, 0xc
mov ecx, edi
call fcn.00496410
mov dword [edi + 0x544], 0
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
movzx eax, ax
push eax
lea eax, [ebp - 0x108]
push eax
xor eax, eax
cmp word [ebp - 0x990], 2
setne al
inc eax
push eax
push str.EPRT
lea eax, [edi + 0x4d0]
push str._s__d_s_hu
push eax
call fcn.004cf140
mov esi, eax
add esp, 0x18
test esi, esi
je 0x4badcd
mov ecx, esi
call fcn.0048fbe0
push eax
push str.Failure_sending_EPRT_command:__s
push dword [ebp - 0xa2c]
call fcn.00494100
mov edx, dword [ebp - 0xa24]
add esp, 0xc
mov ecx, edi
call fcn.00496410
mov dword [edi + 0x538], 1
mov eax, esi
mov dword [edi + 0x544], 0
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
push dword [ebp - 0xa3c]
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push dword [ebp - 0xa2c]
call fcn.00494100
mov eax, dword [ebp - 0xa28]
add esp, 0xc
test eax, eax
je 0x4baf99
push eax
call dword [0x5c1c7c]
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, 0x1e
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00528802
mov esp, ebp
pop ebp
ret