I'm supposed to write a library in c++ that should handle the connections to the kad network. I'm trying to build a packet accordant to those used by aMule&co.
And I really can't understand the difference between this code:
buffer = "\xe4\x20\x02";
and, for example, this code:
char p_buffer[36];
p_buffer[0] = 0xe4;
p_buffer[1] = 0x20;
p_buffer[2] = 0x02;
buffer = p_buffer;
(buffer is a private attribute of the class, while p_buffer is a local variable)
capturing the packets with wireshark gives me different results (the first one is right as I wanted, the second one not), like I was doing something wrong with little endian / big endian notations, I guess...
and why in the constructor of a class can't I modify a [private] "char* buffer" like this:
buffer[0] = 0xe4;
? (it does not work, exits without any trace back error)
(if it can matter, I'm using crypto++ and boost libraries)
thanks in advance for any help_