Function at 0x40aa80
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 0x4ba48c
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 0x40aaf0
mov ecx, 0x4e9880
call fcn.0040ae30
mov ecx, dword [0x4eacac]
mov edx, dword [0x4e7ef0]
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_MessageBoxW]
cmp eax, 7
jne 0x40adef
push 0
jmp 0x40ade3
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 0x40adb0
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 [0x4eaed0]
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 2
mov dword [esp + 0x3c], 1
mov dword [esp + 0x40], 6
cmp eax, ebx
jne 0x40ab5b
push ebx
call fcn.00406170
mov dword [0x4eaed0], 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 0x40ada9
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 0x40abe8
lea esp, [esp]
mov eax, dword [0x4eacac]
mov ecx, dword [0x4e7ef0]
push 0x10012
push eax
push str.Failed_to_connect_to_an_active_debugger_client.
push ecx
call dword [sym.imp.USER32.dll_MessageBoxW]
sub eax, 3
je 0x40ae0b
sub eax, 2
je 0x40ae18
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 0x40aba0
mov eax, dword [0x4eaed4]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
cmp eax, ebx
jne 0x40ac05
push 2
call fcn.00406170
mov dword [0x4eaed4], eax
mov edx, dword [esp + 0x14]
push edx
call eax
cmp esi, ebx
jne 0x40ada9
mov dword [0x4e9890], edi
mov edi, vtable.CKuStringT_wchar_t__class_CKuStringUtilW_.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.0040bf50
call fcn.0040bea0
push eax
lea eax, [esp + 0x58]
push eax
call fcn.004054d0
mov ecx, esi
mov byte [esp + 0x214], 2
call fcn.0040be60
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.0040bf50
call fcn.0040bea0
push eax
lea ecx, [esp + 0x64]
push ecx
call fcn.004054d0
mov ecx, esi
mov byte [esp + 0x214], 5
call fcn.0040be60
mov eax, dword [esp + 0x64]
mov dword [0x4e98b0], ebx
mov dword [0x4e98b4], ebx
cmp eax, ebx
je 0x40acbc
mov eax, dword [eax]
mov edi, eax
cmp eax, ebx
jne 0x40acc1
mov edi, 0x4bbf48
mov eax, dword [esp + 0x58]
cmp eax, ebx
je 0x40accf
mov esi, dword [eax]
cmp esi, ebx
jne 0x40acd4
mov esi, 0x4bbf48
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, 0x4e98a8
call fcn.0040b200
mov edx, dword [0x4eacac]
add esp, 0x10
push edx
lea eax, [esp + 0x70]
push eax
call fcn.004054d0
call fcn.00404bf0
push eax
mov eax, edi
call fcn.0040b520
lea eax, [esp + 0x6c]
call fcn.0046fd60
or eax, 0xffffffff
mov ebx, 0x4bc740
mov ecx, edi
call fcn.0040b1a0
mov ecx, 0x4e9880
call fcn.0040a980
test eax, eax
lea eax, [esp + 0x60]
jne 0x40ad7d
mov ecx, dword [0x4ea818]
mov dword [0x4e9894], ecx
mov byte [esp + 0x214], 2
call fcn.0046fd60
lea eax, [esp + 0x54]
mov dword [esp + 0x214], 0xffffffff
call fcn.0046fd60
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 [0x4e9890], esi
mov byte [esp + 0x214], 2
call fcn.0046fd60
lea eax, [esp + 0x54]
mov dword [esp + 0x214], esi
call fcn.0046fd60
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, 0x4e9880
call fcn.0040ae30
mov edx, dword [0x4eacac]
mov eax, dword [0x4e7ef0]
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_MessageBoxW]
cmp eax, 7
jne 0x40adef
push ebx
push 7
mov ecx, 0x4ea1d0
call fcn.0042b150
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 7
mov ecx, 0x4ea1d0
call fcn.0042b150
push edi
call dword [sym.imp.WSOCK32.dll_closesocket]
jmp 0x40adef