Nmap Development mailing list archives

Re: [nmap-svn] r15082 - nmap-exp/luis/nping


From: "Luis M." <luis.mgarc () gmail com>
Date: Fri, 21 Aug 2009 11:08:14 +0100

Fyodor wrote:
On Tue, Aug 18, 2009 at 06:32:13AM -0700, commit-mailer () insecure org wrote:
  
Log:
    

  
Nmap's lamont_dump() has a bug that triggers when printing lines of
only 3 bytes. The code was quite complicated to understand so I just
implemented a new version from scratch. The code of the new function
is much simpler, no need for all those loops lamont used. Additionaly,
this new hdump is locale aware, so current locale will determine which
chars are printable. Also, a byte count was added to the start of
every line. Basically the output of the function is exactly the same
as wireshark's packet dump.
    

Hi Luis.  As you know, we try to avoid maintining multiple functions
with serve similar purposes.  It is better to standardize on one
function when at all possible (in this case I believe it is).  Nmap
only uses lamont_hdump() in one place, and your function does seem to
be an improvement, so I suggest standardizing on yours.

How about if you add your function to Nbase, remove lamont_hdump()
from Nmap, and replace it to a call to your function?  I think it
would be best to call your function hexdump() or something like that.
I realize that luis_hdump() was just following the lamont_hdump model,
but that was a poorly chosen name in the first place.

You should send your patch to nmap-dev first and give people a couple
days to comment if they want to, then check it in.

Thanks!
-Fyodor

  

Current hdump() and lamont_dump() use log_write() calls to print
information but log_write() is not on nbase. Would it be OK to use my
hexdump() even though it uses only regular printf() calls? Moving
log_write() to nbase is not an option because it uses log_vwrite() which
depends on the "NmapOps o" global.

Luis.



_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

  


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: