Function at 0x408020
Capabilities:
Check for time delay via gettickcount
Create tcp socket
Create udp socket
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x432a5c
mov eax, dword fs:[0]
push eax
sub esp, 0x95c
mov eax, dword [0x43c2d0]
xor eax, ebp
mov dword [ebp - 0x30], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x884], 0
lea ecx, [ebp - 0x870]
call fcn.00401000
mov dword [ebp - 4], 0
mov byte [ebp - 0x834], 0
push 0x7ff
push 0
lea eax, [ebp - 0x833]
push eax
call fcn.00422bf0
add esp, 0xc
lea ecx, [ebp - 0x90c]
call fcn.00405000
mov byte [ebp - 4], 1
mov dword [ebp - 0x85c], 0
mov dword [ebp - 0x854], 0
mov dword [ebp - 0x874], 0
cmp dword [ebp + 8], 1
jne 0x4080cd
mov dword [ebp - 0x854], 0x14
mov dword [ebp - 0x874], 0x7d0
jmp 0x4080e7
cmp dword [ebp + 8], 0
jne 0x4080e7
mov dword [ebp - 0x854], 5
mov dword [ebp - 0x874], 0
mov ecx, dword [ebp + 0x1c]
mov dword [ecx], 0
mov dword [ebp - 0x918], 0
mov dword [ebp - 0x83c], 0
mov edx, dword [ebp + 0x28]
mov dword [edx], 0
mov dword [ebp - 0x850], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x91c], eax
mov dword [ebp - 0x10], 0
mov ecx, dword [ebp + 0xc]
call fcn.004033b0
push eax
call fcn.00407f30
add esp, 4
mov dword [ebp - 0x914], eax
cmp dword [ebp - 0x914], 0xffffffff
jne 0x4081ad
cmp dword [ebp - 0x10], 5
jae 0x408177
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
jmp 0x40813c
mov dword [ebp - 0x964], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x90c]
call fcn.004050e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x870]
call fcn.00401020
mov eax, dword [ebp - 0x964]
jmp 0x4089c5
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov dword [ebp - 0x838], eax
cmp dword [ebp - 0x838], 0xffffffff
jne 0x4081d6
mov dword [ebp - 0x884], 0
jmp 0x408992
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
mov edx, 2
mov word [ebp - 0x84c], dx
mov eax, dword [ebp - 0x914]
mov dword [ebp - 0x848], eax
movzx ecx, word [ebp + 0x10]
push ecx
call sub.WSOCK32.dll_htons
mov word [ebp - 0x84a], ax
cmp dword [ebp + 8], 1
jne 0x408234
push 0xf
push 0xa
push 0x3c
push 0x10
lea edx, [ebp - 0x84c]
push edx
mov eax, dword [ebp - 0x838]
push eax
call fcn.004077a0
add esp, 0x18
mov dword [ebp - 0x87c], eax
jmp 0x40825e
cmp dword [ebp + 8], 0
jne 0x40825e
push 0xf
push 0xa
push 2
push 0x10
lea ecx, [ebp - 0x84c]
push ecx
mov edx, dword [ebp - 0x838]
push edx
call fcn.004077a0
add esp, 0x18
mov dword [ebp - 0x87c], eax
cmp dword [ebp - 0x87c], 0xffffffff
jne 0x40831b
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
je 0x4082cc
cmp dword [ebp - 0x14], 5
jae 0x4082a3
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x838]
push edx
call fcn.004076c0
add esp, 4
jmp 0x4081ad
mov eax, dword [ebp + 0x28]
mov dword [eax], 0xa
mov ecx, dword [ebp - 0x838]
push ecx
call fcn.004076c0
add esp, 4
mov dword [ebp - 0x884], 0
jmp 0x408992
mov edx, dword [ebp + 0x28]
mov dword [edx], 0
mov eax, dword [ebp - 0x838]
push eax
call fcn.004076c0
add esp, 4
mov ecx, dword [ebp - 0x1c]
cmp ecx, dword [ebp - 0x854]
jae 0x40830c
mov edx, dword [ebp - 0x874]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x1c]
add eax, 1
mov dword [ebp - 0x1c], eax
jmp 0x4081ad
mov dword [ebp - 0x884], 0
jmp 0x408992
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x860], 0
push 0x4364a8
push str.Accept:__r_nAccept_Encoding:_deflate_r_nAccept_Language:zh_cn_r_nContent_Type_r_nAccept_Encoding_r_nReferer_r_nUser_Agent:Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.1__SV1__r_nHost_r_nRange:_r_nContent_Length_r_nConnection:Close_r_nCache_Control:no_cache_r_nCookie
lea ecx, [ebp - 0x90c]
call fcn.00405220
push 0x4365a8
lea ecx, [ebp - 0x90c]
call fcn.004055f0
mov ecx, dword [ebp + 0x24]
neg ecx
sbb ecx, ecx
and ecx, 2
mov dword [ebp - 0x908], ecx
mov edx, dword [ebp + 0x14]
push edx
lea ecx, [ebp - 0x8f8]
call fcn.00406e90
push str.Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.1__SV1__.NET_CLR_2.0.50727__
push str.User_Agent
lea ecx, [ebp - 0x90c]
call fcn.00405810
mov ecx, dword [ebp + 0xc]
call fcn.004033b0
push eax
push str.Host
lea ecx, [ebp - 0x90c]
call fcn.00405810
push str.no_cache
push str.Cache_Control
lea ecx, [ebp - 0x90c]
call fcn.00405810
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
je 0x4083d5
push 0
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ecx]
push edx
lea ecx, [ebp - 0x90c]
call fcn.00405870
push 0
lea ecx, [ebp - 0x90c]
call fcn.00405940
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
lea ecx, [ebp - 0x8c0]
call fcn.00401f90
mov dword [ebp - 0x28], eax
push 0
mov eax, dword [ebp - 0x28]
push eax
push 0
lea ecx, [ebp - 0x90c]
call fcn.00405940
push eax
mov ecx, dword [ebp - 0x838]
push ecx
call fcn.004075f0
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x408432
mov dword [ebp - 0x860], 0xb
jmp 0x408795
cmp dword [ebp + 0x24], 0
je 0x40846d
cmp dword [ebp + 0x20], 0
je 0x40846d
push 0
mov eax, dword [ebp + 0x24]
push eax
mov ecx, dword [ebp + 0x20]
push ecx
mov edx, dword [ebp - 0x838]
push edx
call fcn.004075f0
add esp, 0x10
movzx eax, al
test eax, eax
jne 0x40846d
mov dword [ebp - 0x860], 0xc
jmp 0x408795
mov dword [ebp - 0x880], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x20], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
lea ecx, [ebp - 0x870]
call fcn.00401020
mov ecx, 1
test ecx, ecx
je 0x408795
push 0
push 0x800
lea edx, [ebp - 0x834]
push edx
mov eax, dword [ebp - 0x838]
push eax
call sub.WSOCK32.dll_recv
mov dword [ebp - 0x87c], eax
cmp dword [ebp - 0x87c], 0xffffffff
jne 0x4084e9
cmp dword [ebp - 0x860], 0
jne 0x4084e2
mov dword [ebp - 0x860], 0xd
jmp 0x408795
cmp dword [ebp - 0x87c], 0
jne 0x40850a
cmp dword [ebp - 0x860], 0
jne 0x408505
mov dword [ebp - 0x860], 0xe
jmp 0x408795
cmp dword [ebp - 0x880], 0
jne 0x408711
mov ecx, dword [ebp - 0x87c]
push ecx
lea edx, [ebp - 0x834]
push edx
lea ecx, [ebp - 0x870]
call fcn.00407540
lea ecx, [ebp - 0x870]
call fcn.00401040
mov dword [ebp - 0x858], eax
push str._r_n_r_n
mov eax, dword [ebp - 0x858]
push eax
call fcn.004032f0
add esp, 8
mov dword [ebp - 0x910], eax
cmp dword [ebp - 0x910], 0
je 0x40870c
mov ecx, dword [ebp - 0x910]
add ecx, 2
mov dword [ebp - 0x910], ecx
mov edx, dword [ebp - 0x910]
mov byte [edx], 0
mov eax, dword [ebp - 0x910]
mov byte [eax + 1], 0
mov ecx, dword [ebp - 0x910]
add ecx, 2
mov dword [ebp - 0x910], ecx
mov edx, dword [ebp - 0x910]
sub edx, dword [ebp - 0x858]
mov dword [ebp - 0x28], edx
push 0x436634
mov eax, dword [ebp - 0x858]
push eax
lea ecx, [ebp - 0x90c]
call fcn.00405220
mov ecx, dword [ebp - 0x8a4]
mov dword [ebp - 0x860], ecx
cmp dword [ebp - 0x850], 0
jne 0x40860e
push str.Accept_Ranges
lea ecx, [ebp - 0x90c]
call fcn.004058f0
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0x850], eax
jne 0x40860e
push 0x436648
lea ecx, [ebp - 0x90c]
call fcn.004058f0
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0x850], eax
push str.Content_Length
lea ecx, [ebp - 0x90c]
call fcn.004058f0
mov dword [ebp - 0x878], eax
cmp dword [ebp - 0x878], 0
je 0x408683
push 0xa
push 0
mov edx, dword [ebp - 0x878]
push edx
call fcn.0041eb41
add esp, 0xc
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x860], 0xc8
jne 0x408683
cmp dword [ebp - 0x20], 0
je 0x408683
cmp dword [ebp - 0x83c], 0
jne 0x408669
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x83c], eax
jmp 0x408683
mov ecx, dword [ebp - 0x83c]
cmp ecx, dword [ebp - 0x20]
je 0x408683
mov dword [ebp - 0x860], 0x136
jmp 0x408795
mov edx, dword [ebp + 0x1c]
cmp dword [edx], 0
je 0x4086c3
push str.Content_Range
lea ecx, [ebp - 0x90c]
call fcn.004058f0
mov dword [ebp - 0x878], eax
cmp dword [ebp - 0x878], 0
je 0x4086c3
lea eax, [ebp - 0x83c]
push eax
mov ecx, dword [ebp - 0x878]
push ecx
call fcn.00407d00
add esp, 8
mov dword [ebp - 0x20], eax
mov edx, dword [ebp - 0x864]
sub edx, dword [ebp - 0x28]
mov dword [ebp - 0x87c], edx
je 0x4086f5
mov eax, dword [ebp - 0x87c]
push eax
mov ecx, dword [ebp - 0x28]
lea edx, [ebp + ecx - 0x834]
push edx
lea eax, [ebp - 0x834]
push eax
call fcn.0041eb70
add esp, 0xc
mov dword [ebp - 0x880], 1
lea ecx, [ebp - 0x870]
call fcn.00401020
jmp 0x408711
jmp 0x408499
cmp dword [ebp - 0x87c], 0
je 0x40876a
cmp dword [ebp - 0x860], 0xc8
je 0x408732
cmp dword [ebp - 0x860], 0xce
jne 0x40875e
cmp dword [ebp + 0x18], 0
je 0x40874e
mov ecx, dword [ebp - 0x87c]
push ecx
lea edx, [ebp - 0x834]
push edx
mov ecx, dword [ebp + 0x18]
call fcn.00407540
mov eax, dword [ebp + 0x1c]
mov ecx, dword [eax]
add ecx, dword [ebp - 0x87c]
mov edx, dword [ebp + 0x1c]
mov dword [edx], ecx
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x87c]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x20], 0
je 0x408778
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [ebp - 0x20]
jae 0x40878e
cmp dword [ebp - 0x83c], 0
je 0x408790
mov edx, dword [ebp + 0x1c]
mov eax, dword [edx]
cmp eax, dword [ebp - 0x83c]
jb 0x408790
jmp 0x408795
jmp 0x408499
mov ecx, dword [ebp - 0x838]
push ecx
call fcn.004076c0
add esp, 4
cmp dword [ebp - 0x860], 0x12d
je 0x4087c0
cmp dword [ebp - 0x860], 0x12e
jne 0x4088a0
push str.Location
lea ecx, [ebp - 0x90c]
call fcn.004058f0
mov dword [ebp - 0x920], eax
cmp dword [ebp - 0x920], 0
je 0x40889e
lea ecx, [ebp - 0x960]
call fcn.00403da0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x940]
call fcn.00403da0
mov byte [ebp - 4], 3
lea edx, [ebp - 0x944]
push edx
lea eax, [ebp - 0x940]
push eax
lea ecx, [ebp - 0x960]
push ecx
lea edx, [ebp - 0x924]
push edx
mov eax, dword [ebp - 0x920]
push eax
call fcn.00407c00
add esp, 0x14
cmp dword [ebp - 0x924], 3
jne 0x408880
lea ecx, [ebp - 0x960]
push ecx
mov ecx, dword [ebp + 0xc]
call fcn.00406e90
lea edx, [ebp - 0x940]
push edx
mov ecx, dword [ebp + 0x14]
call fcn.00406e90
movzx eax, word [ebp - 0x944]
mov dword [ebp + 0x10], eax
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x940]
call fcn.00403c20
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x960]
call fcn.00403c20
jmp 0x4080e7
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x940]
call fcn.00403c20
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x960]
call fcn.00403c20
jmp 0x4088c9
cmp dword [ebp - 0x860], 0x136
jne 0x4088c9
cmp dword [ebp - 0x91c], 2
jae 0x4088c9
mov ecx, dword [ebp - 0x91c]
add ecx, 1
mov dword [ebp - 0x91c], ecx
jmp 0x4080e7
cmp dword [ebp - 0x83c], 0
je 0x408976
mov edx, dword [ebp + 0x1c]
mov eax, dword [edx]
cmp eax, dword [ebp - 0x83c]
jae 0x40893c
cmp dword [ebp - 0x850], 0
je 0x40893c
cmp dword [ebp - 0x24], 0xa
jae 0x40893c
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ebp - 0x918]
cmp edx, dword [ecx]
ja 0x40890a
mov eax, dword [ebp - 0x24]
add eax, 1
mov dword [ebp - 0x24], eax
jmp 0x40891c
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ecx]
mov dword [ebp - 0x918], edx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x18]
cmp eax, 0x3e8
jae 0x408937
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4081ad
mov eax, dword [ebp + 0x1c]
mov ecx, dword [eax]
xor edx, edx
cmp ecx, dword [ebp - 0x83c]
sete dl
mov dword [ebp - 0x884], edx
cmp dword [ebp - 0x860], 0xce
jne 0x408969
mov eax, dword [ebp + 0x28]
mov dword [eax], 0xc8
jmp 0x408974
mov ecx, dword [ebp + 0x28]
mov edx, dword [ebp - 0x860]
mov dword [ecx], edx
jmp 0x408992
mov eax, dword [ebp + 0x28]
mov ecx, dword [ebp - 0x860]
mov dword [eax], ecx
mov edx, dword [ebp + 0x1c]
xor eax, eax
cmp eax, dword [edx]
sbb ecx, ecx
neg ecx
mov dword [ebp - 0x884], ecx
mov edx, dword [ebp - 0x884]
mov dword [ebp - 0x968], edx
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x90c]
call fcn.004050e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x870]
call fcn.00401020
mov eax, dword [ebp - 0x968]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x30]
xor ecx, ebp
call fcn.0041d976
mov esp, ebp
pop ebp
ret