Function at 0x40fd20
Capabilities:
Check mutex on windows
Create thread
Read file on windows
Terminate thread

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x418965
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x130
mov eax, dword [0x420008]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push str.D93BD84A_B113_45D9_9799_6F8563F0B8C8
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40fdae
push str.Service_is_already_started._r_n
call fcn.004027f0
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
lea eax, [ebp - 0x119]
push eax
push 0x41b648
call fcn.0040f9c0
add esp, 0xc
jmp 0x41007b
push 1
push 0x4100a0
mov dword [0x420d38], 1
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
lea eax, [ebp - 0x120]
mov dword [ebp - 0x120], 0
push eax
push 0
push 0
push 0x405380
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp - 0x138], eax
test eax, eax
je 0x41007b
push 0xcc
call fcn.00416902
mov esi, eax
add esp, 4
mov dword [ebp - 0x13c], esi
push 0xcc
push 0
push esi
mov dword [ebp - 4], 0
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov ecx, esi
call fcn.00405be0
mov esi, eax
mov dword [ebp - 4], 0xffffffff
mov ecx, esi
call fcn.00405d60
test eax, eax
je 0x40fe48
mov eax, str.Service_Core_is_created._r_n
jmp 0x40feeb
mov edi, dword [esi + 0x20]
mov dword [0x420d38], 0
test edi, edi
je 0x40fec2
mov ecx, dword [edi + 4]
mov dword [edi + 0x10], 1
test ecx, ecx
je 0x40fe6c
call fcn.0040e1a0
mov eax, dword [edi + 8]
test eax, eax
je 0x40fe91
push 0x1388
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40fe91
push 0
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x40fea5
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [edi + 4], 0
mov dword [edi + 0x10], 0
mov edi, dword [esi + 0x20]
test edi, edi
je 0x40fec2
mov eax, dword [edi]
mov ecx, edi
push 1
call dword [eax]
mov dword [esi + 0x20], 0
mov ecx, dword [esi + 0x24]
test ecx, ecx
je 0x40fed6
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [esi + 0x24], 0
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax]
xor esi, esi
mov eax, str.Create_Service_Core_error._r_n
push eax
call fcn.004027f0
add esp, 4
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp dword [0x420d38], 0
xorps xmm0, xmm0
mov dword [0x420d3c], eax
movups xmmword [ebp - 0x134], xmm0
mov dword [ebp - 0x124], 0
je 0x41004d
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
nop dword [eax + eax]
push pe_nt_image_headers32
lea eax, [ebp - 0x118]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x124], 0
lea eax, [ebp - 0x134]
xorps xmm0, xmm0
movups xmmword [ebp - 0x134], xmm0
push 0
push eax
push pe_nt_image_headers32
lea eax, [ebp - 0x118]
push eax
push dword [0x420d3c]
call dword [sym.imp.KERNEL32.dll_ReadFileEx]
test eax, eax
je 0x40ffbb
lea eax, [ebp - 0x118]
push str.Stop
push eax
call edi
add esp, 8
test eax, eax
je 0x40ffbb
lea eax, [ebp - 0x118]
push str.Stop_r_n
push eax
call edi
add esp, 8
test eax, eax
je 0x40ffbb
cmp dword [0x420d38], 0
jne 0x40ff30
jmp 0x41004d
mov edi, dword [esi + 0x20]
test edi, edi
je 0x41002b
mov ecx, dword [edi + 4]
mov dword [edi + 0x10], 1
test ecx, ecx
je 0x40ffd5
call fcn.0040e1a0
mov eax, dword [edi + 8]
test eax, eax
je 0x40fffa
push 0x1388
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40fffa
push 0
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x41000e
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [edi + 4], 0
mov dword [edi + 0x10], 0
mov edi, dword [esi + 0x20]
test edi, edi
je 0x41002b
mov eax, dword [edi]
mov ecx, edi
push 1
call dword [eax]
mov dword [esi + 0x20], 0
mov ecx, dword [esi + 0x24]
test ecx, ecx
je 0x41003f
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [esi + 0x24], 0
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax]
call fcn.0040ede0
mov esi, dword [ebp - 0x138]
push 0x1388
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x410074
push 0
push esi
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004168de
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret