From e3b1b87be555d47eb86d572b4af36a0c313b68de Mon Sep 17 00:00:00 2001 From: robertdavidgraham Date: Mon, 1 Sep 2014 16:49:09 -0400 Subject: [PATCH] VisualStudio fixes --- src/main-conf.c | 2 +- src/out-certs.c | 2 ++ src/out-unicornscan.c | 4 ++++ src/proto-banner1.c | 2 +- src/proto-banner1.h | 4 ++-- src/proto-ftp.c | 4 ++-- src/proto-imap4.c | 4 ++-- src/proto-interactive.c | 2 +- src/proto-pop3.c | 4 ++-- src/proto-smtp.c | 4 ++-- vs10/masscan.vcxproj | 11 +++++++++++ vs10/masscan.vcxproj.filters | 33 +++++++++++++++++++++++++++++++++ 12 files changed, 63 insertions(+), 13 deletions(-) diff --git a/src/main-conf.c b/src/main-conf.c index f09b70cb..7d11f481 100644 --- a/src/main-conf.c +++ b/src/main-conf.c @@ -1602,7 +1602,7 @@ masscan_set_parameter(struct Masscan *masscan, exit(1); } else if (EQUALS("vlan", name) || EQUALS("adapter-vlan", name)) { masscan->nic[index].is_vlan = 1; - masscan->nic[index].vlan_id = parseInt(value); + masscan->nic[index].vlan_id = (unsigned)parseInt(value); } else if (EQUALS("wait", name)) { if (EQUALS("forever", value)) masscan->wait = INT_MAX; diff --git a/src/out-certs.c b/src/out-certs.c index e25b0208..81fd290d 100644 --- a/src/out-certs.c +++ b/src/out-certs.c @@ -61,6 +61,8 @@ cert_out_banner(struct Output *out, FILE *fp, time_t timestamp, UNUSEDPARM(fp); UNUSEDPARM(out); UNUSEDPARM(ttl); + UNUSEDPARM(proto); + UNUSEDPARM(port); if (length > 5 && memcmp(px, "cert:", 5) == 0) { px += 5; diff --git a/src/out-unicornscan.c b/src/out-unicornscan.c index d785e960..6d97dac7 100644 --- a/src/out-unicornscan.c +++ b/src/out-unicornscan.c @@ -12,6 +12,10 @@ #endif #include +#if _MSC_VER +#define strdup _strdup +#endif + static char * tcp_services[65536]; static void init_tcp_services(); diff --git a/src/proto-banner1.c b/src/proto-banner1.c index 15234f7c..b2e2e5ca 100644 --- a/src/proto-banner1.c +++ b/src/proto-banner1.c @@ -99,7 +99,7 @@ banner1_parse( } break; case PROTO_VNC_RFB: - tcb_state->sub.vnc.version = patterns[x].extra; + tcb_state->sub.vnc.version = (unsigned char)patterns[x].extra; break; } diff --git a/src/proto-banner1.h b/src/proto-banner1.h index a2a5a159..6106fef9 100644 --- a/src/proto-banner1.h +++ b/src/proto-banner1.h @@ -79,8 +79,8 @@ struct PIXEL_FORMAT { unsigned char blue_shift; unsigned char bits_per_pixel; unsigned char depth; - unsigned char big_endian_flag:1; - unsigned char true_colour_flag:1; + unsigned big_endian_flag:1; + unsigned true_colour_flag:1; }; struct VNCSTUFF { unsigned sectype; diff --git a/src/proto-ftp.c b/src/proto-ftp.c index 736c9dcb..137ea663 100644 --- a/src/proto-ftp.c +++ b/src/proto-ftp.c @@ -95,11 +95,11 @@ ftp_parse( const struct Banner1 *banner1, memset(pstate, 0, sizeof(*pstate)); pstate->app_proto = PROTO_SSL3; pstate->is_sent_sslhello = 1; - pstate->port = port; + pstate->port = (unsigned short)port; state = 0; more->payload = banner_ssl.hello; - more->length = banner_ssl.hello_length; + more->length = (unsigned)banner_ssl.hello_length; } else { state = STATE_DONE; diff --git a/src/proto-imap4.c b/src/proto-imap4.c index ef280dd0..3d1fb9b7 100644 --- a/src/proto-imap4.c +++ b/src/proto-imap4.c @@ -155,11 +155,11 @@ imap4_parse( const struct Banner1 *banner1, memset(pstate, 0, sizeof(*pstate)); pstate->app_proto = PROTO_SSL3; pstate->is_sent_sslhello = 1; - pstate->port = port; + pstate->port = (unsigned short)port; state = 0; more->payload = banner_ssl.hello; - more->length = banner_ssl.hello_length; + more->length = (unsigned)banner_ssl.hello_length; break; } break; diff --git a/src/proto-interactive.c b/src/proto-interactive.c index 77855106..2c57fa43 100644 --- a/src/proto-interactive.c +++ b/src/proto-interactive.c @@ -4,5 +4,5 @@ void tcp_transmit(struct InteractiveData *more, const void *payload, size_t length) { more->payload = payload; - more->length = length; + more->length = (unsigned)length; } diff --git a/src/proto-pop3.c b/src/proto-pop3.c index 4b60c85c..af621404 100644 --- a/src/proto-pop3.c +++ b/src/proto-pop3.c @@ -119,11 +119,11 @@ pop3_parse( const struct Banner1 *banner1, memset(pstate, 0, sizeof(*pstate)); pstate->app_proto = PROTO_SSL3; pstate->is_sent_sslhello = 1; - pstate->port = port; + pstate->port = (unsigned short)port; state = 0; more->payload = banner_ssl.hello; - more->length = banner_ssl.hello_length; + more->length = (unsigned)banner_ssl.hello_length; break; } break; diff --git a/src/proto-smtp.c b/src/proto-smtp.c index 0eb35ce3..d47986cb 100644 --- a/src/proto-smtp.c +++ b/src/proto-smtp.c @@ -141,11 +141,11 @@ smtp_parse( const struct Banner1 *banner1, memset(pstate, 0, sizeof(*pstate)); pstate->app_proto = PROTO_SSL3; pstate->is_sent_sslhello = 1; - pstate->port = port; + pstate->port = (unsigned short)port; state = 0; more->payload = banner_ssl.hello; - more->length = banner_ssl.hello_length; + more->length = (unsigned)banner_ssl.hello_length; } else { state = STATE_DONE; diff --git a/vs10/masscan.vcxproj b/vs10/masscan.vcxproj index 77ee0390..aea5b9e3 100644 --- a/vs10/masscan.vcxproj +++ b/vs10/masscan.vcxproj @@ -43,11 +43,16 @@ + + + + + @@ -66,6 +71,7 @@ + @@ -120,19 +126,24 @@ + + + + + diff --git a/vs10/masscan.vcxproj.filters b/vs10/masscan.vcxproj.filters index 9b3c5472..6d09f516 100644 --- a/vs10/masscan.vcxproj.filters +++ b/vs10/masscan.vcxproj.filters @@ -252,6 +252,24 @@ Source Files\output + + Source Files\proto + + + Source Files\proto + + + Source Files\proto + + + Source Files\proto + + + Source Files\proto + + + Source Files\proto + @@ -431,6 +449,21 @@ Source Files\proto + + Source Files\proto + + + Source Files\proto + + + Source Files\proto + + + Source Files\proto + + + Source Files\proto +