Yes, you're right. It's not a binary data problem, but pxor result. This is my test, really just for my understanding. Well, in the sys_write syscall, when i point %ecx to memory where stored pxor xmm0 value 'mov -0x40(%rbp),%ecx', then i have 0 length file created! On the contrary if i point to bigbuff '-0x30(%rbp)' it's all ok.
#include<stdio.h>
#include<fcntl.h>
#include<unistd.h>
#include <emmintrin.h>
main(int argc, char **argv)
{
unsigned char __attribute__ ((aligned (16))) *bigbuff = (char *) malloc(16);
unsigned char __attribute__ ((aligned (16))) *buff = (char *) malloc(16);
unsigned char __attribute__ ((aligned (16))) *nome_file = (char *) malloc(16);
bigbuff="gatto sisvestr\n";
buff="micio sisvestro2";
nome_file="nuovo.txt"; //la lunghezza massima del nome è data da malloc!!!
asm (
"movdqa -0x30(%rbp), %xmm0;"
"movdqa -0x20(%rbp), %xmm1;"
"pxor %xmm1,%xmm0;"
"movdqa %xmm0,-0x40(%rbp);"
"movdqa -0x40(%rbp), %xmm2;"
"movdqa -0x20(%rbp), %xmm1;"
"pxor %xmm1,%xmm2;"
"movdqa %xmm2,-0x30(%rbp);"
"mov $8, %eax;"
"mov -0x10(%rbp),%ebx;"
"mov $448, %ecx;"
"int $0x80;"
"mov %eax, %ebx;"
"mov $4, %eax;"
"mov -0x40(%rbp), %ecx;"
"mov $14, %edx;"
"int $0x80;"
);
}