in reply to Re^16: p0fq.pl and pack
in thread p0fq.pl and pack?
There's no such thing as a string in C. Strings are just arrays of characters treated specially. So that means you need to convert the array of chars into a string yourself.
foreach (qw( genre detail link tos )) { $data->{$_} = pack('c*', $data->{$_}); $data->{$_} =~ s/\x00.*//; }
Better yet, you can tell Concert::Binary::C whether a certain field should be treated as a string or as an array.
$c->tag('p0f_response.genre', Format => 'String'); $c->tag('p0f_response.detail', Format => 'String'); $c->tag('p0f_response.link', Format => 'String'); $c->tag('p0f_response.tos', Format => 'String');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^18: p0fq.pl and pack
by macli (Beadle) on Feb 26, 2007 at 04:22 UTC | |
by ikegami (Patriarch) on Feb 26, 2007 at 19:41 UTC | |
by macli (Beadle) on Feb 28, 2007 at 05:38 UTC |