Function at 0x495730
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x50
mov eax, dword [0x589758]
xor eax, esp
mov dword [esp + 0x4c], eax
push ebx
mov ebx, dword [esp + 0x64]
push ebp
mov ebp, dword [esp + 0x64]
push esi
mov esi, dword [esp + 0x60]
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], ebx
test ebp, ebp
jne 0x49576d
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.004f6592
add esp, 0x50
ret
test esi, esi
jne 0x495788
push 0x8b
push str..chacha.cpp
push str.st___NULL
call fcn.004941e0
add esp, 0xc
push edi
mov edi, dword [esp + 0x68]
test edi, edi
jne 0x4957a8
push 0x8c
push str..chacha.cpp
push str.in___NULL
call fcn.004941e0
add esp, 0xc
test ebx, ebx
jne 0x4957c3
push 0x8d
push str..chacha.cpp
push str.out___NULL
call fcn.004941e0
add esp, 0xc
cmp dword [esi + 0x84], 0
jne 0x4957e3
push 0x8e
push str..chacha.cpp
push str.st__ivlen___0
call fcn.004941e0
add esp, 0xc
mov edx, dword [esi + 0x80]
test edx, edx
jbe 0x495844
cmp edx, ebp
jae 0x4957f7
mov dword [esp + 0x14], edx
jmp 0x4957fd
mov edx, ebp
mov dword [esp + 0x14], ebp
test edx, edx
jbe 0x495830
mov ecx, edi
mov eax, ebx
sub ecx, ebx
mov ebx, esi
sub ebx, dword [esi + 0x80]
inc eax
mov bl, byte [ebx + 0x80]
xor bl, byte [ecx + eax - 1]
mov byte [eax - 1], bl
dec dword [esi + 0x80]
sub edx, 1
jne 0x495807
mov ebx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
sub ebp, edx
mov dword [esp + 0x6c], ebp
je 0x495976
add ebx, edx
mov dword [esp + 0x10], ebx
add edi, edx
lea eax, [esp + 0x1c]
sub ebx, eax
mov eax, edi
lea ecx, [esp + 0x1c]
sub eax, ecx
mov dword [esp + 0x14], eax
jmp 0x495860
mov eax, dword [esi + 0x88]
lea edx, [esp + 0x1c]
push esi
push edx
call fcn.004954c0
add esp, 8
cmp dword [esi + 0x84], 8
jne 0x49588c
mov eax, 1
add dword [esi + 0x30], eax
jne 0x495892
add dword [esi + 0x34], eax
jmp 0x495890
add dword [esi + 0x30], 1
je 0x495910
xor ecx, ecx
cmp ebp, 0x40
jbe 0x495928
mov esi, dword [esp + 0x10]
mov ebp, edi
inc esi
sub ebp, dword [esp + 0x10]
jmp 0x4958b0
mov edx, dword [esp + 0x14]
lea eax, [esp + ecx + 0x1c]
movzx edx, byte [edx + eax]
xor dl, byte [eax]
add ecx, 4
mov byte [ebx + eax], dl
movzx edx, byte [esi + ebp]
xor dl, byte [eax + 1]
add esi, 4
mov byte [esi - 4], dl
movzx edx, byte [edi + ecx - 2]
xor dl, byte [eax + 2]
mov byte [esi - 3], dl
movzx edx, byte [edi + ecx - 1]
xor dl, byte [eax + 3]
mov byte [esi - 2], dl
cmp ecx, 0x40
jb 0x4958b0
mov ebp, dword [esp + 0x6c]
add dword [esp + 0x10], 0x40
mov esi, dword [esp + 0x18]
sub ebp, 0x40
add ebx, 0x40
add edi, 0x40
add dword [esp + 0x14], 0x40
mov dword [esp + 0x6c], ebp
jmp 0x495860
pop edi
pop esi
pop ebp
mov eax, 0x13
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.004f6592
add esp, 0x50
ret
test ebp, ebp
jbe 0x495951
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
sub edi, eax
sub edx, eax
jmp 0x495940
lea eax, [esp + ecx + 0x1c]
mov bl, byte [edi + eax]
xor bl, byte [eax]
inc ecx
mov byte [edx + eax], bl
cmp ecx, ebp
jb 0x495940
mov eax, 0x40
sub eax, ebp
mov dword [esi + 0x80], eax
cmp ebp, 0x40
jae 0x495976
push eax
lea edx, [esp + ebp + 0x20]
lea ecx, [esi + ebp + 0x40]
push edx
push ecx
call fcn.004f7b80
add esp, 0xc
mov ecx, dword [esp + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.004f6592
add esp, 0x50
ret