Function at 0x4befa0
Capabilities:
Encode data using xor

Disassembly:
push ecx
mov eax, 0x80
push ebx
mov dword [0x720318], eax
mov dword [0x720324], eax
mov eax, dword [0x6d3814]
xor ebx, ebx
push esi
mov esi, dword [esp + 0x18]
push edi
cmp eax, ebx
mov dword [esp + 0xc], ebx
mov edi, 2
mov dword [0x72031c], 6
mov dword [0x720320], 0x10
mov dword [0x720314], 8
mov dword [0x6d3818], ebx
jne 0x4beffa
mov eax, dword [esp + 0x14]
mov dword [0x740368], eax
jmp 0x4bf02e
mov ecx, dword [esp + 0x14]
push 0x10000
mov dword [0x6d3808], ecx
call fcn.004b6a10
add esp, 4
cmp eax, ebx
mov dword [0x740368], eax
jne 0x4bf022
pop edi
pop esi
or eax, 0xffffffff
pop ebx
pop ecx
ret
mov dword [0x6d37fc], ebx
mov dword [0x6d380c], esi
mov edx, dword [esp + 0x18]
push esi
mov dword [0x760380], edx
call fcn.004bec40
mov eax, dword [0x6d3810]
add esp, 4
cmp eax, ebx
je 0x4bf2e5
mov ebx, dword [esp + 0x14]
mov eax, dword [0x740364]
push ebp
mov edx, dword [0x740368]
xor ecx, ecx
mov esi, eax
mov cl, byte [eax + edx + 2]
and esi, 0x7fff
mov edx, ecx
mov ecx, dword [0x6d3800]
and ecx, 0x3ff
and edx, 0x7fff
shl ecx, 5
xor edx, ecx
xor ecx, ecx
mov dword [0x6d3800], edx
mov cx, word [edx*2 + 0x750380]
mov word [esi*2 + 0x740380], cx
mov esi, dword [0x760384]
mov word [edx*2 + 0x750380], ax
mov edx, edi
test ecx, ecx
mov dword [0x740360], edx
mov edi, 2
je 0x4bf10d
cmp edx, dword [0x720320]
jae 0x4bf10d
mov ebp, eax
sub ebp, ecx
cmp ebp, 0x7efa
ja 0x4bf10d
push ecx
call fcn.004bee50
mov edi, eax
mov eax, dword [0x6d3810]
add esp, 4
cmp edi, eax
jbe 0x4bf0e6
mov edi, eax
mov eax, dword [0x740364]
cmp edi, 3
jne 0x4bf107
mov ebp, dword [0x760384]
mov edx, eax
sub edx, ebp
cmp edx, 0x1000
jbe 0x4bf107
mov edi, 2
mov edx, dword [0x740360]
cmp edx, 3
jb 0x4bf202
cmp edi, edx
ja 0x4bf202
sub eax, esi
add edx, 0xfffffffd
dec eax
push edx
push eax
call fcn.004c1860
mov edx, dword [0x6d3810]
mov ebx, eax
mov eax, dword [0x740360]
mov ecx, 1
mov esi, dword [0x740368]
sub ecx, eax
add esp, 8
add edx, ecx
sub eax, 2
mov dword [0x6d3810], edx
mov dword [0x740360], eax
mov eax, dword [0x740364]
inc eax
xor edx, edx
mov dword [0x740364], eax
mov dl, byte [esi + eax + 2]
mov ecx, edx
mov edx, dword [0x6d3800]
and edx, 0x3ff
and ecx, 0x7fff
shl edx, 5
xor ecx, edx
mov edx, eax
and edx, 0x7fff
mov dword [0x6d3800], ecx
mov di, word [ecx*2 + 0x750380]
mov word [edx*2 + 0x740380], di
mov word [ecx*2 + 0x750380], ax
mov ecx, dword [0x740360]
dec ecx
mov dword [0x740360], ecx
jne 0x4bf15d
xor ebp, ebp
inc eax
test ebx, ebx
mov dword [esp + 0x10], ebp
mov edi, 2
mov dword [0x740364], eax
je 0x4bf283
mov edx, dword [0x760388]
test edx, edx
jl 0x4bf1df
lea ecx, [edx + esi]
jmp 0x4bf1e1
xor ecx, ecx
lea esi, [ebx - 1]
push 0
sub eax, edx
push esi
push eax
push ecx
call fcn.004c0ee0
mov eax, dword [0x740364]
add esp, 0x10
mov dword [0x760388], eax
jmp 0x4bf283
mov ebp, dword [esp + 0x10]
test ebp, ebp
je 0x4bf267
mov edx, dword [0x740368]
xor ecx, ecx
mov cl, byte [eax + edx - 1]
push ecx
push 0
call fcn.004c1860
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4bf260
mov ecx, dword [0x760388]
test ecx, ecx
jl 0x4bf23a
mov eax, dword [0x740368]
add eax, ecx
jmp 0x4bf23c
xor eax, eax
lea edx, [ebx - 1]
push 0
push edx
mov edx, dword [0x740364]
sub edx, ecx
push edx
push eax
call fcn.004c0ee0
mov eax, dword [0x740364]
add esp, 0x10
mov dword [0x760388], eax
jmp 0x4bf270
mov eax, dword [0x740364]
jmp 0x4bf270
mov ebp, 1
mov dword [esp + 0x10], ebp
mov ecx, dword [0x6d3810]
inc eax
dec ecx
mov dword [0x740364], eax
mov dword [0x6d3810], ecx
mov ecx, dword [0x6d3814]
test ecx, ecx
je 0x4bf2b9
mov ecx, dword [0x6d3810]
mov esi, 0x106
cmp ecx, esi
jae 0x4bf2b9
mov ecx, dword [0x6d3804]
test ecx, ecx
jne 0x4bf2b9
call fcn.004bed50
mov eax, dword [0x6d3810]
cmp eax, esi
mov eax, dword [0x740364]
jb 0x4bf29c
mov ecx, dword [0x6d3810]
test ecx, ecx
jne 0x4bf058
test ebp, ebp
pop ebp
je 0x4bf2ee
mov edx, dword [0x740368]
xor ecx, ecx
mov cl, byte [eax + edx - 1]
push ecx
push 0
call fcn.004c1860
add esp, 8
jmp 0x4bf2e9
mov ebx, dword [esp + 0x14]
mov eax, dword [0x740364]
mov edx, dword [0x760388]
test edx, edx
jl 0x4bf302
mov ecx, dword [0x740368]
add ecx, edx
jmp 0x4bf304
xor ecx, ecx
dec ebx
push 1
sub eax, edx
push ebx
push eax
push ecx
call fcn.004c0ee0
mov eax, dword [0x6d3818]
add esp, 0x10
pop edi
pop esi
pop ebx
pop ecx
ret