Function at 0x140021030
Capabilities:
Create thread
Get file size
Write file on windows

Disassembly:
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x340
mov rax, qword [0x140072010]
xor rax, rsp
mov qword [rsp + 0x330], rax
mov dword [rsp + 0x60], 0
lea rax, [rsp + 0x40]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x40]
call fcn.140021920
mov rcx, rax
call fcn.140051070
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1f01ff
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x50], rax
xor edx, edx
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [rsp + 0x88], eax
cmp qword [rsp + 0x50], 0
je 0x1400210de
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x1400210de
cmp dword [rsp + 0x88], 0xa
jae 0x14002188d
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x288], 0
lea rax, [rsp + 0x41]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x41]
call fcn.140021a40
mov rcx, rax
call fcn.140050fe0
mov rdx, rax
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.1400594f0
lea rdx, [rsp + 0x288]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_istream_char__struct_std::char_traits_char__::operator___int____ptr64____ptr64]
cmp dword [rsp + 0x288], 1
jne 0x14002140e
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax]
test eax, eax
jne 0x140021191
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [0x140003f60]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x350]
mov byte [rax], 1
lea rax, [rsp + 0x290]
movzx edx, byte [rsp + 0x58]
mov rcx, rax
call fcn.140059fc0
nop
lea rax, [0x14006d601]
mov qword [rsp + 0xa0], rax
mov qword [rsp + 0x68], 0xffffffffffffffff
inc qword [rsp + 0x68]
mov rax, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0x68]
cmp byte [rax + rcx], 0
jne 0x1400211bf
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0xa8], rax
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0xb0], rax
mov r8, qword [rsp + 0xb0]
lea rdx, [0x14006d601]
lea rcx, [rsp + 0x290]
call fcn.14005a2d0
nop
lea rax, [rsp + 0x42]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x42]
call fcn.140021c60
mov rcx, rax
call fcn.140050f50
mov rdx, rax
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.1400594f0
lea rdx, [rsp + 0x290]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
call fcn.140059160
lea rax, [rsp + 0x43]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x43]
call fcn.140021dd0
mov rcx, rax
call fcn.140050ec0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1f01ff
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x44]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x44]
call fcn.140021ef0
mov rcx, rax
call fcn.140050e30
mov qword [rsp + 0x90], rax
lea rax, [rsp + 0x188]
movzx edx, byte [rsp + 0x59]
mov rcx, rax
call fcn.140059fc0
nop
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0xb8], rax
mov qword [rsp + 0x70], 0xffffffffffffffff
inc qword [rsp + 0x70]
mov rax, qword [rsp + 0xb8]
mov rcx, qword [rsp + 0x70]
cmp byte [rax + rcx], 0
jne 0x140021306
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0xc8], rax
mov r8, qword [rsp + 0xc8]
mov rdx, qword [rsp + 0x90]
lea rcx, [rsp + 0x188]
call fcn.14005a2d0
nop
lea rax, [rsp + 0x188]
mov qword [rsp + 0xd0], rax
lea r8, [rsp + 0x290]
mov rdx, qword [rsp + 0xd0]
lea rcx, [rsp + 0x310]
call fcn.140058fc0
nop
lea rcx, [rsp + 0x188]
call fcn.140057fd0
mov rax, qword [rsp + 0x320]
mov qword [rsp + 0xd8], rax
lea rax, [rsp + 0x310]
mov rcx, rax
call fcn.140058650
mov qword [rsp + 0xe0], rax
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0xd8]
mov rdx, qword [rsp + 0xe0]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rsp + 0x310]
call fcn.140057fd0
nop
lea rcx, [rsp + 0x290]
call fcn.140057fd0
jmp 0x14002181e
cmp dword [rsp + 0x288], 2
jne 0x140021819
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax]
test eax, eax
jne 0x140021464
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [0x140003f60]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x350]
mov byte [rax], 1
lea rax, [rsp + 0x2d0]
movzx edx, byte [rsp + 0x5a]
mov rcx, rax
call fcn.140059fc0
nop
lea rax, [0x14006d601]
mov qword [rsp + 0xe8], rax
mov qword [rsp + 0x78], 0xffffffffffffffff
inc qword [rsp + 0x78]
mov rax, qword [rsp + 0xe8]
mov rcx, qword [rsp + 0x78]
cmp byte [rax + rcx], 0
jne 0x140021492
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0xf0], rax
mov rax, qword [rsp + 0xf0]
mov qword [rsp + 0xf8], rax
mov r8, qword [rsp + 0xf8]
lea rdx, [0x14006d601]
lea rcx, [rsp + 0x2d0]
call fcn.14005a2d0
nop
lea rax, [rsp + 0x2b0]
movzx edx, byte [rsp + 0x5b]
mov rcx, rax
call fcn.140059fc0
nop
lea rax, [0x14006d601]
mov qword [rsp + 0x100], rax
mov qword [rsp + 0x80], 0xffffffffffffffff
inc qword [rsp + 0x80]
mov rax, qword [rsp + 0x100]
mov rcx, qword [rsp + 0x80]
cmp byte [rax + rcx], 0
jne 0x140021515
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x108], rax
mov rax, qword [rsp + 0x108]
mov qword [rsp + 0x110], rax
mov r8, qword [rsp + 0x110]
lea rdx, [0x14006d601]
lea rcx, [rsp + 0x2b0]
call fcn.14005a2d0
nop
lea rax, [rsp + 0x45]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x45]
call fcn.140022000
mov rcx, rax
call fcn.140050da0
mov rdx, rax
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.1400594f0
lea rdx, [rsp + 0x2d0]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
call fcn.140059160
lea rax, [rsp + 0x46]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x46]
call fcn.140022180
mov rcx, rax
call fcn.140050d10
mov rdx, rax
lea rcx, [rsp + 0x1e8]
call fcn.1400577c0
mov qword [rsp + 0x118], rax
mov rax, qword [rsp + 0x118]
mov qword [rsp + 0x120], rax
mov rdx, qword [rsp + 0x120]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.1400590b0
nop
lea rcx, [rsp + 0x1e8]
call fcn.140057fd0
lea rdx, [rsp + 0x2b0]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
call fcn.140059160
lea rax, [rsp + 0x47]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rax, [rsp + 0x48]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x47]
call fcn.1400223e0
mov rcx, rax
call fcn.140050bf0
mov rdx, rax
lea rcx, [rsp + 0x248]
call fcn.1400577c0
mov qword [rsp + 0x128], rax
mov rax, qword [rsp + 0x128]
mov qword [rsp + 0x148], rax
lea rcx, [rsp + 0x48]
call fcn.1400222d0
mov rcx, rax
call fcn.140050c80
mov rdx, rax
lea rcx, [rsp + 0x228]
call fcn.1400577c0
mov qword [rsp + 0x130], rax
mov rax, qword [rsp + 0x130]
mov qword [rsp + 0x138], rax
lea r8, [rsp + 0x2d0]
mov rdx, qword [rsp + 0x138]
lea rcx, [rsp + 0x208]
call fcn.140058fc0
mov qword [rsp + 0x140], rax
mov rax, qword [rsp + 0x140]
mov qword [rsp + 0x150], rax
mov r9, qword [rsp + 0x148]
mov r8, qword [rsp + 0x150]
movzx edx, byte [rsp + 0x5c]
lea rcx, [rsp + 0x1a8]
call fcn.14005b3d0
mov eax, dword [rsp + 0x60]
or eax, 4
mov dword [rsp + 0x60], eax
lea rax, [rsp + 0x1a8]
mov qword [rsp + 0x158], rax
lea r8, [rsp + 0x2b0]
mov rdx, qword [rsp + 0x158]
lea rcx, [rsp + 0x2f0]
call fcn.140058fc0
nop
lea rcx, [rsp + 0x1a8]
call fcn.140057fd0
nop
lea rcx, [rsp + 0x208]
call fcn.140057fd0
nop
lea rcx, [rsp + 0x228]
call fcn.140057fd0
nop
lea rcx, [rsp + 0x248]
call fcn.140057fd0
mov rax, qword [rsp + 0x300]
mov qword [rsp + 0x160], rax
lea rax, [rsp + 0x2f0]
mov rcx, rax
call fcn.140058650
mov qword [rsp + 0x168], rax
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0x160]
mov rdx, qword [rsp + 0x168]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rsp + 0x2f0]
call fcn.140057fd0
nop
lea rcx, [rsp + 0x2b0]
call fcn.140057fd0
nop
lea rcx, [rsp + 0x2d0]
call fcn.140057fd0
jmp 0x14002181e
jmp 0x1400210f4
lea rax, [rsp + 0x49]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x49]
call fcn.1400224d0
mov rcx, rax
call fcn.140050b60
mov rdx, rax
lea rcx, [rsp + 0x268]
call fcn.1400577c0
mov qword [rsp + 0x170], rax
mov rax, qword [rsp + 0x170]
mov qword [rsp + 0x178], rax
mov rdx, qword [rsp + 0x178]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.1400590b0
nop
lea rcx, [rsp + 0x268]
call fcn.140057fd0
jmp 0x1400218fa
lea rax, [rsp + 0x4a]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x4a]
call fcn.1400225e0
mov rcx, rax
call fcn.140050ad0
mov rdx, rax
lea rcx, [rsp + 0x1c8]
call fcn.1400577c0
mov qword [rsp + 0x180], rax
mov rax, qword [rsp + 0x180]
mov qword [rsp + 0x98], rax
mov rdx, qword [rsp + 0x98]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.1400590b0
nop
lea rcx, [rsp + 0x1c8]
call fcn.140057fd0
mov rcx, qword [rsp + 0x330]
xor rcx, rsp
call fcn.14005f1e0
add rsp, 0x340
pop rdi
ret