Function at 0x46c490
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0xec8960]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov ebx, edx
mov esi, ecx
push 0x40001
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], esi
call fcn.004977d8
push ebx
mov edi, eax
lea eax, [ebp - 0xc]
push 1
push eax
push str.read
mov dword [ebp - 0x14], edi
call esi
add esp, 0x14
cmp eax, 1
je 0x46c4e1
test eax, eax
mov ebx, 0xfffffffa
cmovs ebx, eax
jmp 0x46c6be
mov al, byte [ebp - 0xc]
test al, al
jne 0x46c53a
push ebx
push 0x40000
push edi
push str.read
call esi
add esp, 0x10
mov ebx, eax
test eax, eax
jle 0x46c6be
push dword [ebp - 0x1c]
push eax
push edi
push str.write
call esi
mov ebx, eax
add esp, 0x10
test ebx, ebx
js 0x46c6be
push dword [ebp - 0x1c]
push 0x40000
push edi
push str.read
call esi
add esp, 0x10
mov ebx, eax
test eax, eax
jg 0x46c503
jmp 0x46c6be
test al, 0xfe
je 0x46c548
mov ebx, 0xfffffff9
jmp 0x46c6be
push ebx
push 2
lea eax, [ebp - 0xb]
push eax
push str.read
call esi
add esp, 0x10
cmp eax, 2
je 0x46c56d
test eax, eax
mov ebx, 0xfffffffa
cmovs ebx, eax
jmp 0x46c6be
push ebx
push 4
lea eax, [ebp - 8]
push eax
push str.read
call esi
add esp, 0x10
cmp eax, 4
je 0x46c592
test eax, eax
mov ebx, 0xfffffffa
cmovs ebx, eax
jmp 0x46c6be
mov esi, dword [ebp - 8]
push esi
call fcn.004977d8
add esp, 4
mov dword [ebp - 0x24], eax
test esi, esi
je 0x46c5c8
push ebx
mov ebx, dword [ebp - 0x20]
push esi
push eax
push str.read
call ebx
add esp, 0x10
cmp eax, esi
je 0x46c5cd
test eax, eax
mov ebx, 0xfffffffa
cmovs ebx, eax
jmp 0x46c6ae
mov ebx, dword [ebp - 0x20]
jmp 0x46c5d0
mov eax, dword [ebp - 0x24]
test esi, esi
je 0x46c5ed
push dword [ebp - 0x1c]
push esi
push eax
push str.write
call ebx
mov ebx, eax
add esp, 0x10
test ebx, ebx
js 0x46c6ae
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x46c604
push eax
call fcn.0048e011
add esp, 4
mov dword [ebp - 0x24], 0
movzx ecx, byte [ebp - 0xa]
movzx edi, byte [ebp - 0xb]
add ecx, 7
shr ecx, 3
mov ebx, ecx
mov dword [ebp - 8], ecx
imul ebx, edi
mov dword [ebp - 0x10], ebx
cmp ebx, 1
jbe 0x46c633
xor edx, edx
mov eax, 0x40000
div ebx
imul eax, ebx
mov dword [ebp - 0x28], eax
jmp 0x46c63a
mov dword [ebp - 0x28], 0x40000
cmp ecx, 3
mov eax, ecx
mov edx, 4
cmove eax, edx
push eax
push edi
call fcn.0049b4a8
lea ebx, [esi + 7]
mov dword [ebp - 0x18], eax
add esp, 8
test ebx, ebx
je 0x46c674
cmp dword [ebp - 0x10], 1
jbe 0x46c674
lea ecx, [ebx - 1]
xor edx, edx
mov ebx, dword [ebp - 0x10]
mov eax, ecx
div ebx
mov eax, dword [ebp - 0x18]
sub ecx, edx
add ebx, ecx
sub ebx, esi
mov esi, dword [ebp - 0x20]
sub ebx, 7
je 0x46c6de
push dword [ebp - 0x1c]
push ebx
push eax
push str.read
call esi
add esp, 0x10
cmp eax, ebx
je 0x46c6de
test eax, eax
mov ebx, 0xfffffffa
cmovs ebx, eax
mov esi, dword [ebp - 0x18]
test esi, esi
je 0x46c6ab
push esi
call fcn.0048e011
add esp, 4
mov edi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x46c6be
push eax
call fcn.0048e011
add esp, 4
test edi, edi
je 0x46c6cb
push edi
call fcn.0048e011
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004888df
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x1c]
push dword [ebp - 0x28]
push dword [ebp - 0x14]
push str.read
call esi
mov edx, eax
add esp, 0x10
mov dword [ebp - 0x10], edx
mov ebx, edx
test edx, edx
jle 0x46c69b
mov eax, dword [ebp - 8]
mov esi, dword [ebp - 0x18]
dec eax
mov dword [ebp - 0x3c], eax
cmp eax, 3
ja case.default.0x46c70f
jmp dword [eax*4 + 0x46c908]
mov ecx, dword [ebp - 0x14]
push esi
push edi
call fcn.0046c0f0
add esp, 8
jmp 0x46c8b8
mov ecx, dword [ebp - 0x14]
push esi
push edi
call fcn.0046c2f0
add esp, 8
jmp 0x46c8b8
mov eax, dword [ebp - 0x14]
lea ecx, [edi + edi*2]
add edx, eax
mov ebx, eax
add eax, ecx
mov dword [ebp - 8], edx
cmp eax, edx
ja 0x46c8b8
xor esi, esi
test edi, edi
je 0x46c78b
mov eax, ebx
nop dword [eax]
mov ecx, dword [eax]
lea eax, [eax + 3]
mov edx, dword [ebp - 0x18]
and ecx, 0xffffff
add dword [edx + esi*4], ecx
mov edx, dword [edx + esi*4]
inc esi
xor edx, dword [eax - 3]
and edx, 0xffffff
xor dword [eax - 3], edx
cmp esi, edi
jl 0x46c760
mov edx, dword [ebp - 8]
lea ecx, [edi + edi*2]
add ebx, ecx
lea eax, [ecx + ebx]
cmp eax, edx
jbe 0x46c751
jmp 0x46c8b5
mov eax, dword [ebp - 0x14]
lea ecx, [edi*4]
mov ebx, dword [ebp - 0x10]
mov edx, eax
add ebx, eax
mov dword [ebp - 8], edx
add eax, ecx
mov dword [ebp - 0x38], ebx
cmp eax, ebx
ja 0x46c8b8
mov eax, ecx
mov ecx, dword [ebp - 0x18]
neg eax
mov ebx, ecx
mov dword [ebp - 0x34], eax
sub ebx, edx
add eax, 0x10
mov dword [ebp - 0x2c], eax
nop
xor esi, esi
test edi, edi
je 0x46c870
cmp edi, 0x10
jb 0x46c870
lea eax, [edi - 1]
lea eax, [ecx + eax*4]
cmp edx, eax
ja 0x46c7f7
lea eax, [edi - 1]
lea eax, [edx + eax*4]
cmp eax, ecx
jae 0x46c870
mov eax, edi
add ecx, 0x30
and eax, 0xfffffff0
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + edi*4]
add eax, edx
nop word [eax + eax]
movups xmm0, xmmword [eax - 0x10]
add esi, 0x10
lea eax, [eax + 0x40]
lea ecx, [ecx + 0x40]
movups xmm1, xmmword [ecx - 0x70]
paddd xmm1, xmm0
movups xmmword [ecx - 0x70], xmm1
movups xmm0, xmmword [ebx + eax - 0x40]
movups xmmword [eax - 0x50], xmm1
movups xmm1, xmmword [eax - 0x40]
paddd xmm1, xmm0
movups xmmword [ebx + eax - 0x40], xmm1
movups xmm0, xmmword [ecx - 0x50]
movups xmmword [eax - 0x40], xmm1
movups xmm1, xmmword [eax - 0x30]
paddd xmm1, xmm0
movups xmmword [eax - 0x30], xmm1
movups xmm0, xmmword [eax - 0x20]
movups xmmword [ecx - 0x50], xmm1
movups xmm1, xmmword [ecx - 0x40]
paddd xmm1, xmm0
movups xmmword [ecx - 0x40], xmm1
movups xmmword [eax - 0x20], xmm1
cmp esi, dword [ebp - 0x30]
jl 0x46c810
cmp esi, edi
jge 0x46c898
lea ecx, [edx + esi*4]
mov edx, edi
sub edx, esi
nop dword [eax + eax]
mov eax, dword [ecx]
lea ecx, [ecx + 4]
add dword [ebx + ecx - 4], eax
mov eax, dword [ebx + ecx - 4]
mov dword [ecx - 4], eax
sub edx, 1
jne 0x46c880
mov edx, dword [ebp - 8]
add ebx, dword [ebp - 0x34]
lea eax, [edi*4]
mov ecx, dword [ebp - 0x18]
add edx, eax
add eax, edx
mov dword [ebp - 8], edx
cmp eax, dword [ebp - 0x38]
jbe 0x46c7d0
mov esi, dword [ebp - 0x18]
mov edx, dword [ebp - 0x10]
test edx, edx
je 0x46c8db
push dword [ebp - 0x1c]
push edx
push dword [ebp - 0x14]
push str.write
call dword [ebp - 0x20]
mov ebx, eax
add esp, 0x10
test ebx, ebx
js 0x46c69e
push dword [ebp - 0x1c]
push dword [ebp - 0x28]
push dword [ebp - 0x14]
push str.read
call dword [ebp - 0x20]
mov edx, eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x3c]
add esp, 0x10
mov ebx, edx
test edx, edx
jg 0x46c706
jmp 0x46c69e