Function at 0x413250
Capabilities:
Encode data using xor

Disassembly:
push ebx
push ebp
push esi
push edi
mov esi, ecx
xor edi, edi
mov eax, dword [esi + 0x6c]
cmp eax, 0x106
jae 0x413287
mov ecx, esi
call fcn.00411c20
mov eax, dword [esi + 0x6c]
mov ebp, dword [esp + 0x14]
cmp eax, 0x106
jae 0x41327f
test ebp, ebp
je 0x41348a
test eax, eax
je 0x413423
cmp eax, 3
jb 0x4132cd
mov eax, dword [esi + 0x40]
mov ecx, dword [esi + 0x50]
mov edx, dword [esi + 0x64]
mov edi, dword [esi + 0x4c]
shl eax, cl
mov ecx, dword [esi + 0x28]
xor ebx, ebx
mov bl, byte [ecx + edx + 2]
mov ecx, dword [esi + 0x38]
xor eax, ebx
and eax, edi
xor edi, edi
mov dword [esi + 0x40], eax
mov di, word [ecx + eax*2]
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x30]
and eax, edx
mov word [ecx + eax*2], di
mov edx, dword [esi + 0x40]
mov eax, dword [esi + 0x38]
mov cx, word [esi + 0x64]
mov word [eax + edx*2], cx
test edi, edi
je 0x4132f6
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x1c]
sub edx, edi
sub eax, 0x106
cmp edx, eax
ja 0x4132f6
cmp dword [esi + 0x80], 2
je 0x4132f6
push edi
mov ecx, esi
call fcn.004134a0
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x58]
cmp eax, 3
jb 0x4133b9
mov ecx, dword [esi + 0x64]
mov ebp, dword [esi + 0x68]
add eax, 0xfffffffd
sub ecx, ebp
push eax
push ecx
mov ecx, esi
call fcn.00413610
mov ecx, dword [esi + 0x58]
mov edx, dword [esi + 0x6c]
mov ebp, eax
mov eax, dword [esi + 0x78]
sub edx, ecx
cmp ecx, eax
mov dword [esi + 0x6c], edx
ja 0x413385
cmp edx, 3
jb 0x413385
dec ecx
mov dword [esi + 0x58], ecx
mov ebx, dword [esi + 0x64]
mov edx, dword [esi + 0x28]
mov ecx, dword [esi + 0x50]
inc ebx
xor eax, eax
mov dword [esi + 0x64], ebx
mov al, byte [ebx + edx + 2]
mov edi, dword [esi + 0x4c]
mov edx, eax
mov eax, dword [esi + 0x40]
shl eax, cl
mov ecx, dword [esi + 0x38]
xor edx, eax
mov eax, dword [esi + 0x30]
and edx, edi
xor edi, edi
mov dword [esi + 0x40], edx
mov di, word [ecx + edx*2]
mov edx, dword [esi + 0x24]
and edx, ebx
mov word [eax + edx*2], di
mov ecx, dword [esi + 0x40]
mov edx, dword [esi + 0x38]
mov ax, word [esi + 0x64]
mov word [edx + ecx*2], ax
mov eax, dword [esi + 0x58]
dec eax
mov dword [esi + 0x58], eax
jne 0x413333
jmp 0x4133d7
mov edx, dword [esi + 0x64]
mov dword [esi + 0x58], 0
add edx, ecx
xor eax, eax
mov dword [esi + 0x64], edx
mov ecx, edx
mov edx, dword [esi + 0x28]
lea ebx, [ecx + edx]
mov ecx, dword [esi + 0x50]
xor edx, edx
mov dl, byte [ebx]
mov dword [esi + 0x40], edx
mov al, byte [ebx + 1]
shl edx, cl
xor edx, eax
mov eax, dword [esi + 0x4c]
and edx, eax
mov dword [esi + 0x40], edx
jmp 0x4133da
mov ecx, dword [esi + 0x64]
mov edx, dword [esi + 0x28]
xor eax, eax
mov al, byte [ecx + edx]
mov ecx, esi
push eax
push 0
call fcn.00413610
mov ecx, dword [esi + 0x6c]
mov ebp, eax
dec ecx
mov dword [esi + 0x6c], ecx
inc dword [esi + 0x64]
test ebp, ebp
je 0x413258
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x4133f2
mov edx, dword [esi + 0x28]
mov eax, ecx
add eax, edx
jmp 0x4133f4
xor eax, eax
mov edx, dword [esi + 0x64]
push 0
sub edx, ecx
mov ecx, esi
push edx
push eax
call fcn.00411d60
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0040e970
mov ecx, dword [esi + 4]
call fcn.0040e8a0
test eax, eax
je 0x41348a
jmp 0x413258
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x413431
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x413433
xor eax, eax
xor edx, edx
cmp ebp, 4
sete dl
push edx
mov edx, dword [esi + 0x64]
sub edx, ecx
mov ecx, esi
push edx
push eax
call fcn.00411d60
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0040e970
mov ecx, dword [esi + 4]
call fcn.0040e8a0
test eax, eax
jne 0x413475
cmp ebp, 4
pop edi
setne al
dec eax
pop esi
pop ebp
and eax, 2
pop ebx
ret 4
mov eax, ebp
pop edi
sub eax, 4
pop esi
neg eax
sbb eax, eax
pop ebp
and al, 0xfe
pop ebx
add eax, 3
ret 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret 4