Function at 0x412538
Capabilities:
Encode data using xor
Encrypt data using curve25519

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x244
xor eax, eax
cmp dword [esp + 0x25c], 0x20
jne 0x412a5d
cmp dword [esp + 0x264], 0x20
ja 0x412a5d
mov eax, dword [esp + 0x258]
and byte [eax + 0x1f], 0x7f
xor eax, eax
lea edx, [esp + 0x14c]
mov esi, 0xffffffe0
xor ebx, ebx
mov ebp, ebx
mov ecx, dword [esp + 0x258]
movzx edi, byte [ecx + esi + 0x20]
mov ebx, edi
mov ecx, eax
shl ebx, cl
or ebx, ebp
cmp eax, 0x16
mov ecx, 8
jl 0x4125b3
mov cl, 0x1e
sub cl, al
shr edi, cl
and ebx, 0x3fffffff
mov dword [edx], ebx
add edx, 4
mov ecx, 0xffffffea
mov ebx, edi
add eax, ecx
inc esi
jne 0x41257b
lea esi, [esp + 0x14c]
mov dword [esi + 0x20], ebx
lea edi, [esp + 0x74]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
xor edi, edi
lea ecx, [esp + 8]
mov dword [ecx + 0x20], edi
xorps xmm0, xmm0
movups xmmword [ecx + 0x10], xmm0
movups xmmword [ecx], xmm0
lea ecx, [esp + 0x2c]
mov dword [ecx + 8], edi
mov dword [ecx + 4], edi
mov dword [ecx + 0x10], edi
mov dword [ecx + 0xc], edi
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], edi
mov dword [ecx + 0x20], edi
mov dword [ecx + 0x1c], edi
xor eax, eax
inc eax
mov dword [ecx], eax
lea ecx, [esp + 0x50]
mov dword [ecx + 8], edi
mov dword [ecx + 4], edi
mov dword [ecx + 0x10], edi
mov dword [ecx + 0xc], edi
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], edi
mov dword [ecx + 0x20], edi
mov dword [ecx + 0x1c], edi
mov dword [ecx], eax
mov eax, 0x20
mov ebx, dword [esp + 0x264]
sub eax, ebx
lea esi, [esp + 0x170]
push eax
push edi
push esi
call fcn.00403060
add esp, 0xc
mov eax, esi
sub eax, ebx
add eax, 0x20
push ebx
push dword [esp + 0x264]
push eax
call fcn.0040307b
add esp, 0xc
and byte [esi + 0x1f], 0xf8
mov al, byte [esi]
and al, 0x3f
or al, 0x40
mov byte [esi], al
mov edx, 0xfe
mov eax, edi
mov ecx, edx
shr ecx, 3
neg ecx
movzx ecx, byte [esp + ecx + 0x18f]
mov dword [esp], edx
and edx, 7
xor ebx, ebx
bt ecx, edx
setb bl
xor eax, ebx
neg eax
mov ecx, 0xffffffdc
mov edx, dword [esp + ecx + 0x50]
mov edi, dword [esp + ecx + 0x98]
mov ebp, edi
xor ebp, edx
and ebp, eax
xor edx, ebp
mov dword [esp + ecx + 0x50], edx
xor ebp, edi
mov dword [esp + ecx + 0x98], ebp
add ecx, 4
jne 0x412690
mov dword [esp + 4], ebx
mov ecx, 0xffffffdc
mov edx, dword [esp + ecx + 0x2c]
mov edi, dword [esp + ecx + 0x74]
mov ebp, edi
xor ebp, edx
and ebp, eax
xor edx, ebp
mov dword [esp + ecx + 0x2c], edx
xor ebp, edi
mov dword [esp + ecx + 0x74], ebp
add ecx, 4
jne 0x4126be
lea ebx, [esp + 0x128]
mov ecx, ebx
lea esi, [esp + 0x2c]
mov edx, esi
lea edi, [esp + 8]
push edi
call fcn.00412aa5
add esp, 4
lea ebp, [esp + 0x104]
mov ecx, ebp
mov edx, ebx
call fcn.00412b04
lea ebx, [esp + 0xe0]
mov ecx, ebx
mov edx, esi
push edi
call fcn.0041306b
add esp, 4
lea esi, [esp + 0x1b4]
mov ecx, esi
mov edx, ebx
call fcn.00412b04
lea ecx, [esp + 0xbc]
mov edx, ebp
push esi
call fcn.0041306b
add esp, 4
lea ecx, [esp + 0x190]
lea edi, [esp + 0x74]
mov edx, edi
lea ebp, [esp + 0x50]
push ebp
call fcn.00412aa5
add esp, 4
lea ebx, [esp + 0x220]
mov ecx, ebx
mov edx, edi
push ebp
call fcn.0041306b
add esp, 4
lea esi, [esp + 0x1fc]
mov ecx, esi
mov edx, ebx
lea eax, [esp + 0x128]
push eax
call fcn.004130d3
add esp, 4
lea ebx, [esp + 0x1d8]
mov ecx, ebx
lea edx, [esp + 0x190]
lea eax, [esp + 0xe0]
push eax
call fcn.004130d3
add esp, 4
mov ecx, edi
mov edx, esi
push ebx
call fcn.00412aa5
add esp, 4
mov ecx, edi
mov edx, edi
call fcn.00412b04
mov ecx, ebp
mov edx, esi
push ebx
call fcn.0041306b
add esp, 4
mov ecx, ebp
mov edx, ebp
call fcn.00412b04
mov ecx, ebp
mov edx, ebp
lea eax, [esp + 0x14c]
push eax
call fcn.004130d3
add esp, 4
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x104]
lea eax, [esp + 0x1b4]
push eax
call fcn.004130d3
add esp, 4
xor edi, edi
mov ebp, 0xffffffe0
mov eax, 0x1db41
mul dword [esp + ebp + 0xdc]
mov ecx, edx
add eax, edi
adc ecx, 0
shld ecx, eax, 2
and eax, 0x3fffffff
mov dword [esp + ebp + 0x28], eax
add ebp, 4
mov edi, ecx
jne 0x41280a
mov eax, 0x1db41
mul dword [esp + 0xdc]
add eax, ecx
adc edx, 0
shld edx, eax, 0x11
and eax, 0x7fff
mov dword [esp + 0x28], eax
lea eax, [edx + edx*8]
lea eax, [edx + eax*2]
mov ecx, 0xffffffdc
mov edi, dword [esp + 4]
add eax, dword [esp + ecx + 0x2c]
mov edx, eax
and edx, 0x3fffffff
mov dword [esp + ecx + 0x2c], edx
shr eax, 0x1e
add ecx, 4
jne 0x41285e
lea ebp, [esp + 8]
mov ecx, ebp
mov edx, ebp
lea eax, [esp + 0x104]
push eax
call fcn.00412aa5
add esp, 4
mov ecx, ebp
lea edx, [esp + 0xbc]
push ebp
call fcn.004130d3
add esp, 4
mov edx, dword [esp]
sub edx, 1
jae 0x412668
neg edi
mov eax, 0xffffffdc
mov ecx, dword [esp + eax + 0x50]
mov edx, dword [esp + eax + 0x98]
mov esi, edx
xor esi, ecx
and esi, edi
xor ecx, esi
mov dword [esp + eax + 0x50], ecx
xor esi, edx
mov dword [esp + eax + 0x98], esi
add eax, 4
jne 0x4128b3
mov eax, 0xffffffdc
mov ecx, dword [esp + eax + 0x2c]
mov edx, dword [esp + eax + 0x74]
mov esi, edx
xor esi, ecx
and esi, edi
xor ecx, esi
mov dword [esp + eax + 0x2c], ecx
xor esi, edx
mov dword [esp + eax + 0x74], esi
add eax, 4
jne 0x4128dd
lea ebx, [esp + 0x128]
mov ecx, 9
mov edi, ebx
mov esi, ebp
rep movsd dword es:[edi], dword [esi]
mov esi, 0xf
mov ecx, ebx
mov edx, ebx
call fcn.00412b04
mov ecx, ebx
mov edx, ebx
push ebp
call fcn.004130d3
add esp, 4
dec esi
jne 0x412913
lea ebp, [esp + 0xe0]
mov ecx, 9
mov edi, ebp
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
xor esi, esi
mov edi, 0x10
mov ecx, ebp
mov edx, ebp
call fcn.00412b04
dec edi
jne 0x412945
mov ecx, ebp
mov edx, ebp
push ebx
call fcn.004130d3
add esp, 4
inc esi
cmp esi, 0xe
jne 0x412940
mov edi, 0xe
mov ebx, 0xffeb
lea esi, [esp + 8]
mov ecx, ebp
mov edx, ebp
call fcn.00412b04
bt ebx, edi
jae 0x41298d
mov ecx, ebp
mov edx, esi
push ebp
call fcn.004130d3
add esp, 4
add edi, 0xffffffff
jb 0x412972
lea ecx, [esp + 0x2c]
mov edx, ecx
push ebp
mov ebp, ecx
call fcn.004130d3
add esp, 4
lea edi, [esp + 0x98]
mov ecx, 9
mov esi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x13
mov eax, 0xffffffdc
add ecx, dword [esp + eax + 0xbc]
mov edx, ecx
shr edx, 0x1e
and ecx, 0x3fffffff
mov dword [esp + eax + 0xbc], ecx
add eax, 4
mov ecx, edx
jne 0x4129bd
mov ecx, dword [esp + 0xb8]
mov eax, ecx
shr eax, 0xf
and ecx, 0x7fff
mov dword [esp + 0xb8], ecx
neg al
mov ecx, 0xffffffdc
mov dl, byte [esp + ecx + 0x50]
mov dh, byte [esp + ecx + 0xbc]
xor dh, dl
and dh, al
xor dh, dl
mov byte [esp + ecx + 0x50], dh
inc ecx
jne 0x4129fd
xor eax, eax
mov edx, 0xffffffe0
xor ebx, ebx
cmp eax, 7
jg 0x412a3e
mov esi, dword [ebp]
add ebp, 4
mov edi, esi
mov ecx, eax
shl edi, cl
or ebx, edi
mov cl, 8
sub cl, al
shr esi, cl
mov ecx, 0x16
jmp 0x412a48
mov esi, ebx
shr esi, 8
mov ecx, 0xfffffff8
add eax, ecx
mov ecx, dword [esp + 0x258]
mov byte [ecx + edx + 0x20], bl
inc edx
mov ebx, esi
jne 0x412a1e
xor eax, eax
inc eax
add esp, 0x244
pop esi
pop edi
pop ebx
pop ebp
ret