Function at 0x642790
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 0x6427c7
mov ecx, esi
call fcn.00641160
mov eax, dword [esi + 0x6c]
mov ebp, dword [esp + 0x14]
cmp eax, 0x106
jae 0x6427bf
test ebp, ebp
je 0x6429c8
test eax, eax
je 0x642961
cmp eax, 3
jb 0x64280d
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 0x642836
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x1c]
sub edx, edi
sub eax, 0x106
cmp edx, eax
ja 0x642836
cmp dword [esi + 0x80], 2
je 0x642836
push edi
mov ecx, esi
call fcn.006429e0
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x58]
cmp eax, 3
jb 0x6428f9
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.00642d90
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 0x6428c5
cmp edx, 3
jb 0x6428c5
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 0x642873
jmp 0x642917
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 0x64291a
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.00642d90
mov ecx, dword [esi + 0x6c]
mov ebp, eax
dec ecx
mov dword [esi + 0x6c], ecx
inc dword [esi + 0x64]
test ebp, ebp
je 0x642798
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x642932
mov edx, dword [esi + 0x28]
mov eax, ecx
add eax, edx
jmp 0x642934
xor eax, eax
mov edx, dword [esi + 0x64]
push 0
sub edx, ecx
mov ecx, esi
push edx
push eax
call fcn.006412a0
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0063c3f0
mov ecx, dword [esi + 4]
mov eax, dword [ecx + 0x24]
test eax, eax
je 0x6429c8
jmp 0x642798
mov ecx, dword [esi + 0x54]
test ecx, ecx
jl 0x64296f
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x642971
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.006412a0
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0063c3f0
mov ecx, dword [esi + 4]
mov eax, dword [ecx + 0x24]
test eax, eax
jne 0x6429b3
xor eax, eax
cmp ebp, 4
setne al
pop edi
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