Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,66 @@ information you think necessary. Refer to [the Npcap Guide section on reporting
bugs](https://npcap.com/guide/npcap-users-guide.html#npcap-issues) for more
complete directions.

## Contribution

If you want to contribute to the development of this project, first you need to setup the development environment.

### Development Environment

Install a Windows. For example, use Windows 11, version 21H2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Install a version of Windows."


When you install Visual Studio 2022, select the Desktop development with C++ workload, then under Individual Components add:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Install Visual Studio 2022" should explicitly be stated as a step, for example:

Install Visual Studio 2022. When you do so, select the Desktop development with C++ workload, then under Individual Components add:


- MSVC v143 - VS 2022 C++ ARM64/ARM64EC Spectre-mitigated libs (Latest)
- MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)
- C++ ATL for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
- C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x64)
- C++ MFC for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
- C++ MFC for latest v143 build tools with Spectre Mitigations (x86 & x64)
- Windows Driver Kit

Install Windows SDK from https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ if you get the error "The Windows SDK version 10.0.26100.0 was not found.".

You also need WDK for Windows 11, version 21H2. Download and install it from https://go.microsoft.com/fwlink/?linkid=2166289

For addition tasks, like building the documentation, you need roffit. Clone it from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For additional tasks".

```
cd C:\Users\Measurement\
git clone https://github.com/bagder/roffit.git
```

Also, download 7z from https://www.7-zip.org/a/7z2409-x64.exe

As this version of Visual Studio does not support the compilation for Win32 drivers out of the box, please follow the instructions given in
https://stackoverflow.com/questions/75509242/compiling-32-bits-driver-using-msvc-2022
In addition, you might need additional files (TODO).

Next, download AirPCAP Devpack from https://support.riverbed.com/bin/support/download?sid=l3vk3eu649usgu3rj60uncjqqu
and unpack it to, for example to %USERPROFILE%\Airpcap_Devpack

Then, download https://npcap.com/dist/ npcap-sdk and install it under, e.g. %USERPROFILE%\npcap-sdk-1.14

We need Winflex, which can be download at https://github.com/lexxmark/winflexbison/releases . Be sure that it is in environment variable 'Path'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called WinFlexBison, and you need both Flex and Bison to compile libpcap's filter parser.

Test it by entering 'win_flex -V' into a command shell.

You might also need pkg-config from https://download.gnome.org/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip

#### Cloing the reposiory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Cloning the repository".


On https://github.com, fork both the repositories npcap https://github.com/nmap/npcap and libpcap https://github.com/the-tcpdump-group/libpcap.
Then, enter the following commands.

```
cd %USERPROFILE%
git clone https://github.com/YOURUSER/npcap
git submodule update --init --recursive
cd wpcap
wpcap-cmake.bat
cd ..
cd installer
build.bat
```

## License

The [Npcap License](https://github.com/nmap/npcap/blob/master/LICENSE) allows
Expand Down
6 changes: 3 additions & 3 deletions installer/Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ for /f "usebackq delims=#" %%a in (`"%ProgramFiles(x86)%\Microsoft Visual Studio
:break1
if %ERRORLEVEL% NEQ 0 goto :badenv

msbuild "%NPCAPDIR%\packetWin7\vs14\npcap.sln" /m /t:Build /p:Configuration="%MODE%" /p:Platform="x86"
msbuild "%NPCAPDIR%\packetWin7\vs14\npcap.sln" /m /t:Build /p:Configuration="%MODE% Win10 driver" /p:Platform="x86"
msbuild "%NPCAPDIR%\wpcap\build-win32\wpcap.vcxproj" /m /t:Build /p:Configuration="%MODE%" /p:Platform="Win32"
REM msbuild "%NPCAPDIR%\packetWin7\vs14\npcap.sln" /m /t:Build /p:Configuration="%MODE%" /p:Platform="x86"
REM msbuild "%NPCAPDIR%\packetWin7\vs14\npcap.sln" /m /t:Build /p:Configuration="%MODE% Win10 driver" /p:Platform="x86"
REM msbuild "%NPCAPDIR%\wpcap\build-win32\wpcap.vcxproj" /m /t:Build /p:Configuration="%MODE%" /p:Platform="Win32"

for /f "usebackq delims=#" %%a in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -version %VSVER% -property installationPath`) do call "%%a\VC\Auxiliary\Build\vcvarsall.bat" x64 & goto :break2
:break2
Expand Down