Function at 0x1800040c0
Capabilities:
Create thread

Disassembly:
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x30
test edx, edx
je 0x1800041dd
cmp edx, 1
jne 0x180004349
cmp qword [0x180073060], 0
mov qword [0x180073070], rcx
jne 0x180004147
cmp qword [0x180073068], 0
jne 0x180004147
call qword [sym.imp.KERNEL32.dll_AllocConsole]
xor ecx, ecx
call fcn.18000b870
mov r9, rax
lea r8, [0x180032ad4]
lea rdx, str.CONIN_
lea rcx, [0x180073060]
call fcn.18000e12c
mov ecx, 1
call fcn.18000b870
mov r9, rax
lea r8, [0x180032ae0]
lea rdx, str.CONOUT_
lea rcx, [0x180073068]
call fcn.18000e12c
lea rcx, str.Injected__welcome._n
call fcn.180001030
xor edi, edi
lea r8, [0x180004020]
mov qword [rsp + 0x28], rdi
xor r9d, r9d
xor edx, edx
mov dword [rsp + 0x20], edi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
test rax, rax
je 0x180004182
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x18000418e
lea rcx, str.Failed_to_create_UnloadThread._n
call fcn.180001030
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
add rax, 0x78a82e0
xor ecx, ecx
mov qword [0x180073010], rax
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov qword [0x180073018], rax
test rax, rax
je 0x1800041c4
call fcn.180001080
test al, al
jne 0x180004349
lea rcx, str.Core::Initialize___failed._n
call fcn.180001030
mov al, 1
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
xor edi, edi
mov qword [rsp + 0x40], rbx
mov ebx, edi
xor eax, eax
mov esi, 1
lock cmpxchg dword [0x180073000], esi
je 0x180004218
cmp rbx, 0x20
jae 0x180004201
xor ecx, ecx
jmp 0x180004203
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_Sleep]
inc rbx
xor eax, eax
lock cmpxchg dword [0x180073000], esi
jne 0x1800041f7
cmp qword [0x180073008], rdi
je 0x1800042d9
xor ecx, ecx
call fcn.180003640
mov edx, eax
test eax, eax
jne 0x1800042de
mov rcx, qword [0x1800730e0]
mov qword [0x1800730e0], rdi
test rcx, rcx
je 0x180004269
nop dword [rax]
mov rbx, qword [rcx]
xor edx, edx
mov r8d, 0x8000
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rcx, rbx
test rbx, rbx
jne 0x180004250
mov r8, qword [0x1800730d0]
xor edx, edx
mov rcx, qword [0x180073008]
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x180073008]
call qword [sym.imp.KERNEL32.dll_HeapDestroy]
mov eax, edi
mov qword [0x180073008], rdi
mov qword [0x1800730d0], rdi
mov qword [0x1800730d8], rdi
xchg dword [0x180073000], eax
mov rcx, qword [0x180073030]
cmp rcx, qword [0x180073038]
je 0x1800042c0
mov qword [0x180073038], rcx
mov rax, qword [0x180073048]
cmp rax, qword [0x180073050]
je 0x1800042fe
mov qword [0x180073050], rax
jmp 0x1800042fe
mov edx, 2
mov eax, edi
lea rcx, str.MH_Uninitialize___failed_with__i
xchg dword [0x180073000], eax
call fcn.180001030
lea rcx, str.Core::Destroy___failed._n
call fcn.180001030
mov rcx, qword [0x180073060]
mov rbx, qword [rsp + 0x40]
test rcx, rcx
je 0x18000431b
call fcn.18000df9c
mov qword [0x180073060], rdi
mov rcx, qword [0x180073068]
test rcx, rcx
je 0x180004333
call fcn.18000df9c
mov qword [0x180073068], rdi
call qword [sym.imp.KERNEL32.dll_FreeConsole]
test eax, eax
jne 0x180004349
lea rcx, str.Globals::DestroyConsole___Failed._n
call fcn.180001030
mov rsi, qword [rsp + 0x48]
mov al, 1
add rsp, 0x30
pop rdi
ret