Function at 0x41d2f0
Capabilities:
Encrypt data using salsa20 or chacha

Disassembly:
sub esp, 0x34
push ebx
push esi
mov esi, dword [esp + 0x4c]
push edi
test esi, esi
jne 0x41d318
mov edi, 0x3320646e
mov ebx, 0x61707865
mov dword [esp + 0xc], edi
mov edx, 0x79622d32
mov eax, 0x6b206574
jmp 0x41d397
movzx ebx, byte [esi + 3]
movzx eax, byte [esi + 2]
movzx ecx, byte [esi + 7]
movzx edx, byte [esi + 0xb]
shl ebx, 8
or ebx, eax
shl ecx, 8
movzx eax, byte [esi + 1]
shl ebx, 8
or ebx, eax
shl edx, 8
movzx eax, byte [esi]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi + 6]
or ecx, eax
movzx eax, byte [esi + 5]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 4]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 0xa]
or edx, eax
mov dword [esp + 0xc], ecx
movzx eax, byte [esi + 9]
movzx ecx, byte [esi + 0xe]
shl edx, 8
or edx, eax
movzx eax, byte [esi + 8]
shl edx, 8
or edx, eax
movzx eax, byte [esi + 0xf]
shl eax, 8
or eax, ecx
movzx ecx, byte [esi + 0xd]
shl eax, 8
or eax, ecx
movzx ecx, byte [esi + 0xc]
shl eax, 8
or eax, ecx
push ebp
mov dword [esp + 0x54], edx
mov edx, dword [esp + 0x50]
movzx ebp, byte [edx + 3]
shl ebp, 8
movzx ecx, byte [edx + 2]
or ebp, ecx
movzx edi, byte [edx + 0x17]
movzx ecx, byte [edx + 1]
shl ebp, 8
or ebp, ecx
movzx esi, byte [edx + 0x1b]
movzx ecx, byte [edx]
shl ebp, 8
or ebp, ecx
shl edi, 8
movzx ecx, byte [edx + 6]
mov dword [esp + 0x18], ebp
movzx ebp, byte [edx + 7]
shl ebp, 8
or ebp, ecx
shl esi, 8
movzx ecx, byte [edx + 5]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 4]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0xa]
mov dword [esp + 0x2c], ebp
movzx ebp, byte [edx + 0xb]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 9]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 8]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0xe]
mov dword [esp + 0x30], ebp
movzx ebp, byte [edx + 0xf]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0xd]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0xc]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0x12]
mov dword [esp + 0x34], ebp
movzx ebp, byte [edx + 0x13]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0x11]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0x10]
shl ebp, 8
or ebp, ecx
movzx ecx, byte [edx + 0x16]
or edi, ecx
movzx ecx, byte [edx + 0x15]
shl edi, 8
or edi, ecx
movzx ecx, byte [edx + 0x14]
shl edi, 8
or edi, ecx
movzx ecx, byte [edx + 0x1a]
or esi, ecx
movzx ecx, byte [edx + 0x19]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0x18]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0x1e]
mov dword [esp + 0x14], esi
movzx esi, byte [edx + 0x1f]
shl esi, 8
or esi, ecx
mov dword [esp + 0x38], 0xa
movzx ecx, byte [edx + 0x1d]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0x1c]
mov edx, dword [esp + 0x4c]
shl esi, 8
or esi, ecx
mov dword [esp + 0x50], esi
movzx esi, byte [edx + 3]
movzx ecx, byte [edx + 2]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 1]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 6]
mov dword [esp + 0x1c], esi
movzx esi, byte [edx + 7]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 5]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 4]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0xa]
mov dword [esp + 0x20], esi
movzx esi, byte [edx + 0xb]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 9]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 8]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0xe]
mov dword [esp + 0x24], esi
movzx esi, byte [edx + 0xf]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0xd]
shl esi, 8
or esi, ecx
movzx ecx, byte [edx + 0xc]
shl esi, 8
or esi, ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x28], esi
jmp 0x41d554
mov ebx, dword [esp + 0x4c]
add ebx, ecx
mov ecx, dword [esp + 0x1c]
xor ecx, ebx
mov esi, ecx
shl ecx, 0x10
shr esi, 0x10
or esi, ecx
add ebp, esi
mov ecx, ebp
xor ecx, dword [esp + 0x18]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add ebx, edx
xor esi, ebx
mov dword [esp + 0x4c], ebx
mov ebx, dword [esp + 0x10]
mov ecx, esi
shr ecx, 0x18
add ebx, dword [esp + 0x2c]
shl esi, 8
or ecx, esi
add ebp, ecx
mov dword [esp + 0x1c], ecx
mov ecx, ebp
mov dword [esp + 0x18], ebp
xor ecx, edx
mov ebp, dword [esp + 0x14]
mov edx, ecx
shl ecx, 7
shr edx, 0x19
or edx, ecx
mov ecx, dword [esp + 0x20]
xor ecx, ebx
mov dword [esp + 0x3c], edx
mov esi, ecx
shl ecx, 0x10
shr esi, 0x10
or esi, ecx
add edi, esi
mov ecx, edi
xor ecx, dword [esp + 0x2c]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add ebx, edx
xor esi, ebx
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x54]
mov ecx, esi
add ebx, dword [esp + 0x30]
shr ecx, 0x18
shl esi, 8
or ecx, esi
add edi, ecx
mov dword [esp + 0x20], ecx
mov ecx, edi
mov dword [esp + 0x40], edi
xor ecx, edx
mov edx, ecx
shl ecx, 7
shr edx, 0x19
or edx, ecx
mov ecx, dword [esp + 0x24]
xor ecx, ebx
mov dword [esp + 0x2c], edx
mov esi, ecx
shl ecx, 0x10
shr esi, 0x10
or esi, ecx
add ebp, esi
mov ecx, ebp
xor ecx, dword [esp + 0x30]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add ebx, edx
mov dword [esp + 0x54], ebx
xor esi, ebx
add eax, dword [esp + 0x34]
mov ecx, esi
mov ebx, dword [esp + 0x50]
shr ecx, 0x18
shl esi, 8
or ecx, esi
add ebp, ecx
mov dword [esp + 0x24], ecx
mov ecx, ebp
mov dword [esp + 0x14], ebp
xor ecx, edx
mov ebp, ecx
shl ecx, 7
shr ebp, 0x19
or ebp, ecx
mov ecx, dword [esp + 0x28]
xor ecx, eax
mov esi, ecx
shl ecx, 0x10
shr esi, 0x10
or esi, ecx
add ebx, esi
mov ecx, ebx
xor ecx, dword [esp + 0x34]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add eax, edx
xor esi, eax
mov edi, esi
shl esi, 8
shr edi, 0x18
or edi, esi
add ebx, edi
mov ecx, ebx
mov dword [esp + 0x50], ebx
xor ecx, edx
mov ebx, ecx
shl ecx, 7
shr ebx, 0x19
or ebx, ecx
mov ecx, dword [esp + 0x4c]
add ecx, dword [esp + 0x2c]
xor edi, ecx
mov dword [esp + 0x4c], ecx
mov esi, edi
shl edi, 0x10
shr esi, 0x10
or esi, edi
mov edi, dword [esp + 0x14]
add edi, esi
mov ecx, edi
xor ecx, dword [esp + 0x2c]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
mov ecx, dword [esp + 0x4c]
add ecx, edx
xor esi, ecx
mov dword [esp + 0x4c], ecx
mov ecx, esi
shl esi, 8
shr ecx, 0x18
or ecx, esi
add edi, ecx
mov dword [esp + 0x28], ecx
mov ecx, edi
mov dword [esp + 0x14], edi
mov edi, dword [esp + 0x10]
xor ecx, edx
ror ecx, 0x19
add edi, ebp
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x1c]
xor ecx, edi
mov esi, ecx
shr esi, 0x10
shl ecx, 0x10
or esi, ecx
add eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x50]
add ecx, esi
mov dword [esp + 0x50], ecx
xor ecx, ebp
mov edx, ecx
mov ebp, dword [esp + 0x18]
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add edi, edx
xor esi, edi
mov dword [esp + 0x10], edi
mov ecx, esi
mov edi, dword [esp + 0x40]
shr ecx, 0x18
shl esi, 8
or ecx, esi
mov esi, dword [esp + 0x50]
add esi, ecx
mov dword [esp + 0x1c], ecx
mov ecx, esi
mov dword [esp + 0x50], esi
xor ecx, edx
mov edx, dword [esp + 0x54]
ror ecx, 0x19
add edx, ebx
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x20]
xor ecx, edx
mov dword [esp + 0x54], edx
mov esi, ecx
shl ecx, 0x10
shr esi, 0x10
or esi, ecx
add ebp, esi
mov ecx, ebp
xor ecx, ebx
mov ebx, dword [esp + 0x54]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add ebx, edx
xor esi, ebx
mov dword [esp + 0x54], ebx
mov ecx, esi
shl esi, 8
shr ecx, 0x18
or ecx, esi
add ebp, ecx
mov dword [esp + 0x20], ecx
mov ecx, ebp
xor ecx, edx
ror ecx, 0x19
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x24]
xor ecx, eax
mov esi, ecx
shl ecx, 0x10
shr esi, 0x10
or esi, ecx
add edi, esi
mov ecx, edi
xor ecx, dword [esp + 0x3c]
mov edx, ecx
shl ecx, 0xc
shr edx, 0x14
or edx, ecx
add eax, edx
xor esi, eax
mov ecx, esi
shl esi, 8
shr ecx, 0x18
or ecx, esi
add edi, ecx
mov dword [esp + 0x24], ecx
mov ecx, edi
xor ecx, edx
ror ecx, 0x19
sub dword [esp + 0x38], 1
mov dword [esp + 0x18], ecx
jne 0x41d550
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
pop ebp
pop edi
mov byte [ecx + 0xc], al
shr eax, 8
mov byte [ecx + 0xd], al
shr eax, 8
mov byte [ecx + 0xe], al
shr eax, 8
mov byte [ecx + 0xf], al
mov eax, dword [esp + 0x14]
mov byte [ecx + 0x10], al
shr eax, 8
mov byte [ecx + 0x11], al
shr eax, 8
mov byte [ecx + 0x12], al
shr eax, 8
mov byte [ecx + 0x13], al
mov eax, dword [esp + 0x18]
mov byte [ecx + 0x14], al
shr eax, 8
mov byte [ecx + 0x15], al
shr eax, 8
mov byte [ecx + 0x16], al
shr eax, 8
mov byte [ecx + 0x17], al
mov eax, dword [esp + 0x1c]
mov byte [ecx + 0x18], al
shr eax, 8
mov byte [ecx], dl
shr edx, 8
mov byte [ecx + 0x19], al
shr eax, 8
mov byte [ecx + 1], dl
shr edx, 8
mov byte [ecx + 0x1a], al
shr eax, 8
mov byte [ecx + 2], dl
shr edx, 8
mov byte [ecx + 0x1b], al
mov eax, dword [esp + 0x20]
mov byte [ecx + 3], dl
mov edx, dword [esp + 8]
mov byte [ecx + 8], bl
shr ebx, 8
mov byte [ecx + 0x1c], al
shr eax, 8
mov byte [ecx + 4], dl
shr edx, 8
mov byte [ecx + 9], bl
shr ebx, 8
mov byte [ecx + 0x1d], al
shr eax, 8
mov byte [ecx + 5], dl
shr edx, 8
mov byte [ecx + 0xa], bl
shr ebx, 8
mov byte [ecx + 0x1e], al
shr eax, 8
mov byte [ecx + 6], dl
shr edx, 8
pop esi
mov byte [ecx + 0xb], bl
mov byte [ecx + 0x1f], al
xor eax, eax
mov byte [ecx + 7], dl
pop ebx
add esp, 0x34
ret