Function at 0x566ec0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x28
cmp dword [esp + 0x44], 0
je 0x567258
mov ebp, edx
mov eax, dword [esp + 0x60]
mov ebx, dword [eax]
xor eax, eax
mov dword [esp + 0x24], ecx
jmp 0x566f01
mov eax, dword [esp + 0x10]
add ebp, edi
inc eax
cmp eax, dword [esp + 0x44]
je 0x567258
mov dword [esp + 0xc], ebp
mov dword [esp + 0x10], eax
shl eax, 4
mov ecx, dword [esp + 0x40]
movzx esi, word [ecx + eax + 0xc]
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0x54]
movzx ebp, word [ecx + esi*2]
mov esi, ebp
shr esi, 1
mov dword [esp + 4], ebx
mov ch, bl
and ch, 7
mov cl, ch
xor cl, 0x1f
shr esi, cl
mov dword [esp], esi
mov esi, ebx
shr esi, 3
mov edi, dword [esp + 0x64]
movzx edi, byte [edi + esi]
mov cl, ch
shl ebp, cl
or ebp, edi
mov ecx, dword [esp + 0x64]
mov edi, dword [esp + 0x40]
mov edx, dword [edi + eax]
mov ebx, dword [edi + eax + 4]
mov dword [esp + 8], ebx
mov ebx, edi
mov edi, dword [edi + eax + 8]
mov dword [esp + 0x1c], edi
mov edi, edx
movzx eax, word [ebx + eax + 0xe]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x50]
mov edx, dword [esp + 0x18]
movzx edx, byte [eax + edx]
mov eax, dword [esp]
mov dword [ecx + esi + 4], eax
mov dword [ecx + esi], ebp
mov esi, dword [esp + 8]
add edx, dword [esp + 4]
mov eax, esi
shr eax, 0x19
mov ecx, esi
shr ecx, 0x18
and ecx, 0xffffff80
or ecx, eax
mov eax, dword [esp + 0x60]
mov dword [esp], edx
mov dword [eax], edx
movsx edx, cl
and esi, 0x1ffffff
add edx, esi
mov ebx, edi
cmp edi, 6
jb 0x567020
cmp edi, 0x81
ja 0x566fe0
lea eax, [edi - 2]
bsr ebx, eax
xor ebx, 0xffffffe0
lea ecx, [ebx + 0x1f]
shr eax, cl
lea ebx, [eax + ebx*2]
add ebx, 0x40
jmp 0x567020
cmp edi, 0x841
ja 0x566ff6
lea eax, [edi - 0x42]
bsr ebx, eax
xor ebx, 0xffffffe0
add ebx, 0x2a
jmp 0x567020
mov ebx, 0x15
cmp edi, 0x1842
jb 0x567020
xor ebx, ebx
cmp edi, 0x5842
setb bl
xor ebx, 0x17
nop word cs:[eax + eax]
cmp edx, 9
mov dword [esp + 8], esi
ja 0x567040
lea eax, [edx + 0xfffe]
jmp 0x567080
cmp edx, 0x85
ja 0x567060
lea eax, [edx - 6]
bsr esi, eax
xor esi, 0xffffffe0
lea ecx, [esi + 0x1f]
shr eax, cl
lea eax, [eax + esi*2]
add eax, 0x42
jmp 0x567080
mov eax, 0x17
cmp edx, 0x845
ja 0x567080
lea eax, [edx - 0x46]
bsr eax, eax
xor eax, 0xffffffe0
add eax, 0x2c
nop dword [eax]
movzx ebp, bx
shl ebp, 2
mov ecx, dword [0x8b5f74]
mov ebx, dword [ecx + ebp]
movzx ecx, ax
shl ecx, 2
mov dword [esp + 0x20], ecx
mov eax, dword [0x8bacc0]
sub edx, dword [eax + ecx]
xor eax, eax
mov ecx, ebx
shld eax, edx, cl
mov esi, edi
mov ecx, dword [0x8bacc4]
sub esi, dword [ecx + ebp]
mov ecx, ebx
shl edx, cl
test bl, 0x20
mov ebp, ebx
cmovne eax, edx
mov ecx, 0
cmovne edx, ecx
or edx, esi
mov ebx, dword [esp]
mov ecx, ebx
and cl, 7
shld eax, edx, cl
mov esi, ebx
shr esi, 3
mov dword [esp + 4], edi
mov edi, dword [esp + 0x64]
movzx edi, byte [edi + esi]
shl edx, cl
or edx, edi
mov edi, dword [esp + 4]
mov ecx, dword [esp + 0x64]
mov dword [ecx + esi + 4], eax
mov dword [ecx + esi], edx
add ebp, ebx
mov eax, dword [0x8b5f70]
mov ecx, dword [esp + 0x20]
add ebp, dword [eax + ecx]
mov eax, dword [esp + 0x60]
mov ebx, ebp
mov dword [eax], ebp
test edi, edi
je 0x5671a0
mov ebp, dword [esp + 0xc]
mov esi, dword [esp + 0x4c]
nop
mov dword [esp + 0xc], ebp
and ebp, dword [esp + 0x3c]
mov ecx, dword [esp + 0x24]
movzx eax, byte [ecx + ebp]
mov dword [esp + 4], eax
movzx ebp, word [esi + eax*2]
mov edx, ebx
shr edx, 3
mov dword [esp], edx
mov ecx, dword [esp + 0x64]
movzx edx, byte [ecx + edx]
mov esi, ebp
shr esi, 1
mov ch, bl
and ch, 7
mov cl, ch
xor cl, 0x1f
shr esi, cl
mov cl, ch
shl ebp, cl
or ebp, edx
mov edx, ebx
mov ecx, dword [esp + 0x64]
mov eax, dword [esp + 0x48]
mov ebx, dword [esp + 4]
movzx eax, byte [eax + ebx]
mov ebx, dword [esp]
mov dword [ecx + ebx + 4], esi
mov esi, dword [esp + 0x4c]
mov dword [ecx + ebx], ebp
mov ebp, dword [esp + 0xc]
add edx, eax
mov eax, dword [esp + 0x60]
mov ebx, edx
mov dword [eax], edx
inc ebp
dec edi
jne 0x567120
jmp 0x5671a4
mov ebp, dword [esp + 0xc]
mov edi, dword [esp + 8]
test edi, edi
je 0x566ef0
movzx eax, word [esp + 0x18]
cmp eax, 0x80
jb 0x566ef0
mov ecx, dword [esp + 0x14]
and ecx, 0x3ff
mov eax, dword [esp + 0x58]
movzx eax, byte [eax + ecx]
mov esi, dword [esp + 0x5c]
movzx esi, word [esi + ecx*2]
mov ch, bl
add eax, ebx
mov edx, ebx
shr edx, 3
mov edi, esi
shr edi, 1
and ch, 7
mov cl, ch
xor cl, 0x1f
shr edi, cl
mov ebx, dword [esp + 0x64]
movzx ebx, byte [ebx + edx]
mov cl, ch
shl esi, cl
or esi, ebx
mov ecx, dword [esp + 0x64]
mov dword [ecx + edx + 4], edi
mov edi, dword [esp + 0x64]
mov dword [edi + edx], esi
mov ecx, dword [esp + 0x60]
mov ebx, eax
mov dword [ecx], eax
mov edx, eax
shr edx, 3
mov ch, bl
and ch, 7
mov cl, ch
xor cl, 0x1f
mov esi, dword [esp + 0x1c]
mov eax, esi
shr eax, 1
shr eax, cl
mov cl, ch
shl esi, cl
movzx ecx, byte [edi + edx]
or esi, ecx
mov dword [edi + edx + 4], eax
mov dword [edi + edx], esi
mov edi, dword [esp + 8]
mov eax, dword [esp + 0x14]
shr eax, 0xa
add ebx, eax
mov eax, dword [esp + 0x60]
mov dword [eax], ebx
jmp 0x566ef0
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret