Function at 0x408040
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x14]
mov ebx, ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebp, eax
movzx eax, word [edi + 0x38]
push eax
call dword [sym.imp.WSOCK32.dll_ntohs]
xor esi, esi
test ax, ax
mov word [edi + 0x38], ax
jbe 0x407270
cmp esi, 0xff
jg 0x407270
movzx ecx, word [edi + esi*2 + 0x3a]
push ebp
push ecx
call dword [sym.imp.WSOCK32.dll_ntohs]
mov ecx, ebx
push eax
call fcn.004042b0
movzx edx, word [edi + 0x38]
add esi, 1
cmp esi, edx
jl 0x407248
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret 4
sub esp, 0x428
mov eax, dword [0x427da0]
xor eax, esp
mov dword [esp + 0x424], eax
push ebp
xor ebp, ebp
push esi
movzx edx, bp
push edi
mov edi, dword [esp + 0x438]
movzx eax, word [edi + 0x24]
cmp ax, bp
mov esi, ecx
movzx ecx, word [edi + 0x28]
mov dword [esp + 0x18], edx
movzx edx, bp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x24], 0xffff
mov dword [edi + 0x2c], ebp
mov dword [edi + 0x30], ebp
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], edx
jne 0x407564
cmp cx, bp
jne 0x407564
mov dword [esp + 0x28], 1
mov eax, dword [esi + 0x2138]
push 0x10
mov dword [edi + 0x38], eax
mov ecx, dword [esi + 0x213c]
lea edx, [esi + 0x2140]
push edx
lea eax, [edi + 0x40]
push eax
mov dword [edi + 0x3c], ecx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
xor eax, eax
cmp dword [0x42aa98], ebp
je 0x407598
mov eax, 1
cmp dword [0x42aa9c], ebp
je 0x4075a3
or eax, 2
cmp dword [0x42aaa0], ebp
je 0x4075ae
or eax, 4
cmp dword [0x42aaa4], ebp
je 0x4075b9
or eax, 8
movzx ecx, word [esi + 0x2160]
movzx edx, ax
shl ecx, 0x10
push ebx
or ecx, edx
push ecx
call dword [sym.imp.WSOCK32.dll_htonl]
cmp dword [esp + 0x2c], ebp
mov dword [edi + 0x50], eax
lea eax, [edi + 0x54]
mov dword [esp + 0x30], 0x1c
mov dword [esp + 0x24], eax
je 0x407600
push eax
mov ecx, esi
call fcn.004045b0
add eax, 0x1c
mov dword [esp + 0x30], eax
mov ebx, dword [esp + 0x30]
jmp 0x407877
cmp dword [esi + 0x2030], ebp
jle 0x407630
mov ax, word [esi + 0x202c]
cmp ax, word [esp + 0x18]
jne 0x407630
mov cx, word [esi + 0x202e]
cmp cx, word [esp + 0x14]
jne 0x407630
cmp dword [esi + 4], ebp
jle 0x407630
xor ebx, ebx
jmp 0x407877
lea edx, [esp + 0x34]
push edx
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
mov dword [esi + 0x2030], ebp
mov word [esi + 0x202e], bp
mov word [esi + 0x202c], bp
lea ebp, [edi + 0x20]
push ebp
lea ecx, [esp + 0x28]
push ecx
lea eax, [edi + 0x18]
push eax
push 1
mov ecx, esi
call fcn.00407280
movzx ebx, ax
test bx, bx
je 0x4076a3
cmp dword [esi + 0x2164], 3
jl 0x407875
movzx edx, bx
push edx
push str.Local_find_failed_code__d_n
push 0x42e090
call fcn.00405490
add esp, 0xc
jmp 0x407875
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x28]
push eax
mov eax, dword [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x20]
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
mov ecx, esi
call fcn.00407320
test eax, eax
je 0x40772f
mov edx, dword [esp + 0x10]
mov ax, word [esp + 0x18]
mov cx, word [esp + 0x14]
mov ebx, dword [sym.imp.WSOCK32.dll_htonl]
push edx
mov word [esi + 0x202c], ax
mov word [esi + 0x202e], cx
call ebx
movzx edx, word [esp + 0x28]
mov ecx, dword [esi + 0x2030]
push edx
mov dword [esi + ecx*8 + 0x2034], eax
call ebx
mov ecx, dword [esi + 0x2030]
mov dword [esi + ecx*8 + 0x2038], eax
add dword [esi + 0x2030], 1
cmp dword [esi + 0x2164], 3
jl 0x40774f
mov edx, dword [esp + 0x10]
push edx
push str.Found_NetROCKEY_ID__x_n
jmp 0x407742
cmp dword [esi + 0x2164], 3
jl 0x40774f
mov eax, dword [esp + 0x10]
push eax
push str.Found_Normal_ROCKEY_ID__x_n
push 0x42e090
call fcn.00405490
add esp, 0xc
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
push ebp
lea eax, [esp + 0x28]
push eax
lea eax, [edi + 0x18]
push eax
push 2
mov ecx, esi
call fcn.00407280
movzx ebx, ax
test bx, bx
jne 0x40786d
jmp 0x407790
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x18]
push edx
mov edx, dword [esp + 0x20]
push eax
mov eax, dword [esp + 0x1c]
push ecx
push edx
push eax
mov ecx, esi
call fcn.00407320
test eax, eax
je 0x407813
cmp dword [esi + 0x2164], 3
jl 0x4077db
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx]
push edx
push str.Found_NetROCKEY_ID__x_n
push 0x42e090
call fcn.00405490
add esp, 0xc
mov eax, dword [esp + 0x10]
mov ebx, dword [sym.imp.WSOCK32.dll_htonl]
push eax
call ebx
movzx edx, word [esp + 0x28]
mov ecx, dword [esi + 0x2030]
push edx
mov dword [esi + ecx*8 + 0x2034], eax
call ebx
mov ecx, dword [esi + 0x2030]
mov dword [esi + ecx*8 + 0x2038], eax
add dword [esi + 0x2030], 1
jmp 0x407835
cmp dword [esi + 0x2164], 3
jl 0x407835
mov edx, dword [esp + 0x24]
mov eax, dword [edx]
push eax
push str.Found_Normal_ROCKEY_ID__x_n
push 0x42e090
call fcn.00405490
add esp, 0xc
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
push ebp
lea eax, [esp + 0x28]
push eax
lea eax, [edi + 0x18]
push eax
push 2
mov ecx, esi
call fcn.00407280
movzx ebx, ax
test bx, bx
je 0x407790
cmp bx, 0x11
jne 0x407875
xor ebx, ebx
xor ebp, ebp
cmp dword [esi + 0x2030], ebp
jne 0x407884
mov ebx, 3
cmp dword [esp + 0x2c], ebp
mov eax, dword [esp + 0x30]
movzx ecx, bx
mov dword [edi + 0x34], ecx
mov edx, dword [esi + 0x2030]
lea ecx, [eax + edx*8]
mov dword [edi + 0x238], ecx
pop ebx
jne 0x4078c4
mov edx, dword [esi + 0x2030]
mov eax, dword [esp + 0x20]
add edx, edx
add edx, edx
add edx, edx
push edx
add esi, 0x2034
push esi
push eax
call fcn.00411170
jmp 0x4078e1
cmp dword [esi + 8], ebp
jne 0x4078e4
mov ecx, dword [esi + 0x2030]
mov edx, dword [esp + 0x20]
add ecx, ecx
add ecx, ecx
add ecx, ecx
push ecx
push ebp
push edx
call fcn.0040fd40
add esp, 0xc
mov ecx, dword [esp + 0x430]
pop edi
pop esi
pop ebp
xor ecx, esp
xor eax, eax
call fcn.0040fac6
add esp, 0x428
ret 4
sub esp, 0x208
mov eax, dword [0x427da0]
xor eax, esp
mov dword [esp + 0x204], eax
push esi
mov esi, dword [esp + 0x210]
movzx eax, word [esi + 0x18]
push edi
push 0
push eax
mov edi, ecx
call fcn.00404310
movzx eax, ax
cmp ax, 0xffff
mov dword [esp + 8], eax
jne 0x40794e
mov dword [esi + 0x238], 0
mov dword [esi + 0x34], 0x3ec
jmp 0x407a85
push 0x200
lea ecx, [esp + 0x10]
push 0
push ecx
call fcn.0040fd40
mov eax, dword [esi + 0x238]
add esp, 0xc
test eax, eax
je 0x40797e
push eax
lea edx, [esi + 0x38]
push edx
lea eax, [esp + 0x14]
push eax
call fcn.00411170
add esp, 0xc
push ebx
push ebp
push 0x42e0a8
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esi + 0x30]
push edx
lea eax, [esi + 0x2c]
push eax
lea ebp, [esi + 0x28]
push ebp
lea eax, [esi + 0x24]
push eax
lea ecx, [esi + 0x20]
push ecx
movzx ecx, word [esi + 0x14]
lea edx, [esi + 0x1c]
push edx
lea eax, [esp + 0x2c]
push eax
push ecx
mov ecx, edi
call fcn.00407280
push 0x42e0a8
movzx ebx, ax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
movzx eax, word [esi + 0x18]
movzx edx, bx
push 0
push eax
mov ecx, edi
mov dword [esi + 0x34], edx
mov dword [esi + 0x238], 0
call fcn.004042b0
test bx, bx
jne 0x407a79
mov eax, dword [esi + 0x14]
cmp eax, 0x2e
jne 0x407a16
mov ecx, dword [ebp]
push ecx
lea edx, [esp + 0x18]
push edx
lea eax, [esi + 0x38]
push eax
call fcn.00411170
mov ecx, dword [ebp]
add esp, 0xc
mov dword [esi + 0x238], ecx
jmp 0x407a83
cmp eax, 0xa1
jne 0x407a30
mov edx, dword [esp + 0x14]
mov dword [esi + 0x38], edx
mov dword [esi + 0x238], 4
jmp 0x407a83
cmp eax, 0xa3
jne 0x407a79
mov eax, dword [esi + 0x2c]
cmp eax, 1
mov ecx, dword [esp + 0x14]
jne 0x407a65
mov edx, dword [esp + 0x18]
mov dword [esi + 0x38], ecx
mov dword [esi + 0x3c], edx
mov edx, dword [esp + 0x1c]
mov dword [esi + 0x40], edx
mov edx, dword [esp + 0x20]
mov dword [esi + 0x44], edx
mov dword [esi + 0x238], 0x10
cmp eax, 2
jne 0x407a83
mov dword [esi + 0x38], ecx
mov dword [esi + 0x238], 4
jmp 0x407a83
mov dword [esi + 0x238], 0
pop ebp
pop ebx
mov ecx, dword [esp + 0x20c]
pop edi
pop esi
xor ecx, esp
xor eax, eax
call fcn.0040fac6
add esp, 0x208
ret 4
push esi
mov esi, dword [esp + 8]
mov edx, dword [esi + 0x28]
cmp edx, 0x2711
lea eax, [esi + 0x14]
jne 0x40805d
pop esi
mov dword [esp + 4], eax
jmp 0x407220
cmp edx, 1
jne 0x40806c
pop esi
mov dword [esp + 4], eax
jmp 0x407500
cmp edx, 3
jne 0x40807b
push esi
call fcn.00407d40
pop esi
ret 4
cmp edx, 4
pop esi
jne 0x40808a
mov dword [esp + 4], eax
jmp fcn.00407f80
mov dword [esp + 4], eax
jmp 0x407900