Function at 0x401550
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x13c
mov eax, dword [0x40d284]
xor eax, ebp
mov dword [ebp - 8], eax
cmp byte [edi + 6], 0
push ebx
push esi
jne 0x401616
mov eax, dword [edi + 0x1020]
cmp eax, dword [ebp + 8]
jae 0x401616
mov esi, dword [edi]
push esi
mov dword [ebp - 0x138], 1
mov dword [edi + 8], 0
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4015b1
push esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x4015b1
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov ebx, dword [edx]
movzx eax, word [edi + 4]
push eax
mov dword [ebp - 0x14], ebx
call dword [sym.imp.WS2_32.dll_htons]
push 6
mov ecx, 2
push 1
push ecx
mov word [ebp - 0x16], ax
mov word [ebp - 0x18], cx
call dword [sym.imp.WS2_32.dll_socket]
lea edx, [ebp - 0x138]
push edx
push 0x8004667e
push eax
mov dword [edi + 0xc], eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
movzx eax, word [edi + 4]
mov ecx, dword [edi]
push eax
push ecx
push str.Connecting_to:__s:_d_n
call fcn.00401f09
mov eax, dword [edi + 0xc]
add esp, 0xc
push 0x10
lea edx, [ebp - 0x18]
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
mov byte [edi + 6], 1
cmp byte [edi + 6], 1
mov esi, dword [sym.imp.WS2_32.dll_select]
jne 0x4016cb
mov ecx, dword [edi + 0xc]
lea ebx, [edi + 0x1034]
push ebx
push 0
lea edx, [ebp - 0x134]
push edx
push 0
push 0
mov dword [ebp - 0x130], ecx
mov dword [ebp - 0x134], 1
call esi
cmp eax, 1
jne 0x40167f
push str.Connected__n
mov byte [edi + 6], 2
call fcn.00401f09
mov ecx, dword [edi + 0xc]
add esp, 4
lea eax, [edi + 0x1028]
push eax
push ecx
mov eax, 0xc
call fcn.004010c0
add esp, 8
jmp 0x4016cb
mov edx, dword [edi + 0xc]
push ebx
lea eax, [ebp - 0x134]
push eax
push 0
push 0
push 0
mov dword [ebp - 0x130], edx
mov dword [ebp - 0x134], 1
call esi
cmp eax, 1
jne 0x4016cb
mov ecx, dword [edi + 0xc]
push ecx
mov byte [edi + 6], 0
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [ebp + 8]
add edx, 0x2710
mov dword [edi + 8], 0
mov dword [edi + 0x1020], edx
cmp byte [edi + 6], 2
jne 0x401c02
mov eax, dword [edi + 0xc]
lea ecx, [edi + 0x1034]
push ecx
push 0
push 0
lea edx, [ebp - 0x134]
push edx
push 0
mov dword [ebp - 0x130], eax
mov dword [ebp - 0x134], 1
call esi
cmp eax, 1
jne 0x401767
mov eax, dword [edi + 8]
cmp eax, 0x1010
jae 0x401767
push 0
mov ecx, 0x1010
sub ecx, eax
push ecx
lea edx, [eax + edi + 0x10]
mov eax, dword [edi + 0xc]
push edx
push eax
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x401764
push str.Connection_with_server_terminated_n
call fcn.00401f09
add esp, 4
mov ebx, edi
call fcn.00401060
mov ecx, dword [edi + 0xc]
xor ebx, ebx
push ecx
mov byte [edi + 6], bl
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [ebp + 8]
add edx, 0x2710
mov dword [edi + 8], ebx
mov dword [edi + 0x1020], edx
jmp 0x401c02
add dword [edi + 8], eax
cmp dword [edi + 8], 4
jle 0x401bfb
mov ebx, dword [edi + 0x10]
mov dword [ebp - 0x138], ebx
test ebx, ebx
jne 0x4017f0
cmp byte [edi + 0x14], 6
jne 0x401bd6
mov eax, dword [edi + 0xc]
lea esi, [ebx + 5]
mov dword [ebp - 0x138], eax
mov edx, dword [ebp - 0x138]
push 0
push esi
lea ecx, [edi + ebx + 0x10]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x4017c5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x4017cd
push 3
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4017c9
add ebx, eax
sub esi, eax
test esi, esi
jg 0x401794
add dword [edi + 8], 0xfffffffb
mov ecx, dword [edi + 8]
lea eax, [edi + 0x10]
lea esi, [edi + 0x15]
je 0x401bca
sub esi, eax
mov dl, byte [esi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x4017e2
jmp 0x401bca
mov al, byte [edi + 0x14]
cmp al, 2
jne 0x401874
mov esi, dword [edi + 0x1024]
test esi, esi
je 0x401851
cmp dword [esi + 4], ebx
je 0x401812
mov esi, dword [esi]
test esi, esi
jne 0x401805
jmp 0x401851
mov eax, dword [esi + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [edi + 0x1024]
mov ecx, dword [edi + 0x1044]
test eax, eax
je 0x401851
cmp eax, esi
jne 0x40183a
mov edx, dword [eax]
mov dword [edi + 0x1024], edx
jmp 0x40184e
cmp dword [eax], esi
je 0x40184a
mov edi, edi
mov eax, dword [eax]
test eax, eax
je 0x401851
cmp dword [eax], esi
jne 0x401840
mov edx, dword [esi]
mov dword [eax], edx
push esi
call ecx
add dword [edi + 8], 0xfffffffb
mov ecx, dword [edi + 8]
lea eax, [edi + 0x10]
lea esi, [edi + 0x15]
je 0x401bca
sub esi, eax
mov dl, byte [esi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x401866
jmp 0x401bca
cmp al, 0x13
jne 0x40196e
cmp dword [edi + 8], 5
jle 0x40196e
mov esi, dword [edi + 0x1024]
test esi, esi
je 0x401949
cmp dword [esi + 4], ebx
je 0x40189f
mov esi, dword [esi]
test esi, esi
jne 0x401894
test esi, esi
je 0x401949
cmp byte [edi + 0x15], 1
jne 0x4018bc
mov dword [esi + 0x1034], 1
jmp 0x401949
mov eax, dword [esi + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [edi + 0x1024]
mov ecx, dword [edi + 0x1044]
test eax, eax
je 0x4018f9
cmp eax, esi
jne 0x4018e4
mov edx, dword [eax]
mov dword [edi + 0x1024], edx
jmp 0x4018f6
cmp dword [eax], esi
je 0x4018f2
mov eax, dword [eax]
test eax, eax
je 0x4018f9
cmp dword [eax], esi
jne 0x4018e8
mov edx, dword [esi]
mov dword [eax], edx
push esi
call ecx
mov eax, dword [edi + 0xc]
mov byte [edi + 0x14], 2
mov esi, 5
mov dword [ebp - 0x138], eax
xor ebx, ebx
lea ecx, [ecx]
mov edx, dword [ebp - 0x138]
push 0
push esi
lea ecx, [edi + ebx + 0x10]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x401941
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401949
push 3
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401945
add ebx, eax
sub esi, eax
test esi, esi
jg 0x401910
add dword [edi + 8], 0xfffffffa
mov ecx, dword [edi + 8]
lea eax, [edi + 0x10]
lea esi, [edi + 0x16]
je 0x401bca
sub esi, eax
mov edi, edi
mov dl, byte [esi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x401960
jmp 0x401bca
mov ecx, dword [edi + 8]
cmp ecx, 0xa
jle 0x401a3e
cmp al, 1
jne 0x401a3e
mov esi, dword [edi + 0x1024]
mov eax, dword [edi + 0x15]
mov cx, word [edi + 0x19]
mov edx, 2
mov dword [ebp - 0x14], eax
mov word [ebp - 0x16], cx
mov word [ebp - 0x18], dx
test esi, esi
je 0x4019bb
cmp dword [esi + 4], ebx
je 0x4019b0
mov esi, dword [esi]
test esi, esi
jne 0x4019a3
jmp 0x4019bb
test esi, esi
je 0x4019bb
mov eax, edi
call section..text
push ebx
lea eax, [ebp - 0x18]
push eax
push edi
call fcn.00401120
add esp, 0xc
test eax, eax
jne 0x401a19
mov ecx, dword [edi + 0xc]
mov byte [edi + 0x14], 2
lea esi, [eax + 5]
mov dword [ebp - 0x138], ecx
xor ebx, ebx
nop
mov eax, dword [ebp - 0x138]
push 0
push esi
lea edx, [edi + ebx + 0x10]
push edx
push eax
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x401a11
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401a19
push 3
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401a15
add ebx, eax
sub esi, eax
test esi, esi
jg 0x4019e0
add dword [edi + 8], 0xfffffff5
mov ecx, dword [edi + 8]
lea eax, [edi + 0x10]
lea esi, [edi + 0x1b]
je 0x401bca
sub esi, eax
mov edi, edi
mov dl, byte [esi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x401a30
jmp 0x401bca
cmp ecx, 7
jle 0x401bee
cmp al, 0x11
jne 0x401b51
movsx eax, byte [edi + 0x17]
add ecx, 0xfffffff8
cmp eax, ecx
jg 0x401bfb
add eax, 8
lea ebx, [edi + 0x18]
push ebx
mov dword [ebp - 0x13c], eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401a8a
push ebx
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x401a8a
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
mov esi, dword [ecx]
mov dx, word [edi + 0x15]
mov ebx, dword [ebp - 0x138]
mov dword [ebp - 0x24], esi
mov esi, dword [edi + 0x1024]
mov eax, 2
mov word [ebp - 0x26], dx
mov word [ebp - 0x28], ax
test esi, esi
je 0x401ac8
mov edi, edi
cmp dword [esi + 4], ebx
je 0x401abd
mov esi, dword [esi]
test esi, esi
jne 0x401ab0
jmp 0x401ac8
test esi, esi
je 0x401ac8
mov eax, edi
call section..text
push ebx
lea ecx, [ebp - 0x28]
push ecx
push edi
call fcn.00401120
add esp, 0xc
test eax, eax
jne 0x401b29
mov edx, dword [edi + 0xc]
mov byte [edi + 0x14], 2
lea esi, [eax + 5]
mov dword [ebp - 0x138], edx
xor ebx, ebx
lea esp, [esp]
mov ecx, dword [ebp - 0x138]
push 0
push esi
lea eax, [edi + ebx + 0x10]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x401b21
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401b29
push 3
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401b25
add ebx, eax
sub esi, eax
test esi, esi
jg 0x401af0
mov edx, dword [ebp - 0x13c]
sub dword [edi + 8], edx
mov ecx, dword [edi + 8]
lea eax, [edi + 0x10]
lea esi, [eax + edx]
je 0x401bca
sub esi, eax
mov dl, byte [esi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x401b43
jmp 0x401bca
cmp al, 3
jne 0x401bee
movzx esi, word [edi + 0x15]
mov eax, dword [edi + 8]
sub eax, 7
cmp esi, eax
jg 0x401bfb
mov eax, dword [edi + 0x1024]
test eax, eax
je 0x401ba9
cmp dword [eax + 4], ebx
je 0x401b82
mov eax, dword [eax]
test eax, eax
jne 0x401b75
jmp 0x401ba9
test eax, eax
je 0x401ba9
cmp dword [eax + 0x1c], 0
jne 0x401bfb
mov edx, dword [eax + 0x18]
lea ecx, [edi + 0x17]
push ecx
push edx
mov eax, esi
call fcn.004010c0
push eax
mov eax, dword [edi + 0xc]
push ebx
push eax
call fcn.004011c0
add esp, 0x14
mov ecx, 0xfffffff9
sub ecx, esi
add dword [edi + 8], ecx
mov ecx, dword [edi + 8]
lea eax, [edi + 0x10]
lea esi, [edi + esi + 0x17]
je 0x401bca
sub esi, eax
mov dl, byte [esi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x401bc1
cmp dword [edi + 8], 4
jg 0x401771
jmp 0x401bfb
cmp byte [edi + 0x14], 4
jne 0x401bfb
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00401d45
mov esp, ebp
pop ebp
ret
cmp dword [edi + 8], 0xa
jle 0x401bfb
mov dword [edi + 8], 0
mov ecx, edi
call fcn.00401440
mov ecx, dword [ebp - 8]
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.00401d45
mov esp, ebp
pop ebp
ret