Skip to content

Commit

Permalink
PCAP detect
Browse files Browse the repository at this point in the history
- `PayloadFile::detectPcap()`: Fix issue with missing first 8 bytes of a text payload
  • Loading branch information
jelu committed Oct 7, 2019
1 parent 95222fb commit 72197b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/payload_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ PayloadFile::PayloadFile()
bool PayloadFile::detectPcap(ppl7::File& ff)
{
unsigned char buffer[8];
if (ff.read(buffer, 8) != 8)
if (ff.read(buffer, 8) != 8) {
ff.seek(0);
return false;
}
ff.seek(0);
unsigned int magic = ppl7::Peek32(buffer + 0);
if (magic == 0xa1b2c3d4 || magic == 0xa1b23c4d)
return true;
Expand Down

0 comments on commit 72197b5

Please sign in to comment.