Function at 0x403ec7
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push rbp
mov rbp, rsp
push rsi
push rbx
sub rsp, 0x40
mov qword [rbp + 0x10], rcx
mov eax, edx
mov qword [rbp + 0x20], r8
mov edx, r9d
mov word [rbp + 0x18], ax
mov word [rbp + 0x28], dx
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
mov ecx, 0
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
movzx eax, word [0x0040b0d8]
test ax, ax
je 0x403f30
mov r8d, 0x11
mov edx, 2
mov ecx, 2
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov dword [0x0040ba84], eax
jmp 0x403f4f
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov dword [0x0040ba84], eax
mov eax, dword [0x0040ba84]
test eax, eax
jns 0x403f65
lea rcx, [0x004097cf]
call fcn.004035db
mov eax, dword [0x0040ba84]
test eax, eax
jne 0x403f82
mov eax, dword [0x0040ba84]
mov ecx, eax
call sub.msvcrt.dll__dup
mov dword [0x0040ba84], eax
mov rdx, qword [0x0040bbb0]
mov eax, dword [0x0040ba84]
cdqe
mov dword [rsp + 0x20], 8
mov r9, rdx
mov r8d, 4
mov edx, 0xffff
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_setsockopt]
call rax
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x403fc6
lea rcx, [0x004097e0]
call fcn.004034eb
mov rax, qword [0x0040b098]
mov word [rax], 2
mov rax, qword [0x0040b0a0]
mov word [rax], 2
cmp qword [rbp + 0x20], 0
je 0x404002
mov rax, qword [0x0040b098]
lea rcx, [rax + 4]
mov rax, qword [rbp + 0x20]
mov r8d, 4
mov rdx, rax
call sub.msvcrt.dll_memcpy
cmp word [rbp + 0x28], 0
je 0x404023
mov rbx, qword [0x0040b098]
movzx eax, word [rbp + 0x28]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_htons]
call rax
mov word [rbx + 2], ax
mov ebx, 0
cmp qword [rbp + 0x20], 0
jne 0x40403a
cmp word [rbp + 0x28], 0
je 0x4040e5
movzx eax, word [rbp + 0x28]
mov dword [rbp - 0x18], eax
mov dword [rbp - 0x14], 4
jmp 0x4040d5
mov rax, qword [0x0040b098]
mov rdx, rax
mov eax, dword [0x0040ba84]
cdqe
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_bind]
call rax
mov ebx, eax
test ebx, ebx
je 0x4040e1
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
cmp eax, 0x2740
jne 0x4040e4
movzx esi, word [rbp + 0x28]
mov rax, qword [0x0040b098]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov r8d, esi
mov rdx, rax
lea rcx, [0x004097f8]
call fcn.004034eb
mov ecx, 1
mov rax, qword [sym.imp.msvcrt.dll__sleep]
call rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
sub dword [rbp - 0x14], 1
cmp dword [rbp - 0x14], 0
jg 0x40404d
jmp 0x4040e5
nop
jmp 0x4040e5
nop
test ebx, ebx
je 0x404114
movzx ebx, word [rbp + 0x28]
mov rax, qword [0x0040b098]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov r8d, ebx
mov rdx, rax
lea rcx, [0x0040980d]
call fcn.004035db
movzx eax, word [0x0040b0d0]
test ax, ax
je 0x40412b
mov eax, dword [0x0040ba84]
jmp 0x404257
mov rax, qword [0x0040b0a0]
add rax, 4
mov r8d, 4
mov rdx, qword [rbp + 0x10]
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rbx, qword [0x0040b0a0]
movzx eax, word [rbp + 0x18]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_htons]
call rax
mov word [rbx + 2], ax
mov eax, dword [0x0040b078]
test eax, eax
je 0x404178
lea rcx, [0x00409828]
call fcn.004034eb
mov eax, dword [0x0040b0dc]
mov edx, eax
mov ecx, 1
call fcn.004036fc
call fcn.00407380
mov rdx, rax
lea rcx, [0x0040baa0]
call sub.msvcrt.dll__setjmp
test eax, eax
jne 0x4041ca
mov rax, qword [0x0040b0a0]
mov rdx, rax
mov eax, dword [0x0040ba84]
cdqe
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_connect]
call rax
mov ebx, eax
jmp 0x4041dd
mov ebx, 0xffffffff
mov ecx, 0x274c
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
mov edx, 0
mov ecx, 0
call fcn.004036fc
test ebx, ebx
jne 0x4041f8
mov eax, dword [0x0040ba84]
jmp 0x404257
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov rbx, rax
mov rax, qword [sym.imp.WSOCK32.dll_WSAGetLastError]
call rax
mov dword [rbx], eax
mov eax, dword [0x0040ba84]
cdqe
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
mov eax, dword [0x0040ba84]
cdqe
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
mov eax, 0xffffffff
add rsp, 0x40
pop rbx
pop rsi
leave
ret