Fix some Windows compilation errors

This commit is contained in:
fyodor 2006-08-31 05:28:59 +00:00
parent abe23035a7
commit 521184fdc8
4 changed files with 13 additions and 7 deletions

View file

@ -1,4 +1,4 @@
Nmap 4.20ALPHA5 ( http://www.insecure.org/nmap/ )
Nmap 4.20ALPHA5 ( http://insecure.org/nmap/ )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc.
@ -36,7 +36,7 @@ SERVICE/VERSION DETECTION:
--version-all: Try every single probe (intensity 9)
--version-trace: Show detailed version scan activity (for debugging)
OS DETECTION:
-O: Enable OS detection (try 2nd generation, then 1st if that fails)
-O: Enable OS detection (try 2nd generation w/fallback to 1st)
-O2: Only use the new OS detection system (no fallback)
-O1: Only use the old (1st generation) OS detection system
--osscan-limit: Limit OS detection to promising targets
@ -59,6 +59,7 @@ FIREWALL/IDS EVASION AND SPOOFING:
-e <iface>: Use specified interface
-g/--source-port <portnum>: Use given port number
--data-length <num>: Append random data to sent packets
--ip-options <options>: Send packets with specified ip options
--ttl <val>: Set IP time-to-live field
--spoof-mac <mac address/prefix/vendor name>: Spoof your MAC address
--badsum: Send packets with a bogus TCP/UDP checksum

View file

@ -280,7 +280,8 @@ int main(int argc, char *argv[]) {
nmap_main(myargc, myargv);
} else if (*myargv[0] == '!') {
cptr = strchr(command, '!');
system(cptr + 1);
int rc = system(cptr + 1);
if (rc < 1) printf("system() execution of command failed\n");
} else if (*myargv[0] == 'd') {
o.debugging++;
} else if (strcasecmp(myargv[0], "f") == 0) {

View file

@ -579,8 +579,8 @@ HostOsScanStats::HostOsScanStats(Target * t) {
target = t;
FP = NULL;
bzero(&si, sizeof(si));
bzero(&ipid, sizeof(ipid));
memset(&si, 0, sizeof(si));
memset(&ipid, 0, sizeof(ipid));
openTCPPort = -1;
closedTCPPort = -1;
@ -1708,7 +1708,7 @@ void HostOsScan::makeTSeqFP(HostOsScanStats *hss) {
/* Finally we take a binary logarithm, multiply by 8, and round
to get the final result */
seq_rate = log(seq_rate) / log(2);
seq_rate = log(seq_rate) / log(2.0);
seq_rate = (unsigned int) (seq_rate * 8 + 0.5);
/* Normally we don't divide by gcd in computing the rate stddev
@ -1742,7 +1742,7 @@ void HostOsScan::makeTSeqFP(HostOsScanStats *hss) {
/* Finally we take a binary logarithm, multiply by 8, and round
to get the final result */
seq_stddev = log(seq_stddev) / log(2);
seq_stddev = log(seq_stddev) / log(2.0);
hss->si.index = (int) (seq_stddev * 8 + 0.5);
}

View file

@ -737,7 +737,11 @@ void log_vwrite(int logt, const char *fmt, va_list ap) {
case LOG_MACHINE:
case LOG_SKID:
case LOG_XML:
#ifdef WIN32
*apcopy = *ap;
#else
va_copy(apcopy, ap); /* Needed in case we need to so a second vnsprintf */
#endif
l = logt;
fileidx = 0;
while ((l&1)==0) { fileidx++; l>>=1; }