Function at 0x59087c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd4
push ebx
push esi
push edi
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0xc], edx
mov edi, eax
mov eax, edi
call fcn.00406270
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
lea eax, [eax + eax*4]
call fcn.00402bf8
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x24], 0xf
xor eax, eax
mov dword [ebp - 0x28], eax
mov esi, dword [ebp - 0x20]
dec esi
test esi, esi
jl 0x5908d7
inc esi
xor ebx, ebx
mov edx, dword [ebp - 0xc]
lea eax, [edi + ebx*8]
call fcn.00590694
mov edx, dword [ebp - 0x10]
mov byte [edx + ebx], al
and dword [ebp - 0x24], eax
or dword [ebp - 0x28], eax
inc ebx
dec esi
jne 0x5908bc
cmp dword [ebp - 0x24], 0xf
jne 0x5908f2
mov eax, dword [ebp - 0x18]
mov edx, edi
mov ecx, dword [0x5a28a0]
call fcn.004065b4
jmp 0x590a92
cmp dword [ebp - 0x28], 0xf
je 0x59090b
mov eax, dword [ebp - 0x18]
mov edx, dword [0x5a28a0]
call fcn.00406578
jmp 0x590a92
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0x20]
movzx eax, byte [eax + edx - 1]
mov dword [ebp - 0x2c], eax
mov esi, dword [ebp - 0x20]
dec esi
test esi, esi
jl 0x590947
inc esi
xor ebx, ebx
mov eax, dword [ebp - 0x10]
movzx eax, byte [eax + ebx]
mov edx, dword [ebp - 0x2c]
xor edx, eax
mov edx, dword [edx*4 + 0x70bd88]
add dword [ebp - 0x14], edx
mov dword [ebp - 0x2c], eax
inc ebx
dec esi
jne 0x59092a
mov eax, dword [ebp - 0x14]
shl eax, 3
call fcn.00402bf8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x14]
shl eax, 3
call fcn.00402bf8
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x20]
shl ecx, 3
mov edx, dword [ebp - 4]
mov eax, edi
call fcn.00402e18
mov esi, dword [ebp - 0x20]
sub esi, 2
test esi, esi
jl 0x59098d
inc esi
xor ebx, ebx
lea eax, [ebx + 1]
mov edx, dword [ebp - 0x1c]
mov dword [edx + ebx*4], eax
inc ebx
dec esi
jne 0x590980
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
xor ecx, ecx
mov dword [eax + edx*4 - 4], ecx
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 8], eax
test byte [ebp - 0x24], 1
jne 0x5909c9
push ebp
mov eax, dword [ebp - 0xc]
push dword [eax]
mov edx, 0x59062c
mov eax, 1
call fcn.00590730
pop ecx
test al, al
jne 0x590a82
test byte [ebp - 0x24], 2
jne 0x5909ee
push ebp
mov eax, dword [ebp - 0xc]
push dword [eax + 8]
mov edx, 0x59062c
mov eax, 2
call fcn.00590730
pop ecx
test al, al
jne 0x590a82
test byte [ebp - 0x24], 4
jne 0x590a0f
push ebp
mov eax, dword [ebp - 0xc]
push dword [eax + 4]
mov edx, 0x590660
mov eax, 4
call fcn.00590730
pop ecx
test al, al
jne 0x590a82
test byte [ebp - 0x24], 8
jne 0x590a30
push ebp
mov eax, dword [ebp - 0xc]
push dword [eax + 0xc]
mov edx, 0x590660
mov eax, 8
call fcn.00590730
pop ecx
test al, al
jne 0x590a82
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x18]
mov ecx, 1
mov edx, dword [0x5a28a0]
call fcn.0040644c
add esp, 4
xor ebx, ebx
jmp 0x590a54
mov eax, dword [ebp - 0x1c]
mov ebx, dword [eax + ebx*4]
mov eax, dword [ebp - 0x10]
cmp byte [eax + ebx], 0
je 0x590a4e
mov edx, ebx
xor eax, eax
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx]
mov esi, dword [ebp - 4]
mov edi, dword [esi + ebx*8]
mov dword [ecx + eax*8], edi
mov edi, dword [esi + ebx*8 + 4]
mov dword [ecx + eax*8 + 4], edi
inc eax
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ecx + ebx*4]
cmp edx, ebx
jne 0x590a61
mov eax, dword [ebp - 0x1c]
call fcn.00402c28
mov eax, dword [ebp - 4]
call fcn.00402c28
mov eax, dword [ebp - 0x10]
call fcn.00402c28
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret