joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140036b30
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbp
push rsi
push r12
push r13
push r14
push r15
sub rsp, 0x40
mov rsi, r8
mov r12d, edx
mov r14, rcx
mov r15d, 0x1000
mov rcx, qword [0x1401683f0]
mov r8d, r15d
xor edx, edx
mov r13, r9
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbp, rax
test rax, rax
je 0x140036d0b
movzx r8d, byte [rsp + 0x30]
mov qword [rsp + 0x70], rbx
mov rbx, rax
mov qword [rsp + 0x78], rdi
cmp rsi, 0xffffffffffffffff
je 0x140036b97
test rsi, rsi
je 0x140036c60
dec rsi
cmp qword [r14 + 8], 0
lea rdi, [r14 + 8]
lea rdx, [rsp + 0x30]
je 0x140036bbb
mov r8d, 1
mov rcx, r14
call fcn.140037110
mov dword [rsp + 0x34], eax
jmp 0x140036bdc
mov rcx, qword [r14]
lea r9, [rsp + 0x34]
mov r8d, 1
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x34]
movzx r8d, byte [rsp + 0x30]
cmp eax, 1
jne 0x140036c64
test r8b, r8b
je 0x140036bf8
mov byte [rbx], r8b
inc rbx
movzx r8d, byte [rsp + 0x30]
mov rdx, rbx
lea eax, [r15 - 1]
sub rdx, rbp
movsxd rcx, eax
cmp rdx, rcx
jle 0x140036c3a
mov rcx, qword [0x1401683f0]
add r15d, 0x1000
movsxd r9, r15d
mov r8, rbp
mov edx, 8
sub ebx, ebp
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
movzx r8d, byte [rsp + 0x30]
mov rbp, rax
movsxd rbx, ebx
add rbx, rax
test r8b, r8b
je 0x140036c64
test r12d, r12d
jne 0x140036b85
cmp r8b, 0xd
je 0x140036c6d
cmp r8b, 0xa
jne 0x140036b85
dec rbx
jmp 0x140036cf1
lea rdi, [r14 + 8]
test r12d, r12d
jne 0x140036cf1
cmp r8b, 0xa
jne 0x140036c78
dec rbx
jmp 0x140036cf1
cmp r8b, 0xd
jne 0x140036cf1
dec rbx
lea rdx, [rsp + 0x30]
cmp qword [rdi], 0
je 0x140036ca0
mov r8d, 1
mov rcx, r14
call fcn.140037110
mov dword [rsp + 0x34], eax
jmp 0x140036cbd
mov rcx, qword [r14]
lea r9, [rsp + 0x34]
mov r8d, 1
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp byte [rsp + 0x30], 0xa
je 0x140036cf1
cmp qword [rdi], 0
je 0x140036cd0
inc dword [r14 + 0x14]
jmp 0x140036cf1
mov rcx, qword [r14]
lea r8, [rsp + 0x3c]
mov r9d, 1
mov qword [rsp + 0x38], 0xffffffffffffffff
lea edx, [r9 - 2]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rdi, qword [rsp + 0x78]
mov rax, rbx
sub rax, rbp
mov qword [r13], rax
mov rax, rbp
mov byte [rbx], 0
mov rbx, qword [rsp + 0x70]
mov rbp, qword [rsp + 0x80]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rsi
ret
Function at 0x140036d30
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], r9
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x40
mov rbp, r8
mov r12d, edx
mov r14, rcx
xor edx, edx
mov rcx, qword [0x1401683f0]
mov r8d, 0x1000
xor edi, edi
mov r13d, 0x800
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r15, rax
test rax, rax
je 0x140036f28
movzx edx, word [rsp + 0x30]
mov qword [rsp + 0x70], rbx
mov rbx, rax
mov qword [rsp + 0x78], rsi
nop dword [rax + rax]
cmp rbp, 0xffffffffffffffff
je 0x140036da2
test rbp, rbp
je 0x140036e68
dec rbp
cmp qword [r14 + 8], 0
lea rsi, [r14 + 8]
lea rdx, [rsp + 0x30]
je 0x140036dc6
mov r8d, 2
mov rcx, r14
call fcn.140037110
mov dword [rsp + 0x34], eax
jmp 0x140036de3
mov rcx, qword [r14]
lea r9, [rsp + 0x34]
mov r8d, 2
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x34]
movzx edx, word [rsp + 0x30]
cmp eax, 2
jne 0x140036e6c
test dx, dx
je 0x140036dfe
mov word [rbx], dx
add rbx, 2
movzx edx, word [rsp + 0x30]
mov rdi, rbx
lea eax, [r13 - 1]
sub rdi, r15
movsxd rcx, eax
sar rdi, 1
cmp rdi, rcx
jle 0x140036e44
mov rcx, qword [0x1401683f0]
add r13d, 0x800
movsxd r9, r13d
mov r8, r15
add r9, r9
mov edx, 8
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
movzx edx, word [rsp + 0x30]
mov r15, rax
movsxd rax, edi
lea rbx, [r15 + rax*2]
test dx, dx
je 0x140036e6c
mov edi, 0
test r12d, r12d
jne 0x140036d90
cmp dx, 0xd
je 0x140036e71
cmp dx, 0xa
je 0x140036e77
jmp 0x140036d90
lea rsi, [r14 + 8]
test r12d, r12d
jne 0x140036e7b
cmp dx, 0xa
jne 0x140036ea6
sub rbx, 2
xor edi, edi
mov rcx, qword [rsp + 0x88]
mov rax, rbx
mov rsi, qword [rsp + 0x78]
sub rax, r15
sar rax, 1
mov qword [rcx], rax
mov rax, r15
mov word [rbx], di
mov rbx, qword [rsp + 0x70]
jmp 0x140036f2b
cmp dx, 0xd
jne 0x140036e7b
sub rbx, 2
lea rdx, [rsp + 0x30]
cmp qword [rsi], 0
je 0x140036ed1
mov r8d, 2
mov rcx, r14
call fcn.140037110
mov dword [rsp + 0x34], eax
xor edi, edi
jmp 0x140036eea
mov rcx, qword [r14]
lea r9, [rsp + 0x34]
xor edi, edi
mov qword [rsp + 0x20], rdi
lea r8d, [rdi + 2]
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp word [rsp + 0x30], 0xa
je 0x140036e7d
cmp qword [rsi], 0
je 0x140036f02
add dword [r14 + 0x14], 2
jmp 0x140036e7d
mov rcx, qword [r14]
lea r8, [rsp + 0x3c]
mov r9d, 1
mov qword [rsp + 0x38], 0xfffffffffffffffe
lea edx, [r9 - 3]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x140036e7d
mov rax, rdi
mov rbp, qword [rsp + 0x80]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
Function at 0x140036f50
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r12
push r14
push r15
sub rsp, 0x40
mov rdi, r8
mov r15d, edx
mov rsi, rcx
mov r14d, 0x1000
mov rcx, qword [0x1401683f0]
mov r8d, r14d
xor edx, edx
mov r12, r9
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbp, rax
test rax, rax
je 0x1400370ea
movzx r8d, byte [rsp + 0x30]
mov qword [rsp + 0x60], rbx
mov rbx, rax
cmp rdi, 0xffffffffffffffff
je 0x140036fb9
test rdi, rdi
je 0x140037047
dec rdi
mov rdx, rbx
mov rcx, rsi
call fcn.140037260
mov dword [rsp + 0x34], eax
test eax, eax
jne 0x140036fd1
xor r8b, r8b
jmp 0x140036fd5
movzx r8d, byte [rbx]
cdqe
add rbx, rax
mov byte [rsp + 0x30], r8b
mov rdx, rbx
lea eax, [r14 - 5]
sub rdx, rbp
movsxd rcx, eax
cmp rdx, rcx
jle 0x140037021
mov rcx, qword [0x1401683f0]
add r14d, 0x1000
movsxd r9, r14d
mov r8, rbp
mov edx, 8
sub ebx, ebp
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
movzx r8d, byte [rsp + 0x30]
mov rbp, rax
movsxd rbx, ebx
add rbx, rax
test r8b, r8b
je 0x140037047
test r15d, r15d
jne 0x140036fa7
cmp r8b, 0xd
je 0x140037050
cmp r8b, 0xa
jne 0x140036fa7
dec rbx
jmp 0x1400370d5
test r15d, r15d
jne 0x1400370d5
cmp r8b, 0xa
jne 0x14003705b
dec rbx
jmp 0x1400370d5
cmp r8b, 0xd
jne 0x1400370d5
dec rbx
lea rdx, [rsp + 0x30]
cmp qword [rsi + 8], 0
je 0x140037084
mov r8d, 1
mov rcx, rsi
call fcn.140037110
mov dword [rsp + 0x34], eax
jmp 0x1400370a1
mov rcx, qword [rsi]
lea r9, [rsp + 0x34]
mov r8d, 1
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp byte [rsp + 0x30], 0xa
je 0x1400370d5
cmp qword [rsi + 8], 0
je 0x1400370b4
inc dword [rsi + 0x14]
jmp 0x1400370d5
mov rcx, qword [rsi]
lea r8, [rsp + 0x3c]
mov r9d, 1
mov qword [rsp + 0x38], 0xffffffffffffffff
lea edx, [r9 - 2]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rax, rbx
sub rax, rbp
mov qword [r12], rax
mov rax, rbp
mov byte [rbx], 0
mov rbx, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x78]
add rsp, 0x40
pop r15
pop r14
pop r12
ret
Function at 0x140037110
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x30
xor ebp, ebp
mov rdi, r8
mov r15, rdx
mov r14, rcx
cmp dword [rcx + 0x1c], ebp
jne 0x140037147
call fcn.140036a00
mov dword [r14 + 0x1c], 1
mov dword [r14 + 0x14], ebp
movsxd r12, dword [r14 + 0x14]
mov eax, dword [r14 + 0x18]
mov rbx, r12
sub eax, r12d
movsxd rdx, eax
add rdx, qword [r14 + 8]
cmp r12, rdi
jl 0x1400371c0
mov rax, rdi
sub rax, 1
je 0x1400371b1
sub rax, 1
je 0x14003719e
cmp rax, 2
je 0x14003718d
mov r8, rdi
mov rcx, r15
call fcn.140022be0
sub dword [r14 + 0x14], edi
movsxd rax, edi
jmp 0x14003723a
mov eax, dword [rdx]
mov dword [r15], eax
sub dword [r14 + 0x14], edi
movsxd rax, edi
jmp 0x14003723a
movzx eax, word [rdx]
mov word [r15], ax
sub dword [r14 + 0x14], edi
movsxd rax, edi
jmp 0x14003723a
movzx eax, byte [rdx]
mov byte [r15], al
sub dword [r14 + 0x14], edi
movsxd rax, edi
jmp 0x14003723a
mov r8, rbx
mov rcx, r15
call fcn.140022be0
movsxd r8, dword [r14 + 0x10]
lea r9, [rsp + 0x60]
mov rcx, qword [r14]
add r15, rbx
sub rdi, rbx
mov qword [rsp + 0x20], rbp
cmp rdi, r8
jl 0x140037200
mov r8d, edi
mov rdx, r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x60]
add eax, r12d
mov dword [r14 + 0x14], ebp
jmp 0x140037238
mov rdx, qword [r14 + 8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
movsxd rax, dword [rsp + 0x60]
mov rcx, r15
mov rdx, qword [r14 + 8]
cmp rdi, rax
mov rbx, rax
mov dword [r14 + 0x14], eax
cmovle rbx, rdi
mov dword [r14 + 0x18], eax
mov r8, rbx
call fcn.140022be0
sub dword [r14 + 0x14], ebx
lea eax, [rbx + r12]
cdqe
mov rbx, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
add rsp, 0x30
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret
Function at 0x140037260
Capabilities:
Read file on windows

Disassembly:
push rbx
push rsi
push r14
push r15
sub rsp, 0x38
xor r15d, r15d
mov rsi, rdx
lea rdx, [rsp + 0x60]
mov r14, rcx
mov dword [rsp + 0x70], r15d
lea ebx, [r15 + 1]
cmp qword [rcx + 8], r15
je 0x140037296
mov r8d, ebx
call fcn.140037110
mov dword [rsp + 0x70], eax
jmp 0x1400372b0
mov rcx, qword [rcx]
lea r9, [rsp + 0x70]
mov r8d, ebx
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x70]
cmp eax, 1
jne 0x140037378
movzx ecx, byte [rsp + 0x60]
test cl, cl
js 0x1400372d6
mov byte [rsi], cl
mov rax, rbx
mov byte [rsi + 1], r15b
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbx
ret
movzx eax, cl
mov qword [rsp + 0x68], rbp
and al, 0xe0
mov qword [rsp + 0x30], rdi
cmp al, 0xc0
jne 0x1400372f2
mov ebp, 2
mov edi, ebp
jmp 0x140037319
movzx eax, cl
and al, 0xf0
cmp al, 0xe0
jne 0x140037305
mov edi, 3
lea ebx, [rdi - 1]
jmp 0x140037316
movzx eax, cl
and al, 0xf8
cmp al, 0xf0
jne 0x14003736e
mov edi, 4
lea ebx, [rdi - 1]
mov rbp, rdi
mov byte [rsi], cl
lea rdx, [rsi + 1]
cmp qword [r14 + 8], r15
je 0x140037333
lea r8, [rdi - 1]
mov rcx, r14
call fcn.140037110
jmp 0x140037350
mov rcx, qword [r14]
lea r9, [rsp + 0x70]
mov r8d, ebx
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x70]
mov rdi, rbp
cmp eax, ebx
cmovne rdi, r15
mov rax, rdi
mov rbp, qword [rsp + 0x68]
mov rdi, qword [rsp + 0x30]
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbx
ret
mov word [rsi], 0x3f
mov rax, rbx
jmp 0x140037359
xor eax, eax
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbx
ret

Function at 0x140037a14
Capabilities:
Set console window title

Disassembly:
mov edx, 2
xor ecx, ecx
jmp 0x140037a20
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x20
cmp dword [0x140168388], 0
mov edi, edx
mov rbx, rcx
jne 0x140037a3e
call qword [sym.imp.KERNEL32.dll_AllocConsole]
mov ecx, 0xfffffff6
mov dword [reloc.WS2_32.dll_bind], edi
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, 0xfffffff5
mov qword [0x14016f420], rax
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, 0xfffffff4
mov qword [0x14016f440], rax
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov rcx, qword [0x14016f440]
lea rdx, [0x14016f460]
mov qword [0x14016f480], rax
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
mov edi, 1
lea rcx, [0x1400379fc]
mov edx, edi
call qword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
test rbx, rbx
je 0x140037ab0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetConsoleTitleW]
lea rcx, [0x14016f4a0]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x14016f4e0]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov rbx, qword [rsp + 0x30]
mov rax, rdi
add rsp, 0x20
pop rdi
ret
Function at 0x140037b48
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x30
xor edi, edi
mov esi, r8d
mov rbx, rdx
mov rbp, rcx
test r9d, r9d
je 0x140037bbf
mov rcx, qword [0x1401683f0]
add esi, 2
xor edx, edx
lea eax, [rsi + 1]
movsxd r8, eax
add r8, r8
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
je 0x140037bbf
mov rcx, rax
test rbx, rbx
je 0x140037bb0
mov rdx, rbx
call fcn.1400ccbf8
lea rdx, [0x140122d68]
mov rcx, rdi
call fcn.1400cd3f4
jmp 0x140037bbc
lea rdx, [0x140122d68]
call fcn.1400ccbf8
mov rbx, rdi
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x58]
mov r8d, esi
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
jne 0x140037c49
mov eax, dword [reloc.WS2_32.dll_bind]
cmp eax, 2
je 0x140037c14
cmp eax, 0x18
je 0x140037c0a
and qword [rsp + 0x20], 0
lea r8d, [rsi + rsi]
lea r9, [rsp + 0x58]
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x140037c49
mov rcx, rbx
call fcn.1400ac730
jmp 0x140037c1c
mov rcx, rbx
call fcn.1400ac820
mov rcx, rax
mov rbx, rax
call fcn.1400cc9a0
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x58]
mov r8, rax
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call fcn.1400ac720
test rdi, rdi
je 0x140037c60
mov rcx, qword [0x1401683f0]
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbx, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x30
pop rdi
ret

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

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x20
mov rsi, rcx
mov ecx, dword [0x140169b30]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test rax, rax
jne 0x140037d95
mov r8, qword [0x140169b28]
lea edx, [rax + 8]
mov rcx, qword [0x1401683f0]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [0x140169b30]
mov rdx, rax
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov rbx, qword [0x140169b20]
jmp 0x140037d81
mov rdx, qword [rbx + 0x18]
test rdx, rdx
je 0x140037d7e
mov rcx, qword [rbx + 0x10]
add rcx, rdi
call rdx
mov rbx, qword [rbx]
test rbx, rbx
jne 0x140037d6c
mov rdx, rdi
lea rcx, [0x140037c78]
call fcn.1400022a8
mov rbx, qword [rsp + 0x30]
lea rax, [rdi + rsi]
mov rsi, qword [rsp + 0x38]
add rsp, 0x20
pop rdi
ret
Function at 0x140037dac
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x20
mov edi, ecx
mov rbp, r8
mov rsi, rdx
and ecx, 7
je 0x140037dd6
mov eax, 8
sub eax, ecx
add edi, eax
mov rbx, qword [0x140169b28]
test rbx, rbx
jne 0x140037e1c
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov rcx, qword [0x1401683f0]
lea edx, [rbx + 8]
movsxd rdi, edi
mov r8, rdi
mov dword [0x140169b30], eax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [0x140169b30]
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov rbx, qword [0x140169b28]
jmp 0x140037e1f
movsxd rdi, edi
mov ecx, dword [0x140169b30]
lea rax, [rdi + rbx]
mov qword [0x140169b28], rax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov r9, qword [0x140169b28]
mov edx, 8
mov rcx, qword [0x1401683f0]
mov r8, rax
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov ecx, dword [0x140169b30]
mov rdx, rax
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test rsi, rsi
jne 0x140037e6e
test rbp, rbp
je 0x140037e95
mov edx, 0x28
lea rcx, [0x140169b20]
call fcn.140038a64
mov qword [rax], rbx
mov qword [rax + 8], rsi
mov qword [rax + 0x10], rbp
test rsi, rsi
je 0x140037e95
lea rcx, [rdi + rbx]
call rsi
mov rbp, qword [rsp + 0x38]
mov rax, rbx
mov rbx, qword [rsp + 0x30]
mov rsi, qword [rsp + 0x40]
add rsp, 0x20
pop rdi
ret

Function at 0x140039ad0
Capabilities:
Get thread local storage value

Disassembly:
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x20
mov rdi, rcx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x140164ef4]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, ebx
mov qword [rax + 0x10], rdi
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
jmp qword [sym.imp.KERNEL32.dll_SetLastError]

Function at 0x140039b10
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
sub rsp, 0x28
mov ecx, dword [0x140164ef4]
cmp ecx, 0xffffffff
jne 0x140039b26
call fcn.140039ee0
jmp 0x140039b36
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
jne 0x140039b55
call fcn.14003a340
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdx, rax
lea rcx, [0x140039b60]
add rsp, 0x28
jmp fcn.1400022a8
add rsp, 0x28
ret

Function at 0x140039be0
Capabilities:
Get thread local storage value

Disassembly:
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x20
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x140164ef4]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
dec qword [rax + 0x338]
mov rcx, qword [rax + 0x338]
mov rbx, qword [rax + rcx*8 + 0x18]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, rbx
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
Function at 0x140039c30
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdx, rax
dec qword [rax + 0x338]
mov rcx, qword [rax + 0x338]
mov rax, qword [rax + rcx*8 + 0x18]
mov qword [rdx + 0x10], rax
add rsp, 0x28
ret

Function at 0x140039ca0
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdx, rax
dec qword [rax + 0x338]
mov rcx, qword [rax + 0x338]
mov rax, qword [rax + rcx*8 + 0x18]
add rax, qword [rdx]
add rsp, 0x28
ret

Function at 0x140039cd0
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdx, qword [rax + 0x338]
mov rcx, qword [rax + 0x10]
mov qword [rax + rdx*8 + 0x18], rcx
inc qword [rax + 0x338]
add rsp, 0x28
ret

Function at 0x140039d30
Capabilities:
Get thread local storage value

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r14
sub rsp, 0x20
mov rdi, rcx
movsxd r14, edx
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rcx, qword [rdi]
mov rsi, rax
mov r8d, dword [rax + 0x10]
sub r8d, r14d
movsxd rbp, r8d
test rcx, rcx
jne 0x140039d86
mov rcx, qword [0x14016f580]
lea r8, [rbp + 0x12]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
jmp 0x140039da5
call fcn.14003c4b0
add qword [rdi], 0xfffffffffffffffc
lea r9, [rbp + 0x12]
mov r8, qword [rdi]
xor edx, edx
mov rcx, qword [0x14016f580]
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
lea r9, [rax + 4]
mov r8, rbp
mov qword [rdi], r9
mov rcx, r9
mov rdx, qword [rsi]
add rdx, r14
shr r8, 1
call fcn.14003a190
mov rcx, qword [rdi]
lea rdx, [rbp + 2]
call fcn.14003c180
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rdi, qword [rsp + 0x48]
mov qword [rsi + 0x10], r14
mov rsi, qword [rsp + 0x40]
add rsp, 0x20
pop r14
ret

Function at 0x140039e90
Capabilities:
Get thread local storage value

Disassembly:
sub rsp, 0x28
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
add qword [rax + 0x10], 2
add rsp, 0x28
ret

Function at 0x140039ee0
Capabilities:
Allocate thread local storage
Set thread local storage value

Disassembly:
sub rsp, 0x28
xor r8d, r8d
mov edx, 0x1000
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_HeapCreate]
mov qword [0x14016f580], rax
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x140164ef4], eax
add rsp, 0x28
jmp fcn.14003a340
Function at 0x14003a070
Capabilities:
Get thread local storage value

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x20
movsxd rbp, ecx
mov esi, edx
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rbx, rax
cmp esi, 0xffffffff
jne 0x14003a0a0
mov esi, dword [rax + 0x10]
mov eax, dword [rax + 0x10]
mov r8, qword [rbx + 8]
lea edx, [rax + rbp*2]
movsxd rax, edx
lea rcx, [r8 - 4]
cmp rax, rcx
jl 0x14003a0c1
lea eax, [rdx + 0x4000]
movsxd r9, eax
jmp 0x14003a0d3
mov eax, 0x100000
cmp r8, rax
jle 0x14003a0f0
cmp edx, eax
cmovl edx, eax
mov r9d, edx
mov r8, qword [rbx]
xor edx, edx
mov qword [rbx + 8], r9
add r9, 0xa
mov rcx, qword [0x14016f580]
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov qword [rbx], rax
mov rax, qword [rbx]
movsxd rdx, esi
mov rsi, qword [rsp + 0x40]
add rax, rdx
lea rcx, [rdx + rbp*2]
mov rbp, qword [rsp + 0x38]
mov qword [rbx + 0x10], rcx
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret

Function at 0x14003a120
Capabilities:
Get thread local storage value

Disassembly:
push rbx
sub rsp, 0x20
mov rbx, rcx
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rcx, qword [rax]
cmp rbx, rcx
jb 0x14003a154
mov rdx, qword [rax + 0x10]
add rdx, rcx
cmp rbx, rdx
ja 0x14003a154
sub ebx, ecx
lea eax, [rbx + 1]
add rsp, 0x20
pop rbx
ret
xor eax, eax
add rsp, 0x20
pop rbx
ret

Function at 0x14003a160
Capabilities:
Get thread local storage value

Disassembly:
push rbx
sub rsp, 0x20
movsxd rbx, ecx
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
dec rbx
mov rax, qword [rax]
add rax, rbx
add rsp, 0x20
pop rbx
ret

Function at 0x14003a1d0
Capabilities:
Get thread local storage value

Disassembly:
push rbx
sub rsp, 0x20
mov ebx, ecx
mov ecx, dword [0x140164ef4]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, [rbx + rbx]
movsxd rdx, ecx
sub qword [rax + 0x10], rdx
add rsp, 0x20
pop rbx
ret

Function at 0x14003a340
Capabilities:
Set thread local storage value

Disassembly:
push rbx
sub rsp, 0x20
mov rcx, qword [0x14016f580]
xor edx, edx
mov r8d, 0x340
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rcx, qword [0x14016f580]
xor edx, edx
mov rbx, rax
lea r8d, [rdx + 0x10]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbx + 8], reloc.WS2_32.dll_recv
mov rdx, rbx
mov qword [rbx], rax
xor eax, eax
mov qword [rbx + 0x10], rax
mov qword [rbx + 0x338], rax
mov ecx, dword [0x140164ef4]
add rsp, 0x20
pop rbx
jmp qword [sym.imp.KERNEL32.dll_TlsSetValue]