joyce8/EMBER2024-capa huggingface dataset:
Function at 0x1800f3b70
Capabilities:
Get common file path

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x478
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x3f0], 0xfffffffffffffffe
mov qword [rbp + 0x3e0], rcx
mov qword [rbp + 0x3c8], 2
xorps xmm0, xmm0
movups xmmword [rbp + 0x3d0], xmm0
mov r8d, 0x200
mov eax, 2
mov qword [rbp + 0x3e8], rax
xor edi, edi
xor ebx, ebx
xor r12d, r12d
cmp r8, 0x201
jae 0x1800f3c00
jmp 0x1800f3bef
jae 0x1800f3cc0
cmp r8, 0x201
jae 0x1800f3c00
mov esi, 0x200
lea r13, [rbp - 0x58]
mov r15, r8
jmp 0x1800f3c58
sub r8, r12
sub rbx, r12
cmp rbx, r8
jae 0x1800f3c2f
lea rcx, [rbp + 0x3c8]
mov rdx, r12
call fcn.180129660
mov rax, qword [rbp + 0x3c8]
mov qword [rbp + 0x3e8], rax
mov rdi, qword [rbp + 0x3d0]
mov eax, 0xffffffff
cmp rdi, rax
mov r12d, 0xffffffff
cmovb r12, rdi
mov qword [rbp + 0x3d8], r12
mov rbx, rdi
mov rsi, r12
mov r13, qword [rbp + 0x3e8]
mov r15, r12
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, r15d
mov rdx, r13
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov r14d, eax
test eax, eax
jne 0x1800f3c81
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1800f3d28
mov r8d, r14d
cmp r15, r8
jne 0x1800f3be0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x1800f3d4b
add r15, r15
mov eax, 0xffffffff
cmp r15, rax
cmovae r15, rax
mov r8, r15
cmp r8, 0x201
jb 0x1800f3bef
jmp 0x1800f3c00
cmp rsi, r8
jb 0x1800f3d65
lea rcx, [rbp + 0x3a8]
mov rdx, r13
call fcn.1800f58d0
movups xmm0, xmmword [rbp + 0x3a8]
movups xmm1, xmmword [rbp + 0x3b8]
mov rsi, qword [rbp + 0x3e0]
movups xmmword [rsi + 0x10], xmm1
movups xmmword [rsi], xmm0
test rdi, rdi
je 0x1800f3d11
add rdi, rdi
mov r8d, 2
mov rcx, qword [rbp + 0x3e8]
mov rdx, rdi
call fcn.18000b030
mov rax, rsi
add rsp, 0x478
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
shl rax, 0x20
or rax, 2
mov rsi, qword [rbp + 0x3e0]
mov qword [rsi], rax
mov byte [rsi + 0x18], 2
test rdi, rdi
jne 0x1800f3cf9
jmp 0x1800f3d11
lea rcx, [0x1801b0138]
lea r8, str.library_std_src_syswindowsmod.rs
mov edx, 0x28
call fcn.18012a170
jmp 0x1800f3d7a
lea rax, str.library_std_src_syswindowsmod.rs
mov rcx, r8
mov rdx, rsi
mov r8, rax
call fcn.18012a600
ud2
Function at 0x1800f3dd0
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x4a8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x420], 0xfffffffffffffffe
mov rsi, rcx
lea rcx, [rbp - 0x60]
call fcn.180106780
mov rax, qword [rbp - 0x60]
mov qword [rbp + 0x408], rax
test rax, rax
je 0x1800f3f56
mov qword [rbp + 0x400], rsi
mov rax, qword [rbp - 0x58]
mov qword [rbp + 0x418], rax
mov qword [rbp + 0x3e8], 2
xorps xmm0, xmm0
movups xmmword [rbp + 0x3f0], xmm0
mov r8d, 0x200
mov eax, 2
mov qword [rbp + 0x410], rax
xor edi, edi
xor ebx, ebx
xor r13d, r13d
cmp r8, 0x201
jae 0x1800f3e90
jmp 0x1800f3e7f
jae 0x1800f3f68
cmp r8, 0x201
jae 0x1800f3e90
mov r15d, 0x200
lea r14, [rbp - 0x60]
mov r12, r8
jmp 0x1800f3ee8
sub r8, r13
sub rbx, r13
cmp rbx, r8
jae 0x1800f3ebf
lea rcx, [rbp + 0x3e8]
mov rdx, r13
call fcn.180129660
mov rax, qword [rbp + 0x3e8]
mov qword [rbp + 0x410], rax
mov rdi, qword [rbp + 0x3f0]
mov eax, 0xffffffff
cmp rdi, rax
mov r13d, 0xffffffff
cmovb r13, rdi
mov qword [rbp + 0x3f8], r13
mov rbx, rdi
mov r15, r13
mov r14, qword [rbp + 0x410]
mov r12, r13
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, qword [rbp + 0x408]
mov rdx, r14
mov r8d, r12d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, eax
test eax, eax
jne 0x1800f3f17
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1800f403b
mov r8d, esi
cmp r12, r8
jne 0x1800f3e70
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x1800f4065
add r12, r12
mov eax, 0xffffffff
cmp r12, rax
cmovae r12, rax
mov r8, r12
cmp r8, 0x201
jb 0x1800f3e7f
jmp 0x1800f3e90
lea rcx, [rbp - 0x58]
call fcn.1800ee730
mov byte [rsi + 0x18], 2
jmp 0x1800f3ffa
cmp r15, r8
jb 0x1800f407f
lea rcx, [rbp + 0x3a0]
mov rdx, r14
call fcn.1800f58d0
movups xmm0, xmmword [rbp + 0x3a0]
movups xmm1, xmmword [rbp + 0x3b0]
movaps xmmword [rbp + 0x3d0], xmm1
movaps xmmword [rbp + 0x3c0], xmm0
test rdi, rdi
je 0x1800f3fb9
add rdi, rdi
mov r8d, 2
mov rcx, qword [rbp + 0x410]
mov rdx, rdi
call fcn.18000b030
cmp byte [rbp + 0x3d8], 2
jne 0x1800f4011
mov rsi, qword [rbp + 0x400]
mov byte [rsi + 0x18], 2
lea rcx, [rbp + 0x3c0]
call fcn.1800ee730
mov rdx, qword [rbp + 0x418]
test rdx, rdx
je 0x1800f3ffa
add rdx, rdx
mov r8d, 2
mov rcx, qword [rbp + 0x408]
call fcn.18000b030
mov rax, rsi
add rsp, 0x4a8
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
movaps xmm0, xmmword [rbp + 0x3c0]
movaps xmm1, xmmword [rbp + 0x3d0]
mov rsi, qword [rbp + 0x400]
movups xmmword [rsi + 0x10], xmm1
movups xmmword [rsi], xmm0
mov rdx, qword [rbp + 0x418]
test rdx, rdx
jne 0x1800f3fe5
jmp 0x1800f3ffa
call qword [sym.imp.KERNEL32.dll_GetLastError]
shl rax, 0x20
or rax, 2
mov qword [rbp + 0x3c0], rax
mov byte [rbp + 0x3d8], 2
test rdi, rdi
jne 0x1800f3fa1
jmp 0x1800f3fb9
lea rcx, [0x1801b0138]
lea r8, str.library_std_src_syswindowsmod.rs
mov edx, 0x28
call fcn.18012a170
jmp 0x1800f4094
lea rax, str.library_std_src_syswindowsmod.rs
mov rcx, r8
mov rdx, r15
mov r8, rax
call fcn.18012a600
ud2
Function at 0x1800f4150
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push rsi
push rdi
push rbx
sub rsp, 0x40
movdqa xmmword [rsp + 0x30], xmm7
movdqa xmmword [rsp + 0x20], xmm6
mov rsi, r8
mov rdi, rcx
test r8, r8
je 0x1800f41c6
js 0x1800f4317
mov r15, rdx
movzx eax, byte [0x1801e4bc1]
mov edx, 1
mov rcx, rsi
call fcn.18000b020
test rax, rax
je 0x1800f431e
mov r14, rax
mov rbx, rax
mov rcx, r14
mov rdx, r15
mov r8, rsi
call fcn.180124360
mov rcx, r14
cmp rsi, 8
jb 0x1800f42cc
cmp rsi, 0x20
jae 0x1800f41d0
xor eax, eax
jmp 0x1800f4266
mov ebx, 1
jmp 0x1800f42ef
mov rax, rsi
and rax, 0xffffffffffffffe0
xor ecx, ecx
movdqa xmm0, xmmword [0x1801af880]
movdqa xmm1, xmmword [0x18012be00]
movdqa xmm2, xmmword [0x18012be10]
nop word cs:[rax + rax]
movdqu xmm3, xmmword [rbx + rcx]
movdqu xmm4, xmmword [rbx + rcx + 0x10]
movdqa xmm5, xmm3
paddb xmm5, xmm0
movdqa xmm6, xmm4
paddb xmm6, xmm0
movdqa xmm7, xmm5
pminub xmm7, xmm1
pcmpeqb xmm7, xmm5
pand xmm7, xmm2
movdqa xmm5, xmm6
pminub xmm5, xmm1
pcmpeqb xmm5, xmm6
pand xmm5, xmm2
pxor xmm7, xmm3
pxor xmm5, xmm4
movdqu xmmword [rbx + rcx], xmm7
movdqu xmmword [rbx + rcx + 0x10], xmm5
add rcx, 0x20
cmp rax, rcx
jne 0x1800f4200
cmp rax, rsi
je 0x1800f42ef
test sil, 0x18
je 0x1800f42c6
mov rdx, rsi
and rdx, 0xfffffffffffffff8
lea rcx, [r14 + rdx]
movdqa xmm0, xmmword [0x1801af890]
movdqa xmm1, xmmword [0x18012be30]
movdqa xmm2, xmmword [0x18012be40]
nop dword [rax]
movq xmm3, qword [rbx + rax]
movdqa xmm4, xmm3
paddb xmm4, xmm0
movdqa xmm5, xmm4
pmaxub xmm5, xmm1
pcmpeqb xmm5, xmm4
pandn xmm5, xmm2
pxor xmm5, xmm3
movq qword [rbx + rax], xmm5
add rax, 8
cmp rdx, rax
jne 0x1800f4290
cmp rdx, rsi
jne 0x1800f42cc
jmp 0x1800f42ef
add rax, r14
mov rcx, rax
add r14, rsi
nop
movzx eax, byte [rcx]
lea edx, [rax - 0x61]
cmp dl, 0x1a
setb dl
shl dl, 5
xor dl, al
mov byte [rcx], dl
lea rax, [rcx + 1]
mov rcx, rax
cmp rax, r14
jne 0x1800f42d0
mov qword [rdi], rbx
mov qword [rdi + 8], rsi
mov qword [rdi + 0x10], rsi
mov byte [rdi + 0x18], 0
mov rax, rdi
movaps xmm6, xmmword [rsp + 0x20]
movaps xmm7, xmmword [rsp + 0x30]
add rsp, 0x40
pop rbx
pop rdi
pop rsi
pop r14
pop r15
ret
call fcn.18010f660
ud2
mov ecx, 1
mov rdx, rsi
call fcn.180129e70
ud2
Function at 0x1800f8b70
Capabilities:
Write file on windows

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
mov eax, 0x10b8
call fcn.180116c40
sub rsp, rax
lea rbp, [rsp + 0x80]
movaps xmmword [rbp + 0x1020], xmm6
mov qword [rbp + 0x1018], 0xfffffffffffffffe
mov qword [rbp + 0x1008], rdx
mov r12, rcx
lea r13, [rbp - 0x50]
mov r8d, 0x1000
mov rcx, r13
xor edx, edx
call fcn.180124a00
lea rcx, [rbp + 0xfe8]
xorps xmm6, xmm6
lea rbx, [rbp + 0xffc]
lea rsi, [0x1800ff620]
lea r15, [rbp + 0xfb0]
mov r14, qword [sym.imp.KERNEL32.dll_WriteFileEx]
mov rdi, qword [sym.imp.KERNEL32.dll_SleepEx]
mov qword [rbp + 0x1010], r12
mov r9d, 0x1000
mov rdx, r12
mov r8, r13
call fcn.1800ff0e0
cmp qword [rbp + 0xfe8], 0
jne 0x1800f8d47
mov r12, qword [rbp + 0xff0]
test r12, r12
je 0x1800f8d13
cmp r12, 0x1000
ja 0x1800f8d69
xor r13d, r13d
nop word cs:[rax + rax]
mov r8d, r12d
sub r8d, r13d
lea rdx, [r13 - 0x50]
add rdx, rbp
mov dword [rbp + 0xffc], 0
movaps xmmword [rbp + 0xfb0], xmm6
mov qword [rbp + 0xfc0], 0
mov qword [rbp + 0xfc8], rbx
mov qword [rsp + 0x20], rsi
mov rcx, qword [rbp + 0x1008]
mov r9, r15
call r14
test eax, eax
je 0x1800f8ce7
nop word [rax + rax]
mov ecx, 0xffffffff
mov edx, 1
call rdi
cmp dword [rbp + 0xffc], 0
je 0x1800f8c90
movsxd rax, dword [rbp + 0x1000]
test rax, rax
jne 0x1800f8ced
mov eax, dword [rbp + 0x1004]
add r13, rax
cmp r13, r12
je 0x1800f8cd0
jbe 0x1800f8c40
jmp 0x1800f8d55
mov r12, qword [rbp + 0x1010]
lea r13, [rbp - 0x50]
lea rcx, [rbp + 0xfe8]
jmp 0x1800f8bf5
call qword [sym.imp.KERNEL32.dll_GetLastError]
shl rax, 0x20
or rax, 2
mov qword [rbp + 0xfe0], rax
mov qword [rbp + 0xfd8], 1
lea rcx, [rbp + 0xfe0]
call fcn.1800ee730
mov rsi, qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 0x1010]
call rsi
mov rcx, qword [rbp + 0x1008]
call rsi
movaps xmm6, xmmword [rbp + 0x1020]
add rsp, 0x10b8
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rcx, [rbp + 0xff0]
call fcn.1800ee730
jmp 0x1800f8d13
lea r8, str.library_std_src_syswindowspipe.rs
mov rcx, r13
mov rdx, r12
call fcn.18012a680
jmp 0x1800f8d7d
lea r8, str.library_std_src_syswindowspipe.rs
mov edx, 0x1000
mov rcx, r12
call fcn.18012a600
ud2
Function at 0x1800fc5c0
Capabilities:
Read file on windows

Disassembly:
push rsi
push rdi
sub rsp, 0xa8
mov rdi, rdx
mov rsi, rcx
mov rcx, qword [rsp + 0xe0]
movups xmm0, xmmword [0x1801b1c68]
movaps xmmword [rsp + 0x60], xmm0
mov eax, 0xffffffff
cmp r9, rax
cmovb rax, r9
test rcx, rcx
je 0x1800fc604
mov rdx, qword [rsp + 0xe8]
mov qword [rsp + 0x80], rdx
test rcx, rcx
mov qword [rsp + 0x78], rcx
lea rdx, [rsp + 0x80]
cmove rdx, rcx
mov qword [rsp + 0x38], rdx
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x28], r8
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x40], 0
mov rcx, rdi
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.ntdll.dll_NtReadFile]
cmp eax, 0x103
jne 0x1800fc663
mov rcx, rdi
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [rsp + 0x60]
cmp eax, 0xc0000011
jne 0x1800fc672
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
jmp 0x1800fc6aa
cmp eax, 0x103
je 0x1800fc6b4
test eax, eax
js 0x1800fc68f
mov rax, qword [rsp + 0x68]
mov qword [rsi + 8], rax
mov qword [rsi], 0
jmp 0x1800fc6aa
mov ecx, eax
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
shl rax, 0x20
or rax, 2
mov qword [rsi + 8], rax
mov qword [rsi], 1
add rsp, 0xa8
pop rdi
pop rsi
ret
mov dword [rsp + 0x58], 0
mov byte [rsp + 0x5c], 0
lea rax, str.fatal_runtime_error:_I_O_error:_operation_failed_to_complete_synchronously_n
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x80], 1
lea rax, [rsp + 0x50]
mov qword [rsp + 0x88], rax
xorps xmm0, xmm0
movups xmmword [rsp + 0x90], xmm0
lea rcx, [rsp + 0x58]
lea rdx, [rsp + 0x78]
call fcn.1800f56a0
mov qword [rsp + 0x70], rax
lea rcx, [rsp + 0x70]
call fcn.1800eece0
mov ecx, 7
int 0x29
ud2
Function at 0x1800fc720
Capabilities:
Write file on windows

Disassembly:
push rsi
push rdi
sub rsp, 0xa8
mov rdi, rdx
mov rsi, rcx
mov rcx, qword [rsp + 0xe0]
movups xmm0, xmmword [0x1801b1c68]
movaps xmmword [rsp + 0x60], xmm0
mov eax, 0xffffffff
cmp r9, rax
cmovb rax, r9
test rcx, rcx
je 0x1800fc764
mov rdx, qword [rsp + 0xe8]
mov qword [rsp + 0x80], rdx
test rcx, rcx
mov qword [rsp + 0x78], rcx
lea rdx, [rsp + 0x80]
cmove rdx, rcx
mov qword [rsp + 0x38], rdx
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x28], r8
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x40], 0
mov rcx, rdi
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.ntdll.dll_NtWriteFile]
cmp eax, 0x103
jne 0x1800fc7ca
mov rcx, rdi
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [rsp + 0x60]
cmp eax, 0x103
je 0x1800fc801
test eax, eax
js 0x1800fc7db
mov rax, qword [rsp + 0x68]
mov qword [rsi + 8], rax
xor eax, eax
jmp 0x1800fc7f4
mov ecx, eax
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
shl rax, 0x20
or rax, 2
mov qword [rsi + 8], rax
mov eax, 1
mov qword [rsi], rax
add rsp, 0xa8
pop rdi
pop rsi
ret
mov dword [rsp + 0x58], 0
mov byte [rsp + 0x5c], 0
lea rax, str.fatal_runtime_error:_I_O_error:_operation_failed_to_complete_synchronously_n
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x80], 1
lea rax, [rsp + 0x50]
mov qword [rsp + 0x88], rax
xorps xmm0, xmm0
movups xmmword [rsp + 0x90], xmm0
lea rcx, [rsp + 0x58]
lea rdx, [rsp + 0x78]
call fcn.1800f56a0
mov qword [rsp + 0x70], rax
lea rcx, [rsp + 0x70]
call fcn.1800eece0
mov ecx, 7
int 0x29
ud2
Function at 0x1800ff0e0
Capabilities:
Read file on windows

Disassembly:
push rsi
push rdi
sub rsp, 0x78
sub esp, 0x78

Function at 0x1800ffae0
Capabilities:
Read file on windows

Disassembly:
push rsi
push rdi
push rbx
sub rsp, 0x70
mov rdi, rdx
cmp qword [rdx], 0
jne 0x1800ffc35
mov rsi, rcx
mov rbx, qword [rdi + 0x18]
mov rax, qword [rbx + 8]
test rax, rax
jne 0x1800ffb18
mov rdx, qword [rbx + 0x10]
lea rax, [rdx + 0xf]
cmp rax, 0xf
jbe 0x1800ffbf8
xor eax, eax
mov rdx, qword [rbx + 0x10]
cmp rax, rdx
je 0x1800ffc17
sub rax, rdx
add rdx, qword [rbx]
mov r8, qword [rdi + 0x10]
mov ecx, 0xffffffff
cmp rax, rcx
cmovae rax, rcx
mov dword [rsp + 0x2c], 0
mov rcx, qword [rdi + 0x20]
mov qword [rsp + 0x20], r8
lea r9, [rsp + 0x2c]
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1800ffb79
mov ecx, dword [rsp + 0x2c]
mov eax, 2
test rcx, rcx
je 0x1800ffbab
mov qword [rdi], rax
mov qword [rdi + 8], rcx
mov byte [rsi + 1], 1
jmp 0x1800ffbaf
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rax
shl rcx, 0x20
or rcx, 2
mov qword [rsp + 0x40], rcx
cmp eax, 0x3e5
je 0x1800ffbb3
cmp eax, 0x6d
jne 0x1800ffbde
mov qword [rsp + 0x30], 1
lea rax, [rsp + 0x38]
jmp 0x1800ffbb8
mov byte [rsi + 1], 0
xor eax, eax
jmp 0x1800ffbe4
lea rax, [rsp + 0x30]
mov qword [rax], 0
lea rcx, [rsp + 0x40]
call fcn.1800ee730
mov rax, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
test rax, rax
je 0x1800ffbee
cmp rax, 1
je 0x1800ffb62
mov qword [rsi + 8], rcx
mov al, 1
mov byte [rsi], al
add rsp, 0x70
pop rbx
pop rdi
pop rsi
ret
mov eax, 1
jmp 0x1800ffb6c
mov r8d, 0x10
mov rcx, rbx
call fcn.180129720
mov rax, qword [rbx + 8]
mov rdx, qword [rbx + 0x10]
cmp rax, rdx
jne 0x1800ffb25
mov r8d, 1
mov rcx, rbx
mov rdx, rax
call fcn.180129720
mov rax, qword [rbx + 8]
mov rdx, qword [rbx + 0x10]
jmp 0x1800ffb25
mov qword [rsp + 0x40], 0
lea rdx, [rsp + 0x40]
mov rcx, rdi
call fcn.180129610
ud2
Function at 0x180104910
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push rsi
push rdi
sub rsp, 0x88
movdqa xmmword [rsp + 0x70], xmm6
mov rsi, rcx
lea rcx, [rsp + 0x40]
call fcn.180106780
mov rcx, qword [rsp + 0x40]

Function at 0x180105880
Capabilities:
Generate random numbers via winapi

Disassembly:
sub rsp, 0x38
xorps xmm0, xmm0
movaps xmmword [rsp + 0x20], xmm0
lea rdx, [rsp + 0x20]
xor ecx, ecx
mov r8d, 0x10
mov r9d, 2
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
test eax, eax
js 0x1801058b8
mov rax, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x28]
add rsp, 0x38
ret
call fcn.1801058d0
nop
add rsp, 0x38
ret

Function at 0x1801058d0
Capabilities:
Generate random numbers via rtlgenrandom

Disassembly:
push rbp
sub rsp, 0x80
lea rbp, [rsp + 0x80]
mov qword [rbp - 8], 0xfffffffffffffffe
xorps xmm0, xmm0
movaps xmmword [rbp - 0x20], xmm0
lea rcx, [rbp - 0x20]
mov edx, 0x10
call qword [sym.imp.advapi32.dll_SystemFunction036]
test al, al
je 0x180105913
mov rax, qword [rbp - 0x20]
mov rdx, qword [rbp - 0x18]
add rsp, 0x80
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
shl rax, 0x20
or rax, 2
mov qword [rbp - 0x10], rax
lea rax, [rbp - 0x10]
mov qword [rbp - 0x30], rax
lea rax, [0x1800f46e0]
mov qword [rbp - 0x28], rax
lea rax, str.fallback_RNG_broken:
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], 1
mov qword [rbp - 0x40], 0
lea rax, [rbp - 0x30]
mov qword [rbp - 0x50], rax
mov qword [rbp - 0x48], 1
lea rdx, str.library_std_src_syswindows_rand.rs
lea rcx, [rbp - 0x60]
call fcn.18012a0c0
ud2

Function at 0x180105f70
Capabilities:
Create thread

Disassembly:
push rbp
push r14
push rsi
push rdi
push rbx
sub rsp, 0x50
lea rbp, [rsp + 0x50]
mov qword [rbp - 8], 0xfffffffffffffffe
mov rdi, r8
mov r14, rdx
mov rsi, rcx
movzx eax, byte [0x1801e4bc1]
mov ecx, 0x10
mov edx, 8
Function at 0x1801151b0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r14
push rsi
push rdi
push rbx
sub rsp, 0x28
test r8, r8
je 0x18011522a
mov rax, rdx
mov rdx, qword [rsp + 0x70]
mov esi, ecx
shr esi, 8
lea r8, [rax + r8*2]
xor r11d, r11d
mov rbx, rax
movzx edi, byte [rax + 1]
add rax, 2
lea r10, [r11 + rdi]
cmp byte [rbx], sil
jne 0x180115220
cmp r11, r10
ja 0x1801152c3
cmp r10, rdx
ja 0x1801152d7
add r11, r9
xor ebx, ebx
nop dword [rax]
cmp rdi, rbx
je 0x180115222
lea r14, [rbx + 1]
cmp byte [r11 + rbx], cl
mov rbx, r14
jne 0x180115200
jmp 0x180115297
ja 0x18011522a
mov r11, r10
cmp rax, r8
jne 0x1801151d2
mov rdx, qword [rsp + 0x80]
test rdx, rdx
je 0x18011529b
mov r8, qword [rsp + 0x78]
add rdx, r8
movzx ecx, cx
mov al, 1
nop word cs:[rax + rax]
lea r10, [r8 + 1]
movzx r9d, byte [r8]
test r9b, r9b
js 0x180115270
mov r8, r10
sub ecx, r9d
jns 0x18011528e
jmp 0x18011529d
cmp r10, rdx
je 0x1801152a9
movzx r10d, byte [r8 + 1]
add r8, 2
and r9d, 0x7f
shl r9d, 8
or r9d, r10d
sub ecx, r9d
js 0x18011529d
xor al, 1
cmp r8, rdx
jne 0x180115250
jmp 0x18011529d
xor eax, eax
jmp 0x18011529d
mov al, 1
and al, 1
add rsp, 0x28
pop rbx
pop rdi
pop rsi
pop r14
ret
lea rcx, [0x1801b4d49]
lea r8, str.librarycore_srcunicodeprintable.rs
mov edx, 0x2b
call fcn.18012a170
ud2
lea r8, str.librarycore_srcunicodeprintable.rs
mov rcx, r11
mov rdx, r10
call fcn.18012a680
ud2
lea r8, str.librarycore_srcunicodeprintable.rs
mov rcx, r10
call fcn.18012a600
ud2
Function at 0x18011e664
Capabilities:
Query environment variable

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r14
sub rsp, 0x40
call qword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
xor esi, esi
mov rbx, rax
test rax, rax
jne 0x18011e694
xor eax, eax
jmp 0x18011e757
mov rbp, rbx
cmp word [rax], si
je 0x18011e6b9
or rax, 0xffffffffffffffff
inc rax
cmp word [rbp + rax*2], si
jne 0x18011e6a0
lea rbp, [rbp + rax*2]
add rbp, 2
cmp word [rbp], si
jne 0x18011e69c
mov qword [rsp + 0x38], rsi
sub rbp, rbx
mov qword [rsp + 0x30], rsi
add rbp, 2
sar rbp, 1
mov r8, rbx
mov r9d, ebp
mov dword [rsp + 0x28], esi
xor edx, edx
mov qword [rsp + 0x20], rsi
xor ecx, ecx
call fcn.18011e584
movsxd r14, eax
test eax, eax
jne 0x18011e6f7
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
jmp 0x18011e68d
mov rcx, r14
call fcn.18011f8f4
mov rdi, rax
test rax, rax
jne 0x18011e710
xor ecx, ecx
call fcn.18011cbbc
jmp 0x18011e6ec
mov qword [rsp + 0x38], rsi
mov r9d, ebp
mov qword [rsp + 0x30], rsi
mov r8, rbx
mov dword [rsp + 0x28], r14d
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rdi
call fcn.18011e584
test eax, eax
jne 0x18011e741
mov rcx, rdi
call fcn.18011cbbc
jmp 0x18011e74b
xor ecx, ecx
call fcn.18011cbbc
mov rsi, rdi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov rax, rsi
mov rbx, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x60]
mov rdi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
ret
Function at 0x180123f50
Capabilities:
Parse pe header

Disassembly:
mov eax, 0x5a4d
cmp word [rcx], ax
jne 0x180123f78
movsxd rdx, dword [rcx + 0x3c]
add rdx, rcx
cmp dword [rdx], 0x4550
jne 0x180123f78
xor eax, eax
mov ecx, 0x20b
cmp word [rdx + 0x18], cx
sete al
ret
xor eax, eax
ret
Function at 0x140004518
Capabilities:
Parse pe header

Disassembly:
sub rsp, 0x28
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x140004562
mov ecx, 0x5a4d
cmp word [rax], cx
jne 0x140004562
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
jne 0x140004562
mov eax, 0x20b
cmp word [rcx + 0x18], ax
jne 0x140004562
cmp dword [rcx + 0x84], 0xe
jbe 0x140004562
cmp dword [rcx + 0xf8], 0
setne al
jmp 0x140004564
xor al, al
add rsp, 0x28
ret
Function at 0x140044e10
Capabilities:
Identify system language via api

Disassembly:
sub rsp, 0x28
cmp byte [0x1400ad7dd], 0
je 0x140044e28
mov eax, dword [0x1400ad810]
add rsp, 0x28
ret
call qword [sym.imp.KERNEL32.dll_GetUserDefaultLangID]
movzx r8d, ax
mov edx, r8d
and edx, 0x3ff
sub edx, 7
je 0x140044e91
sub edx, 2
je 0x140044e8a
sub edx, 1
je 0x140044e66
sub edx, 0xb
je 0x140044e5c
cmp edx, 1
jne 0x140044e8a
lea eax, [rdx + 1]
add rsp, 0x28
ret
mov eax, 5
add rsp, 0x28
ret
mov eax, 0xfc00
mov ecx, 0x800
and r8w, ax
mov edx, 1
cmp r8w, cx
mov eax, 3
cmovne eax, edx
add rsp, 0x28
ret
xor eax, eax
add rsp, 0x28
ret
mov eax, 4
add rsp, 0x28
ret

Function at 0x140047f50
Capabilities:
Get common file path

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
lea rbp, [rsp - 0x250]
sub rsp, 0x350
mov rax, qword [0x1400a0038]
xor rax, rsp
mov qword [rbp + 0x240], rax
mov r10, rdx
mov rbx, rcx
mov qword [rsp + 0x20], rcx
lea rdi, [rbp + 0x30]
xor eax, eax
mov ecx, 0x208
rep stosb byte [rdi], al
xor esi, esi
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x20]
xor r8d, r8d
xor edx, edx
mov rcx, r10
call qword [sym.imp.SHELL32.dll_SHGetKnownFolderPath]
test eax, eax
js 0x1400480c5
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x68], 7
mov word [rsp + 0x50], si
mov rdx, qword [rsp + 0x20]
mov rdi, 0xffffffffffffffff
mov r8, rdi
nop dword [rax]
inc r8
cmp word [rdx + r8*2], si
jne 0x140047fe0
lea rcx, [rsp + 0x50]
call fcn.140020520
nop
lea rdx, [rsp + 0x50]
cmp qword [rsp + 0x68], 8
cmovae rdx, qword [rsp + 0x50]
lea rcx, [rbp + 0x30]
call qword [sym.imp.SHLWAPI.dll_PathAppendW]
mov rcx, qword [rsp + 0x20]
call qword [sym.imp.ole32.dll_CoTaskMemFree]
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x38], rsi
mov qword [rsp + 0x40], 7
lea rax, [rbp + 0x30]
inc rdi
cmp word [rax + rdi*2], 0
jne 0x140048032
mov r8, rdi
lea rdx, [rbp + 0x30]
lea rcx, [rsp + 0x28]
call fcn.140020520
lea rdx, [rsp + 0x28]
mov rcx, rbx
call fcn.140021090
nop
mov rdx, qword [rsp + 0x68]
cmp rdx, 8
jb 0x1400480a0
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x50]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14004809b
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14004809b
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140053a0c
mov rax, rbx
mov rcx, qword [rbp + 0x240]
xor rcx, rsp
call fcn.140053760
mov rbx, qword [rsp + 0x380]
add rsp, 0x350
pop rdi
pop rsi
pop rbp
ret
mov rcx, qword [rsp + 0x20]
call qword [sym.imp.ole32.dll_CoTaskMemFree]
lea rcx, [rbp - 0x30]
call fcn.140020e30
nop
mov rcx, rax
call fcn.140048640
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140020f30
lea rdx, [0x14009c608]
lea rcx, [rsp + 0x70]
call sub.VCRUNTIME140.dll__CxxThrowException
int3