Function at 0x403810
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov dword [ebp - 0x48], ecx
mov dword [ebp - 4], 0
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 4]
mov dword [eax + 4], ecx
cmp dword [ebp - 4], 0
jne 0x403898
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xc], eax
mov edx, dword [ebp + 8]
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x40386e
push 1
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx]
mov ecx, dword [ebp - 0x30]
mov eax, dword [edx]
call eax
mov dword [ebp - 0x4c], eax
jmp 0x403875
mov dword [ebp - 0x4c], 0
call fcn.00403190
push eax
mov ecx, dword [ebp - 0xc]
push ecx
lea ecx, [ebp - 0x14]
call fcn.00402dd0
push str.thread.entry_event
lea edx, [ebp - 0x14]
push edx
call fcn.00402f20
add esp, 8
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x50]
mov dword [eax + 8], ecx
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x50]
mov dword [edx + 8], eax
mov ecx, dword [ebp - 0x48]
cmp dword [ecx + 8], 0
jne 0x40391c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x18], eax
mov edx, dword [ebp + 8]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x4038f2
push 1
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx]
mov ecx, dword [ebp - 0x38]
mov eax, dword [edx]
call eax
mov dword [ebp - 0x54], eax
jmp 0x4038f9
mov dword [ebp - 0x54], 0
call fcn.00403190
push eax
mov ecx, dword [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x20]
call fcn.00402dd0
push str.thread.exit_event
lea edx, [ebp - 0x20]
push edx
call fcn.00402f20
add esp, 8
mov dword [ebp - 8], 0
lea eax, [ebp - 8]
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
push 0x4039f0
mov edx, dword [ebp + 0xc]
push edx
push 0
call fcn.00496e92
add esp, 0x18
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x48]
cmp dword [edx + 4], 0
jne 0x4039cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
mov dword [ebp - 0x40], ecx
cmp dword [ebp - 0x40], 0
je 0x40397d
push 1
mov edx, dword [ebp - 0x40]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x40]
mov edx, dword [eax]
call edx
mov dword [ebp - 0x58], eax
jmp 0x403984
mov dword [ebp - 0x58], 0
cmp dword [ebp - 4], 0
je 0x403994
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x48]
cmp dword [ecx + 8], 0
je 0x4039aa
mov edx, dword [ebp - 0x48]
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00403190
push eax
mov ecx, dword [ebp - 0x24]
push ecx
lea ecx, [ebp - 0x2c]
call fcn.00402dd0
push str.thread
lea edx, [ebp - 0x2c]
push edx
call fcn.00402f20
add esp, 8
cmp dword [ebp - 4], 0
je 0x4039e9
push 0xffffffffffffffff
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esp, ebp
pop ebp
ret 8