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

Disassembly:
mov r11, rsp
mov qword [r11 + 0x10], rbx
mov qword [r11 + 0x20], rsi
mov qword [r11 + 8], rcx
push rbp
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
xor r12d, r12d
mov r14, r9
mov rax, r8
mov rsi, rdx
cmp word [r8], r12w
je 0x1400a58bb
mov qword [r11 - 0x68], r12
mov dword [r11 - 0x70], r12d
xor r9d, r9d
xor r8d, r8d
mov edx, 0x80000000
mov rcx, rax
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.DLL_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400a579c
xor eax, eax
jmp 0x1400a58f6
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GetFileSize]
mov ecx, 2
mov edx, eax
mov ebx, eax
call qword [sym.imp.KERNEL32.DLL_GlobalAlloc]
mov r15, rax
test rax, rax
jne 0x1400a57c9
mov rcx, rdi
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
jmp 0x1400a5795
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GlobalLock]
lea r9, [rbp + 0x30]
mov r8d, ebx
mov rcx, rdi
mov rdx, rax
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.DLL_ReadFile]
mov rcx, r15
mov ebx, eax
call qword [sym.imp.KERNEL32.DLL_GlobalUnlock]
mov rcx, rdi
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
test ebx, ebx
je 0x1400a5795
lea r8, [rbp - 0x28]
mov edx, 1
mov rcx, r15
call qword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
mov rcx, qword [rbp - 0x28]
lea rax, [rbp - 0x30]
lea r9, [0x1400ae980]
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x20], rax
mov qword [rbp - 0x30], r12
call qword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
mov rcx, qword [rbp - 0x28]
mov rax, qword [rcx]
call qword [rax + reloc.WSOCK32.dll_recv]
mov rcx, r15
call qword [sym.imp.KERNEL32.DLL_GlobalFree]
mov rcx, qword [rbp - 0x30]
test rcx, rcx
je 0x1400a5795
mov rax, qword [rcx]
lea rdx, [rbp + 0x40]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
mov rcx, qword [rbp + 0x40]
lea r8, [rbp - 0x20]
mov edx, reloc.OLEAUT32.dll_RegisterActiveObject
call qword [sym.imp.GDI32.dll_GetObjectW]
mov rcx, qword [rbp + 0x50]
cmp dword [r14], r12d
jne 0x1400a588d
cmp dword [rcx], r12d
jne 0x1400a588d
mov eax, dword [rbp - 0x1c]
mov dword [r14], eax
mov eax, dword [rbp - 0x18]
mov dword [rcx], eax
mov r9d, dword [rcx]
mov r8d, dword [r14]
mov rcx, qword [rbp + 0x40]
xor edx, edx
mov dword [rsp + 0x20], 0x2000
call qword [sym.imp.USER32.dll_CopyImage]
mov rcx, qword [rbp - 0x30]
mov qword [rbp + 0x40], rax
mov rax, qword [rcx]
call qword [rax + reloc.WSOCK32.dll_recv]
mov r9, qword [rbp + 0x40]
jmp 0x1400a58c2
mov r9, r12
mov qword [rbp + 0x40], r12
mov rcx, qword [rsi + 0xc0]
test rcx, rcx
je 0x1400a58d8
call qword [sym.imp.GDI32.dll_DeleteObject]
mov r9, qword [rbp + 0x40]
mov rbx, qword [rsi]
xor r8d, r8d
mov edx, 0x172
mov rcx, rbx
mov qword [rsi + 0xc0], r9
call qword [sym.imp.USER32.dll_SendMessageW]
mov rax, rbx
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret