Function at 0x586950
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 8]
xor ecx, ecx
push esi
mov esi, dword [ebp + 0x14]
mov eax, dword [ebx + 0x174]
mov edx, dword [ebx + 0x160]
mov dword [ebp - 0x10], eax
mov eax, dword [ebx + 0x164]
mov dword [ebp - 0x18], eax
mov eax, esi
add eax, dword [ebx + 0x38]
mov dword [ebp - 0x1c], edx
adc ecx, dword [ebx + 0x3c]
cmp ecx, 0xf
ja 0x586b5e
jb 0x586997
cmp eax, 0xffffffe0
ja 0x586b5e
cmp dword [ebx + 0x16c], 0
mov dword [ebx + 0x38], eax
mov dword [ebx + 0x3c], ecx
je 0x5869bd
lea eax, [ebx + 0x60]
push eax
lea eax, [ebx + 0x40]
push eax
call edx
add esp, 8
mov dword [ebx + 0x16c], 0
mov eax, dword [ebx + 0xc]
push edi
mov edi, dword [ebx + 0x168]
mov dword [ebp - 0x14], edi
bswap eax
mov dword [ebp - 0xc], eax
test edi, edi
je 0x586a2a
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
mov dword [ebp - 4], eax
mov dword [ebp - 8], edx
nop
test esi, esi
je 0x586a0c
mov cl, byte [edi + ebx + 0x10]
dec esi
xor cl, byte [edx]
inc edx
mov byte [eax], cl
lea eax, [edi + ebx]
xor byte [eax + 0x40], cl
inc edi
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 8], edx
and edi, 0xf
mov dword [ebp - 4], eax
mov dword [ebp + 0x14], esi
mov dword [ebp - 0x14], edi
jne 0x5869e0
jmp 0x586a14
test edi, edi
jne 0x586b4f
lea eax, [ebx + 0x60]
push eax
lea eax, [ebx + 0x40]
push eax
call dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
add esp, 8
mov ecx, dword [ebp - 4]
jmp 0x586a36
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], ecx
mov dword [ebp - 8], eax
cmp esi, 0xc00
jb 0x586aad
mov edi, dword [ebp - 8]
mov eax, 0xaaaaaaab
mul esi
shr edx, 0xb
mov dword [ebp + 0x14], edx
mov edi, edi
push ebx
push dword [ebp - 0x10]
push 0xc0
push ecx
push edi
call dword [ebp + 0x18]
mov eax, dword [ebp - 0xc]
add eax, 0xc0
mov dword [ebp - 0xc], eax
bswap eax
push 0xc00
push dword [ebp - 4]
mov dword [ebx + 0xc], eax
lea eax, [ebx + 0x60]
push eax
lea eax, [ebx + 0x40]
push eax
call dword [ebp - 0x18]
mov ecx, dword [ebp - 4]
add esp, 0x24
add ecx, 0xc00
add edi, 0xc00
sub esi, 0xc00
mov dword [ebp - 4], ecx
dec dword [ebp + 0x14]
jne 0x586a50
mov dword [ebp - 8], edi
mov edi, dword [ebp - 0x14]
mov eax, dword [ebp - 8]
mov dword [ebp + 0x14], esi
mov edx, esi
and edx, 0xfffffff0
mov dword [ebp - 0x14], edx
je 0x586af6
push ebx
push dword [ebp - 0x10]
mov esi, edx
shr esi, 4
push esi
push ecx
push eax
call dword [ebp + 0x18]
mov eax, dword [ebp - 0xc]
add eax, esi
mov esi, dword [ebp + 0x14]
mov dword [ebp - 0xc], eax
bswap eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebp - 0x14]
sub esi, eax
add dword [ebp - 8], eax
push eax
push dword [ebp - 4]
lea eax, [ebx + 0x60]
push eax
lea eax, [ebx + 0x40]
push eax
call dword [ebp - 0x18]
mov eax, dword [ebp - 0x14]
add esp, 0x24
add dword [ebp - 4], eax
test esi, esi
je 0x586b4f
push dword [ebp - 0x10]
lea eax, [ebx + 0x10]
push eax
mov eax, dword [ebx + 0x170]
push ebx
call eax
mov eax, dword [ebp - 0xc]
add esp, 0xc
inc eax
bswap eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebp - 4]
sub dword [ebp - 8], eax
lea edx, [edi + eax]
lea eax, [ebx + 0x40]
mov ebx, dword [ebp - 8]
mov dword [ebp + 0x14], eax
jmp 0x586b30
movzx ecx, byte [eax + edi - 0x30]
lea edx, [edx + 1]
movzx eax, byte [ebx + edx - 1]
xor ecx, eax
mov eax, dword [ebp + 0x14]
mov byte [edx - 1], cl
xor byte [eax + edi], cl
inc edi
dec esi
jne 0x586b30
mov ebx, dword [ebp + 8]
mov dword [ebx + 0x168], edi
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret