Function at 0x41ac10
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
lea esi, [esi]
mov ebx, dword [0x4f3240]
test ebx, ebx
je 0x41acf3
xor esi, esi
jmp 0x41ac38
mov ebx, dword [ebx]
test ebx, ebx
je 0x41ac68
mov eax, dword [ebx + 0x18]
mov dword [ebx + 0x10], 0
test eax, eax
je 0x41ac32
mov dword [esp], ebx
call eax
mov edi, dword [ebx + 0x10]
test edi, edi
je 0x41ac32
mov eax, dword [ebx + 4]
lea edx, [ebx + 0xc]
mov esi, 1
call fcn.00416190
mov ebx, dword [ebx]
test ebx, ebx
jne 0x41ac38
test esi, esi
je 0x41ad22
mov ebx, dword [0x4f3240]
test ebx, ebx
je 0x41ad10
nop
mov eax, dword [ebx + 0x28]
test eax, eax
je 0x41ac9b
mov dword [esp], ebx
call eax
test eax, eax
je 0x41ac9b
mov eax, dword [ebx + 4]
lea edx, [ebx + 0xc]
call fcn.00416190
mov ebx, dword [ebx]
test ebx, ebx
jne 0x41ac80
mov eax, dword [0x4ac240]
cmp eax, 0x4ac240
je 0x41ac20
mov edx, dword [eax]
xor ecx, ecx
mov dword [edx + 4], 0x4ac240
mov dword [0x4ac240], edx
movzx edx, word [eax + 0x12]
mov word [eax + 0x12], cx
mov ecx, dword [eax + 0x18]
mov dword [eax], 0
mov dword [eax + 4], 0
and word [eax + 0x10], 0xfdff
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov edx, dword [eax + 8]
mov dword [esp], edx
call dword [eax + 0x14]
jmp 0x41ad10
mov dword [0x4f3444], 0
test byte [0x4f3060], 0x80
jne 0x41b600
lea esi, [esi]
mov eax, dword [0x4ac240]
cmp eax, 0x4ac240
je 0x41ac20
jmp 0x41acb1
mov ebx, dword [0x4f3240]
mov dword [0x4f3444], 0
test ebx, ebx
je 0x41acfd
mov eax, dword [ebx + 0x1c]
test eax, eax
je 0x41ad4a
mov dword [esp], ebx
call eax
test eax, eax
je 0x41b1e2
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x41ad8a
mov edx, dword [0x4f3444]
test edx, edx
jle 0x41ad78
cmp ecx, dword [0x4f3244]
je 0x41ad8a
xor eax, eax
jmp 0x41ad71
cmp ecx, dword [eax*4 + 0x4f3244]
je 0x41ad8a
add eax, 1
cmp eax, edx
jne 0x41ad68
lea eax, [edx + 1]
mov dword [0x4f3444], eax
mov eax, dword [ebx + 8]
mov dword [edx*4 + 0x4f3244], eax
mov ebx, dword [ebx]
test ebx, ebx
jne 0x41ad36
mov ebx, dword [0x4f3444]
test ebx, ebx
je 0x41acfd
nop
mov eax, dword [0x4f3060]
test al, 0x80
jne 0x41b13f
mov esi, dword [0x4f3444]
cmp esi, 0x40
jle 0x41b057
test byte [0x4f3060], 0x80
jne 0x41b3f3
mov eax, 0x82082083
imul esi
mov eax, esi
sar eax, 0x1f
mov dword [ebp - 0x1c], 0xffffffff
lea ebx, [edx + esi]
sar ebx, 5
sub ebx, eax
mov eax, esi
mov edi, ebx
shl edi, 6
sub edi, ebx
sub eax, edi
mov dword [ebp - 0x38], eax
setne al
mov byte [ebp - 0x34], al
movzx eax, al
add eax, ebx
lea eax, [eax + eax*2]
shl eax, 3
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov dword [ebp - 0x2c], eax
je 0x41b2a5
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
test eax, eax
mov dword [ebp - 0x30], eax
je 0x41b67e
xor eax, eax
test ebx, ebx
mov ecx, dword [ebp - 0x2c]
mov edx, 0x4f3244
jle 0x41b5f9
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0x3c], ebx
mov dword [ecx + 0x10], eax
lea ebx, [ebp - 0x1c]
add eax, 0x3f
mov dword [ecx + 8], edx
add ecx, 0x18
add edx, 0xfc
mov dword [ecx - 0x18], esi
mov dword [ecx - 0x14], ebx
mov dword [ecx - 0xc], 0x3f
cmp eax, edi
jne 0x41ae61
mov ebx, dword [ebp - 0x3c]
mov edx, ebx
cmp byte [ebp - 0x34], 0
je 0x41aec3
mov edi, dword [ebp - 0x2c]
lea eax, [edx + edx*2]
mov ecx, edx
shl ecx, 6
add ebx, 1
sub ecx, edx
lea edx, [ecx*4 + 0x4f3244]
lea eax, [edi + eax*8]
mov edi, dword [ebp - 0x30]
mov dword [eax + 0x10], ecx
mov dword [eax + 8], edx
mov dword [eax], edi
lea edi, [ebp - 0x1c]
mov dword [eax + 4], edi
mov edi, dword [ebp - 0x38]
mov dword [eax + 0xc], edi
test ebx, ebx
jle 0x41b662
mov esi, dword [ebp - 0x2c]
xor edi, edi
jmp 0x41aee0
add edi, 1
add esi, 0x18
cmp edi, ebx
je 0x41b289
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x4160b0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__beginthreadex]
test eax, eax
mov dword [esi + 0x14], eax
jne 0x41aed2
test byte [0x4f3060], 0x80
jne 0x41b49c
mov esi, dword [ebp - 0x30]
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
test edi, edi
je 0x41af81
mov ebx, dword [ebp - 0x2c]
xor esi, esi
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebx + 0x14]
add esi, 1
add ebx, 0x18
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebx - 4]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
cmp esi, edi
jl 0x41af51
mov eax, dword [ebp - 0x30]
mov esi, 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2c]
sub esp, 4
mov dword [esp], eax
call fcn.0049f980
lea eax, [ebp - 0x1c]
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call fcn.0049fb90
sub esp, 0xc
test eax, eax
cmovns esi, eax
cmp esi, 0xffffffff
je 0x41b086
test byte [0x4f3060], 0x80
jne 0x41b355
cmp esi, dword [0x4f3444]
jae 0x41ada0
mov ebx, dword [0x4f3240]
test ebx, ebx
jne 0x41affe
jmp 0x41ada0
mov ebx, dword [ebx]
test ebx, ebx
je 0x41ada0
mov eax, dword [ebx + 8]
cmp dword [esi*4 + 0x4f3244], eax
jne 0x41aff4
mov eax, dword [ebx + 0x24]
test eax, eax
je 0x41b01a
mov dword [esp], ebx
call eax
test eax, eax
je 0x41aff4
test byte [0x4f3060], 0x80
jne 0x41b54e
mov eax, dword [ebx + 4]
lea edx, [ebx + 0xc]
call fcn.00416190
mov ebx, dword [0x4f3240]
test ebx, ebx
je 0x41ad10
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x41b04c
mov dword [esp], ebx
call eax
mov ebx, dword [ebx]
test ebx, ebx
jne 0x41b040
jmp 0x41ac70
mov dword [esp], esi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4f3244
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov esi, eax
sub esp, 0x10
cmp esi, 0xffffffff
jne 0x41afcc
mov eax, dword [0x4f3060]
test al, 0x80
je 0x41ada5
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], esi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 4], str.adb_win32:_wait_failed__error__ld_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov eax, dword [0x4f3060]
test al, 0x80
je 0x41adad
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], esi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov eax, dword [0x4f3444]
mov dword [esp + 4], str.adb_win32:_waiting_for__d_events_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
jmp 0x41adad
test byte [0x4f3060], 0x80
je 0x41ad10
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], esi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov dword [esp + 4], str.fdevent_process:_error_when_starting_a_hook_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
jmp 0x41ad10
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x41af4c
mov eax, dword [0x4f3060]
test al, 0x80
je 0x41b08b
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str._wait_for_all
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], esi
mov dword [esp + 4], str.Unable_to_allocate_thread_array_for__d_handles.
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov eax, dword [0x4f3060]
jmp 0x41b08b
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], esi
mov dword [esp + 4], str.adb_win32:_got_one__index__d__n
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
jmp 0x41afd9
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], esi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov eax, dword [0x4f3444]
mov dword [esp + 4], str.handle_count__d_exceeds_MAXIMUM_WAIT_OBJECTS._n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov esi, dword [0x4f3444]
jmp 0x41adc9
call dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x34], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x34]
mov dword [esp + 8], str._wait_for_all
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edi
mov dword [esp + 4], str.Unable_to_create_a_waiting_thread__d_of__d._errno_d
mov dword [esp + 0x10], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
jmp 0x41af25
call dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
mov eax, dword [ebx + 0x10]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 4]
mov dword [esp + 4], str.adb_win32:_signaling__s_for__x_n
add eax, 0x18
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
jmp 0x41b027
xor edx, edx
jmp 0x41ae8c
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], esi
mov dword [esp + 8], str.fdevent_process
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
mov dword [esp + 4], str.fdevent_process:_nothing_to_wait_for____n
jmp 0x41b24c
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x41af81
test byte [0x4f3060], 0x80
jne 0x41b69c
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call fcn.0049f980
mov eax, dword [0x4f3060]
jmp 0x41b08b
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], esi
mov dword [esp + 8], str._wait_for_all
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 4], str.Unable_to_create_main_event._Error:__d
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], ebx
jmp 0x41b687