Function at 0x10012980
Capabilities:
Encode data using xor

Disassembly:
push ebp
push esi
mov esi, dword [esp + 0xc]
xor ebp, ebp
push edi
mov edi, 2
cmp dword [esi + 0x4e54], 3
jg 0x100129a4
push esi
call fcn.10012760
add esp, 4
pop edi
pop esi
pop ebp
ret
mov eax, dword [esi + 0x82]
test eax, eax
je 0x10012bf4
push ebx
cmp dword [esi], 0
jne 0x10012bd7
mov edx, dword [esi + 0x76]
mov eax, dword [esi + 0x4e]
xor ecx, ecx
mov ebx, dword [esi + 0x56]
mov cl, byte [edx + eax + 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 [ebx + 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 bx, word [esi + 0x76]
mov word [eax + edx*2], bx
mov ebx, dword [esi + 0x7a]
mov dword [esi + 0x72], edi
mov edi, 2
je 0x10012a5e
mov edx, dword [esi + 0x72]
mov eax, dword [esi + 0x8a]
cmp edx, eax
jae 0x10012a5e
mov eax, dword [esi + 0x76]
sub eax, ecx
cmp eax, 0x7efa
ja 0x10012a5e
push esi
push ecx
call fcn.100124f0
mov edi, eax
mov eax, dword [esi + 0x82]
add esp, 8
cmp edi, eax
jbe 0x10012a44
mov edi, eax
cmp edi, 3
jne 0x10012a5e
mov ecx, dword [esi + 0x76]
mov edx, dword [esi + 0x7a]
sub ecx, edx
cmp ecx, 0x1000
jbe 0x10012a5e
mov edi, 2
mov eax, dword [esi + 0x72]
cmp eax, 3
jb 0x10012b3b
cmp edi, eax
ja 0x10012b3b
mov edx, dword [esi + 0x76]
add eax, 0xfffffffd
sub edx, ebx
push esi
dec edx
push eax
push edx
call fcn.10013b10
mov ecx, dword [esi + 0x72]
mov edi, dword [esi + 0x82]
mov edx, 1
add esp, 0xc
sub edx, ecx
add edi, edx
add ecx, 0xfffffffe
mov dword [esi + 0x82], edi
mov dword [esi + 0x72], ecx
mov ebx, dword [esi + 0x76]
mov ecx, dword [esi + 0x4e]
mov edi, dword [esi + 0x6e]
inc ebx
mov dword [esi + 0x76], ebx
mov edx, ebx
xor ebx, ebx
and edi, 0x1ff
mov bl, byte [edx + ecx + 2]
and edx, 0x7fff
mov ecx, ebx
mov ebx, dword [esi + 0x52]
and ecx, 0x3fff
shl edi, 5
xor ecx, edi
mov edi, dword [esi + 0x56]
mov dword [esi + 0x6e], ecx
mov cx, word [edi + ecx*2]
mov word [ebx + edx*2], cx
mov edx, dword [esi + 0x6e]
mov ecx, dword [esi + 0x56]
mov di, word [esi + 0x76]
mov word [ecx + edx*2], di
mov ecx, dword [esi + 0x72]
dec ecx
mov dword [esi + 0x72], ecx
jne 0x10012aa4
mov ebx, dword [esi + 0x76]
xor ebp, ebp
inc ebx
mov edi, 2
test eax, eax
mov dword [esi + 0x76], ebx
mov ecx, ebx
je 0x10012ba0
mov edx, dword [esi + 0x66]
test edx, edx
jl 0x10012b22
mov ebx, dword [esi + 0x4e]
mov eax, edx
add eax, ebx
jmp 0x10012b24
xor eax, eax
push esi
sub ecx, edx
push 0
push ecx
push eax
call fcn.10013860
mov edx, dword [esi + 0x76]
add esp, 0x10
mov dword [esi + 0x66], edx
jmp 0x10012ba0
test ebp, ebp
je 0x10012b87
mov eax, dword [esi + 0x76]
mov ecx, dword [esi + 0x4e]
xor edx, edx
push esi
mov dl, byte [eax + ecx - 1]
push edx
push 0
call fcn.10013b10
add esp, 0xc
test eax, eax
je 0x10012b8c
mov ecx, dword [esi + 0x66]
test ecx, ecx
jl 0x10012b6b
mov edx, dword [esi + 0x4e]
mov eax, ecx
add eax, edx
jmp 0x10012b6d
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
jmp 0x10012b8c
mov ebp, 1
mov ecx, dword [esi + 0x76]
mov eax, dword [esi + 0x82]
inc ecx
dec eax
mov dword [esi + 0x76], ecx
mov dword [esi + 0x82], eax
mov eax, dword [esi + 0x82]
mov ebx, 0x106
cmp eax, ebx
jae 0x10012bc9
mov eax, dword [esi + 0x7e]
test eax, eax
jne 0x10012bc9
push esi
call fcn.10012640
mov eax, dword [esi + 0x82]
add esp, 4
cmp eax, ebx
jb 0x10012baf
mov eax, dword [esi + 0x82]
test eax, eax
jne 0x100129b3
test ebp, ebp
pop ebx
je 0x10012bf4
mov ecx, dword [esi + 0x76]
mov edx, dword [esi + 0x4e]
xor eax, eax
push esi
mov al, byte [ecx + edx - 1]
push eax
push 0
call fcn.10013b10
add esp, 0xc
mov ecx, dword [esi + 0x66]
test ecx, ecx
jl 0x10012c02
mov eax, dword [esi + 0x4e]
add eax, ecx
jmp 0x10012c04
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
ret