Function at 0x4ec420
Capabilities:
Encode data using xor

Disassembly:
sub esp, 4
push ebx
push esi
mov esi, dword [esp + 0x10]
push edi
mov edi, dword [esp + 0xc]
push ebp
mov dword [esi + 0x6a], 2
cmp dword [esi + 0x66], 0x106
jae 0x4ec465
push esi
call fcn.004ec310
add esp, 4
mov eax, dword [esi + 0x66]
cmp eax, 0x106
jae 0x4ec45d
cmp dword [esp + 0x1c], 0
je 0x4ec60c
test eax, eax
je 0x4ec619
cmp dword [esi + 0x66], 3
jb 0x4ec4a9
mov ebx, dword [esi + 0x5e]
mov ecx, dword [esi + 0x2a]
xor eax, eax
mov edx, dword [esi + 0x3a]
mov al, byte [ecx + ebx + 2]
mov cl, byte [esi + 0x4a]
shl edx, cl
xor eax, edx
mov ecx, dword [esi + 0x36]
and eax, dword [esi + 0x46]
xor edi, edi
mov dword [esi + 0x3a], eax
mov di, word [ecx + eax*2]
mov ecx, dword [esi + 0x26]
and ecx, ebx
mov eax, dword [esi + 0x32]
mov word [eax + ecx*2], di
mov ecx, dword [esi + 0x3a]
mov ebx, dword [esi + 0x5e]
mov edx, dword [esi + 0x36]
mov word [edx + ecx*2], bx
test edi, edi
je 0x4ec4dc
mov eax, dword [esi + 0x1e]
mov ecx, dword [esi + 0x5e]
sub eax, 0x106
sub ecx, edi
cmp eax, ecx
jb 0x4ec4dc
cmp dword [esi + 0x7a], 2
je 0x4ec4d1
push edi
push esi
call fcn.004ec1c0
add esp, 8
mov dword [esi + 0x52], eax
mov eax, dword [esi + 0x66]
cmp dword [esi + 0x52], eax
jbe 0x4ec4dc
mov dword [esi + 0x52], eax
mov eax, dword [esi + 0x52]
cmp eax, 3
jb 0x4ec597
sub eax, 3
push eax
mov eax, dword [esi + 0x5e]
sub eax, dword [esi + 0x62]
push eax
push esi
call fcn.004ef040
add esp, 0xc
mov edx, dword [esi + 0x52]
mov ecx, dword [esi + 0x66]
sub ecx, edx
cmp dword [esi + 0x72], edx
mov dword [esi + 0x66], ecx
jb 0x4ec565
cmp ecx, 3
jb 0x4ec565
dec edx
lea ebp, [esi + 0x2a]
mov dword [esi + 0x52], edx
mov ebx, dword [esi + 0x5e]
mov ecx, dword [ebp]
inc ebx
xor edx, edx
mov edi, dword [esi + 0x3a]
mov dword [esi + 0x5e], ebx
mov dl, byte [ecx + ebx + 2]
mov cl, byte [esi + 0x4a]
shl edi, cl
xor edx, edi
mov ecx, dword [esi + 0x36]
and edx, dword [esi + 0x46]
xor edi, edi
mov dword [esi + 0x3a], edx
mov di, word [ecx + edx*2]
mov edx, dword [esi + 0x26]
and edx, ebx
mov ecx, dword [esi + 0x32]
mov word [ecx + edx*2], di
mov edx, dword [esi + 0x5e]
mov ebx, dword [esi + 0x3a]
mov ecx, dword [esi + 0x36]
mov word [ecx + ebx*2], dx
mov ecx, dword [esi + 0x52]
dec ecx
mov dword [esi + 0x52], ecx
jne 0x4ec518
jmp 0x4ec5b4
mov ecx, dword [esi + 0x5e]
lea ebp, [esi + 0x2a]
mov dword [esi + 0x52], 0
add ecx, edx
mov ebx, dword [ebp]
add ebx, ecx
xor edx, edx
mov dword [esi + 0x5e], ecx
mov cl, byte [esi + 0x4a]
mov dl, byte [ebx]
mov dword [esi + 0x3a], edx
shl edx, cl
xor ecx, ecx
mov cl, byte [ebx + 1]
xor edx, ecx
and edx, dword [esi + 0x46]
mov dword [esi + 0x3a], edx
jmp 0x4ec5b7
lea ebp, [esi + 0x2a]
mov edx, dword [esi + 0x5e]
xor eax, eax
mov ecx, dword [ebp]
mov al, byte [ecx + edx]
push eax
push 0
push esi
call fcn.004ef040
add esp, 0xc
dec dword [esi + 0x66]
inc dword [esi + 0x5e]
test eax, eax
je 0x4ec436
mov edx, dword [esi + 0x4e]
mov eax, 0
test edx, edx
jl 0x4ec5d0
mov eax, dword [ebp]
add eax, edx
push 0
mov ecx, dword [esi + 0x5e]
sub ecx, edx
push ecx
push eax
push esi
call fcn.004eee30
add esp, 0x10
mov ecx, dword [esi + 0x5e]
mov edx, dword [esi]
mov dword [esi + 0x4e], ecx
push edx
call fcn.004ebda0
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], 0
jne 0x4ec436
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edx, dword [esi + 0x4e]
mov ecx, 0
test edx, edx
jl 0x4ec62a
mov ecx, dword [esi + 0x2a]
add ecx, edx
mov eax, dword [esp + 0x1c]
sub eax, 4
cmp eax, 1
sbb eax, eax
neg eax
push eax
mov eax, dword [esi + 0x5e]
sub eax, edx
push eax
push ecx
push esi
call fcn.004eee30
add esp, 0x10
mov ecx, dword [esi + 0x5e]
mov edx, dword [esi]
mov dword [esi + 0x4e], ecx
push edx
call fcn.004ebda0
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], 1
sbb eax, eax
pop ebp
neg eax
pop edi
pop esi
pop ebx
add esp, 4
ret