joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140001450
Capabilities:
Create pipe

Disassembly:
push rbp
push rbx
sub rsp, 0x198
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x130], rcx
mov qword [rbp + 0x138], rdx
mov dword [rbp + 0x10c], 1
mov dword [rbp + 0x108], 0x40000000
mov dword [rbp + 0x104], 0
mov dword [rbp + 0x100], 0
mov dword [rbp + 0xfc], 0x40000000
mov dword [rbp + 0xf8], 3
mov dword [rbp + 0xf4], pe_nt_image_headers64
mov qword [rbp + 0xe8], 0xffffffffffffffff
mov dword [rbp + 0xc0], 0x18
mov qword [rbp + 0xc8], 0
mov dword [rbp + 0xd0], 1
mov qword [rbp - 0x40], 0
mov qword [rbp - 0x38], 0
mov qword [rbp - 0x30], 0
mov qword [rbp - 0x28], 0
mov qword [rbp - 0x20], 0
mov qword [rbp - 0x18], 0
mov qword [rbp - 0x10], 0
mov qword [rbp - 8], 0
mov qword [rbp], 0
mov qword [rbp + 8], 0
mov qword [rbp + 0x10], 0
mov qword [rbp + 0x18], 0
mov qword [rbp + 0x20], 0
mov qword [rbp + 0x28], 0
mov qword [rbp + 0x30], 0
mov qword [rbp + 0x38], 0
mov qword [rbp + 0x40], 0
mov qword [rbp + 0x48], 0
mov qword [rbp + 0x50], 0
mov qword [rbp + 0x58], 0
mov qword [rbp + 0x60], 0
mov qword [rbp + 0x68], 0
mov qword [rbp + 0x70], 0
mov qword [rbp + 0x78], 0
mov qword [rbp + 0x80], 0
mov qword [rbp + 0x88], 0
mov qword [rbp + 0x90], 0
mov qword [rbp + 0x98], 0
mov qword [rbp + 0xa0], 0
mov qword [rbp + 0xa8], 0
mov qword [rbp + 0xb0], 0
mov qword [rbp + 0xb8], 0
lea rax, section..data
mov rcx, rax
call sym.__emutls_get_address
mov edx, dword [rax]
lea ecx, [rdx + 1]
mov dword [rax], ecx
mov dword [rbp + 0xe4], edx
mov rax, qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call rax
mov ebx, eax
mov rax, qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
call rax
mov ecx, eax
lea rax, [rbp - 0x40]
mov edx, dword [rbp + 0xe4]
mov dword [rsp + 0x28], edx
mov dword [rsp + 0x20], ebx
mov r9d, ecx
lea r8, str..pipe_sheredom_subprocess_h._08lx._08lx._ld
mov edx, 0xff
mov rcx, rax
call dbg.snprintf
mov eax, dword [rbp + 0x104]
or eax, dword [rbp + 0x100]
mov r8d, eax
mov eax, dword [rbp + 0x10c]
or eax, dword [rbp + 0x108]
mov edx, eax
lea rax, [rbp - 0x40]
lea rcx, [rbp + 0xc0]
mov qword [rsp + 0x38], rcx
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x1000
mov dword [rsp + 0x20], 0x1000
mov r9d, 1
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
call rax
mov rdx, qword [rbp + 0x130]
mov qword [rdx], rax
mov rax, qword [rbp + 0x130]
mov rax, qword [rax]
cmp qword [rbp + 0xe8], rax
jne 0x1400016cd
mov eax, 0xffffffff
jmp 0x140001739
lea r8, [rbp + 0xc0]
mov edx, dword [rbp + 0xfc]
lea rax, [rbp - 0x40]
mov qword [rsp + 0x30], 0
mov ecx, dword [rbp + 0xf4]
mov dword [rsp + 0x28], ecx
mov ecx, dword [rbp + 0xf8]
mov dword [rsp + 0x20], ecx
mov r9, r8
mov r8d, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov rdx, qword [rbp + 0x138]
mov qword [rdx], rax
mov rax, qword [rbp + 0x138]
mov rax, qword [rax]
cmp qword [rbp + 0xe8], rax
jne 0x140001734
mov eax, 0xffffffff
jmp 0x140001739
mov eax, 0
add rsp, 0x198
pop rbx
pop rbp
ret
Function at 0x14000255a
Capabilities:
Terminate process

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x30
mov qword [rbp + 0x10], rcx
mov dword [rbp - 4], 0x63
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x18]
mov edx, dword [rbp - 4]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_TerminateProcess]
call rax
mov dword [rbp - 8], eax
cmp dword [rbp - 8], 0
sete al
movzx eax, al
mov dword [rbp - 0xc], eax
mov eax, dword [rbp - 0xc]
add rsp, 0x30
pop rbp
ret

Function at 0x14000259d
Capabilities:
Read file on windows

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x70
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
mov dword [rbp + 0x20], r8d
mov dword [rbp - 0x1c], 0
mov qword [rbp - 0x40], 0
mov qword [rbp - 0x38], 0
mov dword [rbp - 0x30], 0
mov dword [rbp - 0x2c], 0
mov qword [rbp - 0x28], 0
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x28]
mov qword [rbp - 0x28], rax
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 8]
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll__fileno]
call rax
mov ecx, eax
mov rax, qword [sym.imp.msvcrt.dll__get_osfhandle]
call rax
mov qword [rbp - 8], rax
lea r9, [rbp - 0x1c]
mov r8d, dword [rbp + 0x20]
mov rdx, qword [rbp + 0x18]
mov rax, qword [rbp - 8]
lea rcx, [rbp - 0x40]
mov qword [rsp + 0x20], rcx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReadFile]
call rax
test eax, eax
jne 0x1400026a7
mov dword [rbp - 0xc], 0x3e5
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov dword [rbp - 0x10], eax
mov eax, dword [rbp - 0x10]
cmp eax, dword [rbp - 0xc]
jne 0x1400026a7
lea rcx, [rbp - 0x1c]
lea rdx, [rbp - 0x40]
mov rax, qword [rbp - 8]
mov r9d, 1
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
call rax
test eax, eax
jne 0x1400026a7
mov dword [rbp - 0x14], 0x3e4
mov dword [rbp - 0x18], 0x26
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov dword [rbp - 0x10], eax
mov eax, dword [rbp - 0x10]
cmp eax, dword [rbp - 0x14]
je 0x1400026a7
mov eax, dword [rbp - 0x10]
cmp eax, dword [rbp - 0x18]
je 0x1400026a7
mov eax, 0
jmp 0x1400026aa
mov eax, dword [rbp - 0x1c]
add rsp, 0x70
pop rbp
ret
Function at 0x1400026b0
Capabilities:
Read file on windows

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x70
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
mov dword [rbp + 0x20], r8d
mov dword [rbp - 0x1c], 0
mov qword [rbp - 0x40], 0
mov qword [rbp - 0x38], 0
mov dword [rbp - 0x30], 0
mov dword [rbp - 0x2c], 0
mov qword [rbp - 0x28], 0
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x30]
mov qword [rbp - 0x28], rax
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x10]
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll__fileno]
call rax
mov ecx, eax
mov rax, qword [sym.imp.msvcrt.dll__get_osfhandle]
call rax
mov qword [rbp - 8], rax
lea r9, [rbp - 0x1c]
mov r8d, dword [rbp + 0x20]
mov rdx, qword [rbp + 0x18]
mov rax, qword [rbp - 8]
lea rcx, [rbp - 0x40]
mov qword [rsp + 0x20], rcx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReadFile]
call rax
test eax, eax
jne 0x1400027ba
mov dword [rbp - 0xc], 0x3e5
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov dword [rbp - 0x10], eax
mov eax, dword [rbp - 0x10]
cmp eax, dword [rbp - 0xc]
jne 0x1400027ba
lea rcx, [rbp - 0x1c]
lea rdx, [rbp - 0x40]
mov rax, qword [rbp - 8]
mov r9d, 1
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
call rax
test eax, eax
jne 0x1400027ba
mov dword [rbp - 0x14], 0x3e4
mov dword [rbp - 0x18], 0x26
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov dword [rbp - 0x10], eax
mov eax, dword [rbp - 0x10]
cmp eax, dword [rbp - 0x14]
je 0x1400027ba
mov eax, dword [rbp - 0x10]
cmp eax, dword [rbp - 0x18]
je 0x1400027ba
mov eax, 0
jmp 0x1400027bd
mov eax, dword [rbp - 0x1c]
add rsp, 0x70
pop rbp
ret
Function at 0x140002d28
Capabilities:
Execute command

Disassembly:
push rbp
push rbx
sub rsp, 0x38
lea rbp, [rsp + 0x30]
mov qword [rbp + 0x20], rcx
mov dword [rbp - 4], 0
jmp 0x140002d6e
mov eax, dword [rbp - 4]
movsxd rdx, eax
mov rax, qword [rbp + 0x20]
add rax, rdx
movzx eax, byte [rax]
movsx eax, al
mov edx, dword [rbp - 4]
movsxd rcx, edx
mov rdx, qword [rbp + 0x20]
lea rbx, [rcx + rdx]
mov ecx, eax
call sym.decode_custom_char
mov byte [rbx], al
add dword [rbp - 4], 1
mov eax, dword [rbp - 4]
movsxd rdx, eax
mov rax, qword [rbp + 0x20]
add rax, rdx
movzx eax, byte [rax]
test al, al
jne 0x140002d40
mov rax, qword [rbp + 0x20]
mov rcx, rax
call sym.system
nop
add rsp, 0x38
pop rbx
pop rbp
ret

Function at 0x1400030b0
Capabilities:
Write file on windows

Disassembly:
push rsi
push rbx
sub rsp, 0x38
mov rbx, rcx
lea rax, [rsp + 0x58]
mov ecx, 2
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x68], r9
mov qword [rsp + 0x28], rax
call dbg.__acrt_iob_func
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sym.fwrite
mov rsi, qword [rsp + 0x28]
mov ecx, 2
call dbg.__acrt_iob_func
mov rdx, rbx
mov rcx, rax
mov r8, rsi
call sym.vfprintf
call sym.abort
nop
nop dword [rax]

Function at 0x140003120
Capabilities:
Allocate or change rwx memory

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x14000c0a4]
mov rbx, rcx
test esi, esi
jle 0x140003250
mov rax, qword [0x14000c0a8]
xor r9d, r9d
add rax, 0x18
nop word [rax + rax]
mov r8, qword [rax]
cmp rbx, r8
jb 0x14000316b
mov rdx, qword [rax + 8]
mov edx, dword [rdx + 8]
add r8, rdx
cmp rbx, r8
jb 0x1400031f5
add r9d, 1
add rax, 0x28
cmp r9d, esi
jne 0x140003150
mov rcx, rbx
call dbg.__mingw_GetSectionForAddress
mov rdi, rax
test rax, rax
je 0x140003272
mov rax, qword [0x14000c0a8]
lea rbx, [rsi + rsi*4]
shl rbx, 3
add rax, rbx
mov qword [rax + 0x20], rdi
mov dword [rax], 0
call dbg._GetPEImageBase
mov edx, dword [rdi + 0xc]
mov r8d, 0x30
lea rcx, [rax + rdx]
mov rax, qword [0x14000c0a8]
lea rdx, [rsp + 0x20]
mov qword [rax + rbx + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x140003257
mov eax, dword [rsp + 0x44]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x1400031ee
lea edx, [rax - 0x40]
and edx, 0xffffffbf
jne 0x140003200
add dword [0x14000c0a4], 1
add rsp, 0x50
pop rbx
pop rsi
pop rdi
ret
cmp eax, 2
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r8d, 0x40
mov eax, 4
cmove r8d, eax
add rbx, qword [0x14000c0a8]
mov qword [rbx + 8], rcx
mov r9, rbx
mov qword [rbx + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x1400031ee
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call dbg.__report_error
nop dword [rax]
xor esi, esi
jmp 0x140003178
mov rax, qword [0x14000c0a8]
mov edx, dword [rdi + 8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov r8, qword [rax + rbx + 0x18]
call dbg.__report_error
mov rdx, rbx
lea rcx, str.Address__p_has_no_image_section
call dbg.__report_error
nop
nop word cs:[rax + rax]
nop dword [rax]
Function at 0x140003800
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
lea r12, [0x14000c100]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x14000c0e0]
test rbx, rbx
je 0x14000385c
mov rbp, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax]
mov ecx, dword [rbx]
call rbp
mov rsi, rax
call rdi
test rsi, rsi
je 0x140003853
test eax, eax
jne 0x140003853
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140003838
mov rcx, r12
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]

Function at 0x140003a70
Capabilities:
Parse pe header

Disassembly:
xor eax, eax
cmp word [rcx], 0x5a4d
jne 0x140003a88
movsxd rdx, dword [rcx + 0x3c]
add rcx, rdx
cmp dword [rcx], 0x4550
je 0x140003a90
ret
xor eax, eax
cmp word [rcx + 0x18], 0x20b
sete al
ret

Function at 0x140003aa0
Capabilities:
Enumerate pe sections

Disassembly:
movsxd rax, dword [rcx + 0x3c]
add rcx, rax
movzx eax, word [rcx + 0x14]
movzx r8d, word [rcx + 6]
lea rax, [rcx + rax + 0x18]
test r8w, r8w
je 0x140003aed
lea ecx, [r8 - 1]
lea rcx, [rcx + rcx*4]
lea r9, [rax + rcx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
mov rcx, r8
cmp rdx, r8
jb 0x140003ae4
add ecx, dword [rax + 8]
cmp rdx, rcx
jb 0x140003aef
add rax, 0x28
cmp rax, r9
jne 0x140003ad0
xor eax, eax
ret

Function at 0x140003af0
Capabilities:
Parse pe header

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x20
mov rsi, rcx
call sym.strlen
cmp rax, 8
ja 0x140003b80
mov rdx, qword [0x140008ce0]
xor ebx, ebx
cmp word [rdx], 0x5a4d
jne 0x140003b6e
movsxd rax, dword [rdx + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
jne 0x140003b6e
cmp word [rax + 0x18], 0x20b
jne 0x140003b6e
movzx edx, word [rax + 0x14]
lea rbx, [rax + rdx + 0x18]
movzx edx, word [rax + 6]
test dx, dx
je 0x140003b80
lea eax, [rdx - 1]
lea rax, [rax + rax*4]
lea rdi, [rbx + rax*8 + 0x28]
jmp 0x140003b59
add rbx, 0x28
cmp rbx, rdi
je 0x140003b80
mov r8d, 8
mov rdx, rsi
mov rcx, rbx
call sym.strncmp
test eax, eax
jne 0x140003b50
mov rax, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
xor ebx, ebx
mov rax, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret

Function at 0x140003b90
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov rdx, qword [0x140008ce0]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x140003bb0
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x140003bb8
ret
cmp word [r8 + 0x18], 0x20b
jne 0x140003bb0
movzx eax, word [r8 + 0x14]
sub rcx, rdx
lea rax, [r8 + rax + 0x18]
movzx r8d, word [r8 + 6]
test r8w, r8w
je 0x140003c0d
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop word cs:[rax + rax]
mov r8d, dword [rax + 0xc]
mov rdx, r8
cmp rcx, r8
jb 0x140003c04
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x140003bb0
add rax, 0x28
cmp rax, r9
jne 0x140003bf0
xor eax, eax
ret
Function at 0x140003c10
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x140008ce0]
xor ecx, ecx
cmp word [rax], 0x5a4d
jne 0x140003c2f
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x140003c38
mov eax, ecx
ret
cmp word [rax + 0x18], 0x20b
jne 0x140003c2f
movzx ecx, word [rax + 6]
mov eax, ecx
ret

Function at 0x140003c50
Capabilities:
Parse pe header

Disassembly:
mov r8, qword [0x140008ce0]
xor eax, eax
cmp word [r8], 0x5a4d
jne 0x140003c70
movsxd rdx, dword [r8 + 0x3c]
add rdx, r8
cmp dword [rdx], 0x4550
je 0x140003c78
ret
cmp word [rdx + 0x18], 0x20b
jne 0x140003c70
movzx eax, word [rdx + 0x14]
movzx r8d, word [rdx + 6]
lea rax, [rdx + rax + 0x18]
test r8w, r8w
je 0x140003cc0
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea rdx, [rax + rdx*8 + 0x28]
nop dword [rax]
test byte [rax + 0x27], 0x20
je 0x140003cb7
test rcx, rcx
je 0x140003c70
sub rcx, 1
add rax, 0x28
cmp rdx, rax
jne 0x140003ca8
xor eax, eax
ret

Function at 0x140003cd0
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x140008ce0]
xor edx, edx
cmp word [rax], 0x5a4d
jne 0x140003cef
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
je 0x140003cf8
mov rax, rdx
ret
cmp word [rcx + 0x18], 0x20b
cmove rdx, rax
mov rax, rdx
ret

Function at 0x140003d10
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov rdx, qword [0x140008ce0]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x140003d30
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x140003d38
ret
cmp word [r8 + 0x18], 0x20b
jne 0x140003d30
sub rcx, rdx
movzx r9d, word [r8 + 6]
movzx edx, word [r8 + 0x14]
lea rdx, [r8 + rdx + 0x18]
test r9w, r9w
je 0x140003d30
lea eax, [r9 - 1]
lea rax, [rax + rax*4]
lea r9, [rdx + rax*8 + 0x28]
nop word cs:[rax + rax]
mov r8d, dword [rdx + 0xc]
mov rax, r8
cmp rcx, r8
jb 0x140003d84
add eax, dword [rdx + 8]
cmp rcx, rax
jb 0x140003d90
add rdx, 0x28
cmp rdx, r9
jne 0x140003d70
xor eax, eax
ret
mov eax, dword [rdx + 0x24]
not eax
shr eax, 0x1f
ret

Function at 0x140003da0
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov r11, qword [0x140008ce0]
xor r9d, r9d
cmp word [r11], 0x5a4d
jne 0x140003dc2
movsxd r8, dword [r11 + 0x3c]
add r8, r11
cmp dword [r8], 0x4550
je 0x140003dd0
mov rax, r9
ret
cmp word [r8 + 0x18], 0x20b
jne 0x140003dc2
mov eax, dword [r8 + 0x90]
test eax, eax
je 0x140003dc2
movzx edx, word [r8 + 0x14]
movzx r10d, word [r8 + 6]
lea rdx, [r8 + rdx + 0x18]
test r10w, r10w
je 0x140003dc2
lea r8d, [r10 - 1]
lea r8, [r8 + r8*4]
lea r10, [rdx + r8*8 + 0x28]
nop word cs:[rax + rax]
mov r9d, dword [rdx + 0xc]
mov r8, r9
cmp rax, r9
jb 0x140003e25
add r8d, dword [rdx + 8]
cmp rax, r8
jb 0x140003e38
add rdx, 0x28
cmp r10, rdx
jne 0x140003e10
xor r9d, r9d
mov rax, r9
ret
add rax, r11
jmp 0x140003e47
sub ecx, 1
add rax, 0x14
mov r8d, dword [rax + 4]
test r8d, r8d
jne 0x140003e57
mov edx, dword [rax + 0xc]
test edx, edx
je 0x140003e2e
test ecx, ecx
jg 0x140003e40
mov r9d, dword [rax + 0xc]
add r9, r11
mov rax, r9
ret
Function at 0x140003fa0
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov rsi, qword [0x140008cb0]
mov r11d, dword [rsi]
mov rbx, rcx
test r11d, r11d
jne 0x140003fd8
mov rax, qword [rcx + 0x10]
test rax, rax
je 0x140004040
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov r12, qword [rcx + 0x10]
test r12, r12
je 0x140004050
mov esi, dword [0x14000c188]
mov r13, qword [sym.imp.KERNEL32.dll_GetLastError]
call r13
mov edi, eax
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, edi
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rsi, rsi
je 0x1400040a8
mov rbp, qword [rsi]
cmp rbp, r12
jb 0x1400040f0
sub r12, 1
mov rax, qword [rsi + r12*8 + 8]
test rax, rax
jne 0x140003fc7
mov rcx, rbx
call fcn.140003f00
mov qword [rsi + r12*8 + 8], rax
jmp 0x140003fc7
call fcn.140003f00
mov qword [rbx + 0x10], rax
jmp 0x140003fc7
mov r10d, dword [rsi]
test r10d, r10d
je 0x140004181
mov r9d, dword [0x140005050]
test r9d, r9d
je 0x1400041a9
lea rcx, [0x14000c1a0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r12, qword [rbx + 0x10]
test r12, r12
je 0x14000418e
mov eax, dword [rsi]
test eax, eax
je 0x140003fe1
lea rcx, [0x14000c1a0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140003fe1
lea rcx, [r12 + 0x21]
mov edx, 8
lea rdi, [r12 + 0x20]
call sym.calloc
mov rsi, rax
test rax, rax
je 0x1400041e4
mov qword [rax], rdi
mov ecx, dword [0x14000c188]
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x14000401b
call r13
jmp 0x14000401b
lea rdi, [rbp + rbp]
lea rax, [r12 + 0x20]
mov rcx, rsi
cmp rdi, r12
cmovb rdi, rax
lea rdx, [rdi*8 + 8]
call sym.realloc
mov rsi, rax
test rax, rax
je 0x1400041e4
mov qword [rax], rdi
sub rdi, rbp
lea rcx, [rax + rbp*8 + 8]
xor edx, edx
lea r8, [rdi*8]
call sym.memset
jmp 0x1400040cb
lea rcx, [0x14000c1a0]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x1400041dc
lea rdx, [0x140003eb0]
mov ecx, eax
mov dword [0x14000c188], eax
call dbg.__mingwthr_key_dtor
test eax, eax
jne 0x1400041e4
mov dword [0x140005050], 1
mov edx, dword [rsi]
test edx, edx
jne 0x14000406c
mov r12, qword [rbx + 0x10]
test r12, r12
jne 0x140003fe1
mov rax, qword [0x14000c180]
lea r12, [rax + 1]
mov qword [0x14000c180], r12
mov qword [rbx + 0x10], r12
jmp 0x140004086
lock add dword [0x140005054], 1
je 0x140004139
mov r8d, dword [0x140005050]
mov rbp, qword [sym.imp.KERNEL32.dll_Sleep]
lea rdi, [0x140005050]
test r8d, r8d
jne 0x140004177
nop dword [rax]
xor ecx, ecx
call rbp
mov ecx, dword [rdi]
test ecx, ecx
je 0x1400041d0
jmp 0x140004177
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140004169
call sym.abort
nop
nop word [rax + rax]
Function at 0x140023bd0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov rax, qword [0x1400e0180]
xor rax, rsp
mov qword [rsp + 0x50], rax
mov rax, rdx
mov r14d, r8d
mov rdi, rdx
mov dword [rsp + 0x38], r14d
cqo
mov byte [rsp + 0x30], 0
idiv r14
mov r15, rcx
mov r12d, r8d
mov r13, rax
xor ebx, ebx
mov eax, r8d
mov esi, ebx
shl eax, 0x11
mov dword [rsp + 0x34], eax
lea ecx, [rax + 0x38]
call fcn.140060250
lea r9, [rsp + 0x48]
mov qword [rsp + 0x40], rax
mov r8d, 0x20000
mov qword [rsp + 0x20], rbx
mov rdx, rax
mov rcx, r15
mov rbp, rax
call qword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x140023cc9
cmp dword [rsp + 0x48], 0x20000
jne 0x140023cc9
inc rsi
lea ecx, [r14 - 1]
add rbp, 0x20000
cmp rsi, rcx
jne 0x140023c78
lea rdx, [rdi - 0x20000]
jmp 0x140023c86
cmp rsi, r12
je 0x140023cb7
mov rdx, rsi
imul rdx, r13
mov edx, edx
xor r9d, r9d
xor r8d, r8d
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rbx
mov r8d, 0x20000
mov rdx, rbp
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
jne 0x140023c52
jmp 0x140023cc9
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
mov r8d, dword [rsp + 0x34]
lea r9, [0x1400f69b8]
mov r14, qword [rsp + 0x40]
mov ebp, 0x20000
mov rcx, r14
mov esi, r8d
lea rdx, [r8 + r14]
call fcn.14003ba70
lea ecx, [rax + 0x38]
lea rax, [rsi + 0x38]
cmp rcx, rax
jne 0x140023dbb
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rbx
mov r8d, ebp
mov rdx, r14
mov rcx, r15
mov rsi, rbx
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x140023d86
nop
cmp dword [rsp + 0x48], ebp
jne 0x140023d81
mov ecx, dword [rsp + 0x38]
inc rsi
add r14, 0x20000
dec ecx
cmp rsi, rcx
jne 0x140023d47
lea rdx, [rdi - 0x20000]
add ebp, 0x38
jmp 0x140023d55
cmp rsi, r12
je 0x140023d81
mov rdx, r13
imul rdx, rsi
mov edx, edx
xor r9d, r9d
xor r8d, r8d
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rbx
mov r8d, ebp
mov rdx, r14
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
jne 0x140023d20
mov r14, qword [rsp + 0x40]
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rbx
mov r8d, 0x78
lea rdx, [0x1400f6940]
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_WriteFile]
mov ecx, dword [rsp + 0x30]
mov edx, 1
test eax, eax
movzx ecx, cl
cmovne ecx, edx
mov dword [rsp + 0x30], ecx
mov rcx, r14
call fcn.14005ff0c
movzx eax, byte [rsp + 0x30]
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.14005feb0
mov rbx, qword [rsp + 0xb8]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret