Function at 0x582164
Capabilities:
Check for time delay via gettickcount
Check os version
Get memory capacity
Link many functions at runtime

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xfffffaf4
xor eax, eax
xor edi, edi
mov esi, str.ADVAPI32.DLL
mov dword [esp], eax
lea eax, [esp + 0x88]
mov dword [esp + 0x88], 0x94
push eax
call sub.KERNEL32.DLL_GetVersionExA
push esi
call sub.KERNEL32.DLL_LoadLibraryA
mov ebp, eax
lea eax, [esi + 0xd]
push eax
call sub.KERNEL32.DLL_LoadLibraryA
mov ebx, eax
lea eax, [esi + 0x1a]
push eax
call sub.KERNEL32.DLL_LoadLibraryA
mov dword [esp + 8], eax
xor edx, edx
mov dword [esp + 0xc], edx
xor ecx, ecx
mov dword [esp + 0x10], ecx
xor eax, eax
mov dword [esp + 0x14], eax
xor edx, edx
mov dword [esp + 0x18], edx
xor ecx, ecx
mov dword [esp + 0x1c], ecx
cmp dword [esp + 8], 0
je 0x5821fb
lea eax, [esi + 0x27]
push eax
mov edx, dword [esp + 0xc]
push edx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x18], eax
lea ecx, [esi + 0x38]
push ecx
mov eax, dword [esp + 0xc]
push eax
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x1c], eax
cmp dword [esp + 0x18], 0
je 0x582278
cmp dword [esp + 0x1c], 0
je 0x582278
lea edx, [esp + 0x20]
push edx
push 0
push 0
lea ecx, [esi + 0x4a]
push ecx
push 0
call dword [esp + 0x2c]
test eax, eax
jne 0x582242
push 0x40468000
push 0
push 0xd8
mov eax, dword [esp + 0x2c]
push eax
call fcn.005820d4
add esp, 0x10
mov edx, dword [esp + 0x20]
push edx
call dword [esp + 0x20]
lea ecx, [esp + 0x20]
push ecx
push 0
push 0
lea eax, [esi + 0x6e]
push eax
push 0
call dword [esp + 0x2c]
test eax, eax
jne 0x582278
push 0x40310000
push 0
push 0x44
mov edx, dword [esp + 0x2c]
push edx
call fcn.005820d4
add esp, 0x10
mov ecx, dword [esp + 0x20]
push ecx
call dword [esp + 0x20]
cmp dword [esp + 8], 0
je 0x582289
mov eax, dword [esp + 8]
push eax
call sub.KERNEL32.DLL_FreeLibrary
test ebp, ebp
je 0x5822c0
lea edx, [esi + 0x88]
push edx
push ebp
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0xc], eax
lea ecx, [esi + 0x9d]
push ecx
push ebp
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x10], eax
lea eax, [esi + 0xac]
push eax
push ebp
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x14], eax
cmp dword [esp + 0xc], 0
je 0x582390
cmp dword [esp + 0x10], 0
je 0x582390
cmp dword [esp + 0x14], 0
je 0x582390
push 0xf0000000
push 1
push 0
push 0
lea edx, [esp + 0x10]
push edx
call dword [esp + 0x20]
test eax, eax
je 0x582336
lea ecx, [esp + 0x11c]
push ecx
push 0x40
mov eax, dword [esp + 8]
push eax
call dword [esp + 0x1c]
test eax, eax
je 0x58232b
push 0
push 0
push 0x40
lea edx, [esp + 0x128]
push edx
call fcn.005820d4
add esp, 0x10
mov edi, 1
push 0
mov eax, dword [esp + 4]
push eax
call dword [esp + 0x1c]
push 0
lea edx, [esi + 0xc0]
push 0x16
push edx
push 0
lea ecx, [esp + 0x10]
push ecx
call dword [esp + 0x20]
test eax, eax
je 0x582390
lea eax, [esp + 0x11c]
push eax
push 0x40
mov edx, dword [esp + 8]
push edx
call dword [esp + 0x1c]
test eax, eax
je 0x582385
push 0x40500000
push 0
push 0x40
lea ecx, [esp + 0x128]
push ecx
call fcn.005820d4
add esp, 0x10
mov edi, 1
push 0
mov eax, dword [esp + 4]
push eax
call dword [esp + 0x1c]
test ebp, ebp
je 0x58239a
push ebp
call sub.KERNEL32.DLL_FreeLibrary
cmp dword [esp + 0x98], 2
jne 0x5823b1
call fcn.00548398
test eax, eax
jne 0x5824ae
lea edx, [esi + 0x11c]
push edx
call sub.KERNEL32.DLL_LoadLibraryA
mov ebp, eax
test eax, eax
je 0x5824ae
lea edx, [esi + 0x127]
push edx
push ebp
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x28], eax
lea ecx, [esi + 0x13b]
push ecx
push ebp
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x24], eax
lea eax, [esi + 0x149]
push eax
push ebp
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x2c], eax
cmp dword [esp + 0x28], 0
je 0x58241c
call dword [esp + 0x28]
mov dword [esp + 0x30], eax
push 0
push 0
push 4
lea edx, [esp + 0x3c]
push edx
call fcn.005820d4
add esp, 0x10
cmp dword [esp + 0x24], 0
je 0x58243d
cmp dword [esp + 0x98], 2
jne 0x58243d
cmp dword [esp + 0x8c], 5
jae 0x58243d
xor ecx, ecx
mov dword [esp + 0x24], ecx
cmp dword [esp + 0x24], 0
je 0x58247e
mov dword [esp + 0x15c], 0x14
lea eax, [esp + 0x15c]
push eax
call dword [esp + 0x28]
test eax, eax
je 0x58247e
push 0x40000000
push 0
mov edx, dword [esp + 0x164]
push edx
lea ecx, [esp + 0x168]
push ecx
call fcn.005820d4
add esp, 0x10
cmp dword [esp + 0x2c], 0
je 0x5824a8
push 0xbf
call dword [esp + 0x30]
mov dword [esp + 4], eax
push 0x3ff00000
push 0
push 4
lea eax, [esp + 0x10]
push eax
call fcn.005820d4
add esp, 0x10
push ebp
call sub.KERNEL32.DLL_FreeLibrary
test ebx, ebx
je 0x58285c
xor ebp, ebp
lea eax, [esi + 0x158]
push eax
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x34], eax
lea edx, [esi + 0x171]
push edx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x38], eax
lea ecx, [esi + 0x189]
push ecx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x3c], eax
lea eax, [esi + 0x195]
push eax
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x40], eax
lea edx, [esi + 0x1a0]
push edx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x44], eax
lea ecx, [esi + 0x1b0]
push ecx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x48], eax
lea eax, [esi + 0x1bf]
push eax
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x4c], eax
lea edx, [esi + 0x1ce]
push edx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x50], eax
lea ecx, [esi + 0x1dc]
push ecx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x54], eax
lea eax, [esi + 0x1ea]
push eax
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x58], eax
lea edx, [esi + 0x1f7]
push edx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x5c], eax
lea ecx, [esi + 0x205]
push ecx
push ebx
call sub.KERNEL32.DLL_GetProcAddress
mov dword [esp + 0x60], eax
cmp dword [esp + 0x34], 0
je 0x582856
cmp dword [esp + 0x3c], 0
je 0x582856
cmp dword [esp + 0x40], 0
je 0x582856
cmp dword [esp + 0x44], 0
je 0x582856
cmp dword [esp + 0x48], 0
je 0x582856
cmp dword [esp + 0x4c], 0
je 0x582856
cmp dword [esp + 0x50], 0
je 0x582856
cmp dword [esp + 0x54], 0
je 0x582856
cmp dword [esp + 0x58], 0
je 0x582856
cmp dword [esp + 0x5c], 0
je 0x582856
cmp dword [esp + 0x60], 0
je 0x582856
push 0
push 0xf
call dword [esp + 0x3c]
mov esi, eax
cmp eax, 0xffffffff
je 0x582856
push 0x10
push 0
lea edx, [esp + 0x178]
push edx
call fcn.0050a57c
add esp, 0xc
mov dword [esp + 0x170], 0x10
test edi, edi
je 0x58263a
call sub.KERNEL32.DLL_GetTickCount
mov ebp, eax
lea eax, [esp + 0x170]
push eax
push esi
call dword [esp + 0x4c]
test eax, eax
je 0x582707
push 0x40080000
push 0
mov edx, dword [esp + 0x178]
push edx
lea ecx, [esp + 0x17c]
push ecx
call fcn.005820d4
add esp, 0x10
mov dword [esp + 0x180], 0x24
mov eax, dword [esp + 0x178]
push eax
mov edx, dword [esp + 0x178]
push edx
lea ecx, [esp + 0x188]
push ecx
call dword [esp + 0x48]
test eax, eax
je 0x5826dc
mov dword [esp + 0x64], 0x50
push 0x40140000
push 0
mov eax, dword [esp + 0x188]
push eax
lea edx, [esp + 0x18c]
push edx
call fcn.005820d4
add esp, 0x10
lea ecx, [esp + 0x180]
push ecx
call dword [esp + 0x44]
test eax, eax
je 0x5826dc
dec dword [esp + 0x64]
mov eax, dword [esp + 0x64]
test eax, eax
jg 0x5826a1
lea edx, [esp + 0x170]
push edx
push esi
call dword [esp + 0x50]
test eax, eax
je 0x582707
test edi, edi
je 0x58264f
call sub.KERNEL32.DLL_GetTickCount
sub eax, ebp
cmp eax, 0x3e8
jb 0x58264f
mov dword [esp + 0x1a4], 0x128
test edi, edi
je 0x58271d
call sub.KERNEL32.DLL_GetTickCount
mov ebp, eax
lea eax, [esp + 0x1a4]
push eax
push esi
call dword [esp + 0x54]
test eax, eax
je 0x582770
push 0x40220000
push 0
mov edx, dword [esp + 0x1ac]
push edx
lea ecx, [esp + 0x1b0]
push ecx
call fcn.005820d4
add esp, 0x10
lea eax, [esp + 0x1a4]
push eax
push esi
call dword [esp + 0x58]
test eax, eax
je 0x582770
test edi, edi
je 0x58272e
call sub.KERNEL32.DLL_GetTickCount
sub eax, ebp
cmp eax, 0x3e8
jb 0x58272e
mov dword [esp + 0x2cc], 0x1c
test edi, edi
je 0x582786
call sub.KERNEL32.DLL_GetTickCount
mov ebp, eax
lea eax, [esp + 0x2cc]
push eax
push esi
call dword [esp + 0x5c]
test eax, eax
je 0x5827d9
push 0x40180000
push 0
mov edx, dword [esp + 0x2d4]
push edx
lea ecx, [esp + 0x2d8]
push ecx
call fcn.005820d4
add esp, 0x10
lea eax, [esp + 0x2cc]
push eax
push esi
call dword [esp + 0x60]
test eax, eax
je 0x5827d9
test edi, edi
je 0x582797
call sub.KERNEL32.DLL_GetTickCount
sub eax, ebp
cmp eax, 0x3e8
jb 0x582797
mov dword [esp + 0x2e8], 0x224
test edi, edi
je 0x5827ef
call sub.KERNEL32.DLL_GetTickCount
mov ebp, eax
lea eax, [esp + 0x2e8]
push eax
push esi
call dword [esp + 0x64]
test eax, eax
je 0x582842
push 0x40220000
push 0
mov edx, dword [esp + 0x2f0]
push edx
lea ecx, [esp + 0x2f4]
push ecx
call fcn.005820d4
add esp, 0x10
lea eax, [esp + 0x2e8]
push eax
push esi
call dword [esp + 0x68]
test eax, eax
je 0x582842
test edi, edi
je 0x582800
call sub.KERNEL32.DLL_GetTickCount
sub eax, ebp
cmp eax, 0x3e8
jb 0x582800
cmp dword [esp + 0x38], 0
je 0x582850
push esi
call dword [esp + 0x3c]
jmp 0x582856
push esi
call sub.KERNEL32.DLL_CloseHandle
push ebx
call sub.KERNEL32.DLL_FreeLibrary
call fcn.005829b8
lea edx, [esp + 0x68]
push edx
call sub.KERNEL32.DLL_GlobalMemoryStatus
push 0x3ff00000
push 0
push 0x20
lea ecx, [esp + 0x74]
push ecx
call fcn.005820d4
add esp, 0x10
call sub.KERNEL32.DLL_GetCurrentProcessId
mov dword [esp + 4], eax
push 0x3ff00000
push 0
push 4
lea eax, [esp + 0x10]
push eax
call fcn.005820d4
add esp, 0x10
mov eax, 1
add esp, 0x50c
pop ebp
pop edi
pop esi
pop ebx
ret