Skip to content

Commit dd61fd3

Browse files
committed
fix data size
1 parent 5ff9b34 commit dd61fd3

File tree

5 files changed

+11
-12831
lines changed

5 files changed

+11
-12831
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
sCap - Version: 1.0.3 Snapshot Build 19
1+
sCap - Version: 1.0.4 Snapshot Build 21
22
----
33

4-
sCap is open source commandline application project which makes you able to scan, capture and dump incoming tcp/udp/icmp traffic. Software is written for educational purposes and is distributed in the hope that it will be useful for anyone interested in this field.
4+
sCap is open source commandline application project which uses system sockets and makes you able to scan, capture and dump incoming tcp/udp/icmp traffic without libcap. Software is written for educational purposes and is distributed in the hope that it will be useful for anyone interested in this field.
55

66
###Usage
77
```
@@ -12,7 +12,7 @@ options are:
1212
-h # print help and usage
1313
```
1414

15-
With option -i, you can capture incomming traffic and log ip/udp/tcp/icmp headers in file. If you add option -d, sCap will capture this headers and also it will dump incomming traffic data in file. Without those arguments, sCap only counts numbers of incoming packets.
15+
With option -i, you can capture incoming traffic and log ip/udp/tcp/icmp headers in file. If you add option -d, sCap will capture headers and also it will dump incoming traffic data in log file. Without those arguments, sCap only counts numbers of incoming packets.
1616

1717
###Installation
1818
Compilation of this project is possible with Makefile (just type 'make' in terminal).

info.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Desc: Get and print additional information
88
#include "stdinc.h"
99

1010
/* Version and build number */
11-
#define VERSION "1.0.3 Snapshot"
12-
#define BUILD 19
11+
#define VERSION "1.0.4 Snapshot"
12+
#define BUILD 21
1313

1414

1515
/*---------------------------------------------

packet.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Desc: Get and dump packets in file
1313
/*---------------------------------------------
1414
| Dump packet data in file
1515
---------------------------------------------*/
16-
void dump_data(unsigned char* data , int size)
16+
void dump_data(unsigned char* data, int size)
1717
{
1818
/* Used variables */
1919
int i, j;
2020

2121
/* Dump whole data */
22-
for(i=0 ; i < size ; i++)
22+
for(i=0; i < size; i++)
2323
{
2424
if(i && i%16 == 0)
2525
{
@@ -62,7 +62,7 @@ void dump_data(unsigned char* data , int size)
6262
/*---------------------------------------------
6363
| Log ip header in file
6464
---------------------------------------------*/
65-
void log_ip(unsigned char* buf, int size)
65+
void log_ip(unsigned char* buf)
6666
{
6767
/* Used variables */
6868
struct sockaddr_in name, dst;
@@ -104,7 +104,7 @@ void log_tcp(short dump, unsigned char* buf, int size)
104104
struct tcphdr* tcph= (struct tcphdr*)(buf + iph_len);
105105

106106
/* Log ip header */
107-
log_ip(buf, size);
107+
log_ip(buf);
108108

109109
/* Log TCP packet header in file */
110110
slog_to_file("[LIVE] Captured TCP Packet");
@@ -157,7 +157,7 @@ void log_udp(short dump, unsigned char* buf, int size)
157157
struct udphdr* udph = (struct udphdr*)(buf + iph_len);
158158

159159
/* Log ip header */
160-
log_ip(buf, size);
160+
log_ip(buf);
161161

162162
/* Log TCP packet header in file */
163163
slog_to_file("[LIVE] Captured UDP Packet");

0 commit comments

Comments
 (0)