Function at 0x40da40
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x450df3
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x460adc]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0x2c]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x28]
mov dword [ebp - 0x40], ecx
mov ebx, edx
push 0x45631c
push eax
push 0
push 0
mov dword [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
mov dword [ebp - 0x38], eax
cmp eax, 0xffffffff
jne 0x40dadd
mov esi, 8
cmp dword [ebp + 0x20], esi
jb 0x40dab1
mov edx, dword [ebp + 0xc]
push edx
call fcn.004204e8
add esp, 4
xor eax, eax
mov dword [ebp + 0x20], 7
mov dword [ebp + 0x1c], 0
mov word [ebp + 0xc], ax
cmp dword [ebp + 0x44], esi
jb 0x40dad6
mov ecx, dword [ebp + 0x30]
push ecx
call fcn.004204e8
add esp, 4
xor al, al
jmp 0x40dd3f
push 0xe8
call fcn.00420ba1
add esp, 4
mov dword [ebp - 0x3c], eax
mov byte [ebp - 4], 2
test eax, eax
je 0x40daff
push eax
call fcn.0040f870
mov esi, eax
jmp 0x40db01
xor esi, esi
mov dl, byte [ebp + 0x50]
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x34]
push str..tmp
lea ecx, [ebp - 0x2c]
push ebx
push ecx
mov dword [esi + 0xc4], 0
mov byte [esi + 0xe4], dl
mov word [esi + 0xbc], 0
mov dword [esi + 0xcc], eax
call fcn.004074c0
add esp, 0xc
lea ebx, [esi + 0x84]
push eax
mov ecx, ebx
mov byte [ebp - 4], 3
call fcn.004028d0
mov byte [ebp - 4], 1
cmp dword [ebp - 0x18], 8
jb 0x40db64
mov edx, dword [ebp - 0x2c]
push edx
call fcn.004204e8
add esp, 4
xor eax, eax
push 0xffffffffffffffff
push eax
push ebx
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x18], 7
mov dword [ebp - 0x1c], 0
mov word [ebp - 0x2c], ax
call fcn.00402a70
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 4
call fcn.00408810
mov byte [ebp - 4], 1
cmp dword [ebp - 0x18], 8
mov byte [ebp - 0x2d], al
jb 0x40dba9
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.004204e8
add esp, 4
cmp byte [ebp - 0x2d], 0
je 0x40dbff
xor edx, edx
push 0xffffffffffffffff
push edx
push ebx
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x18], 7
mov dword [ebp - 0x1c], 0
mov word [ebp - 0x2c], dx
call fcn.00402a70
lea eax, [ebp - 0x2c]
push 0
push eax
mov byte [ebp - 4], 5
call fcn.00439830
add esp, 8
mov byte [ebp - 4], 1
cmp dword [ebp - 0x18], 8
mov dword [esi + 0x58], eax
mov dword [esi + 0x5c], edx
jb 0x40dc07
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.004204e8
add esp, 4
jmp 0x40dc07
xor eax, eax
mov dword [esi + 0x58], eax
mov dword [esi + 0x5c], eax
mov edx, dword [ebp - 0x38]
push 0xffffffffffffffff
push 0
lea eax, [ebp + 0xc]
push eax
lea ecx, [esi + 0x68]
mov dword [esi + 0xc8], edi
mov dword [esi + 0xd0], edx
call fcn.00402a70
mov ecx, dword [ebp + 0x4c]
mov ebx, dword [ebp - 0x34]
mov eax, 1
push esi
mov dword [esi + 0xe0], ecx
mov dword [esi + 0xdc], 0
mov byte [esi + 0xd8], 0
mov dword [esi + 0xd4], eax
mov dword [esi + 0x28], eax
call fcn.0040cee0
mov ebx, dword [ebp - 0x40]
push 0xffffffffffffffff
push 0
lea edx, [esi + 4]
push edx
mov ecx, ebx
call fcn.00402a70
test edi, edi
je 0x40dc9a
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x3c], esp
xor eax, eax
push 0xffffffffffffffff
push eax
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], 0
push ebx
mov word [ecx], ax
call fcn.00402a70
mov edx, dword [edi]
mov eax, dword [edx + 4]
mov ecx, edi
call eax
push esi
push 0
push 0x40d120
call fcn.00422da5
mov edi, eax
mov eax, dword [esi + 0x40]
lea ecx, [ebp - 0x34]
add esp, 0xc
mov dword [ebp - 0x34], edi
cmp ecx, eax
jae 0x40dce8
mov ecx, dword [esi + 0x3c]
lea edx, [ebp - 0x34]
cmp ecx, edx
ja 0x40dce8
mov edi, edx
sub edi, ecx
sar edi, 2
cmp eax, dword [esi + 0x44]
jne 0x40dcd7
lea eax, [esi + 0x3c]
call fcn.0040fca0
mov eax, dword [esi + 0x40]
test eax, eax
je 0x40dcfe
mov ecx, dword [esi + 0x3c]
mov edx, dword [ecx + edi*4]
mov dword [eax], edx
jmp 0x40dcfe
cmp eax, dword [esi + 0x44]
jne 0x40dcf5
lea eax, [esi + 0x3c]
call fcn.0040fca0
mov eax, dword [esi + 0x40]
test eax, eax
je 0x40dcfe
mov dword [eax], edi
add dword [esi + 0x40], 4
mov esi, 8
cmp dword [ebp + 0x20], esi
jb 0x40dd18
mov eax, dword [ebp + 0xc]
push eax
call fcn.004204e8
add esp, 4
xor ecx, ecx
mov dword [ebp + 0x20], 7
mov dword [ebp + 0x1c], 0
mov word [ebp + 0xc], cx
cmp dword [ebp + 0x44], esi
jb 0x40dd3d
mov edx, dword [ebp + 0x30]
push edx
call fcn.004204e8
add esp, 4
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004204f3
mov esp, ebp
pop ebp
ret 0x4c