Function at 0x40a860
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4a3fec
push eax
mov dword fs:[0], esp
sub esp, 0x200
push ebx
push esi
push edi
lea eax, [esp + 0x78]
push eax
push 0x202
call dword [sym.imp.WSOCK32.dll_WSAStartup]
test eax, eax
je 0x40a8d0
mov ecx, 0x4bc3b8
call fcn.0040ac10
mov ecx, dword [0x4bca50]
mov edx, dword [0x4bb428]
push 0x10014
push ecx
push str.An_internal_error_has_occurred_in_the_debugger_engine._nContinue_running_the_script_without_the_debugger_
push edx
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 7
jne 0x40abd0
push 0
jmp 0x40abc4
push 6
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov edi, eax
xor ebx, ebx
mov dword [esp + 0x18], edi
cmp edi, 0xffffffff
je 0x40ab91
xor eax, eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov eax, dword [0x4b9fe4]
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 2
mov dword [esp + 0x3c], 1
mov dword [esp + 0x40], 6
cmp eax, ebx
jne 0x40a93b
push ebx
call fcn.00406050
mov dword [0x4b9fe4], eax
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [ebp + 0xc]
lea edx, [esp + 0x38]
push edx
mov edx, dword [ebp + 8]
push ecx
push edx
call eax
mov esi, eax
push esi
call dword [sym.imp.WSOCK32.dll_WSASetLastError]
cmp esi, ebx
jne 0x40ab8a
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x10]
mov edx, dword [eax + 0x18]
push ecx
push edx
push edi
call dword [sym.imp.WSOCK32.dll_connect]
mov esi, eax
cmp esi, ebx
je 0x40a9c8
lea esp, [esp]
mov eax, dword [0x4bca50]
mov ecx, dword [0x4bb428]
push 0x10012
push eax
push str.Failed_to_connect_to_an_active_debugger_client.
push ecx
call dword [sym.imp.USER32.dll_MessageBoxA]
sub eax, 3
je 0x40abec
sub eax, 2
je 0x40abf9
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 0x10]
mov eax, dword [eax + 0x18]
push edx
push eax
push edi
call dword [sym.imp.WSOCK32.dll_connect]
mov esi, eax
cmp esi, ebx
jne 0x40a980
mov eax, dword [0x4b9fe8]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
cmp eax, ebx
jne 0x40a9e5
push 2
call fcn.00406050
mov dword [0x4b9fe8], eax
mov edx, dword [esp + 0x14]
push edx
call eax
cmp esi, ebx
jne 0x40ab8a
mov dword [0x4bc3c8], edi
mov edi, vtable.CKuStringT_char__class_CKuStringUtilA_.0
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], ebx
mov byte [esp + 0x30], bl
push str.DBGP_IDEKEY
lea esi, [esp + 0x2c]
mov dword [esp + 0x218], ebx
call fcn.0040bd20
call fcn.00403d60
lea ecx, [esp + 0x54]
push ecx
mov ecx, eax
call fcn.0040c090
mov ecx, esi
mov byte [esp + 0x214], 2
call fcn.00403e50
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], ebx
mov byte [esp + 0x24], bl
push str.DBGP_COOKIE
lea esi, [esp + 0x20]
mov byte [esp + 0x218], 3
call fcn.0040bd20
call fcn.00403d60
lea edx, [esp + 0x60]
push edx
mov ecx, eax
call fcn.0040c090
mov ecx, esi
mov byte [esp + 0x214], 5
call fcn.00403e50
mov eax, dword [esp + 0x64]
mov dword [0x4bc3e8], ebx
mov dword [0x4bc3ec], ebx
cmp eax, ebx
je 0x40aa9e
mov eax, dword [eax]
mov edi, eax
cmp eax, ebx
jne 0x40aaa3
mov edi, 0x4a7935
mov eax, dword [esp + 0x58]
cmp eax, ebx
je 0x40aab1
mov esi, dword [eax]
cmp esi, ebx
jne 0x40aab6
mov esi, 0x4a7935
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push edi
push esi
push str._init_appid_AutoHotkey__ide_key__e__session__e__thread__u__parent___language_AutoHotkey__protocol_version_1.0__fileuri_
mov edi, 0x4bc3e0
call fcn.0040afe0
mov ecx, dword [0x4bca50]
add esp, 0x10
lea eax, [esp + 0x6c]
push eax
call fcn.0040c090
call fcn.00403d60
push eax
mov eax, edi
call fcn.0040b300
lea eax, [esp + 0x6c]
call fcn.0040c050
or eax, 0xffffffff
mov ebx, 0x4a8228
mov ecx, edi
call fcn.0040af80
mov ecx, 0x4bc3b8
call fcn.0040a760
test eax, eax
lea eax, [esp + 0x60]
jne 0x40ab5e
mov ecx, dword [0x4bc7c4]
mov dword [0x4bc3cc], ecx
mov byte [esp + 0x214], 2
call fcn.0040c050
lea eax, [esp + 0x54]
mov dword [esp + 0x214], 0xffffffff
call fcn.0040c050
xor eax, eax
mov ecx, dword [esp + 0x20c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
or esi, 0xffffffff
mov dword [0x4bc3c8], esi
mov byte [esp + 0x214], 2
call fcn.0040c050
lea eax, [esp + 0x54]
mov dword [esp + 0x214], esi
call fcn.0040c050
mov edi, dword [esp + 0x18]
xor ebx, ebx
push edi
call dword [sym.imp.WSOCK32.dll_closesocket]
call dword [sym.imp.WSOCK32.dll_WSACleanup]
mov ecx, 0x4bc3b8
call fcn.0040ac10
mov edx, dword [0x4bca50]
mov eax, dword [0x4bb428]
push 0x10014
push edx
push str.Failed_to_connect_to_an_active_debugger_client._nContinue_running_the_script_without_the_debugger_
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 7
jne 0x40abd0
push ebx
push 4
mov ecx, 0x4bc450
call fcn.004204d0
mov ecx, dword [esp + 0x20c]
pop edi
pop esi
mov eax, 0x3e6
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 8
push ebx
push 4
mov ecx, 0x4bc450
call fcn.004204d0
push edi
call dword [sym.imp.WSOCK32.dll_closesocket]
jmp 0x40abd0