Function at 0x408530
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.0041a330
test eax, eax
jne 0x408751
test byte [0x4f3061], 2
jne 0x408655
mov dword [esp], 0xc
call sub.msvcrt.dll_malloc
test eax, eax
mov ebx, eax
je 0x408740
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], 0x4082e0
call dword [sym.imp.msvcrt.dll__beginthread]
cmp eax, 0xffffffff
je 0x408707
test byte [0x4f3061], 2
je 0x40864a
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
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.create_service_thread
mov dword [esp + 4], 0x4b4ff8
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
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.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 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], 0x4f3068
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], 0x4b4ff8
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.0049fc30
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], 0x4b5067
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.0049fc30
mov ecx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [ecx + 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 ebx
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
jmp 0x40855d
mov dword [esp], ebx
call fcn.0049f980
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call fcn.00419090
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call fcn.00419090
mov dword [esp], str.cannot_create_service_thread_n
call fcn.0049fbe0
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.0040b930
jmp 0x408573
mov dword [esp], str.cannot_create_service_socket_pair_n
call fcn.0049fbe0
mov eax, 0xffffffff
jmp 0x40864d