Function at 0x422b90
Capabilities:
Encode data using xor

Disassembly:
push ebx
push ebp
mov ebp, dword [0x510680]
push esi
mov esi, dword [0x510684]
push edi
xor ebx, ebx
xor edi, edi
mov dword [0x4e0664], 2
test ebp, ebp
je 0x422b50
mov ecx, dword [0x510690]
lea esp, [esp]
cmp ebp, 3
jb 0x4229db
movzx eax, byte [esi + 0x4f067a]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
movzx ebx, word [eax*2 + 0x4e0670]
mov ecx, esi
and ecx, 0x7fff
mov dword [0x510690], eax
mov word [ecx*2 + 0x500678], bx
mov word [eax*2 + 0x4e0670], si
test ebx, ebx
je 0x422a07
mov edx, esi
sub edx, ebx
cmp edx, 0x7efa
ja 0x422a07
cmp dword [0x51068c], ebp
jbe 0x4229f9
mov dword [0x51068c], ebp
push ebx
call fcn.004226e0
mov edi, eax
cmp edi, ebp
jbe 0x422a07
mov edi, ebp
cmp edi, 3
jb 0x422abf
sub esi, dword [0x4e066c]
lea eax, [edi - 3]
push eax
push esi
call fcn.00476000
mov ebp, dword [0x510680]
sub ebp, edi
mov dword [0x510680], ebp
cmp edi, dword [0x510688]
ja 0x422a92
cmp ebp, 3
jb 0x422a92
mov ecx, dword [0x510690]
mov esi, dword [0x510684]
dec edi
jmp 0x422a50
movzx edx, byte [esi + 0x4f067b]
inc esi
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov ecx, edx
movzx ebx, word [ecx*2 + 0x4e0670]
mov edx, esi
and edx, 0x7fff
sub edi, 1
mov word [edx*2 + 0x500678], bx
mov word [ecx*2 + 0x4e0670], si
jne 0x422a50
mov dword [0x510690], ecx
jmp 0x422ae7
mov esi, dword [0x510684]
movzx ecx, byte [esi + edi + 0x4f0678]
movzx edx, byte [esi + edi + 0x4f0679]
add esi, edi
shl ecx, 5
xor ecx, edx
xor edi, edi
and ecx, 0x7fff
mov dword [0x510690], ecx
jmp 0x422ae8
movzx eax, byte [esi + 0x4f0678]
push eax
push 0
call fcn.00476000
mov ebp, dword [0x510680]
mov esi, dword [0x510684]
mov ecx, dword [0x510690]
dec ebp
mov dword [0x510680], ebp
inc esi
mov dword [0x510684], esi
test eax, eax
je 0x422b29
mov ecx, dword [0x51067c]
test ecx, ecx
jl 0x422b04
lea eax, [ecx + 0x4f0678]
jmp 0x422b06
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00476d30
mov esi, dword [0x510684]
mov ebp, dword [0x510680]
mov ecx, dword [0x510690]
mov dword [0x51067c], esi
cmp ebp, 0x106
jae 0x422b48
call fcn.00422830
mov ebp, dword [0x510680]
mov ecx, dword [0x510690]
mov esi, dword [0x510684]
test ebp, ebp
jne 0x4229a0
mov ecx, dword [0x51067c]
test ecx, ecx
jl 0x422b70
push 1
sub esi, ecx
lea eax, [ecx + 0x4f0678]
push esi
push eax
call fcn.00476d30
pop edi
pop esi
pop ebp
pop ebx
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.00476d30
pop edi
pop esi
pop ebp
pop ebx
ret
sub esp, 0x10
cmp dword [0x4d6dc0], 3
push ebp
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov ebp, 2
jg 0x422bbb
pop ebp
add esp, 0x10
jmp 0x422970
push ebx
mov ebx, dword [0x510680]
push esi
mov esi, dword [0x510684]
test ebx, ebx
je 0x422e5c
push edi
mov edi, dword [0x510690]
jmp 0x422be4
mov ebp, dword [esp + 0x10]
cmp ebx, 3
jb 0x422c26
movzx eax, byte [esi + 0x4f067a]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x4e0670]
mov ecx, esi
and ecx, 0x7fff
mov dword [0x510690], edi
mov dword [esp + 0x18], eax
mov word [ecx*2 + 0x500678], ax
mov word [edi*2 + 0x4e0670], si
mov eax, dword [esp + 0x18]
mov edx, dword [0x4e066c]
mov dword [0x4e0664], ebp
mov dword [esp + 0x1c], edx
mov dword [esp + 0x10], 2
test eax, eax
je 0x422c99
cmp ebp, dword [0x510688]
jae 0x422c99
mov ecx, esi
sub ecx, eax
cmp ecx, 0x7efa
ja 0x422c99
cmp dword [0x51068c], ebx
jbe 0x422c68
mov dword [0x51068c], ebx
push eax
call fcn.004226e0
mov dword [esp + 0x10], eax
cmp eax, ebx
jbe 0x422c7c
mov dword [esp + 0x10], ebx
mov eax, ebx
cmp eax, 3
jne 0x422c99
mov edx, esi
sub edx, dword [0x4e066c]
cmp edx, 0x1000
jbe 0x422c99
mov dword [esp + 0x10], 2
cmp ebp, 3
jb 0x422d97
cmp dword [esp + 0x10], ebp
ja 0x422d97
lea eax, [esi + ebx - 3]
sub esi, dword [esp + 0x1c]
add ebp, 0xfffffffd
push ebp
dec esi
push esi
mov dword [esp + 0x1c], eax
call fcn.00476000
mov ecx, dword [0x4e0664]
mov ebx, dword [0x510680]
mov edi, dword [0x510690]
mov esi, dword [0x510684]
mov edx, 1
sub edx, ecx
add ebx, edx
mov dword [0x510680], ebx
sub ecx, 2
lea ecx, [ecx]
inc esi
cmp esi, dword [esp + 0x14]
ja 0x422d2f
movzx edx, byte [esi + 0x4f067a]
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
movzx edx, word [edi*2 + 0x4e0670]
mov ebp, esi
and ebp, 0x7fff
mov dword [esp + 0x18], edx
mov word [ebp*2 + 0x500678], dx
mov word [edi*2 + 0x4e0670], si
sub ecx, 1
jne 0x422cf0
inc esi
mov dword [0x4e0664], ecx
mov dword [0x510690], edi
mov dword [0x510684], esi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], 2
test eax, eax
je 0x422e1a
mov ecx, dword [0x51067c]
test ecx, ecx
jl 0x422d6d
lea eax, [ecx + 0x4f0678]
jmp 0x422d6f
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00476d30
mov esi, dword [0x510684]
mov ebx, dword [0x510680]
mov edi, dword [0x510690]
mov dword [0x51067c], esi
jmp 0x422e1a
cmp dword [esp + 0x14], 0
je 0x422e04
movzx eax, byte [esi + 0x4f0677]
push eax
push 0
call fcn.00476000
test eax, eax
je 0x422df0
mov ecx, dword [0x51067c]
test ecx, ecx
jl 0x422dc3
lea eax, [ecx + 0x4f0678]
jmp 0x422dc5
xor eax, eax
mov edx, dword [0x510684]
push 0
sub edx, ecx
push edx
push eax
call fcn.00476d30
mov esi, dword [0x510684]
mov ebx, dword [0x510680]
mov edi, dword [0x510690]
mov dword [0x51067c], esi
jmp 0x422e0c
mov esi, dword [0x510684]
mov ebx, dword [0x510680]
mov edi, dword [0x510690]
jmp 0x422e0c
mov dword [esp + 0x14], 1
inc esi
dec ebx
mov dword [0x510680], ebx
mov dword [0x510684], esi
cmp ebx, 0x106
jae 0x422e39
call fcn.00422830
mov ebx, dword [0x510680]
mov edi, dword [0x510690]
mov esi, dword [0x510684]
test ebx, ebx
jne 0x422be0
pop edi
cmp dword [esp + 0x10], ebx
je 0x422e5c
movzx eax, byte [esi + 0x4f0677]
push eax
push ebx
call fcn.00476000
mov esi, dword [0x510684]
mov ecx, dword [0x51067c]
test ecx, ecx
jl 0x422e7e
push 1
sub esi, ecx
lea eax, [ecx + 0x4f0678]
push esi
push eax
call fcn.00476d30
pop esi
pop ebx
pop ebp
add esp, 0x10
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.00476d30
pop esi
pop ebx
pop ebp
add esp, 0x10
ret