Function at 0x406db0
Capabilities:
Create thread
Resume thread

Disassembly:
sub esp, 0x90
push ebx
push ebp
push edi
mov ecx, 0x1f
xor eax, eax
lea edi, [esp + 0x20]
mov dword [esp + 0x1c], 0
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa0]
test eax, eax
je 0x4070da
mov eax, dword [esp + 0xa4]
test eax, eax
je 0x4070da
mov ebp, dword [esp + 0xa8]
test ebp, ebp
jle 0x4070da
cmp ebp, 0x20
jg 0x4070da
mov eax, ebp
shl eax, 6
add eax, ebp
lea ecx, [ebp + eax*2]
shl ecx, 3
push ecx
call sub.MFC42.DLL_operatornew
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [esp + 0x18], ebx
je 0x406e72
lea eax, [ebp - 1]
push esi
test eax, eax
mov edx, ebx
jl 0x406e4d
lea esi, [eax + 1]
mov ecx, 0x106
xor eax, eax
mov edi, edx
add edx, 0x418
rep stosd dword es:[edi], eax
mov dword [edx - 0x10], 0x7fffffff
dec esi
jne 0x406e32
test ebp, ebp
mov dword [esp + 0x14], 0
jle 0x406f4a
mov edi, dword [esp + 0xa8]
lea edx, [esp + 0x20]
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], edi
jmp 0x406e91
push ebp
push str._GetBestIP__new_TestSpeedData__d__error
call fcn.00411930
add esp, 8
or eax, 0xffffffff
pop edi
pop ebp
pop ebx
add esp, 0x90
ret
mov edi, dword [esp + 0x10]
lea eax, [ebx + 0x404]
push eax
push edi
call fcn.00406d60
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov edx, ecx
mov esi, edi
mov edi, ebx
push 4
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebx
and ecx, 3
push 0x406b90
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0xbc]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov edx, ecx
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x34]
mov dword [ebx + 0x400], esi
call dword [sym.imp.MSVCRT.dll__beginthreadex]
mov ecx, dword [esp + 0x38]
add esp, 0x20
cmp eax, 0xffffffff
mov dword [ecx], eax
je 0x406f39
test eax, eax
je 0x406f39
mov edi, dword [esp + 0x10]
inc esi
add edi, 0x27
add ebx, 0x418
add ecx, 4
cmp esi, ebp
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], ecx
jl 0x406e8d
jmp 0x406f46
push str._GetBestIP___beginthreadex_failed
call fcn.00411930
add esp, 4
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], 0xffffffff
cmp eax, ebp
jl 0x407042
xor esi, esi
test ebp, ebp
jle 0x406f93
lea edi, [esp + 0x20]
mov edx, dword [edi]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
cmp eax, 0xffffffff
jne 0x406f8b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str._GetBestIP__ResumeThread___d__errorCode___d
call fcn.00411930
add esp, 0xc
inc esi
add edi, 4
cmp esi, ebp
jl 0x406f68
mov eax, dword [0x4476fc]
mov esi, dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
lea ecx, [esp + 0x20]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
push eax
push 1
push ecx
push ebp
call esi
cmp eax, 0xffffffff
je 0x407057
cmp eax, 0x102
jne 0x407020
mov edx, dword [0x4476fc]
push edx
push str._GetBestIP__WaitForMultipleObjects_g_ulLineTimeout___d
call fcn.00411930
mov eax, dword [0x4476fc]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
push eax
push ebp
push ebx
call fcn.00407140
add esp, 0x14
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x407090
push 0x7530
lea ecx, [esp + 0x24]
push 0
push ecx
push ebp
call esi
cmp eax, 0xffffffff
je 0x40706d
cmp eax, 0x102
je 0x407083
mov dword [esp + 0x10], eax
jmp 0x407090
mov eax, dword [0x4476fc]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 3
push edx
push ebp
push ebx
call fcn.00407140
add esp, 0xc
mov dword [esp + 0x10], eax
jmp 0x407090
push str._GetBestIP___beginthreadex_failed
call fcn.00411930
mov esi, dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
add esp, 4
jmp 0x407090
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._GetBestIP__WaitForMultipleObjects_errorCode___d
call fcn.00411930
add esp, 8
jmp 0x407090
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetBestIP_WaitForMultipleObjects_WAIT_FAILED_errorCode___d
call fcn.00411930
add esp, 8
jmp 0x407090
push str._GetBestIP__WaitForMultipleObjects_30
call fcn.00411930
add esp, 4
push ebp
push ebx
call fcn.00407100
push ebx
call sub.MFC42.DLL_operatordelete
add esp, 0xc
lea eax, [esp + 0x20]
push 0xffffffffffffffff
push 1
push eax
push ebp
call esi
test ebp, ebp
jle 0x4070cb
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esi, [esp + 0x20]
mov ecx, dword [esi]
push ecx
call edi
mov dword [esi], 0
add esi, 4
dec ebp
jne 0x4070ba
mov eax, dword [esp + 0x10]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x90
ret
push str._GetBestIP_pResourceURL__NULL__strIP__NULL__iIPCount___0__iIPCount___MAX_IP_COUNT
call fcn.00411930
add esp, 4
or eax, 0xffffffff
pop edi
pop ebp
pop ebx
add esp, 0x90
ret