Function at 0x4228d0
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x134
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
cmp dword [edi + 0x18], ebx
push 1
pop esi
mov word [ebp - 0x18], bx
mov word [ebp - 0x16], bx
mov dword [ebp - 0x1c], esi
jne 0x422b8e
cmp dword [ebp + 0x14], esi
je 0x42291c
cmp dword [ebp + 0x14], 2
je 0x42291c
push dword [ebp + 0x14]
push str.Invalid_direction__d_n
add edi, 0x44
push edi
call sub.MSVCRT.dll_sprintf
add esp, 0xc
jmp 0x422b8e
cmp dword [ebp + 0x10], 0x41
je 0x422932
cmp dword [ebp + 0x10], 0x49
je 0x422932
push dword [ebp + 0x10]
push str.Invalid_mode__c_n
jmp 0x42290b
cmp dword [edi + 0x24], esi
push 0x10
pop eax
mov dword [ebp - 0x14], eax
jne 0x4229ec
push eax
lea eax, [ebp - 0x10]
push ebx
push eax
call sub.MSVCRT.dll_memset
push edi
push 0x32
push str.PASV
mov word [ebp - 0x10], 2
call fcn.004227b4
add esp, 0x18
test eax, eax
je 0x422b8e
lea eax, [edi + 0x44]
push 0x28
push eax
call sub.MSVCRT.dll_strchr
cmp eax, ebx
pop ecx
pop ecx
je 0x422b8e
lea ecx, [ebp - 0x30]
push ecx
lea ecx, [ebp - 0x34]
push ecx
lea ecx, [ebp - 0x20]
push ecx
lea ecx, [ebp - 0x24]
push ecx
lea ecx, [ebp - 0x28]
push ecx
lea ecx, [ebp - 0x2c]
push ecx
inc eax
push str._u__u__u__u__u__u
push eax
call sub.MSVCRT.dll_sscanf
mov al, byte [ebp - 0x2c]
mov byte [ebp - 0xc], al
mov al, byte [ebp - 0x28]
mov byte [ebp - 0xb], al
mov al, byte [ebp - 0x24]
mov byte [ebp - 0xa], al
mov al, byte [ebp - 0x20]
mov byte [ebp - 9], al
mov al, byte [ebp - 0x34]
mov byte [ebp - 0xe], al
mov al, byte [ebp - 0x30]
add esp, 0x20
mov byte [ebp - 0xd], al
push 6
push esi
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
jne 0x422a11
push str.socket
call sub.MSVCRT.dll_perror
jmp 0x422b8d
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [edi + 8]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x4229ca
push str.getsockname
call sub.MSVCRT.dll_perror
pop ecx
jmp 0x422ad9
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea ecx, [ebp - 0x1c]
push ecx
push 4
mov ebx, 0xffff
push ebx
push eax
call esi
cmp eax, 0xffffffff
jne 0x422a37
push str.setsockopt
jmp 0x422b42
push 4
lea eax, [ebp - 0x18]
push eax
push 0x80
push ebx
push dword [ebp + 8]
call esi
or esi, 0xffffffff
cmp eax, esi
jne 0x422a61
push str.setsockopt
call sub.MSVCRT.dll_perror
pop ecx
mov ebx, esi
jmp 0x422b4b
cmp dword [edi + 0x24], 1
jne 0x422a85
push 0x10
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, esi
jne 0x422b27
push str.connect
jmp 0x422a54
push 0x10
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 8]
xor ebx, ebx
mov word [ebp - 0xe], bx
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, esi
jne 0x422aae
push str.bind
call sub.MSVCRT.dll_perror
pop ecx
jmp 0x422b4b
push 1
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jge 0x422ac4
push str.listen
jmp 0x422aa3
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x422ae0
xor eax, eax
jmp 0x422bde
movzx eax, byte [ebp - 0xd]
push eax
movzx eax, byte [ebp - 0xe]
push eax
movzx eax, byte [ebp - 9]
push eax
movzx eax, byte [ebp - 0xa]
push eax
movzx eax, byte [ebp - 0xb]
push eax
movzx eax, byte [ebp - 0xc]
push eax
lea eax, [ebp - 0x134]
push str.PORT__d__d__d__d__d__d
push eax
call sub.MSVCRT.dll_sprintf
push edi
lea eax, [ebp - 0x134]
push 0x32
push eax
call fcn.004227b4
add esp, 0x2c
test eax, eax
jne 0x422b29
jmp 0x422b4b
xor ebx, ebx
push 0x144
push 1
call sub.MSVCRT.dll_calloc
mov esi, eax
cmp esi, ebx
pop ecx
pop ecx
jne 0x422b5b
push str.calloc
call sub.MSVCRT.dll_perror
pop ecx
or ebx, 0xffffffff
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, ebx
jmp 0x422bde
cmp dword [ebp + 0x10], 0x41
jne 0x422b93
push 0x2000
call sub.MSVCRT.dll_malloc
cmp eax, ebx
pop ecx
mov dword [esi + 0x14], eax
jne 0x422b93
push str.calloc
call sub.MSVCRT.dll_perror
pop ecx
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
push esi
call sub.MSVCRT.dll_free
pop ecx
or eax, 0xffffffff
jmp 0x422bde
mov eax, dword [ebp + 8]
mov dword [esi + 8], eax
mov eax, dword [ebp + 0x14]
mov dword [esi + 0x18], eax
mov eax, dword [edi + 0x28]
mov dword [esi + 0x28], eax
mov eax, dword [edi + 0x2c]
mov dword [esi + 0x2c], eax
cmp dword [esi + 0x28], ebx
mov eax, dword [edi + 0x34]
mov dword [esi + 0x34], eax
mov dword [esi + 0x38], ebx
mov dword [esi + 0x40], ebx
mov eax, dword [edi + 0x3c]
mov dword [esi + 0x3c], eax
jne 0x422bd0
cmp dword [esi + 0x2c], ebx
jne 0x422bd0
cmp eax, ebx
jne 0x422bd0
mov dword [esi + 0x30], ebx
jmp 0x422bd6
mov eax, dword [edi + 0x30]
mov dword [esi + 0x30], eax
mov eax, dword [ebp + 0xc]
push 1
mov dword [eax], esi
pop eax
pop edi
pop esi
pop ebx
leave
ret