Function at 0x4059a6
Capabilities:
Check for time delay via gettickcount
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x45c
mov eax, dword [0x42a050]
xor eax, esp
mov dword [esp + 0x458], eax
push ebx
push esi
push edi
xor esi, esi
push 8
pop ecx
xor eax, eax
lea edi, [esp + 0x20]
push esi
mov dword [esp + 0x18], esi
rep stosd dword es:[edi], eax
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x42bef0
mov dword [0x42c0e0], eax
call fcn.00406c5c
mov edi, eax
cmp edi, esi
jge 0x405a08
push 0x4036f8
jmp 0x405bbf
cmp dword [0x42bef4], esi
jne 0x405ad8
push 0x5c
push dword [0x42bef0]
call fcn.004191e9
lea ebx, [eax + 2]
xor eax, eax
mov esi, 0x208
push esi
push eax
mov word [esp + 0x50], ax
lea eax, [esp + 0x52]
push eax
call fcn.0041de40
add esp, 0x14
push ebx
mov ebx, 0x104
lea eax, [esp + 0x44]
push ebx
push eax
call fcn.0041921c
add esp, 0xc
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
xor eax, eax
push esi
push eax
mov word [esp + 0x258], ax
lea eax, [esp + 0x25a]
push eax
call fcn.0041de40
add esp, 0xc
push ebx
lea eax, [esp + 0x254]
push eax
push 0x403718
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea ecx, [esp + 0x40]
push ecx
sub ebx, eax
push 0x403724
lea eax, [esp + eax*2 + 0x258]
push ebx
push eax
call fcn.00419284
add esp, 0x10
lea eax, [esp + 0x250]
push eax
xor eax, eax
mov ecx, 0x42bef4
call fcn.00408889
mov edi, eax
test edi, edi
jns 0x405acf
push 0x403760
jmp 0x405bbf
cmp dword [0x42bef4], 0
je 0x405ae3
push dword [0x42bef4]
call fcn.00408417
push dword [0x42bef0]
lea eax, [esp + 0x14]
lea ebx, [esp + 0x24]
call fcn.004060af
mov edi, eax
test edi, edi
jns 0x405b06
push 0x403778
jmp 0x405bbf
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x18]
call fcn.00406123
mov edi, eax
test edi, edi
jns 0x405b29
push 0x403790
jmp 0x405bbf
mov eax, dword [esp + 0x38]
test eax, eax
je 0x405b37
cmp word [eax], 0
jne 0x405b41
mov dword [0x42bf04], 1
push dword [esp + 0x1c]
mov esi, 0x42bef0
push dword [esp + 0x1c]
call fcn.00406ef5
mov edi, eax
test edi, edi
jns 0x405b60
push 0x4037b8
jmp 0x405bbf
call dword [sym.imp.COMCTL32.dll_InitCommonControls]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov ebx, eax
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x14]
push 0x42bef0
call fcn.0040621f
mov edi, eax
test edi, edi
jns 0x405b90
push 0x4037f8
jmp 0x405bbf
call esi
sub eax, ebx
call fcn.00405945
cmp dword [0x42bf04], 0
jne 0x405bc7
lea eax, [esp + 0x14]
push eax
push dword [esp + 0x40]
push dword [esp + 0x40]
call fcn.00405e0b
mov edi, eax
test edi, edi
jns 0x405bc7
push 0x40380c
push edi
call fcn.0040854a
pop ecx
pop ecx
call fcn.004068fb
mov ebx, dword [esp + 0x10]
test ebx, ebx
je 0x405bd9
call fcn.0040a414
cmp dword [esp + 0x14], 0xcabf00d1
jne 0x405bea
and dword [esp + 0x14], 0
jmp 0x405bf4
mov ebx, 0x42bef0
call fcn.00406463
test edi, edi
jns 0x405c07
cmp edi, 0x80070642
je 0x405c07
mov esi, edi
call fcn.00405cda
push edi
push 0x403824
push 1
call fcn.004084c7
and dword [esp + 0x1c], 0
add esp, 0xc
lea esi, [esp + 0x10]
call fcn.00408e9c
test eax, eax
js 0x405c3c
push dword [esp + 0x10]
push 0x404e34
push 1
call fcn.004084c7
add esp, 0xc
xor esi, esi
cmp dword [esp + 0x10], esi
je 0x405c4d
push dword [esp + 0x10]
call fcn.00408e6f
mov eax, dword [0x42b140]
mov dword [0x42c11c], esi
cmp eax, 0xffffffff
je 0x405c6b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [0x42b140], 0xffffffff
mov eax, dword [0x42c120]
cmp eax, esi
je 0x405c80
push eax
call fcn.00408e6f
mov dword [0x42c120], esi
mov eax, dword [0x42bef8]
cmp eax, esi
je 0x405c8f
push eax
call fcn.00408e6f
mov eax, dword [0x42bef0]
cmp eax, esi
je 0x405c9e
push eax
call fcn.00408e6f
mov eax, dword [0x42bef4]
cmp eax, esi
je 0x405cad
push eax
call fcn.00408e6f
cmp edi, esi
jl 0x405cb7
mov eax, dword [esp + 0x14]
jmp 0x405cbe
mov eax, edi
and eax, 0xffff
mov ecx, dword [esp + 0x464]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004191d5
mov esp, ebp
pop ebp
ret 0x10