Function at 0x40a630
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.0040c720
mov eax, dword [esp + 0x204]
add esp, 0x18
test eax, eax
jne 0x409741
push str.no_firwa
push 2
call fcn.0040c720
add esp, 8
mov ecx, ebp
call 0x40a630
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 0x409775
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
push ebx
call fcn.004096b0
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.0040c720
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.0040c720
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 0x40980a
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
call fcn.00404a00
inc edi
cmp esi, 0xffffffff
jne 0x409841
cmp edi, 3
jl 0x4097c6
push str.no_c_firewall
push 2
call fcn.0040c720
add esp, 8
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
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 0x4098a4
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.0040c720
mov eax, dword [esp + 0x1f4]
add esp, 8
dec eax
je 0x40a31e
dec eax
je 0x4099b2
sub eax, 2
jne 0x409946
push str.http
push 2
call fcn.0040c720
mov ecx, dword [esp + 0x1ec]
mov edx, dword [esp + 0x1e8]
add esp, 8
push ecx
push edx
mov ecx, ebp
call fcn.004090a0
cmp eax, 0xffffffff
je 0x409980
test eax, eax
je 0x409937
cmp eax, 1
jne 0x409946
push str.que_reint
push 2
call fcn.0040c720
add esp, 8
lea ecx, [esp + 0x118]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x118]
push 0x4259b0
push eax
call fcn.00416244
push str.okjj
push 2
call fcn.0040c720
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.00416129
push str.conecto
push 2
call fcn.0040c720
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.0040c720
add esp, 8
lea ecx, [esp + 0x100]
push 0x42eb08
call fcn.0040b170
lea ecx, [esp + 0x100]
push 0x4259b0
push ecx
call fcn.00416244
push str.socks5
push 2
call fcn.0040c720
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 0x409a26
push 4
push str.__writing__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x409a6d
test eax, eax
je 0x409a6d
add esi, eax
cmp esi, 4
jl 0x4099fe
mov esi, 2
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x409aaa
cmp eax, 0xffffffff
je 0x409ac7
sub esi, eax
add edi, eax
test esi, esi
jg 0x409a42
jmp 0x409aff
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.00416129
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
cmp byte [esp + 0x30], 5
jne 0x40a2ec
movsx edx, byte [esp + 0x31]
cmp edx, 0xff
je 0x40a2ec
push str.leyo2
push 2
call fcn.0040c720
movsx eax, byte [esp + 0x39]
add esp, 8
sub eax, 0
je 0x409dae
sub eax, 2
je 0x409b7a
sub eax, 0xfd
jne 0x409dbd
push str.reject_socks5
push 2
call fcn.0040c720
add esp, 8
lea ecx, [esp + 0x120]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x120]
push 0x4259b0
push eax
call fcn.00416244
push str.user_p
push 2
call fcn.0040c720
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 0x409cd3
cmp dword [ebp + 0x108], 0xffffffff
je 0x409cd3
push esi
push str.__writing__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
mov ebx, dword [sym.imp.WSOCK32.dll_send]
add esp, 0x10
xor edi, edi
test esi, esi
jle 0x409cd9
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 0x409c97
test eax, eax
je 0x409c97
add edi, eax
cmp edi, esi
jl 0x409c71
jmp 0x409cd9
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.00416129
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
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 0x42f668
call fcn.00405580
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 0x409d59
cmp eax, 0xffffffff
je 0x409d76
sub esi, eax
add edi, eax
test esi, esi
jg 0x409cf5
mov al, byte [esp + 0x31]
test al, al
je 0x409dbd
push str.no_sirvio_pass
push 2
call fcn.0040c720
add esp, 8
lea ecx, [esp + 0x108]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x108]
push 0x4259b0
push eax
call fcn.00416244
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
push str.ya_quedo
push 2
call fcn.0040c720
add esp, 8
push str.si_conecto_5
push 2
call fcn.0040c720
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 0x409ee6
cmp eax, 0xffffffff
je 0x409ee6
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 0x409e58
push 0xa
push str.__writing__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x409ea9
test eax, eax
je 0x409ea9
add esi, eax
cmp esi, 0xa
jl 0x409e30
mov esi, 4
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x409fd6
cmp eax, 0xffffffff
je 0x409ff3
sub esi, eax
add edi, eax
test esi, esi
jg 0x409e7a
jmp 0x40a02b
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.00416129
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
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 0x409e58
cmp dword [ebp + 0x108], 0xffffffff
je 0x409e58
push edi
push str.__writing__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
add esp, 0x10
xor esi, esi
test edi, edi
jle 0x409e58
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 0x409f9a
test eax, eax
je 0x409f9a
add esi, eax
cmp esi, edi
jl 0x409f71
jmp 0x409e58
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.00416129
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
mov al, byte [esp + 0x31]
test al, al
je 0x40a056
push 0x42eb08
lea ecx, [esp + 0xfc]
call fcn.0040b170
lea ecx, [esp + 0xf8]
push 0x4259b0
push ecx
call fcn.00416244
push str.leyo4
push 2
call fcn.0040c720
movsx eax, byte [esp + 0x3b]
add esp, 8
dec eax
je 0x40a254
sub eax, 2
je 0x40a119
dec eax
jne 0x409946
mov esi, 0x12
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x40a0c4
cmp eax, 0xffffffff
je 0x40a0e1
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a09d
jmp 0x409946
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
mov esi, 1
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x40a1aa
cmp eax, 0xffffffff
je 0x40a1c7
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a135
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 0x42f668
call fcn.00405580
add esp, 0x10
test esi, esi
jle 0x409946
mov edx, dword [ebp + 0x108]
push 0
lea ecx, [esp + edi + 0x35]
push esi
push ecx
push edx
call ebx
test eax, eax
je 0x40a1ff
cmp eax, 0xffffffff
je 0x40a21c
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a183
jmp 0x409946
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
mov esi, 6
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x40a297
cmp eax, 0xffffffff
je 0x40a2b4
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a270
jmp 0x409946
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea ecx, [esp + 0x10]
push 0x4259b0
push ecx
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
push str.no_conecto5
push 2
call fcn.0040c720
add esp, 8
lea ecx, [esp + 0x128]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x128]
push 0x4259b0
push eax
call fcn.00416244
push str.socks4
push 2
call fcn.0040c720
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 0x40a35c
cmp ebx, 0xffffffff
jne 0x40a370
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 0x40a49f
cmp ebx, 0xffffffff
je 0x40a49f
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 0x40a412
cmp dword [ebp + 0x108], 0xffffffff
je 0x40a412
push edi
push str.__writing__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
add esp, 0x10
xor esi, esi
test edi, edi
jle 0x40a412
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 0x40a463
test eax, eax
je 0x40a463
add esi, eax
cmp esi, edi
jl 0x40a3ee
mov esi, 8
xor edi, edi
push esi
push str.__reading__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
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 0x40a590
cmp eax, 0xffffffff
je 0x40a5ad
sub esi, eax
add edi, eax
test esi, esi
jg 0x40a434
jmp 0x40a5e5
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.00416129
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
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 0x40a412
cmp dword [ebp + 0x108], 0xffffffff
je 0x40a412
push edi
push str.__writing__d_bytes_n
push 0xa
push 0x42f668
call fcn.00405580
add esp, 0x10
xor esi, esi
test edi, edi
jle 0x40a412
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 0x40a554
test eax, eax
je 0x40a554
add esi, eax
cmp esi, edi
jl 0x40a52b
jmp 0x40a412
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.00416129
add esp, 0x18
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
push 0x42eb08
lea ecx, [esp + 0x14]
call fcn.0040b170
lea edx, [esp + 0x10]
push 0x4259b0
push edx
call fcn.00416244
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Socket_error_while_reading__d_n
push 1
push 0x42f668
call fcn.00405580
add esp, 0x10
lea ecx, [esp + 0x10]
push 0x42eb08
call fcn.0040b170
lea eax, [esp + 0x10]
push 0x4259b0
push eax
call fcn.00416244
cmp byte [esp + 0x31], 0x5a
je 0x409946
push str.no_conecto
push 2
call fcn.0040c720
add esp, 8
lea ecx, [esp + 0x110]
push 0x42eb08
call fcn.0040b170
lea ecx, [esp + 0x110]
push 0x4259b0
push ecx
call fcn.00416244
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 0x40a66b
push 0x42eb08
lea ecx, [esp + 0xc]
call fcn.0040b170
lea eax, [esp + 8]
push 0x4259b0
push eax
call fcn.00416244
mov ecx, dword [edi + 8]
lea ebp, [edi + 0xc]
push ecx
push ebp
push str.el_host_es__s:__d
push 2
call fcn.0040c720
add esp, 0x10
push ebp
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x40a6c5
push ebp
call dword [sym.imp.WSOCK32.dll_gethostbyname]
test eax, eax
jne 0x40a6ba
push 0x42eb08
lea ecx, [esp + 0xc]
call fcn.0040b170
lea edx, [esp + 8]
push 0x4259b0
push edx
call fcn.00416244
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 0x40a710
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
call fcn.00404a00
inc ebx
cmp esi, 0xffffffff
jne 0x40a71b
cmp ebx, 2
jl 0x40a6e0
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.00416129
add esp, 0x10
cmp esi, 0xffffffff
pop esi
pop ebx
jne 0x40a759
push 0x42eb08
lea ecx, [esp + 0xc]
call fcn.0040b170
lea ecx, [esp + 8]
push 0x4259b0
push ecx
call fcn.00416244
mov edx, dword [edi + 8]
push edx
push ebp
push str.Connected_to__s_port__d_n
push 0
push 0x42f668
call fcn.00405580
add esp, 0x14
pop edi
pop ebp
add esp, 0x4c
ret