Function at 0x546ba0
Capabilities:
Create thread
Resume thread
Suspend thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea eax, [ebp - 0x14]
push ebx
sub esp, 0x24
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x542cd0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateThread]
sub esp, 0x18
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x233
xor eax, eax
test ebx, ebx
setne al
mov dword [esp + 4], str.Create_Thread_failed_n
mov dword [esp], eax
call fcn.00543700
mov dword [ebp - 0x18], 0x32
mov edi, dword [sym.imp.kernel32.dll_ResumeThread]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_SuspendThread]
sub esp, 4
mov esi, eax
mov dword [esp], ebx
call edi
sub esp, 4
test esi, esi
je 0x546f00
xor edx, edx
cmp esi, 1
sete dl
mov dword [ebp - 0x18], edx
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x242
mov dword [esp + 4], str.SuspendThread_did_not_work_n
mov edx, dword [ebp - 0x18]
mov dword [esp], edx
call fcn.00543700
mov eax, dword [0x890450]
test eax, eax
je 0x546f48
mov edx, dword [ebp - 0x14]
mov dword [esp + 4], 0
mov dword [esp], 0x1f03fd
mov dword [esp + 8], edx
call eax
sub esp, 0xc
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x247
xor eax, eax
test esi, esi
setne al
mov dword [esp + 4], str.OpenThread_returned_an_invalid_handle_n
mov dword [esp], eax
call fcn.00543700
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [ebp - 0x18], eax
test esi, esi
je 0x546d84
mov edx, dword [0x8903e0]
test edx, edx
je 0x546fb0
mov eax, 0x249
js 0x546f58
call fcn.00542db0
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_SuspendThread]
sub esp, 4
cmp eax, 0xffffffff
sete al
mov dword [esp + 4], str.access_restrictions_not_obeyed_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
mov eax, dword [0x8903e0]
test eax, eax
je 0x546f8f
jns 0x546fcb
mov eax, 0x24a
call fcn.00542db0
mov dword [esp], esi
call edi
sub esp, 4
cmp eax, 0xffffffff
setne al
mov dword [esp + 4], str.access_restrictions_obeyed_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x24b
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], esi
mov dword [ebp - 0x18], eax
call eax
sub esp, 4
test eax, eax
setne al
mov dword [esp + 4], str.CloseHandle_Failed_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x24f
lea eax, [ebp - 0x10]
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetExitCodeThread]
sub esp, 8
test eax, eax
je 0x546db9
xor eax, eax
cmp dword [ebp - 0x10], 0x103
sete al
mov dword [esp], eax
mov dword [esp + 4], str.Thread_did_not_really_suspend_n
call fcn.00543700
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x252
mov dword [esp], ebx
call edi
sub esp, 4
cmp eax, 1
sete al
mov dword [esp + 4], str.Resume_thread_returned_an_invalid_value_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x253
mov dword [esp + 4], 0x3e8
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov edi, eax
sub esp, 8
xor eax, eax
test edi, edi
mov dword [esp + 4], str.Thread_did_not_resume_n
sete al
mov dword [esp], eax
call fcn.00543700
test edi, edi
jne 0x546f28
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_SuspendThread]
sub esp, 4
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x25a
xor eax, eax
cmp esi, 0xffffffff
sete al
mov dword [esp + 8], esi
mov dword [esp], eax
mov dword [esp + 4], str.wrong_return_code:__ld_n
call fcn.00543700
call fcn.0057d110
mov edx, 1
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x25b
mov eax, dword fs:[0x18]
mov ecx, dword [eax + 0x34]
cmp ecx, 5
je 0x546eaf
xor edx, edx
cmp ecx, 0x103
sete dl
mov dword [esp + 8], ecx
mov dword [esp], edx
mov dword [esp + 4], str.unexpected_error_code:__ld_n
call fcn.00543700
call fcn.0057d110
mov dword [eax], 0x5f810b
mov dword [eax + 4], 0x25d
mov dword [esp], ebx
mov eax, dword [ebp - 0x18]
call eax
sub esp, 4
test eax, eax
setne al
mov dword [esp + 4], str.CloseHandle_Failed_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 0x32
call dword [sym.imp.kernel32.dll_Sleep]
sub esp, 4
sub dword [ebp - 0x18], 1
jne 0x546c18
xor edx, edx
jmp 0x546c3e
mov dword [esp + 4], 1
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_TerminateThread]
sub esp, 8
jmp 0x546e43
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [ebp - 0x18], eax
jmp 0x546d84
call fcn.00542db0
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_SuspendThread]
sub esp, 4
cmp eax, 0xffffffff
setne al
mov dword [esp + 4], str.access_restrictions_obeyed_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
mov eax, dword [0x8903e0]
test eax, eax
jne 0x546d19
mov dword [esp], esi
call edi
sub esp, 4
cmp eax, 0xffffffff
jne 0x547020
mov dword [0x8903e0], 1
jmp 0x546d4a
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_SuspendThread]
sub esp, 4
cmp eax, 0xffffffff
jne 0x546ffb
mov dword [0x8903e0], 1
mov eax, 0x24a
call fcn.00542db0
mov dword [esp], esi
call edi
sub esp, 4
cmp eax, 0xffffffff
sete al
mov dword [esp + 4], str.access_restrictions_not_obeyed_n
movzx eax, al
mov dword [esp], eax
call fcn.00543700
jmp 0x546d4a
mov dword [0x8903e0], 0xffffffff
mov eax, 0x249
call fcn.00542db0
mov dword [esp], str.not_restricted__assuming_consistent_behaviour_n
call fcn.00543170
jmp 0x546d0c
mov dword [0x8903e0], 0xffffffff
mov eax, 0x24a
call fcn.00542db0
mov dword [esp], str.not_restricted__assuming_consistent_behaviour_n
call fcn.00543170
jmp 0x546d4a