mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Replaced nmap's hex dump functions with new hexdump() included in nbase. Before
Nmap used two functions: one of them, hdump(), just printed raw hex bytes
(no ASCII equivalents) and the other one, lamont_hdump() had a bug when
printing buffers where bufflen%16==3. A new function has been implemented
from scratch, that basically produces the same output as Wireshark.
Output looks like this:
0000 e8 60 65 86 d7 86 6d 30 35 97 54 87 ff 67 05 9e .`e...m05.T..g..
0010 07 5a 98 c0 ea ad 50 d2 62 4f 7b ff e1 34 f8 fc .Z....P.bO{..4..
0020 c4 84 0a 6a 39 ad 3c 10 63 b2 22 c4 24 40 f4 b1 ...j9.<.c.".$@..
Changes:
- The new hexdump() function has been added to nbase.
- Old hdump() and lamont_dump() have been removed from nmap's code.
- A wrapper to the new hexdump(), called nmap_hexdump(), has been added
to nmap's utils.cc. The wrapper basically prints the buffer returned
by hexdump() using nmap's log_write() function.
This commit is contained in:
2
tcpip.cc
2
tcpip.cc
@@ -2223,7 +2223,7 @@ if (!pd) fatal("NULL packet device passed to %s", __func__);
|
||||
fatal("FATAL: %s: bogus caplen from libpcap (%d) on interface type %d", __func__, head.caplen, datalink);
|
||||
}
|
||||
error("FATAL: Unknown datalink type (%d). Caplen: %d; Packet:", datalink, head.caplen);
|
||||
lamont_hdump(p, head.caplen);
|
||||
nmap_hexdump((unsigned char*)p, head.caplen);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user