Function at 0x40ada0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x1c8
push ebx
mov ebx, dword [esp + 0x1d0]
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 8]
mov edi, dword [esp + 0x1e8]
lea esi, [ebp + 0xc]
push eax
push esi
push edi
push ebx
push str.entra_a_connect_firewall__s__d___f__s:_d
push 2
call fcn.0040d050
mov eax, dword [esp + 0x204]
add esp, 0x18
test eax, eax
jne 0x409eb1
push str.no_firwa
push 2
call fcn.0040d050
add esp, 8
mov ecx, ebp
call 0x40ada0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c8
ret 0x14
push 0
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [ebp + 0x108], eax
jne 0x409ee5
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
push ebx
call fcn.00409e20
add esp, 4
mov dword [esp + 0x24], eax
push edi
mov edi, dword [sym.imp.WSOCK32.dll_htons]
call edi
push esi
mov word [esp + 0x26], ax
mov word [esp + 0x24], 2
call dword [sym.imp.WSOCK32.dll_inet_addr]
mov dx, word [ebp + 8]
mov esi, eax
push edx
mov dword [esp + 0x138], esi
call edi
push esi
push str.addr_next_d
push 2
call fcn.0040d050
mov ebx, dword [sym.imp.WSOCK32.dll_connect]
add esp, 0xc
xor edi, edi
mov eax, dword [esp + 0x24]
push eax
push str.connect__x
push 2
call fcn.0040d050
add esp, 0xc
call fcn.00404a00
mov edx, dword [ebp + 0x108]
lea ecx, [esp + 0x20]
push 0x10
push ecx
push edx
call ebx
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x10], esi
jne 0x409f7a
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
call fcn.00404a00
inc edi
cmp esi, 0xffffffff
jne 0x409fb1
cmp edi, 3
jl 0x409f36
push str.no_c_firewall
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
mov edx, dword [ebp + 0x108]
mov esi, dword [sym.imp.WSOCK32.dll_setsockopt]
lea ecx, [esp + 0x1c]
push 4
push ecx
push 1
push 6
push edx
mov dword [esp + 0x30], 1
call esi
mov ecx, dword [ebp + 0x108]
lea eax, [esp + 0x18]
push 4
push eax
push 0x1006
push 0xffff
push ecx
mov dword [esp + 0x2c], 0x7530
call esi
cmp eax, 0xffffffff
je 0x40a014
mov eax, dword [ebp + 0x108]
lea edx, [esp + 0x18]
push 4
push edx
push 0x1005
push 0xffff
push eax
call esi
push str.conecto_firewall
push 2
call fcn.0040d050
mov eax, dword [esp + 0x1f4]
add esp, 8
dec eax
je 0x40aa8e
dec eax
je 0x40a122
sub eax, 2
jne 0x40a0b6
push str.http
push 2
call fcn.0040d050
mov ecx, dword [esp + 0x1ec]
mov edx, dword [esp + 0x1e8]
add esp, 8
push ecx
push edx
mov ecx, ebp
call fcn.004097f0
cmp eax, 0xffffffff
je 0x40a0f0
test eax, eax
je 0x40a0a7
cmp eax, 1
jne 0x40a0b6
push str.que_reint
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x118]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x118]
push 0x4289b0
push eax
call fcn.00418ed4
push str.okjj
push 2
call fcn.0040d050
add esp, 8
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov edx, dword [esp + 0x10]
push eax
push edx
lea eax, [esp + 0x1ac]
push str.Failed_to_connect_to_server.__res_d__error_d
push eax
call fcn.00418db9
push str.conecto
push 2
call fcn.0040d050
add esp, 0x18
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c8
ret 0x14
push str.failed_to_begin_relaying_via_HTTP._n
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x100]
push 0x4325fc
call fcn.0040b8d0
lea ecx, [esp + 0x100]
push 0x4289b0
push ecx
call fcn.00418ed4
push str.socks5
push 2
call fcn.0040d050
mov eax, dword [ebp + 0x108]
mov ebx, dword [sym.imp.WSOCK32.dll_send]
add esp, 8
cmp eax, 0xffffffff
mov byte [esp + 0x30], 5
mov byte [esp + 0x31], 2
mov byte [esp + 0x32], 0
mov byte [esp + 0x33], 2
je 0x40a196
push 4
push str.__writing__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
xor esi, esi
mov ecx, dword [ebp + 0x108]
mov edx, 4
sub edx, esi
push 0
lea eax, [esp + esi + 0x34]
push edx
push eax
push ecx
call ebx
cmp eax, 0xffffffff
je 0x40a1dd
test eax, eax
je 0x40a1dd
add esi, eax
cmp esi, 4
jl 0x40a16e
mov esi, 2
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
mov edx, dword [ebp + 0x108]
push 0
lea ecx, [esp + edi + 0x34]
push esi
push ecx
push edx
call dword [sym.imp.WSOCK32.dll_recv]
test eax, eax
je 0x40a21a
cmp eax, 0xffffffff
je 0x40a237
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a1b2
jmp 0x40a26f
push eax
push esi
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push 4
lea edx, [esp + 0x150]
push str.WriteExact:_Socket_error_while_writing.__bytes_d__error_d__i_d__j_d
push edx
call fcn.00418db9
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
cmp byte [esp + 0x30], 5
jne 0x40aa5c
movsx edx, byte [esp + 0x31]
cmp edx, 0xff
je 0x40aa5c
push str.leyo2
push 2
call fcn.0040d050
movsx eax, byte [esp + 0x39]
add esp, 8
sub eax, 0
je 0x40a51e
sub eax, 2
je 0x40a2ea
sub eax, 0xfd
jne 0x40a52d
push str.reject_socks5
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x120]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x120]
push 0x4289b0
push eax
call fcn.00418ed4
push str.user_p
push 2
call fcn.0040d050
mov edx, dword [esp + 0x1e8]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
add esp, 8
lea ebx, [esp + 0x32]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, edx
mov byte [esp + 0x31], cl
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x30], 1
mov eax, ecx
mov esi, edi
shr ecx, 2
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x1e4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, edx
mov ebx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, edx
mov byte [esp + ecx + 0x32], bl
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ebx, dword [esp + 0x1e4]
not ecx
dec ecx
mov edi, ebx
lea esi, [esp + ecx + 0x33]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x18], esi
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea esi, [edx + ecx + 3]
test esi, esi
je 0x40a443
cmp dword [ebp + 0x108], 0xffffffff
je 0x40a443
push esi
push str.__writing__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
mov ebx, dword [sym.imp.WSOCK32.dll_send]
add esp, 0x10
xor edi, edi
test esi, esi
jle 0x40a449
mov edx, dword [ebp + 0x108]
mov eax, esi
sub eax, edi
push 0
lea ecx, [esp + edi + 0x34]
push eax
push ecx
push edx
call ebx
cmp eax, 0xffffffff
je 0x40a407
test eax, eax
je 0x40a407
add edi, eax
cmp edi, esi
jl 0x40a3e1
jmp 0x40a449
push eax
push edi
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push esi
lea eax, [esp + 0x150]
push str.WriteExact:_Socket_error_while_writing.__bytes_d__error_d__i_d__j_d
push eax
call fcn.00418db9
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
mov ebx, dword [sym.imp.WSOCK32.dll_send]
mov esi, 2
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
mov eax, dword [ebp + 0x108]
push 0
lea edx, [esp + edi + 0x34]
push esi
push edx
push eax
call dword [sym.imp.WSOCK32.dll_recv]
test eax, eax
je 0x40a4c9
cmp eax, 0xffffffff
je 0x40a4e6
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a465
mov al, byte [esp + 0x31]
test al, al
je 0x40a52d
push str.no_sirvio_pass
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x108]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x108]
push 0x4289b0
push eax
call fcn.00418ed4
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
push str.ya_quedo
push 2
call fcn.0040d050
add esp, 8
push str.si_conecto_5
push 2
call fcn.0040d050
mov eax, dword [esp + 0x13c]
add esp, 8
test eax, eax
mov byte [esp + 0x30], 5
mov byte [esp + 0x31], 1
mov byte [esp + 0x32], 0
je 0x40a656
cmp eax, 0xffffffff
je 0x40a656
mov ecx, dword [ebp + 8]
mov dl, byte [ebp + 8]
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x108]
sar ecx, 8
cmp eax, 0xffffffff
mov byte [esp + 0x33], 1
mov byte [esp + 0x38], cl
mov byte [esp + 0x39], dl
je 0x40a5c8
push 0xa
push str.__writing__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
xor esi, esi
mov edx, dword [ebp + 0x108]
mov eax, 0xa
sub eax, esi
push 0
lea ecx, [esp + esi + 0x34]
push eax
push ecx
push edx
call ebx
cmp eax, 0xffffffff
je 0x40a619
test eax, eax
je 0x40a619
add esi, eax
cmp esi, 0xa
jl 0x40a5a0
mov esi, 4
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
mov ebx, dword [sym.imp.WSOCK32.dll_recv]
add esp, 0x10
mov ecx, dword [ebp + 0x108]
push 0
lea eax, [esp + edi + 0x34]
push esi
push eax
push ecx
call ebx
test eax, eax
je 0x40a746
cmp eax, 0xffffffff
je 0x40a763
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a5ea
jmp 0x40a79b
push eax
push esi
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push 0xa
lea eax, [esp + 0x150]
push str.WriteExact:_Socket_error_while_writing.__bytes_d__error_d__i_d__j_d
push eax
call fcn.00418db9
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
lea esi, [ebp + 0xc]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x35]
mov edx, ecx
mov dword [esp + 0x18], eax
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov byte [esp + 0x33], 3
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x34], dl
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov al, byte [ebp + 8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 8]
lea edi, [edx + 7]
sar ecx, 8
mov byte [esp + edx + 0x35], cl
mov byte [esp + edx + 0x36], al
test edi, edi
je 0x40a5c8
cmp dword [ebp + 0x108], 0xffffffff
je 0x40a5c8
push edi
push str.__writing__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
xor esi, esi
test edi, edi
jle 0x40a5c8
mov eax, dword [ebp + 0x108]
mov ecx, edi
sub ecx, esi
push 0
lea edx, [esp + esi + 0x34]
push ecx
push edx
push eax
call ebx
cmp eax, 0xffffffff
je 0x40a70a
test eax, eax
je 0x40a70a
add esi, eax
cmp esi, edi
jl 0x40a6e1
jmp 0x40a5c8
push eax
push esi
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push edi
lea ecx, [esp + 0x150]
push str.WriteExact:_Socket_error_while_writing.__bytes_d__error_d__i_d__j_d
push ecx
call fcn.00418db9
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
mov al, byte [esp + 0x31]
test al, al
je 0x40a7c6
push 0x4325fc
lea ecx, [esp + 0xfc]
call fcn.0040b8d0
lea ecx, [esp + 0xf8]
push 0x4289b0
push ecx
call fcn.00418ed4
push str.leyo4
push 2
call fcn.0040d050
movsx eax, byte [esp + 0x3b]
add esp, 8
dec eax
je 0x40a9c4
sub eax, 2
je 0x40a889
dec eax
jne 0x40a0b6
mov esi, 0x12
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
mov eax, dword [ebp + 0x108]
push 0
lea edx, [esp + edi + 0x34]
push esi
push edx
push eax
call ebx
test eax, eax
je 0x40a834
cmp eax, 0xffffffff
je 0x40a851
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a80d
jmp 0x40a0b6
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
mov esi, 1
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
mov ecx, dword [ebp + 0x108]
push 0
lea eax, [esp + edi + 0x34]
push esi
push eax
push ecx
call ebx
test eax, eax
je 0x40a91a
cmp eax, 0xffffffff
je 0x40a937
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a8a5
mov esi, dword [esp + 0x30]
xor edi, edi
and esi, 0xff
add esi, 2
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
test esi, esi
jle 0x40a0b6
mov edx, dword [ebp + 0x108]
push 0
lea ecx, [esp + edi + 0x35]
push esi
push ecx
push edx
call ebx
test eax, eax
je 0x40a96f
cmp eax, 0xffffffff
je 0x40a98c
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a8f3
jmp 0x40a0b6
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
mov esi, 6
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
mov eax, dword [ebp + 0x108]
push 0
lea edx, [esp + edi + 0x34]
push esi
push edx
push eax
call ebx
test eax, eax
je 0x40aa07
cmp eax, 0xffffffff
je 0x40aa24
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a9e0
jmp 0x40a0b6
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea ecx, [esp + 0x10]
push 0x4289b0
push ecx
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
push str.no_conecto5
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x128]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x128]
push 0x4289b0
push eax
call fcn.00418ed4
push str.socks4
push 2
call fcn.0040d050
mov ecx, dword [ebp + 8]
mov ebx, dword [esp + 0x13c]
mov dl, byte [ebp + 8]
add esp, 8
sar ecx, 8
test ebx, ebx
mov byte [esp + 0x30], 4
mov byte [esp + 0x31], 1
mov byte [esp + 0x32], cl
mov byte [esp + 0x33], dl
mov dword [esp + 0x34], ebx
je 0x40aacc
cmp ebx, 0xffffffff
jne 0x40aae0
mov byte [esp + 0x34], 0
mov byte [esp + 0x35], 0
mov byte [esp + 0x36], 0
mov byte [esp + 0x37], 1
mov edx, dword [esp + 0x1e0]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea esi, [esp + 0x38]
sub edi, ecx
mov eax, ecx
mov dword [esp + 0x18], esi
mov esi, edi
mov edi, dword [esp + 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
test ebx, ebx
rep movsb byte es:[edi], byte [esi]
je 0x40ac0f
cmp ebx, 0xffffffff
je 0x40ac0f
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
add edi, 9
je 0x40ab82
cmp dword [ebp + 0x108], 0xffffffff
je 0x40ab82
push edi
push str.__writing__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
xor esi, esi
test edi, edi
jle 0x40ab82
mov ebx, dword [sym.imp.WSOCK32.dll_send]
mov eax, dword [ebp + 0x108]
mov ecx, edi
sub ecx, esi
push 0
lea edx, [esp + esi + 0x34]
push ecx
push edx
push eax
call ebx
cmp eax, 0xffffffff
je 0x40abd3
test eax, eax
je 0x40abd3
add esi, eax
cmp esi, edi
jl 0x40ab5e
mov esi, 8
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
mov ebx, dword [sym.imp.WSOCK32.dll_recv]
add esp, 0x10
mov ecx, dword [ebp + 0x108]
push 0
lea eax, [esp + edi + 0x34]
push esi
push eax
push ecx
call ebx
test eax, eax
je 0x40ad00
cmp eax, 0xffffffff
je 0x40ad1d
sub esi, eax
add edi, eax
test esi, esi
jg 0x40aba4
jmp 0x40ad55
push eax
push esi
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push edi
lea ecx, [esp + 0x150]
push str.WriteExact:_Socket_error_while_writing.__bytes_d__error_d__i_d__j_d
push ecx
call fcn.00418db9
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
lea ebx, [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
lea esi, [esp + ecx + 0x39]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x18], esi
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, edx
mov esi, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esi + ecx + 0xa]
test edi, edi
je 0x40ab82
cmp dword [ebp + 0x108], 0xffffffff
je 0x40ab82
push edi
push str.__writing__d_bytes_n
push 0xa
push 0x4333b0
call fcn.00405690
add esp, 0x10
xor esi, esi
test edi, edi
jle 0x40ab82
mov ebx, dword [sym.imp.WSOCK32.dll_send]
mov eax, dword [ebp + 0x108]
mov ecx, edi
sub ecx, esi
push 0
lea edx, [esp + esi + 0x34]
push ecx
push edx
push eax
call ebx
cmp eax, 0xffffffff
je 0x40acc4
test eax, eax
je 0x40acc4
add esi, eax
cmp esi, edi
jl 0x40ac9b
jmp 0x40ab82
push eax
push esi
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push edi
lea ecx, [esp + 0x150]
push str.WriteExact:_Socket_error_while_writing.__bytes_d__error_d__i_d__j_d
push ecx
call fcn.00418db9
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
push 0x4325fc
lea ecx, [esp + 0x14]
call fcn.0040b8d0
lea edx, [esp + 0x10]
push 0x4289b0
push edx
call fcn.00418ed4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x4333b0
call fcn.00405690
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x4325fc
call fcn.0040b8d0
lea eax, [esp + 0x10]
push 0x4289b0
push eax
call fcn.00418ed4
cmp byte [esp + 0x31], 0x5a
je 0x40a0b6
push str.no_conecto
push 2
call fcn.0040d050
add esp, 8
lea ecx, [esp + 0x110]
push 0x4325fc
call fcn.0040b8d0
lea ecx, [esp + 0x110]
push 0x4289b0
push ecx
call fcn.00418ed4
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sub esp, 0x4c
push ebp
push edi
push 0
push 1
mov edi, ecx
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [edi + 0x108], eax
jne 0x40addb
push 0x4325fc
lea ecx, [esp + 0xc]
call fcn.0040b8d0
lea eax, [esp + 8]
push 0x4289b0
push eax
call fcn.00418ed4
mov ecx, dword [edi + 8]
lea ebp, [edi + 0xc]
push ecx
push ebp
push str.el_host_es__s:__d
push 2
call fcn.0040d050
add esp, 0x10
push ebp
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x40ae35
push ebp
call dword [sym.imp.WSOCK32.dll_gethostbyname]
test eax, eax
jne 0x40ae2a
push 0x4325fc
lea ecx, [esp + 0xc]
call fcn.0040b8d0
lea edx, [esp + 8]
push 0x4289b0
push edx
call fcn.00418ed4
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx]
mov dword [esp + 0x14], edx
mov ax, word [edi + 8]
push ebx
push esi
push eax
mov word [esp + 0x1c], 2
call dword [sym.imp.WSOCK32.dll_htons]
mov word [esp + 0x1a], ax
xor ebx, ebx
call fcn.00404a00
mov edx, dword [edi + 0x108]
lea ecx, [esp + 0x18]
push 0x10
push ecx
push edx
call dword [sym.imp.WSOCK32.dll_connect]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40ae80
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
call fcn.00404a00
inc ebx
cmp esi, 0xffffffff
jne 0x40ae8b
cmp ebx, 2
jl 0x40ae50
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push esi
lea eax, [esp + 0x30]
push str.Failed_to_connect_to_server.__res_d__error_d
push eax
call fcn.00418db9
add esp, 0x10
cmp esi, 0xffffffff
pop esi
pop ebx
jne 0x40aec9
push 0x4325fc
lea ecx, [esp + 0xc]
call fcn.0040b8d0
lea ecx, [esp + 8]
push 0x4289b0
push ecx
call fcn.00418ed4
mov edx, dword [edi + 8]
push edx
push ebp
push str.Connected_to__s_port__d_n
push 0
push 0x4333b0
call fcn.00405690
add esp, 0x14
pop edi
pop ebp
add esp, 0x4c
ret