Skip to content

Commit

Permalink
VisualStudio fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed Sep 1, 2014
1 parent 3475019 commit e3b1b87
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main-conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/out-certs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/out-unicornscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#endif
#include <ctype.h>

#if _MSC_VER
#define strdup _strdup
#endif

static char * tcp_services[65536];

static void init_tcp_services();
Expand Down
2 changes: 1 addition & 1 deletion src/proto-banner1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/proto-banner1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/proto-ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/proto-imap4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/proto-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/proto-pop3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/proto-smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions vs10/masscan.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@
<ClCompile Include="..\src\proto-banner1.c" />
<ClCompile Include="..\src\proto-banout.c" />
<ClCompile Include="..\src\proto-dns.c" />
<ClCompile Include="..\src\proto-ftp.c" />
<ClCompile Include="..\src\proto-http.c" />
<ClCompile Include="..\src\proto-icmp.c" />
<ClCompile Include="..\src\proto-imap4.c" />
<ClCompile Include="..\src\proto-interactive.c" />
<ClCompile Include="..\src\proto-netbios.c" />
<ClCompile Include="..\src\proto-ntp.c" />
<ClCompile Include="..\src\proto-pop3.c" />
<ClCompile Include="..\src\proto-sctp.c" />
<ClCompile Include="..\src\proto-smtp.c" />
<ClCompile Include="..\src\proto-snmp.c" />
<ClCompile Include="..\src\proto-ssh.c" />
<ClCompile Include="..\src\proto-ssl-test.c" />
Expand All @@ -66,6 +71,7 @@
<ClCompile Include="..\src\proto-preprocess.c" />
<ClCompile Include="..\src\proto-tcp-telnet.c" />
<ClCompile Include="..\src\proto-udp.c" />
<ClCompile Include="..\src\proto-vnc.c" />
<ClCompile Include="..\src\proto-x509.c" />
<ClCompile Include="..\src\proto-zeroaccess.c" />
<ClCompile Include="..\src\rand-blackrock.c" />
Expand Down Expand Up @@ -120,19 +126,24 @@
<ClInclude Include="..\src\proto-banout.h" />
<ClInclude Include="..\src\proto-dns-parse.h" />
<ClInclude Include="..\src\proto-dns.h" />
<ClInclude Include="..\src\proto-ftp.h" />
<ClInclude Include="..\src\proto-http.h" />
<ClInclude Include="..\src\proto-icmp.h" />
<ClInclude Include="..\src\proto-imap4.h" />
<ClInclude Include="..\src\proto-interactive.h" />
<ClInclude Include="..\src\proto-netbios.h" />
<ClInclude Include="..\src\proto-ntp.h" />
<ClInclude Include="..\src\proto-pop3.h" />
<ClInclude Include="..\src\proto-preprocess.h" />
<ClInclude Include="..\src\proto-sctp.h" />
<ClInclude Include="..\src\proto-smtp.h" />
<ClInclude Include="..\src\proto-snmp.h" />
<ClInclude Include="..\src\proto-ssh.h" />
<ClInclude Include="..\src\proto-ssl.h" />
<ClInclude Include="..\src\proto-tcp.h" />
<ClInclude Include="..\src\proto-tcp-telnet.h" />
<ClInclude Include="..\src\proto-udp.h" />
<ClInclude Include="..\src\proto-vnc.h" />
<ClInclude Include="..\src\proto-x509.h" />
<ClInclude Include="..\src\proto-zeroaccess.h" />
<ClInclude Include="..\src\rand-blackrock.h" />
Expand Down
33 changes: 33 additions & 0 deletions vs10/masscan.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,24 @@
<ClCompile Include="..\src\out-unicornscan.c">
<Filter>Source Files\output</Filter>
</ClCompile>
<ClCompile Include="..\src\proto-ftp.c">
<Filter>Source Files\proto</Filter>
</ClCompile>
<ClCompile Include="..\src\proto-imap4.c">
<Filter>Source Files\proto</Filter>
</ClCompile>
<ClCompile Include="..\src\proto-pop3.c">
<Filter>Source Files\proto</Filter>
</ClCompile>
<ClCompile Include="..\src\proto-smtp.c">
<Filter>Source Files\proto</Filter>
</ClCompile>
<ClCompile Include="..\src\proto-vnc.c">
<Filter>Source Files\proto</Filter>
</ClCompile>
<ClCompile Include="..\src\proto-interactive.c">
<Filter>Source Files\proto</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\proto-arp.h">
Expand Down Expand Up @@ -431,6 +449,21 @@
<ClInclude Include="..\src\proto-interactive.h">
<Filter>Source Files\proto</Filter>
</ClInclude>
<ClInclude Include="..\src\proto-ftp.h">
<Filter>Source Files\proto</Filter>
</ClInclude>
<ClInclude Include="..\src\proto-imap4.h">
<Filter>Source Files\proto</Filter>
</ClInclude>
<ClInclude Include="..\src\proto-pop3.h">
<Filter>Source Files\proto</Filter>
</ClInclude>
<ClInclude Include="..\src\proto-smtp.h">
<Filter>Source Files\proto</Filter>
</ClInclude>
<ClInclude Include="..\src\proto-vnc.h">
<Filter>Source Files\proto</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\README.md" />
Expand Down

0 comments on commit e3b1b87

Please sign in to comment.