Function at 0x401f40
Capabilities:
Encode data using xor
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
mov ebx, ecx
push edi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
movzx edi, ax
mov eax, edi
mov dword [ebp - 8], eax
xor eax, 0x5678
movzx esi, ax
mov eax, esi
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 4
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x40], eax
mov ecx, esi
mov dword [ebp - 0x3c], eax
add eax, 4
mov dword [ebp - 0x38], eax
imul eax, edi, 0xd
shl ecx, 4
add ecx, esi
mov word [ebp - 0x1a], si
mov esi, dword [ebp + 0xc]
mov word [ebp - 0x1c], di
add eax, 3
mov dword [ebp - 0x12], esi
add eax, ecx
lea ecx, [ebp - 0x40]
mov word [ebp - 0x18], ax
lea eax, [esi + 0xe]
mov dword [ebp - 0x16], eax
lea eax, [ebp - 0x1c]
test esi, esi
je 0x402011
push 0xe
push eax
call fcn.004021a0
push esi
push dword [ebp + 8]
lea ecx, [ebp - 0x40]
call fcn.004021a0
mov eax, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x40]
sub eax, edi
cmp eax, 0xe
mov eax, dword [ebp - 8]
movzx eax, al
jbe 0x401fed
add edi, 0xe
jmp 0x401fef
xor edi, edi
imul edx, eax, 0xd
add dl, byte [ebp - 0xc]
xor ecx, ecx
movzx eax, dl
imul edx, eax, 0xd
mov al, byte [edi + ecx]
xor al, cl
add dl, 7
xor al, dl
mov byte [edi + ecx], al
inc ecx
cmp ecx, esi
jb 0x401ff7
jmp 0x402019
push 6
push eax
call fcn.004021a0
lea edi, [ebx + 0x38]
lea esi, [edi + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [edi]
mov eax, dword [edi + 4]
sub eax, ecx
push eax
push 0
push ecx
call fcn.00406600
mov eax, dword [edi]
add esp, 0xc
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [edi + 4], eax
push esi
call ebx
mov esi, dword [ebp - 0x3c]
xor eax, eax
sub esi, dword [ebp - 0x40]
mov ecx, edi
cmp eax, esi
push esi
sbb eax, eax
and eax, dword [ebp - 0x40]
push eax
call fcn.004021a0
mov edx, dword [ebp - 0x3c]
xor ecx, ecx
sub edx, dword [ebp - 0x40]
cmp ecx, edx
mov dword [ebp - 0xc], edx
mov ecx, dword [ebp - 4]
sbb edi, edi
xor esi, esi
and edi, dword [ebp - 0x40]
mov dword [ebp + 8], esi
cmp dword [ecx + 0x10], 0xffffffff
jne 0x402087
or edi, 0xffffffff
jmp 0x402126
mov ebx, dword [sym.imp.WS2_32.dll_send]
mov eax, edx
cmp edx, 0xc800
mov dword [ebp + 0xc], eax
jl 0x4020e4
xor esi, esi
nop dword [eax]
push 0
push 0xc800
push edi
push dword [ecx + 0x10]
call ebx
test eax, eax
jg 0x4020bc
mov ecx, dword [ebp - 4]
inc esi
cmp esi, 0xf
jl 0x4020a0
je 0x40210d
mov esi, dword [ebp + 8]
add edi, 0xc800
add esi, eax
push 0xa
mov dword [ebp + 8], esi
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 4]
sub eax, 0xc800
cmp eax, 0xc800
jmp 0x402095
test eax, eax
jle 0x402117
xor esi, esi
nop word [eax + eax]
push 0
push eax
push edi
push dword [ecx + 0x10]
call ebx
mov edx, eax
test edx, edx
jg 0x402112
mov ecx, dword [ebp - 4]
inc esi
mov eax, dword [ebp + 0xc]
cmp esi, 0xf
jl 0x4020f0
jne 0x402112
or edi, 0xffffffff
jmp 0x402120
mov esi, dword [ebp + 8]
add esi, edx
or edi, 0xffffffff
cmp esi, dword [ebp - 0xc]
cmove edi, esi
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebp - 0x34]
push eax
call esi
cmp dword [ebp - 0x40], 0
je 0x402170
lea eax, [ebp - 0x34]
push eax
call esi
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x40]
sub eax, ecx
push eax
push 0
push ecx
call fcn.00406600
mov eax, dword [ebp - 0x40]
add esp, 0xc
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x34]
push eax
call ebx
push dword [ebp - 0x40]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea eax, [ebp - 0x34]
mov dword [ebp - 0x40], 0
push eax
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
call ebx
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8