Function at 0x10012760
Capabilities:
Encode data using xor

Disassembly:
push ebx
push ebp
push esi
mov esi, dword [esp + 0x10]
push edi
xor edi, edi
mov eax, dword [esi + 0x82]
mov dword [esi + 0x72], 2
test eax, eax
je 0x1001294c
mov ebx, 0x106
cmp dword [esi], 0
jne 0x1001294c
mov edx, dword [esi + 0x76]
mov eax, dword [esi + 0x4e]
xor ecx, ecx
mov ebp, dword [esi + 0x56]
mov cl, byte [eax + edx + 2]
and edx, 0x7fff
mov eax, ecx
mov ecx, dword [esi + 0x6e]
and ecx, 0x1ff
and eax, 0x3fff
shl ecx, 5
xor eax, ecx
xor ecx, ecx
mov dword [esi + 0x6e], eax
mov cx, word [ebp + eax*2]
mov eax, dword [esi + 0x52]
test ecx, ecx
mov word [eax + edx*2], cx
mov edx, dword [esi + 0x6e]
mov eax, dword [esi + 0x56]
mov bp, word [esi + 0x76]
mov word [eax + edx*2], bp
je 0x100127ff
mov edx, dword [esi + 0x76]
sub edx, ecx
cmp edx, 0x7efa
ja 0x100127ff
push esi
push ecx
call fcn.100124f0
mov edi, eax
mov eax, dword [esi + 0x82]
add esp, 8
cmp edi, eax
jbe 0x100127ff
mov edi, eax
cmp edi, 3
push esi
jb 0x100128c4
mov ecx, dword [esi + 0x76]
lea eax, [edi - 3]
push eax
mov eax, dword [esi + 0x7a]
sub ecx, eax
push ecx
call fcn.10013b10
mov ecx, dword [esi + 0x82]
mov ebp, eax
mov eax, dword [esi + 0x8a]
add esp, 0xc
sub ecx, edi
cmp edi, eax
mov dword [esi + 0x82], ecx
ja 0x10012894
dec edi
mov ecx, dword [esi + 0x76]
mov eax, dword [esi + 0x4e]
inc ecx
mov ebx, dword [esi + 0x52]
mov dword [esi + 0x76], ecx
mov edx, ecx
xor ecx, ecx
mov cl, byte [eax + edx + 2]
mov eax, dword [esi + 0x6e]
and eax, 0x1ff
and ecx, 0x3fff
shl eax, 5
xor ecx, eax
mov eax, dword [esi + 0x56]
mov dword [esi + 0x6e], ecx
and edx, 0x7fff
mov cx, word [eax + ecx*2]
dec edi
mov word [ebx + edx*2], cx
mov edx, dword [esi + 0x6e]
mov eax, dword [esi + 0x56]
mov cx, word [esi + 0x76]
mov word [eax + edx*2], cx
jne 0x10012839
mov eax, dword [esi + 0x76]
mov ebx, 0x106
inc eax
mov dword [esi + 0x76], eax
jmp 0x100128f0
mov eax, dword [esi + 0x76]
mov edx, dword [esi + 0x4e]
add eax, edi
xor ecx, ecx
add edx, eax
mov dword [esi + 0x76], eax
xor eax, eax
xor edi, edi
mov cl, byte [edx]
mov dword [esi + 0x6e], ecx
mov al, byte [edx + 1]
and ecx, 0x1ff
and eax, 0x3fff
shl ecx, 5
xor eax, ecx
mov dword [esi + 0x6e], eax
jmp 0x100128f0
mov ecx, dword [esi + 0x4e]
mov edx, dword [esi + 0x76]
xor eax, eax
mov al, byte [ecx + edx]
push eax
push 0
call fcn.10013b10
mov ecx, dword [esi + 0x82]
mov ebp, eax
mov eax, dword [esi + 0x76]
add esp, 0xc
dec ecx
inc eax
mov dword [esi + 0x82], ecx
mov dword [esi + 0x76], eax
test ebp, ebp
je 0x1001291c
mov ecx, dword [esi + 0x66]
test ecx, ecx
jl 0x10012902
mov eax, dword [esi + 0x4e]
add eax, ecx
jmp 0x10012904
xor eax, eax
mov edx, dword [esi + 0x76]
push esi
sub edx, ecx
push 0
push edx
push eax
call fcn.10013860
mov eax, dword [esi + 0x76]
add esp, 0x10
mov dword [esi + 0x66], eax
cmp dword [esi + 0x82], ebx
jae 0x1001293e
mov eax, dword [esi + 0x7e]
test eax, eax
jne 0x1001293e
push esi
call fcn.10012640
mov eax, dword [esi + 0x82]
add esp, 4
cmp eax, ebx
jb 0x10012924
mov eax, dword [esi + 0x82]
test eax, eax
jne 0x10012784
mov ecx, dword [esi + 0x66]
test ecx, ecx
jl 0x1001295a
mov eax, dword [esi + 0x4e]
add eax, ecx
jmp 0x1001295c
xor eax, eax
mov edx, dword [esi + 0x76]
push esi
sub edx, ecx
push 1
push edx
push eax
call fcn.10013860
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
ret