Function at 0x4be360
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x28
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
mov ebx, 0xfffffffc
nop word cs:[eax + eax]
nop
test edi, edi
je 0x4be5a0
mov ebp, edi
dec edi
add ebx, 4
mov eax, dword [ecx + ebp*4 - 4]
test eax, eax
je 0x4be380
test edi, edi
jne 0x4be3a6
mov edx, dword [esp + 0x40]
cmp dword [ecx], edx
jbe 0x4be5a0
mov ecx, eax
shr ecx, 1
or ecx, eax
mov eax, ecx
shr eax, 2
or eax, ecx
mov ecx, eax
shr ecx, 4
or ecx, eax
mov esi, ecx
shr esi, 8
or esi, ecx
mov ecx, edi
mov edi, dword [esp + 0x3c]
mov eax, esi
shr eax, 0x10
test ebx, ebx
mov dword [esp + 8], eax
je 0x4be3f0
lea eax, [edi + ecx*4 + 4]
push ebx
push 0
push eax
mov edi, esi
mov esi, ecx
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov ecx, esi
mov esi, edi
mov edi, dword [esp + 0x48]
add esp, 0xc
or dword [esp + 8], esi
mov esi, dword [esp + 0x48]
mov eax, ecx
lea edx, [ecx + 1]
mov dword [esp + 0x20], ebp
mov dword [esp + 0x1c], ecx
and eax, 0xfffffff8
mov dword [esp + 0xc], edx
mov dword [esp + 4], eax
inc eax
mov dword [esp + 0x18], eax
lea eax, [edi + 0x14]
shl esi, 2
mov dword [esp + 0x14], eax
sub esi, ebx
mov ebx, ecx
mov dword [esp + 0x24], esi
mov esi, edi
mov edi, 0x63
test edi, edi
je 0x4be592
nop word cs:[eax + eax]
push dword [esp + 0x4c]
push dword [esp + 0x28]
push esi
call fcn.004be5d0
add esp, 0xc
mov eax, dword [esp + 8]
and dword [esi + ebp*4 - 4], eax
cmp dword [esp + 0x40], 0
je 0x4be490
mov edx, dword [esp + 0xc]
cmp edx, 1
je 0x4be4a0
test edx, edx
mov eax, edx
mov ecx, edx
je 0x4be585
cmp ebx, 8
mov dword [esp], edi
jae 0x4be4a7
xor ecx, ecx
mov eax, 1
jmp 0x4be500
mov dword [esp], edi
mov dword [esp + 0x10], 0xffffffff
jmp 0x4be52e
mov dword [esp], edi
xor ecx, ecx
jmp 0x4be508
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0x14]
pxor xmm0, xmm0
pxor xmm1, xmm1
nop word [eax + eax]
movdqu xmm2, xmmword [ecx - 0x10]
movdqu xmm3, xmmword [ecx]
add ecx, 0x20
add eax, 0xfffffff8
por xmm0, xmm2
por xmm1, xmm3
jne 0x4be4c0
por xmm1, xmm0
cmp ebx, dword [esp + 4]
mov eax, dword [esp + 0x18]
pshufd xmm0, xmm1, 0x4e
por xmm0, xmm1
pshufd xmm1, xmm0, 0xe5
por xmm1, xmm0
movd ecx, xmm1
je 0x4be508
nop dword [eax]
or ecx, dword [esi + eax*4]
inc eax
cmp edx, eax
jne 0x4be500
mov ebx, dword [esi]
mov eax, dword [esp + 0x40]
mov edi, ecx
dec ecx
not edi
mov esi, ebx
mov edx, ebx
sub esi, eax
xor edx, eax
xor esi, ebx
or esi, edx
xor esi, ebx
and esi, edi
and esi, ecx
sar esi, 0x1f
not esi
mov dword [esp + 0x10], esi
mov eax, dword [esp + 0x44]
mov edi, dword [esp + 0xc]
xor ecx, ecx
xor edx, edx
nop word [eax + eax]
mov esi, dword [esp + 0x3c]
mov ebp, dword [esi + edx*4]
mov esi, dword [eax + edx*4]
mov ebx, ebp
sub ebx, esi
xor esi, ebp
xor ebx, ebp
or ebx, esi
xor ebx, ebp
mov ebp, esi
dec esi
sar ebx, 0x1f
xor ebp, 0x80000000
or ebx, 1
test esi, ebp
cmovns ecx, ebx
inc edx
cmp edi, edx
jne 0x4be540
mov esi, dword [esp + 0x3c]
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x1c]
mov edi, dword [esp]
mov eax, dword [esp + 0x10]
shr ecx, 0x1f
test ecx, eax
jne 0x4be5bc
dec edi
test edi, edi
jne 0x4be440
push 0x10b
push str.external_boringssl_src_crypto_fipsmodule_bn_random.c
push 0x73
jmp 0x4be5ac
push 0xe2
push str.external_boringssl_src_crypto_fipsmodule_bn_random.c
push 0x6c
push 0
push 3
call sym.fastboot.exe_ERR_put_error
add esp, 0x14
xor eax, eax
jmp 0x4be5c1
mov eax, 1
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret