Function at 0x409770
Capabilities:
Check for time delay via gettickcount
Check for time delay via queryperformancecounter
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x270
mov eax, dword [0x445750]
xor eax, esp
mov dword [esp + 0x26c], eax
push ebx
push ebp
push esi
xor ebp, ebp
push edi
mov ebx, ecx
mov dword [esp + 0x18], ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_GetPriorityClass]
cmp dword [0x444bd8], ebp
mov dword [esp + 0x20], eax
jl 0x409842
push 0x4477f8
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov eax, dword [0x447a00]
cmp eax, ebp
je 0x4097e1
push eax
call fcn.0041e77a
mov eax, dword [0x447a08]
push eax
mov dword [0x447a00], ebp
call fcn.0041e77a
add esp, 8
mov dword [0x447a08], ebp
mov ecx, dword [0x444bd8]
lea edx, [ecx*4 + 4]
push edx
call fcn.0041e962
mov dword [0x447a00], eax
mov eax, dword [0x444bd8]
inc eax
shl eax, 4
push eax
call fcn.0041e962
mov ecx, dword [0x444bd8]
lea edx, [ecx*4 + 4]
push edx
mov dword [0x447a08], eax
mov eax, dword [0x447a00]
push ebp
push eax
call fcn.0041e700
mov ecx, dword [0x444bd8]
mov edx, dword [0x447a08]
inc ecx
shl ecx, 4
push ecx
push ebp
push edx
call fcn.0041e700
add esp, 0x20
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [ebx + 0x41c], ebp
jne 0x409cbd
lea esp, [esp]
mov edi, dword [ebx + 0x40c]
mov dword [esp + 0x14], edi
mov esi, 1
cmp dword [esp + 0x18], ebp
jne 0x40988b
add edi, esi
cmp edi, 0x100
mov dword [esp + 0x14], edi
jl 0x409891
mov dword [esp + 0x14], ebp
mov edi, ebp
jmp 0x409891
inc dword [0x4479fc]
cmp edi, dword [ebx + 0x418]
jne 0x4098b8
mov eax, dword [ebx + 0x40c]
add dword [ebx + 0x408], esi
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
jne 0x4098b6
mov dword [esp + 0x14], ebp
mov edi, ebp
jmp 0x4098b8
mov edi, eax
cmp dword [0x444bd8], ebp
jl 0x4098cb
push 0x447808
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
cmp edi, 0xffffffff
jne 0x4098d8
mov edi, dword [ebx + 0x404]
jmp 0x4098dc
mov edi, dword [ebx + edi*4 + 4]
mov ecx, dword [0x447844]
push ebp
mov ebp, dword [sym.imp.WS2_32.dll_recv]
push esi
lea eax, [esp + 0x1b]
push eax
push ecx
mov dword [esp + 0x2c], esi
call ebp
mov al, byte [esp + 0x13]
cmp al, 7
je 0x409989
push 0
push esi
cmp al, 0x70
jne 0x409927
mov eax, dword [0x447844]
lea edx, [esp + 0x1b]
push edx
push eax
mov byte [esp + 0x23], 0x71
call dword [sym.imp.WS2_32.dll_send]
mov dword [0x447254], esi
jmp 0x40996d
cmp al, 0x72
jne 0x40994e
mov edx, dword [0x447844]
lea ecx, [esp + 0x1b]
push ecx
push edx
mov byte [esp + 0x23], 0x73
call dword [sym.imp.WS2_32.dll_send]
mov dword [0x447254], 0
jmp 0x40996d
cmp al, 5
je 0x409a7b
mov ecx, dword [0x447844]
lea eax, [esp + 0x1b]
push eax
push ecx
mov byte [esp + 0x23], 0xb
call dword [sym.imp.WS2_32.dll_send]
mov eax, dword [0x447844]
push 0
push esi
lea edx, [esp + 0x1b]
push edx
push eax
call ebp
mov al, byte [esp + 0x13]
cmp al, 7
jne 0x409902
mov edx, dword [0x447844]
push 0
push esi
lea ecx, [esp + 0x1b]
push ecx
push edx
mov byte [esp + 0x23], 8
call dword [sym.imp.WS2_32.dll_send]
mov ecx, dword [0x447840]
xor esi, esi
push esi
push 0x254
lea eax, [esp + 0x2c]
push eax
push ecx
call ebp
cmp eax, 0x254
je 0x4099c9
mov dword [esp + 0x1c], esi
jmp 0x409aaa
mov edx, dword [esp + 0x2c]
push edx
call fcn.0040fab4
mov dword [esp + 0x27c], eax
mov eax, dword [esp + 0x30]
add esp, 4
mov edx, dword [0x447840]
push 0
sub eax, esi
push eax
mov eax, dword [esp + 0x280]
lea ecx, [esi + eax]
push ecx
push edx
call ebp
test eax, eax
jl 0x409dd8
add esi, eax
mov eax, dword [esp + 0x2c]
cmp esi, eax
jne 0x4099e1
mov ecx, dword [0x447844]
push 0
push 1
lea eax, [esp + 0x1b]
push eax
push ecx
call ebp
cmp byte [esp + 0x13], 9
je 0x409a32
mov dword [esp + 0x1c], 0
jmp 0x409aaa
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x278]
push edx
push eax
push edi
call fcn.0041ea30
add esp, 0xc
lea ecx, [esp + 0x24]
push ecx
mov ecx, 0x44781d
call fcn.00403d20
mov eax, dword [0x447844]
push 0
push 1
lea edx, [esp + 0x1b]
push edx
push eax
mov byte [esp + 0x23], 0xa
call dword [sym.imp.WS2_32.dll_send]
mov dword [esp + 0x1c], 1
jmp 0x409aaa
mov edx, dword [0x447844]
lea ecx, [esp + 0x1b]
push ecx
push edx
mov byte [esp + 0x23], 6
call dword [sym.imp.WS2_32.dll_send]
mov eax, dword [0x447840]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebx + 0x41c], esi
mov eax, dword [0x4479e8]
dec eax
cmp eax, 6
ja case.0x409ab9.2
jmp dword [eax*4 + 0x409dec]
mov ecx, dword [0x4479ec]
mov ebp, dword [0x4479f0]
add ecx, 0xfffffffb
imul ecx, ebp
lea esi, [edi + ecx*2]
jmp 0x409b1c
mov eax, dword [0x4479ec]
mov ebp, dword [0x4479f0]
add eax, 0xfffffffb
imul eax, ebp
lea esi, [edi + eax*2 + 0xc]
jmp 0x409b1c
mov ecx, dword [0x4479ec]
mov ebp, dword [0x4479f0]
add ecx, 0xfffffffb
imul ecx, ebp
lea esi, [edi + ecx*2 + 0x20]
jmp 0x409b1c
mov edx, dword [0x4479ec]
mov ebp, dword [0x4479f0]
add edx, 0xfffffffb
imul edx, ebp
lea esi, [edi + edx*2 + 0x10]
test esi, esi
je 0x409c95
cmp dword [0x444bd8], 0
jl 0x409c95
push 0x447800
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
cmp dword [0x447a04], 0
mov eax, dword [0x444bd8]
jne 0x409b58
cmp dword [0x447398], 0
jle 0x409b58
mov dword [0x447a04], eax
mov ecx, dword [0x447800]
sub ecx, dword [0x447808]
mov edx, dword [0x447a00]
mov dword [edx + eax*4], ecx
mov ecx, dword [0x4479f0]
movzx edx, word [esi + ecx*8]
mov eax, dword [0x444bd8]
mov ecx, dword [0x447a08]
shl eax, 4
mov word [eax + ecx], dx
mov edx, dword [0x4479ec]
imul edx, dword [0x4479f0]
mov eax, dword [0x444bd8]
sar edx, 1
movzx ecx, word [edi + edx*2 + 0x34]
mov edx, dword [0x447a08]
shl eax, 4
mov word [eax + edx + 2], cx
mov eax, dword [0x4479ec]
imul eax, dword [0x4479f0]
mov ecx, dword [0x444bd8]
sar eax, 1
movzx edx, word [edi + eax*2 + 0x44]
mov eax, dword [0x447a08]
shl ecx, 4
mov word [ecx + eax + 4], dx
mov edx, dword [0x4479f0]
movzx eax, word [esi + edx*2]
mov ecx, dword [0x444bd8]
mov edx, dword [0x447a08]
shl ecx, 4
mov word [ecx + edx + 6], ax
mov eax, dword [0x444bd8]
movzx ecx, word [esi]
mov edx, dword [0x447a08]
shl eax, 4
mov word [eax + edx + 8], cx
call fcn.0040d760
mov ecx, dword [0x444bd8]
mov edx, dword [0x447a08]
shl ecx, 4
mov word [ecx + edx + 0xa], ax
mov eax, dword [0x444bd8]
movzx ecx, word [ebx + 0x418]
mov edx, dword [0x447a08]
shl eax, 4
mov word [eax + edx + 0xc], cx
mov eax, dword [0x4479ec]
imul eax, dword [0x4479f0]
movzx ecx, word [edi + eax*2 - 2]
movzx eax, word [edi + eax*2 - 4]
mov edx, 0x3ff
and cx, dx
mov edx, dword [0x444bd8]
shl ax, 0xc
or cx, ax
mov eax, dword [0x447a08]
shl edx, 4
mov word [edx + eax + 0xe], cx
mov ebp, dword [0x4479f0]
mov ecx, 1
sub dword [0x444bd8], ecx
jmp 0x409c9a
mov ebp, dword [0x4479f0]
mov ecx, 1
jmp 0x409c9a
mov ecx, 1
mov eax, dword [esp + 0x18]
test eax, eax
jl 0x409caf
cmp eax, ecx
jle 0x409cff
cmp eax, 2
jne 0x409caf
mov dword [esp + 0x18], ecx
xor ebp, ebp
cmp dword [ebx + 0x41c], ebp
je 0x409860
cmp dword [0x4479f4], ebp
je 0x409cd2
mov edx, dword [ebx + 0x424]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
mov ecx, dword [esp + 0x27c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0041e904
add esp, 0x270
ret
cmp dword [esp + 0x1c], 0
je 0x409cab
cmp dword [0x4479e4], ecx
jg 0x409d92
cmp dword [0x4479e8], ecx
jne 0x409d92
mov ecx, dword [0x4479ec]
imul ecx, ebp
mov eax, ebp
cdq
sub eax, edx
mov edx, eax
sar edx, 1
mov eax, ecx
sub eax, edx
movsx edx, word [edi + eax*2 - 2]
movsx eax, word [edi + eax*2 + 4]
and edx, 0x3fff
and eax, 0x3fff
sub eax, edx
cmp eax, 0x5dc
jge 0x409d85
mov cx, word [edi + ecx*2 - 2]
mov edx, 0x3fff
and cx, dx
mov eax, 0x3a98
cmp cx, ax
jle 0x409d85
mov ecx, dword [0x4479ec]
dec ecx
imul ecx, ebp
mov dx, word [edi + ecx*2]
mov eax, 0x3fff
and dx, ax
mov ecx, 0x3a98
cmp dx, cx
jl 0x409d92
mov dword [esp + 0x18], 2
jmp 0x409caf
mov edx, dword [ebx + 0x40c]
mov dword [ebx + 0x410], edx
call fcn.0040d760
mov ecx, dword [0x4479ec]
imul ecx, dword [0x4479f0]
mov edx, dword [esp + 0x14]
mov word [edi + ecx*2], ax
mov eax, dword [ebx + 0x424]
push eax
mov dword [ebx + 0x40c], edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov dword [esp + 0x18], 0
jmp 0x409caf
mov ecx, dword [0x447840]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x409ce4