Function at 0x100406eb8
Capabilities:
Connect socket
Convert ip address from string
Get local ipv4 addresses
Get socket information

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x40
mov r13, rcx
mov r14, rdx
mov rbx, r8
mov r8d, 0x98
lea rdx, global___FUNCTION__.207
lea rcx, str.src.it_iroffer_dccchat.c
call dbg.updatecontext_f
mov dword [rsp + 0x20], 0x9a
lea r9, str.src.it_iroffer_dccchat.c
lea r8, global___FUNCTION__.207
mov edx, 7
mov rcx, rbx
call dbg.getpart2
mov r12, rax
mov dword [rsp + 0x20], 0x9b
lea r9, str.src.it_iroffer_dccchat.c
lea r8, global___FUNCTION__.207
mov edx, 8
mov rcx, rbx
call dbg.getpart2
mov rbp, rax
test r12, r12
je 0x100406f3e
test rax, rax
jne 0x100406f58
mov rcx, r12
call dbg.mydelete2
mov rcx, rbp
call dbg.mydelete2
mov eax, 1
jmp 0x10040746e
mov ecx, 2
lea rdi, [0x10044f0fa]
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta dl
setb al
cmp dl, al
jne 0x100407032
mov rcx, r12
call dbg.mydelete2
mov rcx, rbp
call dbg.mydelete2
mov rax, qword [0x1004632d0]
cmp dword [rax + 0x7a3c], 0
je 0x100406fdd
mov dword [rsp + 0x20], 0xad
lea r9, str.src.it_iroffer_dccchat.c
lea r8, global___FUNCTION__.207
mov edx, 9
mov rcx, rbx
call dbg.getpart2
mov rbx, rax
mov r8, rax
mov rdx, r14
mov rcx, r13
call dbg.setupdccchatout
mov rcx, rbx
call dbg.mydelete2
mov eax, 1
jmp 0x10040746e
call dbg.get_user_nick
mov r8, rax
lea rdx, str.DCC_passive_Chat_negata__usa_il_comando___MSG__s_ADMIN_password_CHATME__.
mov rcx, r13
call dbg.notice
mov rax, qword [0x1004632e0]
mov rax, qword [rax]
mov rax, qword [rax + 0xa48]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r14
mov r9, r13
lea r8, [0x10044f150]
mov edx, 0x23
mov ecx, 7
call dbg.ioutput
mov eax, 1
jmp 0x10040746e
mov dword [rsp + 0x20], 0xbb
lea r9, str.src.it_iroffer_dccchat.c
lea r8, global___FUNCTION__.207
mov edx, 0x8d8
mov rcx, qword [0x1004632d0]
add rcx, 0xb550
call dbg.irlist_add2
mov rbx, rax
mov rax, qword [0x1004632e0]
mov rax, qword [rax]
mov rax, qword [rax + 0xa48]
mov qword [rbx + 0xa8], rax
lea rsi, [rbx + 0x34]
mov qword [rbx + 0x34], 0
mov qword [rsi + 8], 0
mov qword [rsi + 0x10], 0
mov dword [rsi + 0x18], 0
mov edx, 0x3a
mov rcx, r12
call sym.strchr
cmp rax, 1
sbb ecx, ecx
and ecx, 0xffffffeb
add ecx, 0x17
mov dword [rbx], ecx
mov r8d, 0
mov edx, 1
call sym.socket
mov dword [rbx + 8], eax
test eax, eax
jns 0x100407111
call sym.__errno
mov ecx, dword [rax]
call sym.strerror
mov r8, rax
lea rdx, [0x10044f171]
mov ecx, 1
call dbg.outerror
mov dword [rbx + 8], 0xffffffff
mov rcx, r12
call dbg.mydelete2
mov rcx, rbp
call dbg.mydelete2
mov eax, 1
jmp 0x10040746e
mov eax, 0
mov rcx, 0xffffffffffffffff
mov rdi, rbp
repne scasb al, byte [rdi]
not rcx
mov byte [rbp + rcx - 2], 0
cmp dword [rbx], 2
jne 0x10040715a
mov dword [rsp + 0x3c], 0x10
mov word [rbx + 0x34], 2
mov rcx, rbp
call sym.atoi
xchg ah, al
mov word [rbx + 0x36], ax
mov rcx, r12
call dbg.atoul
bswap eax
mov dword [rbx + 0x38], eax
jmp 0x10040719f
mov dword [rsp + 0x3c], 0x1c
mov word [rbx + 0x34], 0x17
mov rcx, rbp
call sym.atoi
xchg ah, al
mov word [rbx + 0x36], ax
lea r8, [rbx + 0x3c]
mov rdx, r12
mov ecx, 0x17
call sym.inet_pton
test eax, eax
je 0x10040719f
mov r8, r12
lea rdx, [0x10044f183]
mov ecx, 1
call dbg.outerror
mov rcx, rbp
call dbg.mydelete2
mov rcx, r12
call dbg.mydelete2
mov rcx, rsi
call dbg.is_in_badip
test eax, eax
je 0x1004071d2
mov edx, 0
mov rcx, rbx
call dbg.shutdowndccchat
mov eax, 1
jmp 0x10040746e
mov edx, dword [rbx + 8]
mov ecx, dword [rbx]
call dbg.bind_irc_vhost
test eax, eax
je 0x100407211
call sym.__errno
mov ecx, dword [rax]
call sym.strerror
mov r8, rax
lea rdx, str.Non_posso_impegnare_il_Virtual_Host:__s
mov ecx, 1
call dbg.outerror
mov dword [rbx + 8], 0xffffffff
mov eax, 1
jmp 0x10040746e
mov ecx, dword [rbx + 8]
mov edx, 1
call dbg.set_socket_nonblocking
test eax, eax
jns 0x100407233
lea rdx, [0x10044f0d8]
mov ecx, 2
call dbg.outerror
mov ecx, 5
call sym.alarm
mov ecx, dword [rbx + 8]
mov r8d, dword [rsp + 0x3c]
mov rdx, rsi
call sym.connect
test eax, eax
jns 0x100407296
call sym.__errno
cmp dword [rax], 0x77
je 0x100407296
call sym.__errno
cmp dword [rax], 0xb
je 0x100407296
call sym.__errno
mov ecx, dword [rax]
call sym.strerror
mov r8, rax
lea rdx, str.Connessione_alla_DCC_CHAT_Fallita:__s
mov ecx, 1
call dbg.outerror
mov dword [rbx + 8], 0xffffffff
mov eax, 1
jmp 0x10040746e
mov ecx, 0
call sym.alarm
mov dword [rsp + 0x3c], 0x1c
lea rbp, [rbx + 0x50]
mov ecx, dword [rbx + 8]
lea r8, [rsp + 0x3c]
mov rdx, rbp
call sub.cygwin1.dll_getsockname
test eax, eax
jns 0x1004072f1
call sym.__errno
mov ecx, dword [rax]
call sym.strerror
mov r8, rax
lea rdx, [0x10044f1e8]
mov ecx, 1
call dbg.outerror
mov dword [rbx + 8], 0xffffffff
mov eax, 1
jmp 0x10040746e
mov rax, qword [0x1004632d0]
cmp dword [rax + 0x78b8], 0
je 0x10040731b
mov r9d, dword [rbx + 8]
lea r8, str.dccchat_socket___d
mov edx, 0x21
mov ecx, 1
call dbg.ioutput
mov rdi, qword [0x1004632d0]
add dword [rdi + 0xb79c], 1
mov dword [rbx + 0xc8], 2
mov r9d, 0x10a
lea r8, str.src.it_iroffer_dccchat.c
lea rdx, global___FUNCTION__.207
mov rcx, r13
call dbg.mystrdup2
mov qword [rbx + 0xb0], rax
mov r9d, 0x10b
lea r8, str.src.it_iroffer_dccchat.c
lea rdx, global___FUNCTION__.207
mov rcx, r14
call dbg.mystrdup2
mov qword [rbx + 0xb8], rax
mov word [rbx + 0x30], 0
mov rax, qword [rdi + 0xa9d0]
mov qword [rbx + 0x28], rax
mov rax, qword [rdi + 0xa9d0]
mov qword [rbx + 0x20], rax
mov rax, qword [0x1004632e0]
mov rax, qword [rax]
mov eax, dword [rax + 0xaa0]
mov dword [rbx + 0xcc], eax
mov dword [rsp + 0x20], 0x111
lea r9, str.src.it_iroffer_dccchat.c
lea r8, global___FUNCTION__.207
mov edx, 0
mov ecx, 0x200
call dbg.mymalloc2
mov rdi, rax
mov r8, rbp
mov edx, 0x1ff
mov rcx, rax
call dbg.my_getnameinfo
mov r9d, 0x113
lea r8, str.src.it_iroffer_dccchat.c
lea rdx, global___FUNCTION__.207
mov rcx, rdi
call dbg.mystrdup2
mov qword [rbx + 0x18], rax
mov r8, rsi
mov edx, 0x1ff
mov rcx, rdi
call dbg.my_getnameinfo
mov r9d, 0x115
lea r8, str.src.it_iroffer_dccchat.c
lea rdx, global___FUNCTION__.207
mov rcx, rdi
call dbg.mystrdup2
mov qword [rbx + 0x10], rax
mov rcx, rdi
call dbg.mydelete2
mov rax, qword [rbx + 0x10]
mov qword [rsp + 0x28], rax
mov rax, qword [rbx + 0xa8]
mov qword [rsp + 0x20], rax
mov r9, r13
lea r8, str.DCC_CHAT_Ricevuta_da__s_su__s__tento_la_connessione_con__s
mov edx, 0x23
mov ecx, 7
call dbg.ioutput
mov eax, 0
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret