Function at 0x4078b0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, eax
push esi
mov esi, edx
push ebx
sub esp, 0x3c
lea eax, [ebp - 0x20]
mov dword [esp], eax
call fcn.00418e80
test eax, eax
jne 0x407ad1
test byte [0x4ee061], 2
jne 0x4079d5
mov dword [esp], 0xc
call sub.msvcrt.dll_malloc
test eax, eax
mov ebx, eax
je 0x407ac0
mov eax, dword [ebp - 0x1c]
mov dword [ebx], edi
mov dword [ebx + 8], esi
mov dword [ebx + 4], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], 0x407660
call dword [sym.imp.msvcrt.dll__beginthread]
cmp eax, 0xffffffff
je 0x407a87
test byte [0x4ee061], 2
je 0x4079ca
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
mov dword [esp], 0x4ee068
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.create_service_thread
mov dword [esp + 4], 0x4afef8
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049e490
call ebx
mov dword [eax], esi
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], str.service_thread_started___d:_d_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049e490
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call ebx
mov dword [eax], esi
mov eax, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov eax, dword [eax]
mov dword [esp], 0x4ee068
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x30], eax
call sub.msvcrt.dll__getpid
mov ecx, dword [ebp - 0x30]
mov dword [esp + 8], str.create_service_thread
mov dword [esp + 4], 0x4afef8
mov dword [esp + 0x10], ecx
mov ecx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
lea eax, [ecx + 0x40]
mov dword [esp], eax
call fcn.0049e490
call ebx
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], 0x4aff67
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
lea eax, [ecx + 0x40]
mov dword [esp], eax
call fcn.0049e490
mov ecx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [ecx + 0x40]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call ebx
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
jmp 0x4078dd
mov dword [esp], ebx
call fcn.0049e1d0
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call fcn.00417be0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call fcn.00417be0
mov dword [esp], str.cannot_create_service_thread_n
call fcn.0049e440
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.cannot_allocate_stinfo
call fcn.0040a7b0
jmp 0x4078f3
mov dword [esp], str.cannot_create_service_socket_pair_n
call fcn.0049e440
mov eax, 0xffffffff
jmp 0x4079cd