Function at 0x140021040
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.140021930
mov rcx, rax
call fcn.140051080
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 0x1400210ee
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x1400210ee
cmp dword [rsp + 0x88], 0xa
jae 0x14002189d
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.140021a50
mov rcx, rax
call fcn.140050ff0
mov rdx, rax
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.140059470
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 0x14002141e
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax]
test eax, eax
jne 0x1400211a1
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.140059f40
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 0x1400211cf
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.14005a250
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.140021c70
mov rcx, rax
call fcn.140050f60
mov rdx, rax
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.140059470
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.1400590e0
lea rax, [rsp + 0x43]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x43]
call fcn.140021de0
mov rcx, rax
call fcn.140050ed0
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.140021f00
mov rcx, rax
call fcn.140050e40
mov qword [rsp + 0x90], rax
lea rax, [rsp + 0x188]
movzx edx, byte [rsp + 0x59]
mov rcx, rax
call fcn.140059f40
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 0x140021316
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.14005a250
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.140058f40
nop
lea rcx, [rsp + 0x188]
call fcn.140057f50
mov rax, qword [rsp + 0x320]
mov qword [rsp + 0xd8], rax
lea rax, [rsp + 0x310]
mov rcx, rax
call fcn.1400585d0
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.140057f50
nop
lea rcx, [rsp + 0x290]
call fcn.140057f50
jmp 0x14002182e
cmp dword [rsp + 0x288], 2
jne 0x140021829
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax]
test eax, eax
jne 0x140021474
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.140059f40
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 0x1400214a2
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.14005a250
nop
lea rax, [rsp + 0x2b0]
movzx edx, byte [rsp + 0x5b]
mov rcx, rax
call fcn.140059f40
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 0x140021525
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.14005a250
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.140022010
mov rcx, rax
call fcn.140050db0
mov rdx, rax
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.140059470
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.1400590e0
lea rax, [rsp + 0x46]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x46]
call fcn.140022190
mov rcx, rax
call fcn.140050d20
mov rdx, rax
lea rcx, [rsp + 0x1e8]
call fcn.140057740
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.140059030
nop
lea rcx, [rsp + 0x1e8]
call fcn.140057f50
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.1400590e0
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.1400223f0
mov rcx, rax
call fcn.140050c00
mov rdx, rax
lea rcx, [rsp + 0x248]
call fcn.140057740
mov qword [rsp + 0x128], rax
mov rax, qword [rsp + 0x128]
mov qword [rsp + 0x148], rax
lea rcx, [rsp + 0x48]
call fcn.1400222e0
mov rcx, rax
call fcn.140050c90
mov rdx, rax
lea rcx, [rsp + 0x228]
call fcn.140057740
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.140058f40
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.14005b350
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.140058f40
nop
lea rcx, [rsp + 0x1a8]
call fcn.140057f50
nop
lea rcx, [rsp + 0x208]
call fcn.140057f50
nop
lea rcx, [rsp + 0x228]
call fcn.140057f50
nop
lea rcx, [rsp + 0x248]
call fcn.140057f50
mov rax, qword [rsp + 0x300]
mov qword [rsp + 0x160], rax
lea rax, [rsp + 0x2f0]
mov rcx, rax
call fcn.1400585d0
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.140057f50
nop
lea rcx, [rsp + 0x2b0]
call fcn.140057f50
nop
lea rcx, [rsp + 0x2d0]
call fcn.140057f50
jmp 0x14002182e
jmp 0x140021104
lea rax, [rsp + 0x49]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x49]
call fcn.1400224e0
mov rcx, rax
call fcn.140050b70
mov rdx, rax
lea rcx, [rsp + 0x268]
call fcn.140057740
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.140059030
nop
lea rcx, [rsp + 0x268]
call fcn.140057f50
jmp 0x14002190a
lea rax, [rsp + 0x4a]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rcx, [rsp + 0x4a]
call fcn.1400225f0
mov rcx, rax
call fcn.140050ae0
mov rdx, rax
lea rcx, [rsp + 0x1c8]
call fcn.140057740
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.140059030
nop
lea rcx, [rsp + 0x1c8]
call fcn.140057f50
mov rcx, qword [rsp + 0x330]
xor rcx, rsp
call fcn.14005f160
add rsp, 0x340
pop rdi
ret