Function at 0x490440
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff8
xor eax, eax
cmp dword [0x4afd80], 3
push ebx
push esi
push edi
mov dword [ebp - 8], eax
mov esi, 0x4e81ec
mov ebx, 2
jg 0x4906bb
call fcn.0048fed3
jmp 0x49070b
mov edx, dword [esi]
mov eax, dword [0x4afcc0]
xor ecx, ecx
mov cl, byte [eax + edx + 2]
mov eax, dword [0x4e81e4]
shl eax, 5
xor ecx, eax
and ecx, 0x7fff
mov dword [0x4e81e4], ecx
mov ecx, dword [0x4e81e4]
mov edx, dword [0x4e81d4]
mov eax, dword [esi]
movzx edi, word [edx + ecx*2]
mov edx, dword [0x4afcc4]
and eax, 0x7fff
test edi, edi
mov word [edx + eax*2], di
mov dx, word [esi]
mov eax, dword [0x4e81e4]
mov ecx, dword [0x4e81d4]
mov word [ecx + eax*2], dx
mov dword [0x4e81e8], ebx
mov ecx, dword [0x4e81f0]
mov ebx, 2
mov dword [ebp - 4], ecx
je 0x490526
mov eax, dword [0x4e81e8]
cmp eax, dword [0x4e8200]
jae 0x490526
mov edx, dword [esi]
sub edx, edi
cmp edx, 0x7efa
ja 0x490526
mov eax, edi
call fcn.004902f0
mov ebx, eax
cmp ebx, dword [0x4e81f8]
jbe 0x49050d
mov ebx, dword [0x4e81f8]
cmp ebx, 3
jne 0x490526
mov eax, dword [esi]
sub eax, dword [0x4e81f0]
cmp eax, 0x1000
jbe 0x490526
mov ebx, 2
cmp dword [0x4e81e8], 3
jb 0x490645
cmp ebx, dword [0x4e81e8]
jbe 0x490575
mov eax, ebx
sub eax, dword [0x4e81e8]
cmp eax, 1
jne 0x490645
mov edx, dword [esi]
sub edx, dword [0x4e81f0]
cmp edx, 0x4000
jbe 0x490645
mov ecx, dword [0x4e81f0]
add ecx, 0x5dc
cmp ecx, dword [ebp - 4]
jae 0x490645
mov edx, dword [0x4e81e8]
mov eax, dword [esi]
sub edx, 3
dec eax
sub eax, dword [ebp - 4]
call fcn.00491fa0
mov ecx, dword [0x4e81e8]
dec ecx
sub dword [0x4e81f8], ecx
sub dword [0x4e81e8], 2
inc dword [esi]
mov edx, dword [0x4afcc0]
mov ecx, dword [esi]
movzx edx, byte [edx + ecx + 2]
mov ecx, dword [0x4e81e4]
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov dword [0x4e81e4], edx
mov edx, dword [0x4e81d4]
mov ecx, dword [0x4e81e4]
movzx edi, word [edx + ecx*2]
mov edx, dword [esi]
and edx, 0x7fff
mov ecx, dword [0x4afcc4]
mov word [ecx + edx*2], di
mov edx, dword [0x4e81d4]
mov ecx, dword [0x4e81e4]
mov bx, word [esi]
mov word [edx + ecx*2], bx
dec dword [0x4e81e8]
jne 0x49059d
xor edx, edx
mov dword [ebp - 8], edx
mov ebx, 2
inc dword [esi]
test eax, eax
je 0x4906aa
mov edx, dword [esi]
sub edx, dword [0x4e81dc]
cmp dword [0x4e81dc], 0
jl 0x490632
mov eax, dword [0x4afcc0]
add eax, dword [0x4e81dc]
jmp 0x490634
xor eax, eax
xor ecx, ecx
call fcn.00491dbc
mov edx, dword [esi]
mov dword [0x4e81dc], edx
jmp 0x4906aa
cmp dword [ebp - 8], 0
je 0x49069b
mov eax, dword [0x4afcc0]
mov edx, dword [esi]
movzx edx, byte [eax + edx - 1]
xor eax, eax
call fcn.00491fa0
test eax, eax
je 0x490691
mov edx, dword [esi]
sub edx, dword [0x4e81dc]
cmp dword [0x4e81dc], 0
jl 0x490680
mov eax, dword [0x4afcc0]
add eax, dword [0x4e81dc]
jmp 0x490682
xor eax, eax
xor ecx, ecx
call fcn.00491dbc
mov edx, dword [esi]
mov dword [0x4e81dc], edx
inc dword [esi]
dec dword [0x4e81f8]
jmp 0x4906aa
mov dword [ebp - 8], 1
inc dword [esi]
dec dword [0x4e81f8]
cmp dword [0x4e81f8], 0x106
jae 0x4906bb
call fcn.0048fda0
cmp dword [0x4e81f8], 0
jne 0x49046f
cmp dword [ebp - 8], 0
je 0x4906e1
mov eax, dword [0x4afcc0]
mov edx, dword [esi]
movzx edx, byte [eax + edx - 1]
xor eax, eax
call fcn.00491fa0
mov edx, dword [esi]
sub edx, dword [0x4e81dc]
cmp dword [0x4e81dc], 0
jl 0x4906ff
mov eax, dword [0x4afcc0]
add eax, dword [0x4e81dc]
jmp 0x490701
xor eax, eax
mov ecx, 1
call fcn.00491dbc
pop edi
pop esi
pop ebx
pop ecx
pop ecx
pop ebp
ret