joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140020230
Capabilities:
Encode data using xor
Generate random numbers via winapi

Disassembly:
mov qword [rsp + 0x10], rbx
push rdi
sub rsp, 0xc0
mov edi, 1
lea rcx, [rsp + 0xd0]
xor r8d, r8d
xor edx, edx
mov r9d, edi
mov dword [rsp + 0x20], 0xf0000040
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
xor ebx, ebx
test eax, eax
je 0x140020295
mov rcx, qword [rsp + 0xd0]
lea r8, [rsp + 0x30]
lea edx, [rdi + 0x1f]
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov rcx, qword [rsp + 0xd0]
test eax, eax
cmovne edi, ebx
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
test edi, edi
je 0x140020301
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [rsp + 0x30], eax
call fcn.14001dfe0
mov rcx, rbx
movups xmm0, xmmword [0x14003f570]
mov dword [rsp + 0x34], eax
mov eax, dword [0x140041db8]
movups xmmword [rsp + 0x40], xmm0
mov dword [rsp + 0x38], eax
movzx eax, byte [rsp + rcx + 0x30]
add rcx, 6
xor byte [rsp + rcx + 0x2b], al
movzx eax, byte [rsp + rcx + 0x2b]
xor byte [rsp + rcx + 0x2c], al
movzx eax, byte [rsp + rcx + 0x2c]
xor byte [rsp + rcx + 0x2d], al
movzx eax, byte [rsp + rcx + 0x2d]
xor byte [rsp + rcx + 0x2e], al
movzx eax, byte [rsp + rcx + 0x2e]
xor byte [rsp + rcx + 0x2f], al
movzx eax, byte [rsp + rcx + 0x2f]
xor byte [rsp + rcx + 0x30], al
cmp rcx, 0x1e
jl 0x1400202c1
lea rcx, [rsp + 0x60]
call fcn.1400288b4
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x60]
mov r8d, 0x20
call fcn.140029144
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x50]
call fcn.1400287d8
lea rdx, [0x140000000]
nop word [rax + rax]
movzx ecx, byte [rsp + rbx + 0x50]
inc rbx
mov eax, ecx
and ecx, 0xf
shr rax, 4
movzx eax, byte [rax + rdx + 0x37778]
mov byte [rdx + rbx*2 + 0x41ff6], al
movzx eax, byte [rcx + rdx + 0x37778]
mov byte [rdx + rbx*2 + 0x41ff7], al
cmp rbx, 0x10
jl 0x140020340
lea r8, [0x140042088]
lea rdx, [rsp + 0x30]
lea rcx, [0x140041e10]
mov r9d, 0x20
call fcn.14002aba0
mov rbx, qword [rsp + 0xd8]
add rsp, 0xc0
pop rdi
ret
Function at 0x140020ef0
Capabilities:
Send data
Send data on socket

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x20
xor ebx, ebx
mov edi, edx
mov rbp, rcx
test edx, edx
jle 0x140020f4b
nop
mov rcx, qword [0x140041dd8]
mov r8d, edi
movsxd rdx, ebx
sub r8d, ebx
add rdx, rbp
xor r9d, r9d
call qword [sym.imp.WS2_32.dll_send]
mov esi, eax
cmp eax, 0xffffffff
jne 0x140020f45
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
add eax, 0xffffd8bb
test eax, 0xfffffffa
je 0x140020f65
add ebx, esi
cmp ebx, edi
jl 0x140020f10
mov eax, 1
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
add rsp, 0x20
pop rdi
ret
xor eax, eax
jmp 0x140020f50
Function at 0x140029eb0
Capabilities:
Encode data using xor

Disassembly:
push rbx
sub rsp, 0x20
mov rbx, rcx
call fcn.14002a0e0
xor r10d, r10d
lea edx, [rax*4]
mov r11d, eax
movsxd r9, edx
test edx, edx
jle 0x140029f29
lea r8, [rbx + 8]
lea rcx, [rbx + 8]
lea r8, [r8 + r9*4]
nop
mov eax, dword [r8 - 8]
mov edx, dword [rcx - 8]
add r10, 4
mov dword [rcx - 8], eax
mov eax, dword [r8 - 4]
mov dword [r8 - 8], edx
mov edx, dword [rcx - 4]
mov dword [rcx - 4], eax
mov eax, dword [r8]
mov dword [r8 - 4], edx
mov edx, dword [rcx]
mov dword [rcx], eax
mov eax, dword [r8 + 4]
mov dword [r8], edx
mov edx, dword [rcx + 4]
mov dword [rcx + 4], eax
sub r9, 4
mov dword [r8 + 4], edx
lea r8, [r8 - 0x10]
lea rcx, [rcx + 0x10]
cmp r10, r9
jl 0x140029ee0
cmp r11d, 1
jle 0x14002a0cd
mov qword [rsp + 0x30], rdi
add rbx, 2
lea r10d, [r11 - 1]
lea rdi, [0x140000000]
nop word [rax + rax]
mov r8d, dword [rbx + 0xe]
lea rbx, [rbx + 0x10]
mov eax, r8d
shr rax, 0x18
movzx edx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx - 1]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
mov r9d, dword [rdi + rdx*4 + 0x39cb0]
movzx eax, r8b
xor r9d, dword [rdi + rcx*4 + 0x3a4b0]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx]
xor r9d, dword [rdi + rcx*4 + 0x3a8b0]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx + 3]
movzx edx, byte [rdi + rax*4 + 0x398b0]
xor r9d, dword [rdi + rcx*4 + 0x3a0b0]
movzx eax, byte [rbx + 4]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
mov r8d, dword [rdi + rdx*4 + 0x3a4b0]
mov dword [rbx - 2], r9d
xor r8d, dword [rdi + rcx*4 + 0x3a0b0]
mov r9d, dword [rbx + 2]
mov eax, r9d
shr rax, 0x18
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, r9b
mov r9d, dword [rbx + 6]
xor r8d, dword [rdi + rcx*4 + 0x39cb0]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx + 7]
xor r8d, dword [rdi + rcx*4 + 0x3a8b0]
movzx edx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx + 8]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
mov dword [rbx + 2], r8d
mov r8d, dword [rdi + rdx*4 + 0x3a4b0]
xor r8d, dword [rdi + rcx*4 + 0x3a0b0]
mov eax, r9d
shr rax, 0x18
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, r9b
mov r9d, dword [rbx + 0xa]
xor r8d, dword [rdi + rcx*4 + 0x39cb0]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx + 0xb]
xor r8d, dword [rdi + rcx*4 + 0x3a8b0]
movzx edx, byte [rdi + rax*4 + 0x398b0]
movzx eax, byte [rbx + 0xc]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
mov dword [rbx + 6], r8d
mov r8d, dword [rdi + rdx*4 + 0x3a4b0]
xor r8d, dword [rdi + rcx*4 + 0x3a0b0]
mov eax, r9d
shr rax, 0x18
movzx ecx, byte [rdi + rax*4 + 0x398b0]
movzx eax, r9b
xor r8d, dword [rdi + rcx*4 + 0x39cb0]
movzx ecx, byte [rdi + rax*4 + 0x398b0]
xor r8d, dword [rdi + rcx*4 + 0x3a8b0]
mov dword [rbx + 0xa], r8d
dec r10
jne 0x140029f50
mov rdi, qword [rsp + 0x30]
mov eax, r11d
add rsp, 0x20
pop rbx
ret
Function at 0x14002a5f0
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0x50
mov rdi, rdx
mov rax, r9
mov r12, r9
cqo
mov rbx, r8
mov r13, rcx
and edx, 0xf
add rax, rdx
mov rbp, rax
and eax, 0xf
sub rax, rdx
sar rbp, 4
mov rsi, rax
test rax, rax
je 0x14002a63b
test rbp, rbp
jne 0x14002a638
xor eax, eax
jmp 0x14002a819
dec rbp
mov qword [rsp + 0x80], r14
mov r14, qword [rsp + 0xa0]
movups xmm0, xmmword [r14]
movups xmm1, xmm0
movups xmmword [rsp + 0x20], xmm0
test rbp, rbp
je 0x14002a6c2
mov qword [rsp + 0x88], r15
nop dword [rax]
nop dword [rax + rax]
mov edx, dword [r13 + 4]
lea rcx, [r13 + 0xf8]
mov r9, rbx
mov r8, rdi
call fcn.140029280
mov eax, dword [rsp + 0x20]
add rdi, 0x10
xor dword [rbx], eax
mov eax, dword [rsp + 0x24]
add rbx, 0x10
xor dword [rbx - 0xc], eax
mov eax, dword [rsp + 0x28]
xor dword [rbx - 8], eax
mov eax, dword [rsp + 0x2c]
xor dword [rbx - 4], eax
movups xmm0, xmmword [rdi - 0x10]
movups xmm1, xmm0
movups xmmword [rsp + 0x20], xmm0
dec rbp
jne 0x14002a670
mov r15, qword [rsp + 0x88]
test rsi, rsi
je 0x14002a80a
movups xmm0, xmmword [rdi]
lea r9, [rsp + 0x30]
lea r8, [rsp + 0x40]
lea rcx, [r13 + 0xf8]
movups xmmword [r14], xmm0
mov edx, dword [r13 + 4]
movups xmmword [rsp + 0x40], xmm0
call fcn.140029280
xor r9d, r9d
test rsi, rsi
je 0x14002a7d5
cmp rsi, 0x10
jb 0x14002a799
lea r10, [rsi + 0xf]
lea rdx, [rsi + 0xf]
lea r8, [rbx + 0x10]
add r10, rdi
add rdx, rbx
lea rcx, [rdi + 0x10]
cmp r8, r10
ja 0x14002a727
cmp rdx, rcx
jae 0x14002a799
lea rax, [rsp + rsi + 0x2f]
cmp r8, rax
ja 0x14002a73b
lea r8, [rsp + 0x30]
cmp rdx, r8
jae 0x14002a799
lea rdx, [rsp + 0x30]
cmp rdx, r10
ja 0x14002a74a
cmp rax, rcx
jae 0x14002a799
mov rax, rsi
mov rdx, rsi
lea r8, [rsp + 0x30]
and eax, 0xf
sub r8, rdi
sub rdx, rax
mov rax, rbx
sub rax, rdi
nop dword [rax]
nop dword [rax + rax]
movdqu xmm1, xmmword [rcx]
movdqu xmm0, xmmword [r8 + rcx - 0x10]
add r9, 0x10
lea rcx, [rcx + 0x10]
pxor xmm0, xmm1
movdqu xmmword [rax + rcx - 0x10], xmm0
movdqu xmmword [r8 + rcx - 0x20], xmm1
cmp r9, rdx
jb 0x14002a770
cmp r9, rsi
jae 0x14002a7d5
lea rax, [rsp + 0x30]
lea rcx, [rsp + 0x30]
mov r10, rbx
sub rdi, rax
sub r10, rcx
lea r8, [rsp + 0x30]
add r8, r9
inc r9
movzx eax, byte [r8 + rdi + 0x10]
movzx edx, al
xor dl, byte [r8]
mov byte [r8], al
mov byte [r8 + r10 + 0x10], dl
cmp r9, rsi
jb 0x14002a7b1
mov edx, dword [r13 + 4]
lea r8, [rsp + 0x30]
lea rcx, [r13 + 0xf8]
mov r9, rbx
call fcn.140029280
mov eax, dword [rsp + 0x20]
xor dword [rbx], eax
mov eax, dword [rsp + 0x24]
xor dword [rbx + 4], eax
mov eax, dword [rsp + 0x28]
xor dword [rbx + 8], eax
mov eax, dword [rsp + 0x2c]
xor dword [rbx + 0xc], eax
jmp 0x14002a80e
movups xmmword [r14], xmm1
mov r14, qword [rsp + 0x80]
mov rax, r12
mov rbx, qword [rsp + 0x90]
add rsp, 0x50
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
Function at 0x4017e5
Capabilities:
Get memory capacity
Get system information on windows

Disassembly:
push rbp
sub rsp, 0x100
lea rbp, [rsp + 0x80]
lea rax, [rbp + 0x10]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetSystemInfo]
call rax
mov eax, dword [rbp + 0x30]
cmp eax, 1
ja 0x401817
mov eax, 1
jmp 0x4018d6
mov dword [rbp - 0x30], 0x40
lea rax, [rbp - 0x30]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GlobalMemoryStatusEx]
call rax
mov rax, qword [rbp - 0x28]
mov edx, 0x80000000
cmp rax, rdx
jae 0x401846
mov eax, 1
jmp 0x4018d6
mov rax, qword [sym.imp.KERNEL32.dll_GetTickCount64]
call rax
mov qword [rbp + 0x78], rax
mov qword [rbp - 0x38], 0xffffffffdc3cba00
lea rax, [rbp + 0x50]
lea rdx, [rbp + 0x4f]
mov rcx, rax
call fcn.00401704
mov rax, qword [rbp + 0x50]
mov rdx, qword [rbp + 0x58]
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], rdx
mov rax, qword [rbp + 0x60]
mov qword [rbp - 0x50], rax
movzx eax, word [rbp + 0x68]
mov word [rbp - 0x48], ax
lea rax, [rbp - 0x60]
mov rcx, rax
call fcn.00420340
mov r8, qword [0x005550b8]
lea rax, [rbp - 0x38]
mov rdx, rax
mov ecx, 0
call r8
mov rax, qword [sym.imp.KERNEL32.dll_GetTickCount64]
call rax
mov qword [rbp + 0x70], rax
mov rax, qword [rbp + 0x70]
sub rax, qword [rbp + 0x78]
cmp rax, 0xea5f
ja 0x4018d1
mov eax, 1
jmp 0x4018d6
mov eax, 0
add rsp, 0x100
pop rbp
ret
Function at 0x401a49
Capabilities:
Enumerate processes

Disassembly:
push rbp
sub rsp, 0x1b0
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x140], rcx
mov qword [rbp + 0x120], 0
mov dword [rbp - 0x10], 0x130
mov edx, 0
mov ecx, 2
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov qword [rbp + 0x128], rax
lea rdx, [rbp - 0x10]
mov rax, qword [rbp + 0x128]
mov rcx, rax
call sub.KERNEL32.dll_Process32First
cmp eax, 1
sete al
test al, al
je 0x401bd7
lea rdx, [rbp - 0x10]
mov rax, qword [rbp + 0x128]
mov rcx, rax
call sub.KERNEL32.dll_Process32Next
cmp eax, 1
sete al
test al, al
je 0x401bd7
lea rax, [rbp - 0x10]
add rax, 0x2c
mov rdx, qword [rbp + 0x140]
mov rcx, rax
call sub.msvcrt.dll__stricmp
test eax, eax
sete al
test al, al
je 0x401aa9
mov rax, qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
call rax
mov ecx, eax
lea rax, [rbp - 0x14]
mov rdx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
call rax
mov eax, dword [rbp - 8]
mov ecx, eax
call fcn.00401925
mov edx, dword [rbp - 0x14]
cmp eax, edx
sete al
test al, al
je 0x401aa9
mov qword [rbp - 0x28], 0
mov eax, dword [rbp - 8]
mov ecx, eax
call fcn.00401594
mov qword [rbp - 0x30], rax
mov dword [rbp - 0x60], 0x30
mov qword [rbp - 0x58], 0
mov dword [rbp - 0x48], 0
mov qword [rbp - 0x50], 0
mov qword [rbp - 0x40], 0
mov qword [rbp - 0x38], 0
mov r10, qword [0x00555090]
lea rcx, [rbp - 0x30]
lea rdx, [rbp - 0x60]
lea rax, [rbp + 0x120]
mov r9, rcx
mov r8, rdx
mov edx, 0x1fffff
mov rcx, rax
call r10
mov rax, qword [rbp + 0x120]
test rax, rax
je 0x401bbb
mov rax, qword [rbp + 0x120]
cmp rax, 0xffffffffffffffff
je 0x401bbb
mov rdx, qword [0x00555088]
mov rax, qword [rbp + 0x128]
mov rcx, rax
call rdx
mov rax, qword [rbp + 0x120]
jmp 0x401bf1
mov rdx, qword [0x00555088]
mov rax, qword [rbp + 0x128]
mov rcx, rax
call rdx
mov rax, 0xffffffffffffffff
jmp 0x401bf1
mov rdx, qword [0x00555088]
mov rax, qword [rbp + 0x128]
mov rcx, rax
call rdx
mov rax, 0xffffffffffffffff
add rsp, 0x1b0
pop rbp
ret
Function at 0x413ae0
Capabilities:
Write file on windows

Disassembly:
push r12
push rbx
sub rsp, 0x38
mov r12, 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 fcn.0041fe60
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sub.msvcrt.dll_fwrite
mov rbx, qword [rsp + 0x28]
mov ecx, 2
call fcn.0041fe60
mov rdx, r12
mov rcx, rax
mov r8, rbx
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
nop
nop word [rax + rax]

Function at 0x413b50
Capabilities:
Allocate or change rwx memory

Disassembly:
push r12
push rsi
push rbx
sub rsp, 0x50
movsxd rbx, dword [0x00555164]
mov r12, rcx
test ebx, ebx
jle 0x413c80
mov rax, qword [0x00555168]
xor ecx, ecx
add rax, 0x18
nop word [rax + rax]
mov rdx, qword [rax]
cmp rdx, r12
ja 0x413b9c
mov r8, qword [rax + 8]
mov r8d, dword [r8 + 8]
add rdx, r8
cmp r12, rdx
jb 0x413c23
add ecx, 1
add rax, 0x28
cmp ecx, ebx
jne 0x413b80
mov rcx, r12
call fcn.00414500
mov rsi, rax
test rax, rax
je 0x413ca2
mov rax, qword [0x00555168]
lea rbx, [rbx + rbx*4]
shl rbx, 3
add rax, rbx
mov qword [rax + 0x20], rsi
mov dword [rax], 0
call fcn.00414630
mov ecx, dword [rsi + 0xc]
lea rdx, [rsp + 0x20]
mov r8d, 0x30
add rcx, rax
mov rax, qword [0x00555168]
mov qword [rax + rbx + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x413c87
mov eax, dword [rsp + 0x44]
lea edx, [rax - 0x40]
and edx, 0xffffffbf
je 0x413c1c
lea edx, [rax - 4]
and edx, 0xfffffffb
jne 0x413c30
add dword [0x00555164], 1
add rsp, 0x50
pop rbx
pop rsi
pop r12
ret
cmp eax, 2
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r8d, 4
mov eax, 0x40
cmovne r8d, eax
add rbx, qword [0x00555168]
mov qword [rbx + 8], rcx
mov r9, rbx
mov qword [rbx + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x413c1c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call fcn.00413ae0
nop dword [rax]
xor ebx, ebx
jmp 0x413ba7
mov rax, qword [0x00555168]
mov edx, dword [rsi + 8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov r8, qword [rax + rbx + 0x18]
call fcn.00413ae0
mov rdx, r12
lea rcx, str.Address__p_has_no_image_section
call fcn.00413ae0
nop
nop word cs:[rax + rax]
nop dword [rax]

Function at 0x414170
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rcx, [0x005551c0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x005551a0]
test rbx, rbx
je 0x4141c4
mov rdi, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
call rdi
mov r12, rax
call rsi
test eax, eax
jne 0x4141bb
test r12, r12
je 0x4141bb
mov rax, qword [rbx + 8]
mov rcx, r12
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x4141a0
lea rcx, [0x005551c0]
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop r12
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
Function at 0x414500
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov rdx, qword [0x0052ea40]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x414520
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x414528
ret
cmp word [r8 + 0x18], 0x20b
jne 0x414520
movzx eax, word [r8 + 0x14]
sub rcx, rdx
movzx edx, word [r8 + 6]
lea rax, [r8 + rax + 0x18]
test edx, edx
je 0x414575
sub edx, 1
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
mov rdx, r8
cmp rcx, r8
jb 0x41456c
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x414520
add rax, 0x28
cmp rax, r9
jne 0x414558
xor eax, eax
ret

Function at 0x414580
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x0052ea40]
xor r8d, r8d
cmp word [rax], 0x5a4d
jne 0x4145a0
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x4145a8
mov eax, r8d
ret
cmp word [rax + 0x18], 0x20b
jne 0x4145a0
movzx r8d, word [rax + 6]
mov eax, r8d
ret

Function at 0x414630
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x0052ea40]
xor r8d, r8d
cmp word [rax], 0x5a4d
jne 0x414650
movsxd rdx, dword [rax + 0x3c]
add rdx, rax
cmp dword [rdx], 0x4550
je 0x414658
mov rax, r8
ret
cmp word [rdx + 0x18], 0x20b
cmove r8, rax
mov rax, r8
ret

Function at 0x414880
Capabilities:
Allocate thread local storage

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x20
mov eax, dword [0x005551a8]
mov edi, ecx
mov rsi, rdx
test eax, eax
jne 0x414200
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
mov edx, 0x18
mov ecx, 1
call sub.msvcrt.dll_calloc
mov rbx, rax
test rax, rax
je 0x414253
mov dword [rax], edi
lea rcx, [0x005551c0]
mov qword [rax + 8], rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [0x005551a0]
lea rcx, [0x005551c0]
mov qword [0x005551a0], rbx
mov qword [rbx + 0x10], rax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
or eax, 0xffffffff
jmp 0x4141f6
push r12
push rbx
sub rsp, 0x28
mov rbx, rcx
mov r12, rdx
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov ecx, eax
cmp eax, 0xffffffff
je 0x4148b0
mov rdx, r12
mov dword [rbx], eax
add rsp, 0x28
pop rbx
pop r12
jmp 0x420240
add rsp, 0x28
pop rbx
pop r12
jmp qword [sym.imp.KERNEL32.dll_GetLastError]
test rdx, rdx
jne 0x420250
xor eax, eax
ret
jmp 0x4141e0

Function at 0x4148f0
Capabilities:
Get thread local storage value

Disassembly:
push r13
push r12
sub rsp, 0x28
mov r12d, ecx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, r12d
mov r13d, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, r13d
mov r12, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, r12
add rsp, 0x28
pop r12
pop r13
ret

Function at 0x414930
Capabilities:
Set thread local storage value

Disassembly:
sub rsp, 0x28
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x414948
xor eax, eax
add rsp, 0x28
ret
add rsp, 0x28
jmp qword [sym.imp.KERNEL32.dll_GetLastError]
Function at 0x47d1f0
Capabilities:
Read file on windows

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
mov rbp, qword [sym.imp.msvcrt.dll__errno]
mov rdi, rcx
mov rsi, rdx
mov ebx, r8d
jmp 0x47d217
call rbp
cmp dword [rax], 4
jne 0x47d234
mov rcx, rdi
call fcn.0047d010
mov r8d, ebx
mov rdx, rsi
mov ecx, eax
call sub.msvcrt.dll__read
movsxd r12, eax
cmp eax, 0xffffffff
je 0x47d210
mov rax, r12
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
Function at 0x405aac
Capabilities:
Accept command line arguments

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x20], rsi
push rdi
mov eax, 0x200f0
call fcn.00427830
sub rsp, rax
mov rax, qword [0x0043a0c0]
xor rax, rsp
mov qword [rsp + 0x200e0], rax
mov rsi, r8
mov rdi, rcx
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
xor ecx, ecx
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
xor r9d, r9d
mov r8, rbx
mov rcx, rax
xor edx, edx
call fcn.00408988
lea r8, str.FBDiskOptimizer
lea r11, [0x004302ac]
lea rcx, [rsp + 0x50]
mov r9, r8
mov rdx, rdi
mov qword [rsp + 0x20], r11
call fcn.0040618c
xor ebx, ebx
cmp word [rsi], 0x2d
lea rbp, vtable.CService.0
lea rax, vtable.CService.1.0
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x200c0], rax
mov qword [rsp + 0x200c8], rbx
je 0x405bab
cmp word [rsi], 0x2f
je 0x405bab
cmp dword [rsp + 0x58], 4
jl 0x405ba0
mov rax, qword [rsp + 0x68]
lea rcx, [rsp + 0x30]
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x30], rax
lea rax, [fcn.00406654]
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x38], rax
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
cmp eax, ebx
jne 0x405bff
mov rax, qword [rsp + 0x50]
lea rcx, [rsp + 0x50]
mov edx, 0x3ee
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x405bf6
xor edx, edx
xor ecx, ecx
call fcn.00406654
jmp 0x405bff
lea rdx, [rsi + 2]
lea rcx, str.install
call fcn.00418544
cmp eax, ebx
jne 0x405bd6
xor r9d, r9d
lea rcx, [rsp + 0x50]
lea edx, [r9 + 0x10]
lea r8d, [r9 + 2]
call fcn.00406358
jmp 0x405bf6
lea rdx, [rsi + 2]
lea rcx, str.remove
call fcn.00418544
cmp eax, ebx
jne 0x405bfa
lea rcx, [rsp + 0x50]
xor edx, edx
call fcn.004064cc
mov ebx, eax
jmp 0x405bff
mov ebx, 0x3e9
lea rax, vtable.CThread.0
lea rcx, [rsp + 0x50]
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x200c0], rax
call fcn.00406330
mov eax, ebx
mov rcx, qword [rsp + 0x200e0]
xor rcx, rsp
call fcn.00417910
lea r11, [rsp + 0x200f0]
mov rbx, qword [r11 + 0x10]
mov rbp, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
ret
Function at 0x406118
Capabilities:
Suspend thread

Disassembly:
push rbx
sub rsp, 0x20
mov rbx, rcx
mov rcx, qword [0x0043bb00]
call qword [sym.imp.KERNEL32.dll_SuspendThread]
mov rcx, qword [rbx + 0x20088]
call qword [sym.imp.KERNEL32.dll_SuspendThread]
mov eax, 1
add rsp, 0x20
pop rbx
ret

Function at 0x406148
Capabilities:
Resume thread

Disassembly:
push rbx
sub rsp, 0x20
mov rbx, rcx
mov rcx, qword [0x0043bb00]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rcx, qword [rbx + 0x20088]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov eax, 1
add rsp, 0x20
pop rbx
ret

Function at 0x406358
Capabilities:
Create service
Persist via run registry key
Persist via windows service
Set registry value

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x70
xor edi, edi
cmp dword [rcx + 8], 4
mov rbx, rcx
jl 0x406437
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
cmp rax, rdi
jne 0x4063a1
mov rax, qword [rbx]
mov edx, 0x3eb
mov rcx, rbx
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x4064b9
mov rax, qword [rbx + 0x28]
mov r8, qword [rbx + 0x20]
mov rdx, qword [rbx + 0x18]
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], rdi
mov qword [rsp + 0x40], rdi
lea rcx, [rbx + 0x10030]
mov qword [rsp + 0x38], rcx
mov dword [rsp + 0x30], 1
mov rcx, rsi
mov r9d, 0xf01ff
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
cmp rax, rdi
jne 0x406410
mov rax, qword [rbx]
mov edx, 0x3eb
mov rcx, rbx
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov edi, eax
jmp 0x406419
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rdx, qword [rbx + 0x18]
lea rcx, str._s_service_installed._n
call fcn.00418978
jmp 0x4064b7
lea r8, [rsp + 0x80]
lea rdx, str.SoftwareMicrosoftWindowsCurrentVersionRun
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
cmp eax, edi
jne 0x4064a2
add rbx, 0x10030
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov rcx, qword [rsp + 0x80]
lea rdx, str.FBDiskOptimizer
lea eax, [rax + rax + 2]
mov r9d, 1
xor r8d, r8d
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rbx
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4064b7
lea rdx, [0x00430830]
xor r9d, r9d
xor ecx, ecx
mov r8, rdx
call qword [sym.imp.USER32.dll_MessageBoxW]
mov eax, edi
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rsp, r11
pop rdi
ret