Function at 0x401658
Capabilities:
Create thread
Terminate thread

Disassembly:
mov eax, 0x41945e
call fcn.00418040
sub esp, 0x34
push ebx
push esi
push edi
lea esi, [ebp - 0x2c]
mov edi, ecx
call fcn.00401388
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, dword [ebp + 0x10]
mov dword [eax], ebx
mov eax, dword [ebp + 0x14]
mov dword [eax], ebx
lea eax, [edi + 0x49b4]
push eax
mov dword [ebp - 0x10], eax
call fcn.004043ad
test al, al
je 0x4019c3
mov esi, dword [edi + 0x4a08]
call fcn.004027fc
sub eax, esi
cmp eax, 0x384
jb 0x4017c5
cmp esi, ebx
je 0x4016c6
call fcn.004027fc
sub eax, dword [edi + 0x4a08]
cmp eax, 0xe10
jbe 0x4016d5
mov byte [ebp + 0x18], 1
call fcn.004027fc
mov dword [edi + 0x4a08], eax
cmp byte [ebp + 0x18], bl
je 0x4017c5
push 1
push 0x400000
lea esi, [ebp - 0x2c]
call fcn.0040443f
cmp dword [edi + 0x504], ebx
mov esi, dword [ebp - 0x28]
mov dword [ebp + 0x18], ebx
jle 0x40179d
lea eax, [edi + 0x294]
mov dword [ebp - 0x14], eax
push 0x11
lea eax, [ebp - 0x40]
push ebx
push eax
call fcn.00410230
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x2c]
add esp, 0xc
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x1c]
push eax
push ebx
lea eax, [ebp - 0x40]
push eax
push 0x4015f6
push 0x10000
push ebx
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x34], esi
mov byte [ebp - 0x30], bl
call dword [sym.imp.KERNEL32.DLL_CreateThread]
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
je 0x40177c
mov esi, dword [ebp - 0x14]
push dword [esi - 4]
push eax
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
cmp eax, 0x102
je 0x401767
cmp eax, 0xffffffff
jne 0x401773
inc dword [esi]
push ebx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.DLL_TerminateThread]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp byte [ebp - 0x30], bl
mov esi, dword [ebp - 0x34]
mov dword [ebp - 0x18], esi
jne 0x4017a5
inc dword [ebp + 0x18]
mov eax, dword [ebp + 0x18]
add dword [ebp - 0x14], 0x14
cmp eax, dword [edi + 0x504]
jl 0x401708
inc dword [edi + 0x4b48]
jmp 0x4017c5
cmp esi, ebx
jle 0x4017bf
call fcn.004027fc
mov ecx, dword [ebp - 0x2c]
mov dword [edi + 0x4a08], eax
lea eax, [ebp - 0x18]
call fcn.004013bb
mov dword [edi + 0x4b48], ebx
xor eax, eax
cmp dword [edi + 0x2494], ebx
mov esi, 0xe4
jle 0x4017ff
lea ecx, [edi + 0x8f0]
mov edx, dword [ebp + 8]
cmp edx, dword [ecx - 0xd8]
jne 0x4017f4
mov edx, dword [ecx]
cmp edx, ebx
jle 0x4017f4
cmp edx, 0x10
jl 0x40187b
inc eax
add ecx, esi
cmp eax, dword [edi + 0x2494]
jl 0x4017da
xor eax, eax
cmp dword [edi + 0x4118], ebx
jle 0x401834
lea ecx, [edi + 0x2574]
mov edx, dword [ebp + 8]
cmp edx, dword [ecx - 0xd8]
jne 0x401829
mov edx, dword [ecx]
cmp edx, ebx
jle 0x401829
cmp edx, 0x10
jl 0x401930
inc eax
add ecx, esi
cmp eax, dword [edi + 0x4118]
jl 0x40180f
cmp dword [ebp + 8], 0xff00aaee
jne 0x4019bb
lea eax, [edi + 0x4a0c]
mov ecx, dword [eax]
cmp ecx, ebx
je 0x4019bb
mov edx, dword [ebp + 0x10]
push dword [ebp - 0x10]
mov dword [edx], ecx
mov edx, dword [ebp + 0x14]
add edi, 0x4a10
mov ecx, dword [edi]
mov dword [edx], ecx
mov dword [eax], ebx
mov dword [edi], ebx
call fcn.004043d8
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x2c], ebx
jmp 0x40191a
mov edx, dword [ebp + 0x10]
mov ebx, eax
imul ebx, ebx, 0xe4
lea esi, [ebx + edi]
dec dword [esi + 0x8f0]
lea ecx, [esi + 0x820]
mov eax, dword [ecx]
mov dword [edx], eax
mov eax, dword [esi + 0x824]
mov edx, dword [ebp + 0x14]
mov dword [edx], eax
mov eax, dword [esi + 0x828]
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
mov eax, dword [esi + 0x8f0]
imul eax, eax, 0xd
push eax
lea eax, [esi + 0x82d]
push eax
push ecx
call fcn.0040fec0
mov ecx, dword [esi + 0x8f0]
add ecx, 0xa0
imul ecx, ecx, 0xd
add ecx, ebx
xor eax, eax
mov dword [ecx + edi], eax
mov ecx, dword [esi + 0x8f0]
imul ecx, ecx, 0xd
add ecx, ebx
mov dword [ecx + edi + 0x824], eax
mov ecx, dword [esi + 0x8f0]
imul ecx, ecx, 0xd
add esp, 0xc
add ecx, ebx
mov dword [ecx + edi + 0x828], eax
mov byte [esi + 0x82c], 1
push dword [ebp - 0x10]
call fcn.004043d8
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x2c], 0
je 0x401929
call fcn.004033c0
push dword [ebp - 0x2c]
call fcn.0040434c
mov al, 1
jmp 0x4019db
mov edx, dword [ebp + 0x10]
mov ebx, eax
imul ebx, ebx, 0xe4
lea esi, [ebx + edi]
dec dword [esi + 0x2574]
lea ecx, [esi + 0x24a4]
mov eax, dword [ecx]
mov dword [edx], eax
mov eax, dword [esi + 0x24a8]
mov edx, dword [ebp + 0x14]
mov dword [edx], eax
mov eax, dword [esi + 0x24ac]
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
mov eax, dword [esi + 0x2574]
imul eax, eax, 0xd
push eax
lea eax, [esi + 0x24b1]
push eax
push ecx
call fcn.0040fec0
mov ecx, dword [esi + 0x2574]
imul ecx, ecx, 0xd
add ecx, ebx
xor eax, eax
mov dword [ecx + edi + 0x24a4], eax
mov ecx, dword [esi + 0x2574]
imul ecx, ecx, 0xd
add ecx, ebx
mov dword [ecx + edi + 0x24a8], eax
mov ecx, dword [esi + 0x2574]
imul ecx, ecx, 0xd
add esp, 0xc
add ecx, ebx
mov dword [ecx + edi + 0x24ac], eax
jmp 0x40190a
push dword [ebp - 0x10]
call fcn.004043d8
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x2c], ebx
je 0x4019d9
call fcn.004033c0
push dword [ebp - 0x2c]
call fcn.0040434c
xor al, al
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 0x14