Function at 0x46ec50
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5f0
mov eax, dword [0x4ea5e0]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x18]
mov ebx, ecx
mov esi, edx
mov dword [ebp - 0x56c], eax
mov dword [ebp - 0x594], esi
mov dword [ebp - 0x59c], edi
cmp ebx, 0x100
jbe 0x46ec98
mov eax, dword [eax + 0x400]
mov dword [ebp - 0x5a0], eax
jmp 0x46eca2
mov dword [ebp - 0x5a0], 0x10
push 0x44
lea ecx, [ebp - 0x54]
push 0
push ecx
call fcn.004b2d10
mov ecx, dword [ebp - 0x56c]
add esp, 0xc
mov edx, ebx
lea ebx, [ebx]
mov eax, dword [ecx]
inc dword [ebp + eax*4 - 0x54]
lea eax, [ebp + eax*4 - 0x54]
add ecx, 4
dec edx
jne 0x46ecc0
cmp dword [ebp - 0x54], ebx
jne 0x46ecec
mov dword [esi], edx
mov dword [edi], edx
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004a8a2f
mov esp, ebp
pop ebp
ret
mov ecx, 1
cmp dword [ebp + ecx*4 - 0x54], 0
jne 0x46ecfe
inc ecx
cmp ecx, 0x10
jbe 0x46ecf1
mov dword [ebp - 0x568], ecx
cmp dword [edi], ecx
jae 0x46ed0a
mov dword [edi], ecx
mov eax, 0x10
nop
cmp dword [ebp + eax*4 - 0x54], 0
jne 0x46ed1a
dec eax
jne 0x46ed10
mov dword [ebp - 0x58c], eax
cmp dword [edi], eax
jbe 0x46ed26
mov dword [edi], eax
mov edx, 1
shl edx, cl
cmp ecx, eax
jae 0x46ed42
sub edx, dword [ebp + ecx*4 - 0x54]
js 0x46ee44
inc ecx
add edx, edx
cmp ecx, eax
jb 0x46ed31
lea edi, [eax*4]
mov ecx, dword [ebp + edi - 0x54]
sub edx, ecx
mov dword [ebp - 0x5a4], edx
js 0x46ee44
add ecx, edx
mov dword [ebp + edi - 0x54], ecx
xor ecx, ecx
dec eax
mov dword [ebp - 0xe0], ecx
je 0x46ed81
xor edx, edx
mov edi, edi
add ecx, dword [ebp + edx - 0x50]
add edx, 4
dec eax
mov dword [ebp + edx - 0xe0], ecx
jne 0x46ed70
push 0x480
lea edx, [ebp - 0x564]
push 0
push edx
call fcn.004b2d10
mov esi, dword [ebp - 0x56c]
add esp, 0xc
xor edx, edx
mov eax, dword [esi]
add esi, 4
test eax, eax
je 0x46edc0
mov ecx, dword [ebp + eax*4 - 0xe4]
lea eax, [ebp + eax*4 - 0xe4]
mov dword [ebp + ecx*4 - 0x564], edx
inc ecx
mov dword [eax], ecx
inc edx
cmp edx, ebx
jb 0x46ed9f
mov eax, dword [ebp + edi - 0xe4]
mov edx, dword [ebp - 0x58c]
lea ecx, [ebp - 0x564]
xor edi, edi
mov dword [ebp - 0x574], ecx
mov ecx, dword [ebp - 0x568]
mov dword [ebp - 0x5ac], eax
xor eax, eax
or esi, 0xffffffff
xor ebx, ebx
mov dword [ebp - 0x584], edi
mov dword [ebp - 0xe4], edi
mov dword [ebp - 0x9c], edi
mov dword [ebp - 0x5ec], eax
mov dword [ebp - 0x598], eax
mov dword [ebp - 0x588], eax
cmp ecx, edx
jg 0x46f14e
lea eax, [ebp + ecx*4 - 0x54]
mov dword [ebp - 0x580], eax
mov eax, dword [ebp - 0x580]
mov eax, dword [eax]
test eax, eax
je 0x46f136
lea edx, [eax + 1]
mov dword [ebp - 0x590], edx
jmp 0x46ee66
mov eax, 2
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004a8a2f
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x56c]
dec dword [ebp - 0x590]
dec eax
mov dword [ebp - 0x56c], eax
mov eax, dword [ebp + esi*4 - 0x98]
add eax, ebx
cmp ecx, eax
jle 0x46eff8
lea edx, [ebp - 0x5ec]
sub edx, 4
mov dword [ebp - 0x5a8], edx
jmp 0x46eea0
mov edx, dword [ebp - 0x58c]
mov edi, eax
mov eax, dword [ebp - 0x59c]
mov eax, dword [eax]
sub edx, edi
inc esi
mov dword [ebp - 0x570], edi
cmp edx, eax
jbe 0x46eebf
mov edx, eax
mov ebx, ecx
sub ebx, edi
mov eax, 1
mov ecx, ebx
shl eax, cl
cmp eax, dword [ebp - 0x590]
jbe 0x46ef09
mov edi, dword [ebp - 0x580]
or ecx, 0xffffffff
sub ecx, dword [ebp - 0x56c]
inc ebx
add eax, ecx
cmp ebx, edx
jae 0x46ef03
lea ebx, [ebx]
mov ecx, dword [edi + 4]
add edi, 4
add eax, eax
cmp eax, ecx
jbe 0x46ef03
inc ebx
sub eax, ecx
cmp ebx, edx
jb 0x46eef0
mov edi, dword [ebp - 0x570]
mov eax, dword [ebp - 0x5a0]
lea edx, [edi + ebx]
cmp edx, eax
jbe 0x46ef1e
cmp edi, eax
jae 0x46ef1e
mov ebx, eax
sub ebx, edi
mov ecx, ebx
mov eax, 1
shl eax, cl
mov dword [ebp + esi*4 - 0x98], ebx
mov dword [ebp - 0x588], eax
lea eax, [eax*8 + 8]
push eax
call fcn.004aa188
add esp, 4
test eax, eax
je 0x46f17f
mov edx, dword [ebp - 0x594]
lea ecx, [eax + 8]
add eax, 4
mov dword [edx], ecx
mov edx, dword [ebp - 0x570]
mov dword [ebp - 0x594], eax
mov dword [eax], 0
mov eax, ecx
mov dword [ebp - 0x598], eax
mov dword [ebp + esi*4 - 0x5ec], eax
test esi, esi
je 0x46efd5
mov cl, byte [ebp + esi*4 - 0x9c]
mov edi, dword [ebp - 0x584]
add bl, 0x20
mov byte [ebp - 0x57b], cl
mov byte [ebp - 0x57c], bl
mov ebx, eax
mov ecx, edx
mov eax, 1
shl eax, cl
sub ecx, dword [ebp + esi*4 - 0x9c]
mov dword [ebp + esi*4 - 0xe4], edi
mov dword [ebp - 0x578], ebx
dec eax
and eax, edi
mov edi, dword [ebp - 0x57c]
shr eax, cl
mov ecx, dword [ebp - 0x5a8]
mov ecx, dword [ecx + esi*4]
mov dword [ecx + eax*8], edi
mov dword [ecx + eax*8 + 4], ebx
mov eax, dword [ebp + esi*4 - 0x98]
mov ecx, dword [ebp - 0x568]
add eax, edx
cmp ecx, eax
jg 0x46eea0
mov ebx, dword [ebp - 0x570]
mov edi, dword [ebp - 0x584]
mov eax, dword [ebp - 0x5ac]
mov dl, cl
sub dl, bl
mov byte [ebp - 0x57b], dl
lea edx, [ebp + eax*4 - 0x564]
mov eax, dword [ebp - 0x574]
cmp eax, edx
jb 0x46f022
mov byte [ebp - 0x57c], 0x63
jmp 0x46f079
mov eax, dword [eax]
mov edx, dword [ebp + 0xc]
cmp eax, edx
jae 0x46f056
cmp eax, 0x100
setb al
add al, 0x1f
mov byte [ebp - 0x57c], al
mov eax, dword [ebp - 0x574]
mov dx, word [eax]
add eax, 4
mov word [ebp - 0x578], dx
mov dword [ebp - 0x574], eax
jmp 0x46f079
sub eax, edx
mov edx, dword [ebp + 0x14]
mov dl, byte [eax + edx]
add dword [ebp - 0x574], 4
mov byte [ebp - 0x57c], dl
mov edx, dword [ebp + 0x10]
mov ax, word [edx + eax*2]
mov word [ebp - 0x578], ax
sub ecx, ebx
mov edx, 1
shl edx, cl
mov eax, edi
mov ecx, ebx
shr eax, cl
cmp eax, dword [ebp - 0x588]
jae 0x46f0c3
mov ecx, dword [ebp - 0x598]
lea ecx, [ecx + eax*8]
mov edi, dword [ebp - 0x57c]
mov dword [ecx], edi
mov edi, dword [ebp - 0x578]
mov dword [ecx + 4], edi
lea edi, [edx*8]
add eax, edx
add ecx, edi
cmp eax, dword [ebp - 0x588]
jb 0x46f099
mov edi, dword [ebp - 0x584]
mov ecx, dword [ebp - 0x568]
dec ecx
mov eax, 1
shl eax, cl
test edi, eax
je 0x46f0dd
xor edi, eax
shr eax, 1
test edi, eax
jne 0x46f0d5
mov edx, 1
mov ecx, ebx
shl edx, cl
xor edi, eax
mov dword [ebp - 0x584], edi
dec edx
and edx, edi
cmp edx, dword [ebp + esi*4 - 0xe4]
je 0x46f11d
lea ebx, [ebx]
sub ebx, dword [ebp + esi*4 - 0x9c]
dec esi
mov eax, 1
mov ecx, ebx
shl eax, cl
dec eax
and eax, edi
cmp eax, dword [ebp + esi*4 - 0xe4]
jne 0x46f100
cmp dword [ebp - 0x56c], 0
mov ecx, dword [ebp - 0x568]
jne 0x46ee60
mov edx, dword [ebp - 0x58c]
add dword [ebp - 0x580], 4
inc ecx
mov dword [ebp - 0x568], ecx
cmp ecx, edx
jle 0x46ee29
xor eax, eax
mov ecx, dword [ebp - 0x98]
mov esi, dword [ebp - 0x59c]
mov dword [esi], ecx
cmp dword [ebp - 0x5a4], eax
je 0x46f16e
cmp edx, 1
je 0x46f16e
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004a8a2f
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x46f1a5
mov eax, dword [ebp - 0x5ec]
test eax, eax
je 0x46f1a5
lea ecx, [ecx]
mov esi, dword [eax - 4]
sub eax, 8
push eax
call fcn.004aa14e
add esp, 4
mov eax, esi
test esi, esi
jne 0x46f190
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov eax, 3
pop ebx
call fcn.004a8a2f
mov esp, ebp
pop ebp
ret