Function at 0x180008d38
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push rsi
push rdi
push rbx
sub rsp, 0x20
mov rdi, r8
mov r14, rdx
mov eax, dword [rcx]
cmp eax, 2
jge 0x180008cca
cmp eax, 1
je 0x180008cf0
test eax, eax
jne 0x180008d24
xor esi, esi
mov r15, qword [fcn.180002070]
cmp rdi, rsi
je 0x180008ce4
movzx ebx, byte [r14 + rsi]
mov ecx, 1
call r15
mov ecx, ebx
mov rdx, rax
call sub.msvcrt.dll_fputc
inc rsi
jmp 0x180008ca9
je 0x180008d0a
cmp eax, 3
jne 0x180008d24
mov rax, qword [rcx + 8]
mov rdx, qword [rax]
mov rcx, r14
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x180008d2f
add rsp, 0x20
pop rbx
pop rdi
pop rsi
pop r14
pop r15
ret
mov rcx, qword [rcx + 8]
mov rdx, r14
mov r8, rdi
add rsp, 0x20
pop rbx
pop rdi
pop rsi
pop r14
pop r15
jmp 0x180009ad7
mov rcx, qword [rcx + 8]
mov rdx, r14
mov r8, rdi
add rsp, 0x20
pop rbx
pop rdi
pop rsi
pop r14
pop r15
jmp 0x180008d38
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_ExitThread]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_ExitThread]
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
mov rsi, rcx
mov rcx, qword [rcx + 0x10]
call fcn.180009da0
lea r12, str.cmd.exe
lea r15, [rsp + 0x28]
lea r13, [0x1800127dc]
lea r14, [0x180017bf0]
mov rcx, qword [rsi + 0x10]
call fcn.180009481
test rax, rax
je 0x180009020
mov rdi, rax
mov eax, dword [rax + 4]
cmp eax, 5
jge 0x180008dd6
cmp eax, 2
jge 0x180008e0f
cmp eax, 1
je 0x180008f0b
test eax, eax
jne 0x180008fbd
cmp dword [rdi + 8], 0
je 0x180009003
movzx ecx, word [rdi]
mov rbx, r14
mov r14, qword [rdi + 0x10]
xor edx, edx
xor r8d, r8d
call fcn.1800096e9
mov rbp, rax
mov rcx, r14
mov r14, rbx
call fcn.18000ecad
mov qword [rbp + 0x10], rax
jmp 0x180008fcf
cmp eax, 0x1001
jge 0x180008e48
cmp eax, 6
jge 0x180008e5a
cmp dword [rdi + 8], 0
je 0x180009003
mov rbx, r14
mov rbx, qword [rbx]
test rbx, rbx
je 0x180008f4f
mov rcx, qword [rbx]
cmp dword [rcx + 0xc], 0
jne 0x180008e09
call fcn.180008420
add rbx, 8
jmp 0x180008def
jne 0x180008e8e
cmp dword [rdi + 8], 0
je 0x180009003
mov rcx, qword [rsi + 0x18]
mov rdx, qword [rdi + 0x10]
mov r8, qword [rdi + 0x18]
call fcn.180008b5d
mov rbp, rax
mov rcx, rax
call fcn.180008c12
movzx ecx, word [rdi]
movzx ebx, word [rbp]
mov edx, 2
jmp 0x180008f3b
jne 0x180008ea4
mov rcx, rsi
mov rdx, rdi
call fcn.18000923f
jmp 0x180009003
cmp eax, 0xfff
jg 0x180008f59
cmp eax, 6
jne 0x180008fbd
cmp dword [rdi + 8], 0
je 0x180009003
mov eax, dword [rdi + 0x10]
mov dword [0x1800170e4], eax
movzx ecx, word [rdi]
mov edx, 6
jmp 0x180008fb1
cmp eax, 4
jge 0x180008f66
mov rcx, rdi
call fcn.180009031
jmp 0x180008fcc
cmp eax, 0xffff
jge 0x180008fbb
cmp eax, 0x1002
jne 0x180008fbd
mov rcx, qword [rsi + 0x30]
mov eax, dword [rdi + 0x10]
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x30], eax
mov rdx, r15
call fcn.18000ea66
test rax, rax
je 0x180009003
mov rbp, rax
mov rcx, qword [rsi + 0x18]
mov edx, dword [rax + 4]
call fcn.18000ef80
mov ecx, dword [rbp + 4]
call fcn.18000fa3d
mov rcx, qword [rbp + 0x18]
call sub.msvcrt.dll_free
mov rcx, rbp
call sub.msvcrt.dll_free
jmp 0x180009003
cmp dword [rdi + 8], 0
je 0x180009003
mov rcx, qword [rsi + 0x18]
mov rdx, r12
mov r8, r12
call fcn.180008b5d
mov rbp, rax
mov rcx, rax
call fcn.180008c12
movzx ecx, word [rdi]
movzx ebx, word [rbp]
mov edx, 1
xor r8d, r8d
call fcn.1800096e9
mov rbp, rax
mov word [rax + 0x10], bx
jmp 0x180008fcf
movzx ecx, word [rdi]
mov edx, 5
jmp 0x180008fb1
mov rcx, rsi
mov rdx, rdi
call fcn.180009121
jmp 0x180008fcc
cmp dword [rdi + 8], 0
je 0x180009003
mov rcx, qword [rdi + 0x10]
lea rdx, [0x180012857]
call sub.msvcrt.dll_fopen
test rax, rax
je 0x180009010
mov rbp, rax
mov rcx, qword [rdi + 0x18]
mov edx, dword [rdi + 0x20]
mov r8d, 1
mov r9, rax
call sub.msvcrt.dll_fwrite
mov rcx, rbp
call sub.msvcrt.dll_fclose
movzx ecx, word [rdi]
mov edx, 4
xor r8d, r8d
call fcn.1800096e9
jmp 0x180008fcc
je 0x180009003
movzx ecx, word [rdi]
mov dx, 0xffff
mov r8, r13
call fcn.18000974b
mov rbp, rax
test rbp, rbp
je 0x180009003
mov rcx, rbp
mov rdx, r15
call fcn.180009813
mov rbx, rax
mov rcx, qword [rsi + 0x20]
mov r8, qword [rsp + 0x28]
mov rdx, rax
call fcn.180009da0
mov rcx, rbx
call sub.msvcrt.dll_free
mov rcx, rbp
call fcn.180009782
mov rcx, rdi
call fcn.180009782
jmp 0x180008d6e
movzx ecx, word [rdi]
mov dx, 0xffff
lea r8, str.Error_opening_file_for_writing
jmp 0x180008fc7
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
sub rsp, 0x38
mov rcx, qword [rcx + 0x28]
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x34]
call qword [sym.imp.KERNEL32.dll_WriteFile]
nop
add rsp, 0x38
ret