Function at 0x412dd0
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 0x412e07
mov ecx, esi
call fcn.004117a0
mov eax, dword [esi + 0x6c]
mov ebp, dword [esp + 0x14]
cmp eax, 0x106
jae 0x412dff
test ebp, ebp
je 0x41300a
test eax, eax
je 0x412fa3
cmp eax, 3
jb 0x412e4d
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 0x412e76
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x1c]
sub edx, edi
sub eax, 0x106
cmp edx, eax
ja 0x412e76
cmp dword [esi + 0x80], 2
je 0x412e76
push edi
mov ecx, esi
call fcn.00413020
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x58]
cmp eax, 3
jb 0x412f39
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.00413190
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 0x412f05
cmp edx, 3
jb 0x412f05
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 0x412eb3
jmp 0x412f57
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 0x412f5a
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.00413190
mov ecx, dword [esi + 0x6c]
mov ebp, eax
dec ecx
mov dword [esi + 0x6c], ecx
inc dword [esi + 0x64]
test ebp, ebp
je 0x412dd8
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x412f72
mov edx, dword [esi + 0x28]
mov eax, ecx
add eax, edx
jmp 0x412f74
xor eax, eax
mov edx, dword [esi + 0x64]
push 0
sub edx, ecx
mov ecx, esi
push edx
push eax
call fcn.004118e0
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0040e4f0
mov ecx, dword [esi + 4]
call fcn.0040e420
test eax, eax
je 0x41300a
jmp 0x412dd8
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x412fb1
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x412fb3
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.004118e0
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0040e4f0
mov ecx, dword [esi + 4]
call fcn.0040e420
test eax, eax
jne 0x412ff5
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