Function at 0x10057990
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
mov ecx, esi
push edi
push 8
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.10004c40
mov eax, dword [ebp + 0x18]
xor edi, edi
cdq
and edx, 3
mov dword [ebp - 4], edi
add eax, edx
sar eax, 2
mov dword [ebp - 0x14], eax
test eax, eax
jle 0x10057b1a
mov edx, dword [ebp + 0xc]
nop dword [eax]
push 8
lea eax, [ebp - 0x1c]
mov ecx, esi
push eax
push edx
call fcn.10004c40
mov edx, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 8], ebx
push 8
lea eax, [ebp - 0x1c]
mov ecx, esi
push eax
push edx
call fcn.10004c40
mov edx, dword [ebp + 0xc]
xor eax, eax
mov dword [ebp + 0x18], eax
mov esi, dword [edx + 4]
nop
mov edi, eax
and edi, 0x80000007
jns 0x10057a0f
dec edi
or edi, 0xfffffff8
inc edi
mov edx, dword [edx]
mov ecx, esi
shr ecx, 8
mov eax, esi
shl eax, 6
xor ecx, eax
mov ebx, dword [ebp - 8]
sub edx, ecx
mov dword [ebp - 0xc], edi
mov ecx, dword [ebp - 4]
mov eax, 7
add ecx, dword [ebp + 0x14]
sub eax, edi
sub edx, dword [ecx + eax*4]
mov eax, dword [ebp + 0x18]
sub edx, esi
sub edx, dword [ebp - 8]
add eax, 0xffffffc1
add edx, eax
mov eax, dword [ebp + 0xc]
mov ecx, edx
shr ecx, 8
mov dword [eax], edx
mov eax, edx
shl eax, 6
xor ecx, eax
mov eax, 6
sub esi, ecx
sub eax, edi
mov ecx, dword [ebp - 4]
add ecx, dword [ebp + 0x14]
sub esi, dword [ecx + eax*4]
mov eax, dword [ebp + 0x18]
sub esi, edx
sub esi, dword [ebp - 8]
add eax, 0xffffffc2
add esi, eax
mov eax, dword [ebp + 0xc]
mov ecx, esi
shr ecx, 8
mov dword [eax + 4], esi
mov eax, esi
shl eax, 6
xor ecx, eax
mov eax, 5
sub edx, ecx
sub eax, edi
mov ecx, dword [ebp - 4]
add ecx, dword [ebp + 0x14]
sub edx, dword [ecx + eax*4]
mov eax, dword [ebp + 0x18]
sub edx, esi
sub edx, dword [ebp - 8]
add eax, 0xffffffc3
add eax, edx
mov edx, dword [ebp + 0xc]
mov ecx, eax
mov dword [ebp - 0x10], eax
shr ecx, 8
mov dword [edx], eax
shl eax, 6
xor ecx, eax
mov eax, 4
sub esi, ecx
sub eax, edi
mov ecx, dword [ebp + 0x14]
mov edi, dword [ebp - 4]
add ecx, edi
sub esi, dword [ecx + eax*4]
mov ecx, dword [ebp - 0x10]
sub esi, ecx
mov eax, dword [ebp + 0x18]
sub esi, ebx
add esi, 0xffffffc4
add esi, eax
add eax, 4
mov dword [edx + 4], esi
mov dword [ebp + 0x18], eax
cmp eax, 0x40
jl 0x10057a00
cmp ecx, 0xe8
jne 0x10057afa
cmp esi, 0xc58b5d00
je 0x10057b23
mov esi, dword [ebp + 8]
inc ebx
mov dword [ebp - 8], ebx
cmp ebx, 0x21000
jl 0x100579e6
inc edi
mov dword [ebp - 4], edi
cmp edi, dword [ebp - 0x14]
jl 0x100579d0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
add edx, 8
movzx eax, bx
mov dword [ebp + 0x18], edx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0xc], 0xfffffff8
mov dword [ebp - 8], 0x1fff
nop dword [eax]
mov edi, dword [edx + 4]
mov ebx, 0x3f
mov eax, dword [edx]
nop word [eax + eax]
mov edx, dword [ebp - 4]
mov ecx, ebx
and ecx, 7
lea ecx, [edx + ecx*4]
mov edx, dword [ebp + 0x14]
mov esi, dword [ecx + edx]
mov edx, edi
mov ecx, edi
shl edx, 6
shr ecx, 8
xor edx, ecx
sub eax, edx
mov edx, dword [ebp + 0x18]
sub eax, dword [ebp - 0x14]
sub eax, edi
sub eax, esi
mov esi, dword [ebp - 0xc]
sub eax, ebx
mov dword [edx], edi
sub ebx, 1
lea ecx, [eax + esi]
mov eax, edi
mov edi, ecx
mov dword [edx + 4], edi
jns 0x10057b50
add edx, 8
sub esi, 8
sub dword [ebp - 8], 1
mov dword [ebp + 0x18], edx
mov dword [ebp - 0xc], esi
jne 0x10057b40
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret