1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11: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:
luis
2009-08-25 18:09:19 +00:00
parent d63fba1dd6
commit a5ca31db9e
5 changed files with 14 additions and 86 deletions

View File

@@ -173,8 +173,7 @@ template<class T> T box(T bmin, T bmax, T bnum) {
int wildtest(char *wild, char *test);
void hdump(unsigned char *packet, unsigned int len);
void lamont_hdump(char *cp, unsigned int length);
void nmap_hexdump(unsigned char *cp, unsigned int length);
/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the