Function at 0x4058fc
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x158
push ebx
push esi
mov esi, ecx
mov dword [ebp - 4], edx
push edi
push 0x140
lea eax, [ebp - 0x158]
mov dword [ebp - 0x18], esi
lea ebx, [esi - 1]
or edi, 0xffffffff
push 0
shr ebx, 6
push eax
inc ebx
call fcn.0040a390
add esp, 0xc
cmp esi, 0x400
ja 0x405952
test esi, esi
jne 0x40595a
push 1
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SleepEx]
test eax, eax
je 0x405989
cmp eax, 0xc0
je 0x40597a
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret
cmp esi, 0x40
ja 0x4059a9
push 1
push dword [ebp + 8]
push 0
push dword [ebp - 4]
push esi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
mov ecx, eax
cmp ecx, 0xc0
jne 0x405981
mov eax, 0x30000000
jmp 0x405955
cmp ecx, 0x102
jne 0x405990
mov eax, 0x20000000
jmp 0x405955
lea eax, [ecx - 0x80]
cmp eax, 0x3f
ja 0x4059a0
lea eax, [ecx + 0xfffff80]
jmp 0x405955
cmp ecx, 0x40
jae 0x405952
mov eax, ecx
jmp 0x405955
xor eax, eax
push eax
push eax
push 1
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov ecx, eax
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x405ad1
and dword [ebp - 0xc], 0
test ebx, ebx
je 0x405a45
and dword [ebp - 8], 0
lea edx, [ebp - 0x154]
mov eax, dword [ebp - 4]
mov dword [ebp - 0x10], edx
push 0x40
mov dword [edx], ecx
mov ecx, esi
sub ecx, dword [ebp - 8]
lea esi, [edx - 4]
mov dword [edx + 8], eax
pop eax
cmp ecx, eax
mov dword [edx + 0xc], 0xfffffffe
cmovb eax, ecx
mov dword [edx + 4], eax
xor eax, eax
push eax
push eax
push esi
push 0x4058c4
push 0x800
push eax
call fcn.0040e02d
add esp, 0x18
mov dword [esi], eax
test eax, eax
je 0x405ad1
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
inc ecx
mov edx, dword [ebp - 0x10]
add eax, 0x100
add dword [ebp - 8], 0x40
add edx, 0x14
mov esi, dword [ebp - 0x18]
cmp ecx, ebx
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
mov dword [ebp - 0x10], edx
jb 0x4059db
push 1
push dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
cmp eax, 0xc0
jne 0x405a5f
mov edi, 0x30000000
jmp 0x405ad1
cmp eax, 0x102
jne 0x405a6d
mov edi, 0x20000000
jmp 0x405ad1
test eax, eax
jne 0x405ace
xor edx, edx
test ebx, ebx
je 0x405b10
lea esi, [ebp - 0x150]
mov ecx, dword [esi + 8]
cmp ecx, 0xfffffffe
je 0x405ab3
cmp ecx, 0xffffffff
je 0x405ace
cmp ecx, 0xc0
je 0x405ace
cmp ecx, 0x102
je 0x405ace
cmp ecx, 0x80
jb 0x405aaf
mov eax, dword [esi]
sub eax, 0xffffff80
cmp ecx, eax
jb 0x405abd
cmp ecx, dword [esi]
jb 0x405aca
inc edx
add esi, 0x14
cmp edx, ebx
jb 0x405a81
jmp 0x405ad1
lea edi, [edx + 0x3ffffe]
shl edi, 6
add edi, ecx
jmp 0x405ad1
mov edi, edx
jmp 0x405ac3
or edi, 0xffffffff
test ebx, ebx
je 0x405b10
lea esi, [ebp - 0x158]
mov eax, dword [esi]
test eax, eax
je 0x405b08
cmp dword [esi + 0x10], 0xfffffffe
jne 0x405af7
push 0
push eax
push 0x4058f1
call dword [sym.imp.KERNEL32.dll_QueueUserAPC]
mov eax, dword [esi]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add esi, 0x14
sub ebx, 1
jne 0x405adb
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x405b1e
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x405955