Compilation on Windows

Simone Margaritelli edited this page Feb 23, 2018 · 3 revisions

Despite Windows support is not yet 100% complete, it is possible to build bettercap for Microsoft platforms and enjoy 99.99% of the experience. The steps to prepare the building environment are:

  • Install go amd64 (add go binaries to your %PATH%).
  • Install TDM GCC for amd64 (add TDM-GCC binaries to your %PATH%).
  • Also add TDM-GCC\x86_64-w64-mingw32\bin to your %PATH%.
  • Install winpcap.
  • Download Winpcap developer's pack and extract it to C:\.
  • Find wpcap.dll and packet.dll in your PC (typically in c:\windows\system32).
  • Copy them to some other temp folder or else you'll have to supply Admin privs to the following commands.
  • Run gendef on those files: gendef wpcap.dll and gendef packet.dll (obtainable with MinGW Installation Manager, package mingw32-gendef).

This will generate .def files, now we'll generate the static libraries files:

  • Run dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libwpcap.a --input-def wpcap.def.
  • and dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpacket.a --input-def packet.def.
  • Copy both libwpcap.a and libpacket.a to c:\WpdPack\Lib\x64.

And eventually just go get github.com/bettercap/bettercap as you would do on other platforms.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.