Nmap Development mailing list archives

Ndiff included in Windows zip distribution


From: David Fifield <david () bamsoftware com>
Date: Wed, 4 Feb 2009 16:09:00 -0700

Hi all,

Fyodor asked me to find a way to include Ndiff in the Windows zip
distribution. The only difficulty with this is that Ndiff is a Python
program and needs either a Python interpreter or to be compiled with
py2exe (like in the executable installer). I tried including Ndiff built
with py2exe, but it roughly doubled the size of the distribution from
4 MB to 8 MB. So instead we decided to package the Ndiff source and
require Python to be installed already.

Ideally you want to be able to say "ndiff a.xml b.xml" and have it work,
as long as Python is installed and the Ndiff source is in the PATH. But
Windows won't automatically execute a Python script unless it has a .py
extension. To get around this, I wrote a batch file that looks for
Python and runs ndiff.py. You're allowed to leave off the extension when
calling a batch program, so it's not necessary to say "ndiff.bat" or
"ndiff.py".

I probably doubled my knowledge of batch programming in writing this
little script, so I bet it could be done better. I attached it so anyone
more knowledgeable can comment on it. For a reference of the %~ variable
references, type "help for" at the Windows command prompt.

A minor problem with this batch program is that it doesn't communicate
the exit status of ndiff to the outside environment. In other words,
running ndiff.bat always returns a status code of 0. After some web
searching I decided there's no easy way to do it. Does anyone know
different?

David Fifield

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

Current thread: