Function at 0x8351d29a
Capabilities:
Encode data using xor

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x50
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
push edi
mov edi, dword [ebp + 0xc]
push dword [ebp + 0x18]
inc esi
test bl, 7
jne 0x8351d2c4
push edi
call fcn.8351d254
cmp dword [ebp + 0x14], eax
je 0x8351d2ce
push dword [ebp + 0x18]
xor esi, esi
push esi
push 6
call fcn.834f1760
and dword [ebp - 0x50], 0
test esi, esi
je 0x8351d2fc
push dword [ebp + 0x18]
lea eax, [ebp - 0x50]
push eax
call fcn.8351d22c
test eax, eax
je 0x8351d2fc
xor esi, esi
inc esi
mov dword [ebp - 0x38], esi
cmp edi, 7
ja 0x8351da57
jmp dword [edi*4 - 0x7864bec6]
xor esi, esi
jmp 0x8351dd2e
push dword [ebp + 0x18]
mov eax, edi
shr eax, 1
sub edi, eax
xor ecx, ecx
cmp eax, edi
setne cl
push edi
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], ecx
call fcn.8351d254
mov dword [ebp - 8], eax
lea ecx, [eax + eax]
mov eax, dword [ebp + 0x14]
sub eax, ecx
cmp dword [ebp + 0x10], 0
mov dword [ebp - 0x2c], eax
je 0x8351db63
mov eax, dword [ebp - 8]
lea edx, [ebx + eax*8]
mov eax, dword [ebp + 0x10]
mov ecx, ebx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x1c], eax
jmp 0x8351daa4
mov ecx, dword [ebp - 4]
cmp dword [ebp - 0x14], 0
je 0x8351dab9
mov eax, dword [ebp + 0xc]
shl eax, 3
and dword [ecx + eax + 4], 0
and dword [ecx + eax], 0
mov dword [ebp - 0x10], edi
test edi, edi
je 0x8351db4c
mov eax, dword [ebp - 8]
mov ebx, dword [ebp - 4]
lea eax, [edx + eax*8]
sub ebx, edx
mov dword [ebp - 0x28], eax
lea eax, [eax + edi*8]
mov dword [ebp - 0x34], ebx
mov ebx, dword [ebp - 0x28]
mov ecx, edi
sub ebx, edx
mov dword [ebp - 0xc], eax
lea eax, [edx + edi*8 + 4]
mov edx, dword [ebp - 4]
shl ecx, 4
add ecx, dword [ebp - 4]
sub edx, dword [ebp - 0x28]
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], edx
jmp 0x8351dafd
mov edx, dword [ebp - 0x38]
mov ebx, dword [ebp - 0x34]
sub dword [ebp - 0xc], 8
dec dword [ebp - 0x10]
sub eax, 8
mov ebx, dword [ebx + eax]
mov dword [ebp - 0x30], ebx
sub ecx, 8
mov ebx, dword [ecx]
mov dword [ebp - 0x28], ebx
mov ebx, dword [ecx + 4]
mov dword [ebp - 0x24], ebx
mov ebx, dword [ebp - 0xc]
mov edx, dword [edx + ebx]
xor edx, dword [ebp - 0x28]
mov dword [eax - 4], edx
mov edx, dword [ebp - 0x24]
xor edx, dword [ebp - 0x30]
cmp dword [ebp - 0x10], 0
mov dword [eax], edx
mov edx, dword [ebp - 0x28]
mov dword [ebx], edx
mov edx, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x3c]
mov dword [ebx + eax], edx
jne 0x8351dafa
mov edx, dword [ebp - 0x20]
mov ebx, dword [ebp + 8]
mov eax, dword [ebp + 0x14]
shl eax, 3
add dword [ebp - 4], eax
add edx, eax
dec dword [ebp - 0x1c]
mov dword [ebp - 0x20], edx
jne 0x8351daa1
cmp dword [ebp - 0x14], 0
jne 0x8351db86
mov eax, dword [ebp + 0x10]
push dword [ebp + 0x18]
imul eax, eax, 3
push dword [ebp - 0x2c]
push eax
push dword [ebp - 0x18]
push ebx
call fcn.8351d29a
xor esi, esi
test eax, eax
je 0x8351dba1
inc esi
mov eax, dword [ebp - 8]
mov ecx, edi
imul ecx, ecx, 3
add eax, eax
cmp ecx, eax
jbe 0x8351dba1
push dword [ebp + 0x18]
xor esi, esi
push esi
push 5
call fcn.834f1760
and dword [ebp - 0x28], 0
test esi, esi
je 0x8351dcd7
mov dword [ebp - 4], ebx
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x28], eax
je 0x8351dcd4
mov eax, dword [ebp - 8]
shl eax, 3
lea ecx, [ebx + eax]
mov dword [ebp - 0x10], ecx
add ecx, eax
cmp dword [ebp - 0x14], 0
mov dword [ebp - 0xc], ecx
je 0x8351dc18
test esi, esi
je 0x8351dc04
push dword [ebp + 0x18]
push dword [ebp - 0x2c]
push 1
push dword [ebp - 0x18]
push ecx
call fcn.8351d29a
test eax, eax
je 0x8351dc04
push dword [ebp + 0x18]
push dword [ebp - 8]
push 2
push edi
push ebx
call fcn.8351d29a
test eax, eax
je 0x8351dc04
xor esi, esi
inc esi
jmp 0x8351dc06
xor esi, esi
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
shl eax, 3
and dword [ecx + eax + 4], 0
and dword [ecx + eax], 0
test edi, edi
je 0x8351dcbe
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x20], edx
mov edx, dword [ebp - 0xc]
sub dword [ebp - 0x1c], edx
sub edx, dword [ebp - 4]
mov eax, edi
imul eax, eax, 0xc
mov dword [ebp - 0x30], edx
mov edx, dword [ebp - 0xc]
sub edx, dword [ebp - 0x10]
add eax, ebx
mov dword [ebp - 0x3c], edx
mov edx, dword [ebp - 4]
sub edx, dword [ebp - 0x10]
lea ecx, [ebx + edi*8]
mov dword [ebp - 0x24], ecx
lea ecx, [ebx + edi*4]
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x38], edi
mov edx, dword [ecx]
mov ebx, dword [ebp - 0x1c]
mov dword [ebp - 0xc], edx
mov edx, dword [ebp - 0x30]
add edx, ecx
mov edx, dword [ebx + edx]
mov ebx, dword [ebp - 0x3c]
mov dword [ebp - 0x44], edx
mov edx, dword [ebp - 0x20]
mov ebx, dword [ebx + edx]
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp - 0x30]
add ebx, ecx
mov ebx, dword [ebx]
mov dword [ebp - 0x34], ebx
mov ebx, dword [ebp - 0x40]
mov ebx, dword [edx + ebx]
xor ebx, dword [edx]
mov edx, dword [ebp - 0x34]
xor edx, dword [ebp - 0x10]
xor ebx, dword [ebp - 0x10]
xor edx, dword [ebp - 0x44]
xor ebx, dword [ebp - 0xc]
xor edx, dword [ebp - 0xc]
mov dword [ecx], ebx
mov ebx, dword [ebp - 0x24]
mov dword [ebx], edx
mov edx, dword [ebp - 0x34]
mov dword [eax], edx
push 4
pop edx
add dword [ebp - 0x20], edx
add dword [ebp - 0x24], edx
add ecx, edx
add eax, edx
dec dword [ebp - 0x38]
jne 0x8351dc5a
mov ebx, dword [ebp - 4]
mov eax, dword [ebp + 0x14]
inc dword [ebp - 0x28]
shl eax, 3
add ebx, eax
mov dword [ebp - 4], ebx
test esi, esi
jne 0x8351dbb0
mov ebx, dword [ebp + 8]
and dword [ebp - 0x38], 0
test esi, esi
je 0x8351dd2e
cmp dword [ebp - 0x38], 0
je 0x8351dd2e
mov edi, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x8351dd2e
mov ecx, dword [ebp + 0x14]
shl ecx, 3
mov dword [ebp + 0x14], ecx
mov dword [ebp + 0x18], eax
lea edx, [edi - 1]
test edx, edx
je 0x8351dd26
lea eax, [ebx + 8]
lea ecx, [ebx + edi*8]
mov dword [ebp + 0x10], edx
mov edx, dword [ecx + 4]
mov dword [ebp + 8], edx
mov edx, dword [ecx]
xor dword [eax - 4], edx
mov edx, dword [ebp + 8]
xor dword [eax], edx
add ecx, 8
add eax, 8
dec dword [ebp + 0x10]
jne 0x8351dd0b
add ebx, dword [ebp + 0x14]
dec dword [ebp + 0x18]
jne 0x8351dcfb
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 0x14