joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140010b90
Capabilities:
Set thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
call sym.pop_pthread_mem
cmp qword [sym.__dyn_tls_pthread], 0
mov rbx, rax
je 0x140010ca8
test rax, rax
je 0x140010ca8
mov dword [rax + 0x44], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
xor ecx, ecx
xor r9d, r9d
xor r8d, r8d
mov dword [rbx + 0x70], eax
mov edx, 1
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov qword [rbx + 0x38], 0xffffffffffffffff
lea rcx, [rbx + 0x68]
mov qword [rbx + 0x30], rax
call dbg.pthread_spin_destroy
cmp eax, 1
je 0x140010cb6
mov rbp, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rbx + 0x68], 0xffffffffffffffff
mov dword [rbx + 0xb8], 0
mov qword [rbx + 0x28], 0
call rbp
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rsi, rax
call rbp
mov dword [rsp + 0x30], 2
mov r8, rdi
mov rdx, rsi
mov dword [rsp + 0x28], 0
mov rcx, rax
lea r9, [rbx + 0x28]
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je sym.__pthread_self_lite.part.0.cold
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov ecx, dword [0x140016398]
mov rdx, rbx
mov dword [rbx + 0xbc], 0
mov dword [rbx + 0xc0], eax
movzx eax, byte [rbx + 0x40]
and eax, 0xffffffcf
or eax, 0x10
mov byte [rbx + 0x40], al
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x140010cbc
mov rax, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
ret
xor ebx, ebx
mov rax, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
ret
call sym.replace_spin_keys.part.0
nop
jmp sym.__pthread_self_lite.part.0.cold

Function at 0x140010cd0
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
sub rsp, 0x28
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140010cf0
add rsp, 0x28
ret
add rsp, 0x28
jmp sym.__pthread_self_lite.part.0
Function at 0x140010e40
Capabilities:
Set thread local storage value

Disassembly:
push rbp
mov rbp, rsp
push rsi
push rbx
sub rsp, 0x20
mov qword [rbp + 0x10], rcx
call dbg._fpreset
lea rcx, [0x140016388]
call dbg.pthread_mutex_lock
mov rax, qword [rbp + 0x10]
lea rbx, [rax + 0x38]
mov rcx, rbx
call dbg.pthread_mutex_lock
call sym._pthread_once_raw.constprop.0.isra.0
mov rdx, qword [rbp + 0x10]
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rsi, qword [rbp + 0x10]
mov rcx, rbx
mov dword [rsi + 0x70], eax
call dbg.pthread_mutex_unlock
mov rax, qword [rbp + 0x10]
mov rdx, rbp
lea rcx, [rax + 0xd0]
call sym._setjmp
test eax, eax
jne 0x140010f80
lea rcx, [0x140016388]
call dbg.pthread_mutex_unlock
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x10]
test rax, rax
je 0x140010f91
mov rdx, qword [rbp + 0x10]
mov rcx, qword [rdx + 8]
call rax
mov rbx, rax
nop
nop
lea rcx, [0x140016388]
call dbg.pthread_mutex_lock
mov rax, qword [rbp + 0x10]
mov rcx, qword [rax + 0x1d8]
mov qword [rax + 8], rbx
test rcx, rcx
je 0x140010f05
call sym._pthread_cleanup_dest.part.0
mov rax, qword [rbp + 0x10]
lea rbx, [rax + 0x38]
mov rcx, rbx
call dbg.pthread_mutex_lock
mov rax, qword [rbp + 0x10]
mov rcx, qword [rax + 0x30]
mov rsi, qword [rax + 8]
test rcx, rcx
je 0x140010f2c
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbp + 0x10]
xor edx, edx
cmp qword [rax + 0x28], 0
mov qword [rax + 0x30], rdx
je 0x140010fa3
mov rcx, rbx
call dbg.pthread_mutex_unlock
mov rcx, rbx
call dbg.pthread_mutex_destroy
mov rax, qword [rbp + 0x10]
mov qword [rax + 0x38], 0xffffffffffffffff
mov dword [rax + 0xbc], 1
lea rbx, [0x140016388]
mov rcx, rbx
call dbg.pthread_mutex_unlock
test eax, eax
jne 0x140010f9b
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140010f6a
lea rcx, [0x140016388]
call dbg.pthread_mutex_lock
jmp 0x140010f05
mov ebx, pe_nt_image_headers64
jmp 0x140010ede
mov ecx, esi
call qword [sym.imp.msvcrt.dll__endthreadex]
mov rax, qword [rbp + 0x10]
mov rcx, rbx
mov dword [rax], 0xdeadbeef
call dbg.pthread_mutex_unlock
mov rcx, rbx
call dbg.pthread_mutex_destroy
mov rcx, qword [rbp + 0x10]
call sym.push_pthread_mem
mov ecx, dword [0x140016398]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x140010f63
Function at 0x140010fe0
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
test edx, edx
jne 0x140011008
test r8, r8
je 0x1400110c0
mov eax, 1
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret
cmp edx, 1
je 0x1400110f0
cmp edx, 3
jne 0x140010ff5
mov ecx, dword [0x140016398]
cmp ecx, 0xffffffff
je 0x140010ff5
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x140010ff5
lea rsi, [rax + 0x38]
lea rdi, [rax + 0x68]
test byte [rax + 0x40], 0x30
je 0x140011120
mov rcx, qword [rax + 0x1d8]
test rcx, rcx
je 0x140011052
call sym._pthread_cleanup_dest.part.0
mov rcx, qword [rbx + 0x28]
test rcx, rcx
je 0x140011077
mov rbp, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rbp
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x14001106f
call rbp
pxor xmm0, xmm0
movups xmmword [rbx + 0x28], xmm0
mov rcx, rsi
call dbg.pthread_mutex_destroy
mov rcx, rdi
call dbg.pthread_spin_destroy
cmp eax, 1
je 0x1400111df
cmp qword [rbx + 0x1d0], 0
mov qword [rbx + 0x68], 0xffffffffffffffff
je 0x1400111d2
mov ecx, dword [0x140016398]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x140010ff5
mov rcx, qword [0x14001fcc0]
test rcx, rcx
je 0x140010ff5
call qword [sym.imp.KERNEL32.dll_RemoveVectoredExceptionHandler]
mov qword [0x14001fcc0], 0
jmp 0x140010ff5
lea rdx, [dbg.SetThreadName_VEH]
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_AddVectoredExceptionHandler]
mov qword [0x14001fcc0], rax
mov eax, 1
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret
mov rcx, qword [rax + 0x30]
mov eax, dword [rax + 0xbc]
test eax, eax
jne 0x140011190
test rcx, rcx
je 0x140011139
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbx + 0x1d8]
mov qword [rbx + 0x30], 0
mov dword [rbx + 0xbc], 1
test rcx, rcx
je 0x14001115c
call sym._pthread_cleanup_dest.part.0
test byte [rbx + 0x44], 4
je 0x1400111c8
mov rcx, qword [rbx + 0x28]
mov dword [rbx], 0xdeadbeef
test rcx, rcx
je 0x140011077
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x28], 0
mov rcx, rsi
call dbg.pthread_mutex_destroy
jmp 0x14001107f
test rcx, rcx
je 0x1400111c8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x30], 0
mov rcx, rsi
call dbg.pthread_mutex_destroy
mov rcx, rdi
call dbg.pthread_spin_destroy
cmp eax, 1
je 0x1400111df
mov qword [rbx + 0x68], 0xffffffffffffffff
jmp 0x140010ff5
mov rcx, rsi
call dbg.pthread_mutex_destroy
jmp 0x1400111ab
mov rcx, rbx
call sym.push_pthread_mem.part.0
jmp 0x1400110a6
call sym.replace_spin_keys.part.0
nop
nop word cs:[rax + rax]
Function at 0x140011460
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x40
mov eax, dword [rcx]
mov rbx, rcx
mov rsi, rdx
test rdx, rdx
je 0x140011588
cmp eax, 1
je 0x1400114bb
call dbg.enterOnceObject
lea rbp, [rax + 8]
mov rdi, rax
mov rcx, rbp
call dbg.pthread_mutex_lock
mov r12d, dword [rbx]
test r12d, r12d
je 0x1400114d0
cmp r12d, 1
jne 0x140011560
mov rcx, rbp
call dbg.pthread_mutex_unlock
test rdi, rdi
je 0x1400114bb
mov rcx, rdi
call sym.leaveOnceObject.part.0
xor eax, eax
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
lea rax, [dbg._pthread_once_cleanup]
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rax
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
mov r12, qword [sym.imp.KERNEL32.dll_TlsGetValue]
call r12
test rax, rax
je 0x1400115c8
mov rax, qword [rax + 0x18]
mov qword [rsp + 0x30], rax
lock or qword [rsp], 0
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call r12
test rax, rax
je 0x1400115b0
lea rdx, [rsp + 0x20]
mov qword [rax + 0x18], rdx
lock or qword [rsp], 0
call rsi
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call r12
test rax, rax
je 0x1400115a0
mov rdx, qword [rsp + 0x30]
mov qword [rax + 0x18], rdx
mov dword [rbx], 1
jmp 0x1400114a6
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r9d, r12d
mov r8, rbx
lea rdx, str._once__p_is__d_n
mov rcx, rax
call sym.fprintf
jmp 0x1400114a6
mov eax, 0x16
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x140011549
jmp sym.pthread_once.cold
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x140011525
jmp 0x14001555e
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x1400114ff
jmp 0x140015554
mov rax, qword [pe_dos_header]
ud2
lea rax, [rsp + 0x20]
mov qword [0], rax
ud2

Function at 0x140011850
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
mov esi, ecx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x1400118c8
lea rbp, [rbx + 0x68]
xor r12d, r12d
mov rcx, rbp
call dbg.pthread_spin_lock
cmp esi, dword [rbx + 0x48]
jae 0x1400118a3
mov rax, qword [rbx + 0x58]
cmp byte [rax + rsi], 0
je 0x1400118a3
mov rax, qword [rbx + 0x50]
mov r12, qword [rax + rsi*8]
mov rcx, rbp
call dbg.pthread_spin_unlock
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, r12
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
call sym.__pthread_self_lite.part.0
mov rbx, rax
jmp 0x14001187d
Function at 0x1400118e0
Capabilities:
Get thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov esi, ecx
mov r12, rdx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x1400119e0
lea r13, [rbx + 0x68]
mov rcx, r13
call dbg.pthread_spin_lock
cmp esi, dword [rbx + 0x48]
jae 0x140011960
mov rdi, qword [rbx + 0x50]
mov qword [rdi + rsi*8], r12
mov rax, qword [rbx + 0x58]
mov rcx, r13
mov byte [rax + rsi], 1
call dbg.pthread_spin_unlock
mov ecx, ebp
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea r15d, [rsi + 1]
mov rcx, qword [rbx + 0x50]
movsxd r14, r15d
lea rdx, [r14*8]
call sym.realloc
mov rdi, rax
test rax, rax
je 0x1400119ed
mov rcx, qword [rbx + 0x58]
mov rdx, r14
call sym.realloc
mov r14, rax
test rax, rax
je 0x1400119ed
mov eax, dword [rbx + 0x48]
mov edx, r15d
sub edx, eax
lea rcx, [rdi + rax*8]
lea r8, [rdx*8]
xor edx, edx
call sym.memset
mov ecx, dword [rbx + 0x48]
mov r8d, r15d
xor edx, edx
mov rax, rcx
add rcx, r14
sub r8d, eax
call sym.memset
mov qword [rbx + 0x50], rdi
mov qword [rbx + 0x58], r14
mov dword [rbx + 0x48], r15d
jmp 0x14001192f
call sym.__pthread_self_lite.part.0
mov rbx, rax
jmp 0x14001191a
mov rcx, r13
call dbg.pthread_spin_unlock
mov eax, 0xc
jmp 0x14001194d

Function at 0x140011a20
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140011a50
mov rdx, qword [rax + 0x1d8]
mov rax, rdx
add rsp, 0x28
ret
call sym.__pthread_self_lite.part.0
xor edx, edx
test rax, rax
jne 0x140011a3a
mov rax, rdx
add rsp, 0x28
ret

Function at 0x140011a70
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140011a98
mov rax, qword [rax + 0x30]
add rsp, 0x28
ret
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x140011a8a
add rsp, 0x28
ret

Function at 0x140011b00
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140011b28
add rax, 0x18
add rsp, 0x28
ret
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x140011b1a
jmp 0x140011b1e
Function at 0x140011c40
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
mov eax, dword [0x14001fd08]
test eax, eax
jne 0x140011c58
xor eax, eax
add rsp, 0x28
ret
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140011c88
mov edx, dword [rax + 0x20]
test edx, edx
jg 0x140011c4e
test byte [rax + 0x40], 3
je 0x140011c4e
mov eax, dword [rax + 0x44]
and eax, 1
jmp 0x140011c50
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x140011c6e
jmp 0x140011c4e

Function at 0x140011ca0
Capabilities:
Get thread local storage value

Disassembly:
push rbx
sub rsp, 0x20
mov ebx, ecx
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140011ce0
test ebx, ebx
jle 0x140011cd0
lock add dword [rax + 0x20], 1
add rsp, 0x20
pop rbx
ret
lock sub dword [rax + 0x20], 1
add rsp, 0x20
pop rbx
ret
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x140011cbd
add rsp, 0x20
pop rbx
ret

Function at 0x140011dd0
Capabilities:
Get thread local storage value

Disassembly:
push rsi
push rbx
sub rsp, 0x28
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x140011e48
test byte [rbx + 0x40], 0xc
jne 0x140011dff
mov eax, dword [0x14001fd08]
test eax, eax
jne 0x140011e10
add rsp, 0x28
pop rbx
pop rsi
ret
lea rsi, [rbx + 0x38]
mov rcx, rsi
call dbg.pthread_mutex_lock
movzx eax, byte [rbx + 0x40]
test al, 3
je 0x140011e33
mov edx, dword [rbx + 0x44]
test dl, 1
je 0x140011e33
mov ecx, dword [rbx + 0x20]
test ecx, ecx
jle 0x140011e5c
mov rcx, rsi
add rsp, 0x28
pop rbx
pop rsi
jmp dbg.pthread_mutex_unlock
call sym.__pthread_self_lite.part.0
mov rbx, rax
test rax, rax
jne 0x140011def
add rsp, 0x28
pop rbx
pop rsi
ret
and eax, 0xfffffff3
mov rcx, qword [rbx + 0x30]
and edx, 0xfffffffe
or eax, 4
mov dword [rbx + 0x44], edx
mov byte [rbx + 0x40], al
test rcx, rcx
je 0x140011e7a
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov rcx, rsi
call dbg.pthread_mutex_unlock
call dbg._pthread_invoke_cancel
nop
nop dword [rax + rax]
Function at 0x140011e90
Capabilities:
Get thread local storage value

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x20
test rcx, rcx
je 0x140011f00
call sym._pthread_time_in_ms_from_timespec
mov rsi, rax
mov eax, 0xfffffffe
cmp rax, rsi
jb 0x140011f38
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
mov edi, esi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x140011f90
test esi, esi
je 0x140011f16
call dbg.pthread_testcancel
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140011f70
mov edx, edi
call dbg._pthread_wait_for_single_object
call dbg.pthread_testcancel
xor eax, eax
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140011f80
call dbg.pthread_testcancel
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
call dbg.pthread_testcancel
xor eax, eax
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
mov edi, 0xffffffff
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
jne 0x140011ed5
call sym.__pthread_self_lite.part.0
mov rbx, rax
jmp 0x140011ed5
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140011eee
call sym.__pthread_self_lite.part.0
jmp 0x140011f16
call sym.__pthread_self_lite.part.0
mov rbx, rax
jmp 0x140011ed1

Function at 0x140011fa0
Capabilities:
Get thread local storage value

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov esi, ecx
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x140012010
test esi, esi
je 0x140011ff0
call dbg.pthread_testcancel
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140012020
mov edx, esi
call dbg._pthread_wait_for_single_object
call dbg.pthread_testcancel
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
ret
call dbg.pthread_testcancel
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
call dbg.pthread_testcancel
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
ret
call sym.__pthread_self_lite.part.0
mov rbx, rax
jmp 0x140011fc1
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140011fda
Function at 0x140012030
Capabilities:
Get thread local storage value
Hijack thread execution

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x4f8
mov rsi, rcx
test rcx, rcx
je 0x140012120
lea rdi, [0x140016388]
mov rcx, rdi
call dbg.pthread_mutex_lock
mov rcx, rsi
call dbg.__pthread_get_pointer
mov rcx, rdi
mov rbx, rax
call dbg.pthread_mutex_unlock
test rbx, rbx
je 0x140012120
mov rcx, qword [rbx + 0x28]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140012120
lea rdi, [rsp + 0x20]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x140012120
lea rbp, [rbx + 0x38]
mov rcx, rbp
call dbg.pthread_mutex_lock
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x140012230
movzx edx, byte [rbx + 0x40]
cmp rsi, qword [rax + 0x1d8]
je 0x140012138
mov eax, dword [rbx + 0x44]
and eax, 3
cmp eax, 3
je 0x140012190
test dl, 3
jne 0x140012110
and edx, 0xfffffffc
or edx, 1
mov byte [rbx + 0x40], dl
lock add dword [0x14001fd08], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140012101
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, rbp
call dbg.pthread_mutex_unlock
xor eax, eax
jmp 0x140012125
mov rcx, rbp
call dbg.pthread_mutex_unlock
test byte [rbx + 0x40], 0xc
je 0x140012109
nop
mov eax, 3
add rsp, 0x4f8
pop rbx
pop rsi
pop rdi
pop rbp
ret
test dl, 3
jne 0x140012110
and edx, 0xfffffffc
or edx, 1
mov byte [rbx + 0x40], dl
lock add dword [0x14001fd08], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x14001215d
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [rbx + 0x44]
mov edx, eax
and edx, 3
cmp edx, 3
jne 0x140012101
and eax, 0xfffffffe
mov rcx, rbp
mov dword [rbx + 0x44], eax
movzx eax, byte [rbx + 0x40]
and eax, 0xfffffff3
or eax, 4
mov byte [rbx + 0x40], al
call dbg.pthread_mutex_unlock
call dbg._pthread_invoke_cancel
nop word [rax + rax]
test dl, 0xc
jne 0x140012110
and edx, 0xf
jne 0x140012120
mov rcx, qword [rbx + 0x28]
mov dword [rsp + 0x50], 0x100001
call qword [sym.imp.KERNEL32.dll_SuspendThread]
xor edx, edx
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x140012101
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetThreadContext]
lea rax, [dbg._pthread_invoke_cancel]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
mov qword [rsp + 0x118], rax
call qword [sym.imp.KERNEL32.dll_SetThreadContext]
movzx eax, byte [rbx + 0x40]
and dword [rbx + 0x44], 0xfffffffe
and eax, 0xfffffff0
or eax, 5
mov byte [rbx + 0x40], al
lock add dword [0x14001fd08], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140012218
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, rbp
call dbg.pthread_mutex_unlock
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x140012101
call sym.__pthread_self_lite.part.0
test rax, rax
jne 0x1400120c0
movzx edx, byte [rbx + 0x40]
jmp 0x1400120cd
Function at 0x140012250
Capabilities:
Get thread local storage value
Hijack thread execution
Resume thread
Suspend thread

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x20
lea rdi, [0x140016388]
mov rbx, rcx
mov rcx, rdi
mov esi, edx
call dbg.pthread_mutex_lock
mov rcx, rbx
call dbg.__pthread_get_pointer
test rax, rax
je 0x1400122c8
cmp qword [rax + 0x1d8], rbx
jne 0x1400122c8
test byte [rax + 0x40], 0xc
jne 0x1400122c8
mov edx, dword [rax + 0xbc]
test edx, edx
jne 0x1400122c8
mov rax, qword [rax + 0x28]
sub rax, 1
cmp rax, 0xfffffffffffffffd
ja 0x1400122c8
mov rcx, rdi
call dbg.pthread_mutex_unlock
test esi, esi
je 0x1400122e0
lea edx, [rsi - 2]
cmp edx, 0x15
ja 0x1400122e8
mov rcx, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
jmp dbg.pthread_cancel
mov rcx, rdi
call dbg.pthread_mutex_unlock
mov eax, 3
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
xor eax, eax
jmp 0x1400122d5
mov eax, 0x16
jmp 0x1400122d5

Function at 0x140012480
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov esi, ecx
mov rdi, rdx
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x1400124f0
cmp esi, 1
ja 0x1400124fd
lea rbp, [rbx + 0x38]
mov rcx, rbp
call dbg.pthread_mutex_lock
test rdi, rdi
je 0x1400124c4
mov eax, dword [rbx + 0x44]
and eax, 1
mov dword [rdi], eax
mov eax, dword [rbx + 0x44]
mov rcx, qword [rbx + 0x1d8]
and eax, 0xfffffffe
or eax, esi
mov dword [rbx + 0x44], eax
call dbg.test_cancel_locked
mov rcx, rbp
call dbg.pthread_mutex_unlock
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret
call sym.__pthread_self_lite.part.0
mov rbx, rax
test rax, rax
jne 0x1400124a6
mov eax, 0x16
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret

Function at 0x140012510
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
mov esi, ecx
mov rdi, rdx
call sym._pthread_once_raw.constprop.0.isra.0
mov ecx, dword [0x140016398]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
test rax, rax
je 0x140012588
mov ebp, esi
and ebp, 0xfffffffd
jne 0x140012595
lea r12, [rbx + 0x38]
mov rcx, r12
call dbg.pthread_mutex_lock
test rdi, rdi
je 0x140012558
mov eax, dword [rbx + 0x44]
and eax, 2
mov dword [rdi], eax
mov eax, dword [rbx + 0x44]
mov rcx, qword [rbx + 0x1d8]
and eax, 0xfffffffd
or eax, esi
mov dword [rbx + 0x44], eax
call dbg.test_cancel_locked
mov rcx, r12
call dbg.pthread_mutex_unlock
mov eax, ebp
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
call sym.__pthread_self_lite.part.0
mov rbx, rax
test rax, rax
jne 0x140012538
mov ebp, 0x16
mov eax, ebp
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret