Function at 0x408000
Capabilities:
Connect socket

Disassembly:
sub esp, 0x444
mov eax, dword [0x45a7c0]
push ebx
mov ebx, dword [esp + 0x450]
push ebp
push esi
push edi
xor edi, edi
push ebx
mov dword [esp + 0x454], eax
mov dword [esp + 0x14], edi
call fcn.0040f420
mov ebp, dword [esp + 0x45c]
add esp, 4
cmp eax, 1
jne 0x408341
mov eax, dword [ebx]
mov edx, dword [ebx + 4]
lea ecx, [eax + 0x1a]
cmp ecx, edx
ja 0x408341
mov edx, dword [ebx + 0xc]
add edx, eax
mov ecx, dword [edx]
lea eax, [ebp + 0x70]
mov dword [eax], ecx
mov ecx, dword [edx + 4]
mov dword [eax + 4], ecx
mov ecx, dword [edx + 8]
mov dword [eax + 8], ecx
mov edx, dword [edx + 0xc]
mov dword [eax + 0xc], edx
cmp byte [ebp + 0x75], 0xe
jne 0x407c8a
cmp byte [ebp + 0x7e], 0x6f
jne 0x407c8a
or dword [ebp + 0x1c], 2
mov esi, dword [ebx]
mov ecx, dword [ebx + 0xc]
lea eax, [esi + 0x14]
mov dword [ebx], eax
mov dx, word [eax + ecx]
mov word [ebp + 0x90], dx
mov eax, dword [ebx]
mov ecx, dword [ebx + 0xc]
add eax, 2
mov dword [ebx], eax
mov ecx, dword [eax + ecx]
add eax, 4
mov dword [ebx], eax
xor eax, eax
cmp ecx, eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], ecx
mov dword [ebp + 0x24], eax
mov dword [ebp + 0x4c], eax
mov byte [ebp + 0x38], al
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x20], eax
mov dword [ebp + 0x34], eax
mov dword [ebp + 0x48], eax
mov dword [esp + 0x14], eax
jbe 0x407eff
jmp 0x407ce2
mov esi, dword [esp + 0x1c]
lea edx, [esp + 0x30]
push edx
push ebx
call fcn.0040f860
add esp, 8
cmp eax, 0xffffffff
je 0x408330
mov eax, dword [esp + 0x3c]
cmp eax, 1
je 0x407d7c
cmp eax, 4
jne 0x407ee6
mov eax, dword [esp + 0x38]
mov cl, byte [eax]
or cl, 0x20
cmp cl, 0x6c
jne 0x407ee6
mov dl, byte [eax + 1]
or dl, 0x20
cmp dl, 0x61
jne 0x407ee6
mov cl, byte [eax + 2]
or cl, 0x20
cmp cl, 0x6e
jne 0x407ee6
mov dl, byte [eax + 3]
or dl, 0x20
cmp dl, 0x67
jne 0x407ee6
cmp dword [esp + 0x30], 2
jne 0x407ee6
mov eax, dword [ebp + 0x44]
test eax, eax
je 0x407d65
push eax
call fcn.00418290
add esp, 4
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x40]
push eax
push ecx
call fcn.00402830
mov dword [ebp + 0x44], eax
jmp 0x407ee3
mov eax, dword [esp + 0x30]
cmp eax, 3
jne 0x407e36
mov edx, dword [esp + 0x38]
mov al, byte [edx]
cmp al, 0x11
jne 0x407d9f
mov eax, dword [esp + 0x34]
mov dword [ebp + 0x24], eax
jmp 0x407ee6
cmp al, 0x20
jne 0x407dc4
mov eax, dword [esp + 0x34]
test al, 2
mov dword [ebp + 0x20], eax
je 0x407ee6
mov ecx, dword [ebx + 0xc]
mov edx, dword [esi + ecx + 0x10]
mov dword [ebp + 0xd8], edx
jmp 0x407ee6
cmp al, 0x22
jne 0x407dd7
mov eax, dword [esp + 0x34]
mov dword [ebp + 0xd8], eax
jmp 0x407ee6
cmp al, 0x23
jne 0x407df0
mov eax, dword [ebp + 0x1c]
mov ecx, dword [esp + 0x34]
or eax, 0x40
mov dword [ebp + 0x1c], eax
mov dword [ebp + 0x34], ecx
jmp 0x407ee6
cmp al, 0xfb
jne 0x407e11
mov ecx, dword [ebp + 0x28]
test ecx, ecx
mov eax, dword [esp + 0x34]
mov dword [ebp + 0x48], eax
jne 0x407ee6
shr eax, 0x18
mov dword [ebp + 0x28], eax
jmp 0x407ee6
cmp al, 0xf9
jne 0x407ee6
test dword [esp + 0x34], 0xffff0000
je 0x407ee6
or dword [ebp + 0x108], 0x200000
jmp 0x407ee6
cmp eax, 2
jne 0x407ee6
mov edx, dword [esp + 0x38]
mov al, byte [edx]
cmp al, 1
jne 0x407ebf
mov eax, dword [ebp + 0x3c]
test eax, eax
je 0x407e67
cmp eax, str.http:__emule_project.net
je 0x407e67
cmp eax, str.http:__www.emule_project.org
je 0x407e67
push eax
call fcn.00418290
add esp, 4
mov ecx, dword [esp + 0x34]
cmp ecx, 0x18
mov eax, dword [esp + 0x40]
jne 0x407e8f
mov ecx, 6
mov edi, str.http:__emule_project.net
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x407eaf
mov dword [ebp + 0x3c], str.http:__emule_project.net
jmp 0x407ee6
cmp ecx, 0x1c
jne 0x407eb3
mov ecx, 7
mov edi, str.http:__www.emule_project.org
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x407eaf
mov dword [ebp + 0x3c], str.http:__www.emule_project.org
jmp 0x407ee6
mov ecx, dword [esp + 0x34]
push ecx
push eax
call fcn.00402830
mov dword [ebp + 0x3c], eax
jmp 0x407ee3
cmp al, 0x21
jne 0x407ee6
test edi, edi
je 0x407ed0
push edi
call fcn.00418290
add esp, 4
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x40]
push eax
push ecx
call fcn.00402830
mov dword [esp + 0x18], eax
add esp, 8
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jb 0x407cde
push 0x465da0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x46649c]
test esi, esi
je 0x407f6b
test edi, edi
je 0x407f51
mov eax, edi
lea ebx, [ebx]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x407f48
test cl, cl
je 0x407f44
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x407f48
add eax, 2
add esi, 2
test cl, cl
jne 0x407f20
xor eax, eax
jmp 0x407f4d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x407f6b
push 0x465da0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [0x469a24]
mov ecx, dword [ebp + 0xdc]
push eax
push ecx
jmp 0x407fdf
mov ecx, dword [0x4664a4]
test ecx, ecx
jne 0x407f82
mov eax, dword [0x4664a0]
test eax, eax
je 0x408028
mov eax, dword [ebp + 0x3c]
test eax, eax
mov byte [esp + 0x50], 0
je 0x407fa2
push eax
lea edx, [esp + 0x54]
push edx
call fcn.00417030
mov ecx, dword [0x4664a4]
add esp, 8
test ecx, ecx
je 0x408008
push ecx
lea eax, [esp + 0x54]
push eax
call fcn.00423000
add esp, 8
test eax, eax
jne 0x408008
mov ecx, dword [0x462620]
cmp ecx, dword [0x46647c]
jb 0x408008
push 0x465da0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [0x4650ec]
mov eax, dword [ebp + 0xdc]
push edx
push eax
call fcn.00402090
mov ecx, dword [0x462d98]
mov eax, dword [0x462d9c]
add esp, 8
add ecx, 1
adc eax, 0
mov dword [0x462d98], ecx
mov dword [0x462d9c], eax
jmp 0x408330
mov eax, dword [0x4664a0]
test eax, eax
je 0x408028
lea ebx, [esp + 0x50]
call fcn.00402870
test eax, eax
je 0x408028
or dword [ebp + 0x108], 0x8000
push 0x465da0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor esi, esi
cmp edi, esi
je 0x408046
push edi
call fcn.00418290
add esp, 4
mov dword [esp + 0x10], esi
mov eax, dword [ebp + 0xe8]
cmp eax, esi
je 0x40806c
mov ecx, dword [eax + 0xc]
cmp ecx, dword [eax + 8]
jne 0x40806c
push eax
push 0x45a180
call fcn.0041f5e0
add esp, 8
mov dword [ebp + 0xe8], esi
mov edx, dword [ebp + 0x174]
mov ecx, dword [ebp + 0xdc]
mov edi, dword [sym.imp.WS2_32.dll_WSAAsyncSelect]
push 0x20
add edx, 0x401
mov byte [ebp + 0x39], 1
mov eax, dword [0x479ba0]
push edx
push eax
push ecx
call edi
mov al, byte [ebp + 0xdb]
test al, al
jne 0x408109
mov esi, ebp
call fcn.00401e80
mov edx, dword [ebp + 0xd8]
push edx
lea eax, [esp + 0x34]
push eax
call fcn.0041fa90
mov edx, dword [0x4650dc]
lea ecx, [esp + 0x38]
push ecx
push edx
lea eax, [esp + 0x260]
push eax
call fcn.00422d02
lea ecx, [esp + 0x264]
push ecx
push ebp
call fcn.00403ac0
mov edx, dword [ebp + 0x1c]
or edx, 0x800
push ebp
mov dword [ebp + 0x1c], edx
call fcn.00407470
add esp, 0x20
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
call fcn.004233fe
add esp, 0x444
ret
mov edx, dword [ebp + 0xd8]
push 0x4663b8
push edx
call fcn.004150a0
add esp, 8
test eax, eax
je 0x4081be
cmp dword [ebp + 0x48], 0xaa00
jae 0x408157
test byte [0x465dd8], 0x40
jne 0x40818b
push ebp
call fcn.004052e0
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
call fcn.004233fe
add esp, 0x444
ret
mov eax, dword [ebp + 0xd8]
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0041fa90
mov eax, dword [0x4650d4]
lea edx, [esp + 0x38]
push edx
push eax
lea ecx, [esp + 0x60]
push ecx
call fcn.00422d02
lea edx, [esp + 0x64]
push edx
push ebp
call fcn.00403ac0
add esp, 0x1c
mov esi, ebp
call fcn.00401e80
mov edx, dword [ebp + 0x1c]
or edx, 0x800
push ebp
mov dword [ebp + 0x1c], edx
call fcn.00407470
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
call fcn.004233fe
add esp, 0x444
ret
mov eax, dword [ebp + 0xd8]
push 0x4663cc
push eax
call fcn.004150a0
add esp, 8
test eax, eax
je 0x408209
mov esi, ebp
call fcn.00401e80
mov edx, dword [ebp + 0x1c]
or edx, 0x4000800
push ebp
mov dword [ebp + 0x1c], edx
call fcn.00407470
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
call fcn.004233fe
add esp, 0x444
ret
mov eax, dword [ebp + 0x3c]
cmp eax, esi
je 0x408226
push str.lowid
push eax
call fcn.00423000
add esp, 8
test eax, eax
jne 0x40818b
test dword [ebp + 0x1c], 0x80000
je 0x40825b
mov ecx, dword [ebp + 0xd8]
push ebp
mov dword [ebp + 0x8c], ecx
call fcn.00407470
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
call fcn.004233fe
add esp, 0x444
ret
push esi
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x408330
push esi
mov dword [ebp + 0xe0], esi
call fcn.00415d20
mov eax, dword [0x465e14]
add esp, 4
test eax, eax
je 0x4082b4
xor edx, edx
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x24], eax
push 0x10
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x30], edx
push esi
mov dword [esp + 0x38], edx
mov word [esp + 0x2c], 2
call dword [sym.imp.WS2_32.dll_bind]
xor edx, edx
mov dx, word [ebp + 0x90]
xor ecx, ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], ecx
mov word [esp + 0x20], 2
push edx
call dword [sym.imp.WS2_32.dll_htons]
push 0x10
lea ecx, [esp + 0x24]
mov word [esp + 0x26], ax
mov eax, dword [ebp + 0xd8]
push ecx
push esi
mov dword [esp + 0x30], eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x408361
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call ebx
cmp eax, 0x2733
je 0x408361
call ebx
push eax
lea edx, [esp + 0x254]
push esi
push edx
call fcn.0040f280
add esp, 4
push eax
push str._s_connect_fd_d____1_errno_d_n
call fcn.0040ce60
add esp, 0x10
mov eax, dword [esp + 0x10]
test eax, eax
je 0x408341
push eax
call fcn.00418290
add esp, 4
push ebp
call fcn.004052e0
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
call fcn.004233fe
add esp, 0x444
ret
mov eax, dword [ebp + 0x174]
mov ecx, dword [0x479ba0]
push 0x37
add eax, 0x401
push eax
push ecx
push esi
call edi
mov ecx, dword [esp + 0x450]
pop edi
pop esi
pop ebp
pop ebx
call fcn.004233fe
add esp, 0x444
ret