Function at 0x489845
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x20]
sub esp, 0x128
push esi
mov esi, dword [esp + 0x144]
push esi
mov dword [eax], 0
call fcn.00489b65
add esp, 4
test eax, eax
jne 0x489afc
mov eax, esi
imul eax, eax, 0x64
push ebx
mov ebx, dword [eax + 0x507350]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14c]
mov ecx, eax
and cl, 7
neg cl
push edi
mov dword [esp + 0x18], ebx
sbb ecx, ecx
shr eax, 3
neg ecx
add ecx, eax
mov eax, dword [esp + 0x148]
mov esi, ecx
cmp eax, esi
ja 0x489b50
lea edx, [ebx + eax + 2]
cmp esi, edx
jb 0x489b50
mov edi, dword [esp + 0x144]
cmp edi, esi
jne 0x489b50
push ebp
push esi
call fcn.004664f5
push esi
mov ebp, eax
call fcn.004664f5
push esi
mov dword [esp + 0x1c], eax
call fcn.004664f5
push esi
mov dword [esp + 0x28], eax
call fcn.004664f5
add esp, 0x10
test ebp, ebp
mov dword [esp + 0x14], eax
je 0x489b0d
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x489b04
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x489b04
test eax, eax
je 0x489b04
mov eax, dword [esp + 0x144]
cmp byte [eax + edi - 1], 0xbc
jne 0x4899fb
mov edi, esi
sub edi, ebx
lea ebx, [edi - 1]
push ebx
push eax
push ebp
call fcn.00488ee5
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x150]
push eax
mov ecx, esi
sub ecx, eax
lea eax, [ecx + edx - 1]
mov ecx, dword [esp + 0x24]
push eax
push ecx
call fcn.00488ee5
mov edx, dword [esp + 0x16c]
lea ecx, [esi*8]
sub ecx, edx
mov edx, dword [esp + 0x15c]
add esp, 0x18
inc ecx
mov eax, 0xff
sar eax, cl
mov cl, byte [edx]
mov dword [esp + 0x20], eax
not eax
test al, cl
jne 0x4899fb
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
push ebx
push eax
mov eax, dword [esp + 0x158]
push ecx
push edx
push eax
call fcn.004b5075
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x489ad0
test ebx, ebx
jbe 0x4899ce
mov ecx, dword [esp + 0x10]
mov eax, ebp
sub ecx, ebp
mov esi, ebx
lea esp, [esp]
mov dl, byte [ecx + eax]
xor byte [eax], dl
inc eax
dec esi
jne 0x4899c5
mov dl, byte [ebp]
mov ecx, dword [esp + 0x14c]
mov al, byte [esp + 0x20]
and dl, al
sub edi, ecx
xor ebx, ebx
sub edi, 2
mov byte [ebp], dl
je 0x4899f5
cmp byte [ebx + ebp], 0
jne 0x4899fb
inc ebx
cmp ebx, edi
jb 0x4899ea
cmp byte [ebx + ebp], 1
je 0x489a05
mov esi, 0x20005
jmp 0x489ad0
mov edi, dword [esp + 0x24]
lea ecx, [esp + 0x28]
push ecx
call dword [edi + 0x50739c]
mov esi, eax
add esp, 4
test esi, esi
jne 0x489ad0
mov esi, dword [esp + 0x10]
push 8
push esi
call fcn.004a7b45
push 8
lea edx, [esp + 0x34]
push esi
push edx
call dword [edi + 0x5073a0]
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x489ad0
mov eax, dword [esp + 0x140]
mov ecx, dword [esp + 0x13c]
push eax
push ecx
lea edx, [esp + 0x30]
push edx
call dword [edi + 0x5073a0]
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x489ad0
mov eax, dword [esp + 0x14c]
push eax
lea ecx, [ebx + ebp + 1]
push ecx
lea edx, [esp + 0x30]
push edx
call dword [edi + 0x5073a0]
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x489ad0
mov eax, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x2c]
push ecx
call dword [edi + 0x5073a4]
mov esi, eax
add esp, 8
test esi, esi
jne 0x489ad0
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push edx
push eax
push ecx
call fcn.00489255
add esp, 0xc
test eax, eax
jne 0x489ace
mov edx, dword [esp + 0x158]
mov dword [edx], 1
xor esi, esi
mov eax, dword [esp + 0x14]
push eax
call fcn.00466485
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.00466485
mov edx, dword [esp + 0x18]
push edx
call fcn.00466485
push ebp
call fcn.00466485
add esp, 0x10
pop ebp
pop edi
mov eax, esi
pop ebx
pop esi
add esp, 0x128
ret
push ebp
call fcn.00466485
add esp, 4
mov eax, dword [esp + 0x10]
test eax, eax
je 0x489b1e
push eax
call fcn.00466485
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x489b2f
push eax
call fcn.00466485
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x489b40
push eax
call fcn.00466485
add esp, 4
pop ebp
pop edi
pop ebx
mov eax, 0xc
pop esi
add esp, 0x128
ret
pop edi
pop ebx
mov eax, 0x20012
pop esi
add esp, 0x128
ret