Function at 0x415410
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 0x415447
mov ecx, esi
call fcn.00413de0
mov eax, dword [esi + 0x6c]
mov ebp, dword [esp + 0x14]
cmp eax, 0x106
jae 0x41543f
test ebp, ebp
je 0x41564a
test eax, eax
je 0x4155e3
cmp eax, 3
jb 0x41548d
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 0x4154b6
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x1c]
sub edx, edi
sub eax, 0x106
cmp edx, eax
ja 0x4154b6
cmp dword [esi + 0x80], 2
je 0x4154b6
push edi
mov ecx, esi
call fcn.00415660
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x58]
cmp eax, 3
jb 0x415579
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.004157d0
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 0x415545
cmp edx, 3
jb 0x415545
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 0x4154f3
jmp 0x415597
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 0x41559a
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.004157d0
mov ecx, dword [esi + 0x6c]
mov ebp, eax
dec ecx
mov dword [esi + 0x6c], ecx
inc dword [esi + 0x64]
test ebp, ebp
je 0x415418
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x4155b2
mov edx, dword [esi + 0x28]
mov eax, ecx
add eax, edx
jmp 0x4155b4
xor eax, eax
mov edx, dword [esi + 0x64]
push 0
sub edx, ecx
mov ecx, esi
push edx
push eax
call fcn.00413f20
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0040f530
mov ecx, dword [esi + 4]
call fcn.0040f460
test eax, eax
je 0x41564a
jmp 0x415418
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x4155f1
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x4155f3
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.00413f20
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0040f530
mov ecx, dword [esi + 4]
call fcn.0040f460
test eax, eax
jne 0x415635
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