Function at 0x405a70
Capabilities:
Create thread
Resume thread

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
xor edi, edi
cmp byte [ebx], 0
je 0x405a88
inc edi
cmp byte [edi + ebx], 0
jne 0x405a81
lea eax, [edi + 0x1c]
push eax
call dword [sym.imp.RTX_RTSS.SYS_RtAllocateLockedMemory]
mov esi, eax
test esi, esi
jne 0x405aab
push 8
call dword [sym.imp.RTX_RTSS.SYS_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov al, byte [ebx]
lea edx, [esi + 0x18]
mov byte [edx], al
test al, al
je 0x405ac3
mov ecx, ebx
mov al, byte [ecx + 1]
inc ecx
inc edx
mov byte [edx], al
test al, al
jne 0x405ab8
mov ecx, dword [ebp + 0xc]
mov dword [esi + 0x10], ecx
mov al, byte [0x5524e8]
lea edx, [esi + edi + 0x18]
mov byte [edx], al
cmp byte [0x5524e8], 0
mov dword [ebp + 0xc], edx
je 0x405af0
mov ecx, 0x5524e8
mov al, byte [ecx + 1]
inc ecx
inc edx
mov byte [edx], al
test al, al
jne 0x405ae5
mov ebx, dword [ebp + 0x18]
lea edi, [esi + 0x14]
push edi
lea eax, [esi + 0x18]
push eax
lea ecx, [ebx + 0x24]
push ecx
push 0
push 4
call dword [sym.imp.RTX_RTSS.SYS_RtCreateSharedMemoryA]
mov dword [esi], eax
test eax, eax
jne 0x405b2c
push esi
call dword [sym.imp.RTX_RTSS.SYS_RtFreeLockedMemory]
push 0xb7
call dword [sym.imp.RTX_RTSS.SYS_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov edx, dword [edi]
mov dword [edx], ebx
mov eax, dword [edi]
mov ebx, dword [ebp + 0xc]
mov dword [eax + 0x1c], 0
mov cl, byte [0x5524ec]
mov byte [ebx], cl
cmp byte [0x5524ec], 0
je 0x405b5f
mov edx, ebx
mov ecx, 0x5524ec
mov al, byte [ecx + 1]
inc ecx
inc edx
mov byte [edx], al
test al, al
jne 0x405b54
mov edi, dword [sym.imp.RTX_RTSS.SYS_RtCreateSemaphoreA]
lea eax, [esi + 0x18]
push eax
push 1
push 0
push 0
call edi
mov dword [esi + 8], eax
test eax, eax
jne 0x405b9b
mov edx, dword [esi]
push edx
call dword [sym.imp.RTX_RTSS.SYS_RtCloseHandle]
push esi
call dword [sym.imp.RTX_RTSS.SYS_RtFreeLockedMemory]
push 3
call dword [sym.imp.RTX_RTSS.SYS_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov al, byte [0x5524f0]
mov byte [ebx], al
cmp byte [0x5524f0], 0
je 0x405bbd
mov edx, ebx
mov ecx, 0x5524f0
mov al, byte [ecx + 1]
inc ecx
inc edx
mov byte [edx], al
test al, al
jne 0x405bb2
lea eax, [esi + 0x18]
push eax
push 1
push 0
push 0
call edi
mov dword [esi + 0xc], eax
test eax, eax
jne 0x405be3
mov ecx, dword [esi + 8]
mov edi, dword [sym.imp.RTX_RTSS.SYS_RtCloseHandle]
push ecx
call edi
mov edx, dword [esi]
push edx
call edi
jmp 0x405b81
mov eax, dword [ebp + 8]
push eax
push 0
push 0
mov byte [ebx], 0
call dword [sym.imp.RTX_RTSS.SYS_RtCreateMutexA]
mov dword [esi + 4], eax
test eax, eax
jne 0x405c17
mov ecx, dword [esi + 0xc]
mov edi, dword [sym.imp.RTX_RTSS.SYS_RtCloseHandle]
push ecx
call edi
mov edx, dword [esi + 8]
push edx
call edi
mov eax, dword [esi]
push eax
call edi
jmp 0x405b81
mov edx, dword [ebp + 0x10]
lea ecx, [ebp - 4]
push ecx
push 4
push esi
push 0x4059e0
push edx
push 0
call dword [sym.imp.RTX_RTSS.SYS_CreateThread]
mov edi, eax
test edi, edi
jne 0x405c57
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.RTX_RTSS.SYS_RtCloseHandle]
push eax
call edi
mov ecx, dword [esi + 0xc]
push ecx
call edi
mov edx, dword [esi + 8]
push edx
call edi
mov eax, dword [esi]
push eax
call edi
jmp 0x405b81
mov ecx, dword [ebp + 0x14]
push ecx
push edi
call dword [sym.imp.RTX_RTSS.SYS_RtSetThreadPriority]
push edi
test eax, eax
jne 0x405c8b
mov edi, dword [sym.imp.RTX_RTSS.SYS_RtCloseHandle]
call edi
mov edx, dword [esi + 4]
push edx
call edi
mov eax, dword [esi + 0xc]
push eax
call edi
mov ecx, dword [esi + 8]
push ecx
call edi
mov edx, dword [esi]
push edx
call edi
jmp 0x405b81
call dword [sym.imp.RTX_RTSS.SYS_ResumeThread]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18