Function at 0x402ff0
Capabilities:
Encode data using xor
Generate random numbers using a mersenne twister

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x409fbb
mov eax, dword fs:[0]
push eax
mov eax, 0x1484
call fcn.00409c30
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push 0xc0
lea eax, [ebp - 0xd8]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov eax, esi
cmp dword [esi + 0x14], 7
jbe 0x403044
mov eax, dword [esi]
sub esp, 0xc
lea ecx, [ebp - 0xd8]
push eax
call fcn.00407bb0
mov eax, dword [ebp - 0xd8]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xd8], vtable.std::basic_fstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0xd8]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x78]
mov dword [ebp + ecx - 0xdc], eax
mov dword [ebp - 4], 0
cmp dword [ebp - 0x74], 0
jne 0x403168
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Failed_to_open_file:
call fcn.00406b50
cmp dword [esi + 0x14], 7
mov edi, eax
mov ecx, esi
jbe 0x4030a7
mov ecx, dword [esi]
push dword [esi + 0x10]
push ecx
lea ecx, [ebp - 0x1490]
call fcn.00407da0
add esp, 8
mov byte [ebp - 4], 1
lea eax, [ebp - 0x1490]
cmp dword [ebp - 0x147c], 0xf
lea edx, [ebp - 0x1478]
mov ecx, edi
mov word [ebp - 0x1470], 0x5c22
cmova eax, dword [ebp - 0x1490]
mov dword [ebp - 0x1478], eax
mov eax, dword [ebp - 0x1480]
mov dword [ebp - 0x1474], eax
call fcn.00407f10
mov byte [ebp - 4], 0
mov esi, eax
mov ecx, dword [ebp - 0x147c]
cmp ecx, 0xf
jbe 0x40313b
mov edx, dword [ebp - 0x1490]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x403131
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x403131
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.00408d9c
add esp, 8
push 0x406d70
mov ecx, esi
mov dword [ebp - 0x1480], 0
mov dword [ebp - 0x147c], 0xf
mov byte [ebp - 0x1490], 0
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
jmp 0x4032f6
push 2
push 0
push 0
lea ecx, [ebp - 0xd8]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::seekg_long_long___int64___int_]
lea eax, [ebp - 0x1490]
push eax
lea ecx, [ebp - 0xd8]
call dword [sym.imp.MSVCP140.dll_public:_class_std::fpos_struct__Mbstatet____thiscall_std::basic_istream_char__struct_std::char_traits_char__::tellg_void_]
push 0
push 0
push 0
mov esi, dword [eax + 8]
lea ecx, [ebp - 0xd8]
add esi, dword [eax]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::seekg_long_long___int64___int_]
call dword [sym.imp.MSVCP140.dll_unsigned_int___cdecl_std::_Random_device_void_]
mov dword [ebp - 0xdc], 0xffffffff
mov edx, 1
mov dword [ebp - 0x145c], eax
nop
mov ecx, eax
shr ecx, 0x1e
xor ecx, eax
imul eax, ecx, 0x6c078965
add eax, edx
mov dword [ebp + edx*4 - 0x145c], eax
inc edx
cmp edx, 0x270
jb 0x4031c0
lea eax, [esi - 1]
mov dword [ebp - 0x1460], 0x270
xor eax, 0x80000000
mov edi, 0x186a0
mov dword [ebp - 0x1470], eax
mov dword [ebp - 0x1464], edi
lea ecx, [ebp - 0x1460]
cmp eax, 0x7fffffff
jne 0x403218
call fcn.00408620
mov ecx, eax
jmp 0x403259
lea esi, [eax - 0x7fffffff]
call fcn.00408620
mul esi
mov ebx, eax
mov ecx, edx
cmp ebx, esi
jae 0x403259
mov eax, esi
xor edx, edx
neg eax
div esi
mov edi, edx
cmp ebx, edi
jae 0x403253
nop dword [eax + eax]
lea ecx, [ebp - 0x1460]
call fcn.00408620
mul esi
mov ecx, edx
cmp eax, edi
jb 0x403240
mov edi, dword [ebp - 0x1464]
lea eax, [ecx - 0x80000000]
sub esp, 0x18
mov ecx, esp
xor eax, 0x80000000
cdq
xorps xmm0, xmm0
mov dword [ecx], eax
mov dword [ecx + 4], edx
mov dword [ecx + 8], 0
mov dword [ecx + 0xc], 0
movq qword [ecx + 0x10], xmm0
lea ecx, [ebp - 0xc8]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::seekp_class_std::fpos_struct__Mbstatet__]
lea ecx, [ebp - 0x1460]
call fcn.00408620
mov ecx, 2
mul ecx
push 0
push 1
lea eax, [ebp - 0x11]
mov byte [ebp - 0x11], dl
push eax
lea ecx, [ebp - 0xc8]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::write_char_const___long_long___int64__]
mov eax, dword [ebp - 0x1470]
sub edi, 1
mov dword [ebp - 0x1464], edi
jne 0x403202
lea ecx, [ebp - 0xc0]
call fcn.00406440
test eax, eax
jne 0x4032f6
push eax
mov eax, dword [ebp - 0xd8]
lea ecx, [ebp - 0xd8]
push 2
add ecx, dword [eax + 4]
call dword [sym.imp.MSVCP140.dll_public:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool_]
mov eax, dword [ebp - 0xd8]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xd8], vtable.std::basic_fstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0xd8]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x78]
mov dword [ebp + ecx - 0xdc], eax
lea ecx, [ebp - 0xc0]
call fcn.00405dc0
lea ecx, [ebp - 0xb8]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_iostream_char__struct_std::char_traits_char__::destructor_void_]
lea ecx, [ebp - 0x60]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::destructor_void_]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00408d54
mov esp, ebp
pop ebp
ret