Function at 0x590930
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x28]
sub esp, 0x28
push ebx
push esi
push edi
cmp eax, 2
je 0x59095a
cmp eax, 3
je 0x59095a
mov edx, dword [ebp + 0x14]
mov esi, dword [ebp + 0x10]
mov edi, dword [ebp + 8]
mov dword [ebp - 0x14], edx
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x10], edx
jmp 0x59097e
mov ecx, dword [ebp + 0xc]
cmp eax, 2
mov esi, dword [ebp + 8]
mov edx, 4
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x10], ecx
mov ecx, 1
cmove ecx, edx
mov eax, ecx
mov dword [ebp - 4], edi
mov dword [ebp + 0x28], esi
cmp eax, 1
je 0x590ae7
cmp eax, 4
je 0x590ae7
test eax, eax
je 0x5909a3
cmp eax, 5
jne 0x590c22
mov ecx, dword [ebp + 0x24]
neg eax
sbb eax, eax
and eax, 0xff
test ecx, ecx
je 0x590c22
mov edx, dword [ebp + 0x20]
add edx, 0xfffffffc
mov dword [ebp - 0x18], edx
mov edx, dword [ebp + 0x18]
mov dword [ebp - 8], edx
xor ebx, ebx
dec ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp + 0x14], ebx
cmp dword [ebp - 0x18], ebx
jl 0x590a81
lea ecx, [esi + 1]
mov dword [ebp - 0xc], edx
sub dword [ebp - 0xc], esi
mov dword [ebp - 0x20], ecx
mov ecx, edi
sub ecx, esi
mov dword [ebp + 0xc], edx
mov esi, edi
mov dword [ebp - 0x28], ecx
sub esi, edx
mov dword [ebp - 0x24], esi
mov esi, dword [ebp - 0x20]
jmp 0x590a00
movzx ecx, byte [ecx + esi]
lea esi, [esi + 4]
mov ebx, dword [ebp - 0x24]
xor edx, edx
cmp cl, byte [esi - 4]
mov ecx, dword [ebp + 0xc]
sete dl
neg edx
xor edx, eax
movzx ecx, byte [ebx + ecx]
cmp cl, byte [esi - 5]
mov ebx, dword [ebp + 0xc]
sete cl
neg cl
xor cl, al
mov byte [ebx], cl
mov ebx, dword [ebp + 0x14]
mov ecx, dword [ebp - 0xc]
mov byte [ecx + esi - 4], dl
xor edx, edx
movzx ecx, byte [edi + ebx + 3]
cmp cl, byte [esi - 2]
movzx ecx, byte [edi + ebx + 2]
mov ebx, dword [ebp + 0xc]
sete dl
neg edx
xor edx, eax
cmp cl, byte [esi - 3]
sete cl
neg cl
xor cl, al
mov byte [ebx + 2], cl
mov ecx, ebx
mov ebx, dword [ebp + 0x14]
add ebx, 4
mov dword [ebp + 0x14], ebx
mov byte [ecx + 3], dl
add ecx, 4
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp - 0x28]
cmp ebx, dword [ebp - 0x18]
jle 0x590a00
mov esi, dword [ebp + 0x28]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
cmp ebx, dword [ebp + 0x20]
jge 0x590ac6
mov ecx, edi
lea edx, [ebx + esi]
mov ebx, dword [ebp + 0x20]
sub ecx, esi
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp - 8]
sub ecx, esi
sub ebx, dword [ebp + 0x14]
mov esi, dword [ebp + 0xc]
mov edi, ecx
mov dword [ebp - 0x28], ecx
mov cl, byte [edx + esi]
lea edx, [edx + 1]
cmp cl, byte [edx - 1]
sete cl
neg cl
xor cl, al
mov byte [edx + edi - 1], cl
dec ebx
jne 0x590aa3
mov esi, dword [ebp + 0x28]
mov edi, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
add edi, dword [ebp - 0x10]
add esi, dword [ebp - 0x14]
add edx, dword [ebp + 0x1c]
mov dword [ebp - 4], edi
mov dword [ebp + 0x28], esi
mov dword [ebp - 8], edx
test ecx, ecx
jne 0x5909c6
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x24]
dec eax
neg eax
sbb eax, eax
and eax, 0xff
test ecx, ecx
je 0x590c22
mov edx, dword [ebp + 0x20]
add edx, 0xfffffffc
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp + 0x18]
mov dword [ebp - 8], edx
jmp 0x590b10
xor ebx, ebx
dec ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp + 0x14], ebx
cmp dword [ebp - 0x1c], ebx
jl 0x590bc3
lea ecx, [esi + 1]
mov dword [ebp - 0xc], edx
sub dword [ebp - 0xc], esi
mov dword [ebp - 0x28], ecx
mov ecx, edi
sub ecx, esi
mov dword [ebp + 0xc], edx
mov esi, edi
mov dword [ebp - 0x20], ecx
sub esi, edx
mov dword [ebp - 0x24], esi
mov esi, dword [ebp - 0x28]
movzx ecx, byte [ecx + esi]
lea esi, [esi + 4]
mov ebx, dword [ebp - 0x24]
xor edx, edx
cmp cl, byte [esi - 4]
mov ecx, dword [ebp + 0xc]
setg dl
neg edx
xor edx, eax
movzx ecx, byte [ebx + ecx]
cmp cl, byte [esi - 5]
mov ebx, dword [ebp + 0xc]
setg cl
neg cl
xor cl, al
mov byte [ebx], cl
mov ebx, dword [ebp + 0x14]
mov ecx, dword [ebp - 0xc]
mov byte [ecx + esi - 4], dl
xor edx, edx
movzx ecx, byte [edi + ebx + 3]
cmp cl, byte [esi - 2]
movzx ecx, byte [edi + ebx + 2]
mov ebx, dword [ebp + 0xc]
setg dl
neg edx
xor edx, eax
cmp cl, byte [esi - 3]
setg cl
neg cl
xor cl, al
mov byte [ebx + 2], cl
mov ecx, ebx
mov ebx, dword [ebp + 0x14]
add ebx, 4
mov dword [ebp + 0x14], ebx
mov byte [ecx + 3], dl
add ecx, 4
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp - 0x20]
cmp ebx, dword [ebp - 0x1c]
jle 0x590b42
mov esi, dword [ebp + 0x28]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x18]
cmp ebx, dword [ebp + 0x20]
jge 0x590c08
mov ecx, edi
lea edx, [ebx + esi]
mov ebx, dword [ebp + 0x20]
sub ecx, esi
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp - 8]
sub ecx, esi
sub ebx, dword [ebp + 0x14]
mov esi, dword [ebp + 0xc]
mov edi, ecx
mov dword [ebp - 0x28], ecx
mov cl, byte [esi + edx]
lea edx, [edx + 1]
cmp cl, byte [edx - 1]
setg cl
neg cl
xor cl, al
mov byte [edi + edx - 1], cl
dec ebx
jne 0x590be5
mov esi, dword [ebp + 0x28]
mov edi, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x18]
add edi, dword [ebp - 0x10]
add esi, dword [ebp - 0x14]
add edx, dword [ebp + 0x1c]
mov dword [ebp - 4], edi
mov dword [ebp + 0x28], esi
mov dword [ebp - 8], edx
test ecx, ecx
jne 0x590b10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret