Function at 0x4affd0
Capabilities:
Encode data using xor

Disassembly:
push ecx
mov eax, dword [0x5ad130]
push ebp
test eax, eax
mov dword [esp + 4], 0
mov ebp, 2
je 0x4b0289
mov edx, dword [0x5ad128]
mov ecx, dword [0x5b0a54]
push ebx
push esi
push edi
xor eax, eax
and edx, 0x3ff
mov al, byte [ecx + 0x5c0a82]
mov esi, ecx
and eax, 0x7fff
mov edi, dword [0x5d0a84]
shl edx, 5
xor edx, eax
xor eax, eax
and esi, 0x7fff
mov dword [0x5ad128], edx
mov ax, word [edx*2 + 0x5d0aa0]
mov word [edx*2 + 0x5d0aa0], cx
mov word [esi*2 + 0x5b0a60], ax
mov esi, ebp
test eax, eax
mov dword [0x5b0a50], esi
mov ebp, 2
je 0x4b00ae
cmp esi, dword [0x5ad124]
jae 0x4b00ae
mov ebx, ecx
sub ebx, eax
cmp ebx, 0x7efa
ja 0x4b00ae
push eax
call fcn.004afdf0
mov ebp, eax
mov eax, dword [0x5ad130]
add esp, 4
cmp ebp, eax
jbe 0x4b007c
mov ebp, eax
cmp ebp, 3
jne 0x4b016e
mov ecx, dword [0x5b0a54]
mov esi, dword [0x5d0a84]
mov edx, ecx
sub edx, esi
cmp edx, 0x1000
jbe 0x4b00a2
mov ebp, 2
mov edx, dword [0x5ad128]
mov esi, dword [0x5b0a50]
cmp esi, 3
jb 0x4b01a6
cmp ebp, esi
ja 0x4b01a6
sub ecx, edi
add esi, 0xfffffffd
dec ecx
push esi
push ecx
call fcn.004af9c0
mov esi, dword [0x5b0a50]
mov ecx, dword [0x5ad130]
mov edi, eax
mov edx, dword [0x5ad128]
mov eax, 1
add esp, 8
sub eax, esi
add ecx, eax
sub esi, 2
mov dword [0x5ad130], ecx
mov ecx, dword [0x5b0a54]
inc ecx
xor eax, eax
and edx, 0x3ff
mov al, byte [ecx + 0x5c0a82]
and eax, 0x7fff
shl edx, 5
xor edx, eax
mov eax, ecx
and eax, 0x7fff
dec esi
mov bx, word [edx*2 + 0x5d0aa0]
mov word [edx*2 + 0x5d0aa0], cx
mov word [eax*2 + 0x5b0a60], bx
jne 0x4b00fb
mov dword [0x5b0a50], esi
xor esi, esi
inc ecx
mov dword [0x5ad128], edx
test edi, edi
mov dword [esp + 0x10], esi
mov ebp, 2
mov dword [0x5b0a54], ecx
je 0x4b0236
mov edx, dword [0x5d0a88]
test edx, edx
jl 0x4b017f
lea eax, [edx + 0x5c0a80]
jmp 0x4b0181
mov edx, dword [0x5ad128]
mov ecx, dword [0x5b0a54]
jmp 0x4b00a8
xor eax, eax
sub ecx, edx
push 0
push ecx
push eax
call fcn.004af090
mov ecx, dword [0x5b0a54]
mov edx, dword [0x5ad128]
add esp, 0xc
mov dword [0x5d0a88], ecx
jmp 0x4b0236
mov esi, dword [esp + 0x10]
test esi, esi
je 0x4b021b
xor edx, edx
mov dl, byte [ecx + 0x5c0a7f]
push edx
push 0
call fcn.004af9c0
add esp, 8
test eax, eax
je 0x4b01fb
mov ecx, dword [0x5d0a88]
test ecx, ecx
jl 0x4b01d7
lea eax, [ecx + 0x5c0a80]
jmp 0x4b01d9
xor eax, eax
mov edx, dword [0x5b0a54]
push 0
sub edx, ecx
push edx
push eax
call fcn.004af090
mov ecx, dword [0x5b0a54]
add esp, 0xc
mov dword [0x5d0a88], ecx
jmp 0x4b0201
mov ecx, dword [0x5b0a54]
mov eax, dword [0x5ad130]
mov edx, dword [0x5ad128]
inc ecx
dec eax
mov dword [0x5b0a54], ecx
mov dword [0x5ad130], eax
jmp 0x4b0236
mov eax, dword [0x5ad130]
inc ecx
mov esi, 1
dec eax
mov dword [esp + 0x10], esi
mov dword [0x5b0a54], ecx
mov dword [0x5ad130], eax
mov eax, dword [0x5ad130]
cmp eax, 0x106
jae 0x4b0269
mov edi, dword [0x5ad12c]
test edi, edi
jne 0x4b0269
call fcn.004afef0
mov eax, dword [0x5ad130]
mov edx, dword [0x5ad128]
mov ecx, dword [0x5b0a54]
cmp eax, 0x106
jb 0x4b0242
test eax, eax
jne 0x4afffb
pop edi
test esi, esi
pop esi
pop ebx
je 0x4b028f
mov al, byte [ecx + 0x5c0a7f]
push eax
push 0
call fcn.004af9c0
add esp, 8
mov ecx, dword [0x5b0a54]
mov edx, dword [0x5d0a88]
pop ebp
test edx, edx
jl 0x4b02af
sub ecx, edx
lea eax, [edx + 0x5c0a80]
push 1
push ecx
push eax
call fcn.004af090
add esp, 0x10
ret
sub ecx, edx
xor eax, eax
push 1
push ecx
push eax
call fcn.004af090
add esp, 0x10
ret