Function at 0x401220
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4040bb
mov eax, dword fs:[0]
push eax
sub esp, 0x924
mov eax, dword [0x408004]
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
cmp dword [ebp + 8], 3
mov esi, dword [ebp + 0xc]
je 0x401293
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Usage:
push 0x402bc0
call fcn.00402990
mov edx, dword [esi]
mov ecx, eax
call fcn.00402990
mov edx, str.__key___input_file_
mov ecx, eax
call fcn.00402990
mov ecx, eax
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_____]
mov eax, 1
jmp 0x401803
push dword [esi + 4]
lea ecx, [ebp - 0x68]
call fcn.00402470
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x50]
push dword [esi + 8]
call fcn.00402470
push 0xb8
lea eax, [ebp - 0x920]
mov byte [ebp - 4], 1
push 0
push eax
call sub.VCRUNTIME140.dll_memset
cmp dword [ebp - 0x3c], 0x10
lea eax, [ebp - 0x50]
lea ecx, [ebp - 0x920]
cmovae eax, dword [ebp - 0x50]
push eax
call fcn.004027a0
mov eax, dword [ebp - 0x920]
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_ifstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ifstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0x920]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x70]
mov dword [ebp + ecx - 0x924], eax
mov byte [ebp - 4], 2
mov esi, dword [ebp - 0x920]
mov ebx, dword [ebp - 0x68]
mov eax, dword [esi + 4]
test byte [ebp + eax - 0x914], 6
je 0x40135e
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_opening_input_file:
call fcn.00402990
cmp dword [ebp - 0x3c], 0x10
lea edx, [ebp - 0x50]
push 0x402bc0
push dword [ebp - 0x40]
cmovae edx, dword [ebp - 0x50]
mov ecx, eax
call fcn.00402f70
add esp, 4
mov ecx, eax
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_____]
mov edi, 1
jmp 0x40177f
xorps xmm0, xmm0
mov dword [ebp - 0x14], 0
movq qword [ebp - 0x1c], xmm0
lea eax, [ebp - 0x1c]
mov esi, dword [esi + 4]
xor edi, edi
mov word [ebp - 0x20], 1
mov byte [ebp - 0x92b], 0
mov dword [ebp - 0x1c], edi
mov esi, dword [ebp + esi - 0x8e8]
test esi, esi
mov dword [ebp - 0x18], edi
sete cl
mov dword [ebp - 0x14], edi
mov byte [ebp - 0x92c], cl
mov dword [ebp - 0x928], eax
mov eax, dword [ebp - 0x20]
mov byte [ebp - 4], 3
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x92c]
mov dword [ebp - 0x20], eax
mov al, byte [ebp - 0x28]
mov bl, byte [ebp - 0x1f]
mov byte [ebp - 0x921], al
test cl, cl
je 0x4013cb
mov bh, byte [ebp - 0x20]
jmp 0x4013f0
test esi, esi
je 0x4013e0
mov ecx, esi
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::sgetc_void_]
cmp eax, 0xffffffff
je 0x4013e0
mov bl, al
jmp 0x4013e2
xor esi, esi
mov al, byte [ebp - 0x921]
mov bh, 1
nop word [eax + eax]
test al, al
jne 0x40140e
test edi, edi
je 0x401405
mov ecx, edi
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::sgetc_void_]
cmp eax, 0xffffffff
jne 0x401407
xor edi, edi
mov byte [ebp - 0x921], 1
test esi, esi
jne 0x401500
test edi, edi
jne 0x401508
lea ecx, [ebp - 0x910]
mov byte [ebp - 4], 4
call fcn.00402720
test eax, eax
jne 0x401449
push eax
mov eax, dword [ebp - 0x920]
lea ecx, [ebp - 0x920]
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 edi, dword [ebp - 0x58]
xor esi, esi
mov ebx, dword [ebp - 0x68]
cmp dword [ebp - 0x54], 0x10
lea ecx, [ebp - 0x68]
mov eax, esi
mov dword [ebp + esi*4 - 0x868], esi
cmovae ecx, ebx
xor edx, edx
div edi
movsx eax, byte [edx + ecx]
mov dword [ebp + esi*4 - 0x468], eax
inc esi
cmp esi, 0x100
jl 0x401451
xor edx, edx
xor esi, esi
mov eax, dword [ebp + esi*4 - 0x468]
mov ecx, dword [ebp + esi*4 - 0x868]
add eax, ecx
add edx, eax
and edx, 0x800000ff
jns 0x4014a2
dec edx
or edx, 0xffffff00
inc edx
mov eax, dword [ebp + edx*4 - 0x868]
mov dword [ebp + esi*4 - 0x868], eax
inc esi
mov dword [ebp + edx*4 - 0x868], ecx
cmp esi, 0x100
jl 0x401480
mov eax, dword [ebp - 0x18]
mov esi, 0
mov ecx, dword [ebp - 0x1c]
mov ebx, esi
xorps xmm0, xmm0
mov dword [ebp - 0x30], 0
mov edi, eax
movq qword [ebp - 0x38], xmm0
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], ebx
sub edi, ecx
je 0x4015cb
cmp edi, 0x7fffffff
ja 0x40181f
jmp 0x40156c
test edi, edi
jne 0x40141e
test bh, bh
jne 0x401523
test esi, esi
je 0x401521
mov ecx, esi
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::sgetc_void_]
cmp eax, 0xffffffff
je 0x401521
mov bl, al
jmp 0x401523
xor esi, esi
mov eax, dword [ebp - 0x18]
mov byte [ebp - 0x922], bl
cmp eax, dword [ebp - 0x14]
je 0x401538
mov byte [eax], bl
inc dword [ebp - 0x18]
jmp 0x40154a
lea eax, [ebp - 0x922]
push eax
push dword [ebp - 0x18]
lea ecx, [ebp - 0x1c]
call fcn.00403150
test esi, esi
je 0x4013e0
mov ecx, esi
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::sbumpc_void_]
cmp eax, 0xffffffff
je 0x4013e0
mov byte [ebp - 0x20], 0
jmp 0x4013cb
cmp edi, 0x1000
jb 0x40159b
lea eax, [edi + 0x23]
cmp eax, edi
jbe 0x401824
push eax
call fcn.00403331
add esp, 4
test eax, eax
je 0x4017f1
lea esi, [eax + 0x23]
and esi, 0xffffffe0
mov dword [esi - 4], eax
jmp 0x4015a6
push edi
call fcn.00403331
add esp, 4
mov esi, eax
push edi
lea ebx, [esi + edi]
mov dword [ebp - 0x38], esi
push 0
push esi
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x30], ebx
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 0x18]
mov edi, ebx
mov ecx, dword [ebp - 0x1c]
add esp, 0xc
mov dword [ebp - 0x34], edi
jmp 0x4015cd
xor edi, edi
mov dword [ebp - 0x92c], 0
mov dword [ebp - 0x928], 0
sub eax, ecx
je 0x401684
mov edi, dword [ebp - 0x1c]
xor ebx, ebx
nop
inc ebx
and ebx, 0x800000ff
jns 0x401601
dec ebx
or ebx, 0xffffff00
inc ebx
mov ecx, dword [ebp - 0x92c]
mov edx, dword [ebp + ebx*4 - 0x868]
add ecx, edx
and ecx, 0x800000ff
jns 0x401620
dec ecx
or ecx, 0xffffff00
inc ecx
mov eax, dword [ebp + ecx*4 - 0x868]
mov dword [ebp - 0x92c], ecx
mov dword [ebp + ebx*4 - 0x868], eax
mov dword [ebp + ecx*4 - 0x868], edx
mov ecx, dword [ebp + ebx*4 - 0x868]
add ecx, edx
and ecx, 0x800000ff
jns 0x401654
dec ecx
or ecx, 0xffffff00
inc ecx
mov edx, dword [ebp - 0x928]
mov al, byte [edi + edx]
xor al, byte [ebp + ecx*4 - 0x868]
mov byte [esi + edx], al
inc edx
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
sub eax, edi
mov dword [ebp - 0x928], edx
cmp edx, eax
jb 0x4015f0
mov ebx, dword [ebp - 0x30]
mov edi, dword [ebp - 0x28]
push 4
push 0x3000
sub edi, esi
mov byte [ebp - 4], 5
push edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x928], eax
test eax, eax
jne 0x4016c8
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_allocating_memory_using_VirtualAlloc.
push 0x402bc0
call fcn.00402990
mov ecx, eax
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_____]
mov edi, 1
jmp 0x401705
push edi
push esi
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
push 0x8000
push 0
push dword [ebp - 0x928]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Decryption_completed._Decrypted_data_stored_in_memory_allocated_by_VirtualAlloc.
push 0x402bc0
call fcn.00402990
mov ecx, eax
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_____]
xor edi, edi
test esi, esi
je 0x401733
sub ebx, esi
mov eax, esi
cmp ebx, 0x1000
jb 0x401729
mov esi, dword [eax - 4]
add ebx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4017f1
push ebx
push esi
call fcn.00403361
add esp, 8
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x40177c
mov edx, dword [ebp - 0x14]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x40175d
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4017f1
push edx
push ecx
call fcn.00403361
add esp, 8
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov ebx, dword [ebp - 0x68]
lea ecx, [ebp - 0x920]
call fcn.00401830
mov ecx, dword [ebp - 0x3c]
cmp ecx, 0x10
jb 0x4017ba
mov edx, dword [ebp - 0x50]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4017b0
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4017f1
push ecx
push edx
call fcn.00403361
add esp, 8
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0xf
mov byte [ebp - 0x50], 0
cmp eax, 0x10
jb 0x401801
lea ecx, [eax + 1]
mov eax, ebx
cmp ecx, 0x1000
jb 0x4017f7
mov ebx, dword [eax - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4017f7
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push ebx
call fcn.00403361
add esp, 8
mov eax, edi
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.00403323
mov esp, ebp
pop ebp
ret
call fcn.00402f60
call fcn.004010d0
int3