Function at 0x10013680
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x1011c168
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x1016b2e8]
xor eax, esp
mov dword [esp + 0x38], eax
push ebx
push esi
push edi
mov eax, dword [0x1016b2e8]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x18], eax
xor eax, eax
mov esi, ecx
mov ebx, edx
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x44], 0xf
mov dword [esp + 0x40], eax
mov byte [esp + 0x30], al
lea edi, [esp + 0x2c]
mov dword [esp + 0x58], eax
call fcn.10009ee0
cmp byte [ebp + 0xc], 1
mov ebx, dword [ebx]
mov dword [esp + 0x14], ebx
jne 0x10013728
push ebx
push esi
mov eax, edi
call fcn.10014290
add esp, 8
test al, al
jne 0x10013720
cmp dword [esp + 0x44], 0x10
jb 0x10013719
mov ecx, dword [esp + 0x30]
push ecx
call fcn.100618cf
add esp, 4
xor al, al
jmp 0x1001394e
mov edx, dword [esp + 0x40]
mov dword [esp + 0x14], edx
mov esi, dword [esp + 0x18]
mov edi, dword [esi + 0x14]
add esi, 4
cmp dword [esi + 0xc], edi
jbe 0x1001373c
call fcn.10061d20
mov ebx, dword [esi + 0xc]
mov eax, dword [esi]
mov dword [esp + 0x24], eax
cmp ebx, dword [esi + 0x10]
jbe 0x1001374f
call fcn.10061d20
mov ecx, dword [esp + 0x24]
mov eax, dword [esi]
push edi
push ecx
push ebx
push eax
lea ebx, [esp + 0x34]
call fcn.10003910
cmp dword [ebp + 0x10], 6
jne 0x10013781
mov edx, dword [esp + 0x14]
add edx, 6
push edx
mov eax, esi
call fcn.10003840
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
jne 0x1001379c
jmp 0x100137a8
mov eax, dword [esp + 0x14]
add eax, 4
push eax
mov eax, esi
call fcn.10003840
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
jne 0x100137d5
xor ebx, ebx
jmp 0x100137e1
test eax, eax
ja 0x100137a5
call fcn.10061d20
mov eax, dword [esi + 0xc]
mov cx, word [esi + 0x10]
sub cx, word [esi + 0xc]
sub cx, 2
mov word [eax], cx
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
jne 0x100137c4
lea ebx, [eax + 2]
jmp 0x100137e1
test eax, eax
ja 0x100137cd
call fcn.10061d20
mov eax, dword [esi + 0xc]
lea ebx, [eax + 2]
jmp 0x100137e1
test eax, eax
ja 0x100137de
call fcn.10061d20
mov ebx, dword [esi + 0xc]
mov edi, dword [esp + 0x18]
mov ecx, dword [ebp + 0x10]
mov dl, byte [ebp + 0xc]
cmp ecx, 6
sete al
mov byte [edi + 0x1e], al
mov ax, word [0x1017818c]
inc ax
mov word [edi], ax
mov byte [edi + 0x1c], dl
mov byte [edi + 0x1d], 1
mov word [ebx], ax
movzx edx, byte [edi + 0x1c]
mov word [0x1017818c], ax
mov byte [ebx + 3], dl
movzx eax, byte [edi + 0x1e]
shl al, 6
xor al, byte [ebx + 2]
mov dword [esp + 0x18], 4
and al, 0x40
xor byte [ebx + 2], al
movzx edx, byte [edi + 0x1d]
mov al, byte [ebx + 2]
and al, 0x7f
shl dl, 7
or al, dl
mov byte [ebx + 2], al
cmp ecx, 6
jne 0x10013847
mov dword [esp + 0x18], ecx
cmp dword [esp + 0x1c], 0
je 0x10013935
mov eax, dword [esp + 0x20]
cmp dword [eax], 0
je 0x10013935
cmp byte [edi + 0x1c], 1
jne 0x100138b1
cmp dword [esp + 0x44], 0x10
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x20], ecx
jb 0x1001387e
mov edx, dword [esp + 0x30]
mov dword [esp + 0x1c], edx
jmp 0x10013886
lea eax, [esp + 0x30]
mov dword [esp + 0x1c], eax
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
je 0x1001389a
test eax, eax
ja 0x10013897
call fcn.10061d20
mov eax, dword [esi + 0xc]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
push ecx
mov ecx, dword [esp + 0x18]
push edx
mov edx, dword [esp + 0x20]
push ecx
add eax, edx
jmp 0x100138d6
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
je 0x100138c5
test eax, eax
ja 0x100138c2
call fcn.10061d20
mov eax, dword [esi + 0xc]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
push ecx
push edx
push ecx
mov ecx, dword [esp + 0x24]
add eax, ecx
push eax
call fcn.100618da
mov eax, dword [esi + 0x10]
add esp, 0x10
sub eax, dword [esi + 0xc]
jne 0x100138eb
xor esi, esi
jmp 0x100138f7
test eax, eax
ja 0x100138f4
call fcn.10061d20
mov esi, dword [esi + 0xc]
mov edx, dword [esp + 0x18]
add esi, edx
call fcn.10013a60
add eax, 4
test esi, esi
je 0x10013935
mov edx, dword [esp + 0x14]
cmp edx, 1
jl 0x10013935
test eax, eax
je 0x10013935
xor ecx, ecx
test edx, edx
jle 0x10013935
lea esp, [esp]
mov edx, ecx
and edx, 0x3ff
mov dl, byte [edx + eax]
xor byte [ecx + esi], dl
inc ecx
cmp ecx, dword [esp + 0x14]
jl 0x10013920
cmp dword [esp + 0x44], 0x10
mov dword [edi + 0x20], ebx
jb 0x1001394c
mov eax, dword [esp + 0x30]
push eax
call fcn.100618cf
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x38]
xor ecx, esp
call fcn.10061731
mov esp, ebp
pop ebp
ret 0xc