, , ( , ..), . , , .
, , - (?), , ( ).
, , , . , C. gcc :
struct my_struct {
int blah;
} __attribute__((packed));
, , ..
, __attribute__((packed)) !
Another solution, which is much more appropriate, is self-parsing. You simply select the appropriate structure and fill in its fields, looking for good information from your buffer. The sequence of instructions memcpyis likely to do the trick here (see Kerrek's answer)
source
share