Various network libraries and ports

This is just a random collection of mainly network libraries for Watt-32 and/or MinGW and Visual-C that I've been involved with. There are more stuff waiting on my harddisk to get a home here, but time is limited...

For MSDOS/Watt-32 only

curl-7.10.5-djgpp.zip
cURL 7.10.5 library for djgpp only. Goto the cURL site for the latest version.  cURL rocks

dosftp12.zip
A conio-based FTP client. Includes sources for Borland, High-C, Watcom, Digital Mars and GNU-C (djgpp).

dos-ncftp-21.zip
A port of the ncFTP client programs and libNcFTP API to djgpp. Includes source and binaries.
This version (2.1) is rather old, so go to http://www.ncftp.com for the latest version.

dosrpc05.zip
Sun's RPC/XDR library. The basis for the NFS protocol among other things. Also includes a portmapper and RPC code-generator.
Compiles with djgpp, Borland or High-C.

dossmb02.zip
Richard Sharpe's SMB library ported to MSDOS. This is the core protocol used in file-sharing under Windows (and OS/2's LAN-Manager).
Incomplete now, but work is in progress to support the latest SMB standard (NT LANMAN 1.02).

dostn09.zip
A conio-based Telnet client. Includes sources for Borland, HighC, Watcom, and GNU-C (djgpp).

exc_dx07.zip
Exception handler library mainly for Pharlap and Metaware High-C. Some of it can be used under djgpp too.

gnumap.zip
Extracts debug information from a djgpp program and produces a detailed .map-file.
Handy if you need to know the exact layout of structures or what the stack looks like.
Example:
    struct _tm {
      /* 00000000 */ int _tm_sec;
      /* 00000004 */ int _tm_min;
      /* 00000008 */ int _tm_hour;
      /* 0000000C */ int _tm_mday;
      /* 00000010 */ int _tm_mon;
      /* 00000014 */ int _tm_year;
      /* 00000018 */ int _tm_wday;
      /* 0000001C */ int _tm_yday;
      /* 00000020 */ int _tm_isdst;
      /* 00000024 */ char *___tm_zone;
      /* 00000028 */ int ___tm_gmtoff;
   }; /* size=44 bytes */

   ...

   00001A03 1          int _main()  /* size=1115 */
   00001A03            {                             (51)
                         int _argc                   (%ebp+8)
                         char **_argv                (%ebp+12)
                         struct _SMB_Connect *_con   (%ebp-12)
                         struct _SMB_Tree *_tree     (%ebp-16)
                         int _opt                    (%ebp-20)
                         int _status                 (%ebp-24)
                  ...
  

gnutella.zip
A quick and dirty port of GNUtella file-sharing program to DOS. Requires pthreads and djgpp to compile.
Define a GNUT environment variable to point to location of gnut.exe and edit the gnut.hst file. I'm not sure this even works (I only made it compile).
Use at own risk.

lwip-dos.zip
Nothing to do with the Watt-32 tcp/ip-stack, but this is something very interesting. A full featured tcp/ip called lwIP. I.e. "Lightweight tcp/ip" stack which is somewhat of an understatement. I've added compile-specific support for djgpp and OpenWatcom plus the necessary packet-driver interface.
The content of the .zip must be extracted to LWIP_ROOT/src/contrib/ports/msdos/. I've provided makefiles for djgpp and OpenWatcom.
Support for Pharlap's DOS-extender TNT (with High-C, OpenWatcom) is in the works.
Features and limitations in this port: Planned additional features:

lynx-djgpp.zip
A set of Makefiles and a lynx-dj.exe for Lynx, the text-mode Web-browser.

mwcon14.zip
A Borland compatible conio text-mode screen library for High-C/Watcom (32-bit only).
Now also for Windows (MSVC and MinGW).

nullpkt.zip
A dummy test PKTDRVR.

openssl-djgpp.zip
Makefiles and libs for OpenSSL. I was tired of fighting with bash, Configure and automake, so I wrote this Makefile.
Contary to what the included INSTALL.DJGPP says (Doug Kaufman wrote that), I prefer to use these *.djg files.
Use at own risk.

snarf7-djgpp.zip
snarf ftp/http fetcher. Simpler but similar to wget.

snmp114.zip
A port of SNMP lib v1.14 to Watt-32. Based on the project from University of Carnegie Mellon's. This project has been
discontinued and replaced by net-SNMP.

webs218-djgpp.zip
GoAhead web-server 2.1.8 with embedded JavaScript and Active Server Pages. Optionally with https/SSL support.
This .zip only contains patches and files specific to Watt-32. Get the official files before patching with this zip-file.
Currently for djgpp only, but easily portable to other compilers and environments.

Other ongoing and/or dormant Watt-32 projects:
Port the OpenVPN library. XML-RPC, SOAP clients for embedded Web-based clients.
Mail me if you have time to spare and is willing to help.

For MinGW only

gobbler-mingw.zip
Makefile for "The Gobbler". A tool to audit DHCP networks.
Very little tested by me (I mostly tweaked it to build and link). This .zip includes a binary and required DLLs.
Requires libpcap and libnet if you want to build it.

ntop-mingw.zip
A makefile, brief instructions and patches for building ntop using MinGW. It in a pretty bad state at the moment, but Ntop builds and runs fine here.

openvpn-mingw.zip
A makefile and a simple patch (win/config.h.in) for building OpenVPN using MinGW.

polipo-mingw.zip
Makefile and some small diffs for Polipo. Polipo is a small and fast caching web proxy that can be used together with the Tor client below.

For both MSDOS and MinGW

dos-win-mtr054.zip
Matt's Traceroute 0.54 for MinGW and Watt-32.

wput-031.zip
The inverse of wget; uploads files to a ftp-server directly from the cmd-line. No more messing with ftp scripts.
Note: this zip is supposed to be installed under the ./bin tree of Watt-32.

For MinGW and/or Visual-C

boringssl-windows.zip
Makefiles for BoringSSL targeting MinGW, clang-cl and MSVC.
This is Google's fork of OpenSSL which should be ABI compatiple with OpenSSL. I'm not sure, but it looks really neat.

envtool.zip. Please go to the page Github since the version here is not up-to-date.
EnvTool v1.2: A little utility to check and search along these environment variables:
CMAKE_MODULE_PATH envtool --cmake <wildcard> Searches the built-in module-path first.
INCLUDE, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH envtool --inc <wildcard>
LIB, LIBRARY_PATH envtool --lib <wildcard>
MANPATH envtool --man <wildcard> Searches for *.[1-9]* files in sub-directories
man[1-9] in %MANPATH%.
PATH envtool --path <wildcard> (1)
PKG_CONFIG_PATH envtool --pkg <wildcard> Searches for *.pc files.
PYTHONPATH and sys.path[] envtool --python <wildcard> (2)
Everything database envtool --evry <wildcard> (3)
Everything remote database envtool --evry=host_or_IP_addr <wildcard> Searches via FTP on a remote computer
(which has EveryThing installed).
It searches and checks the above environment variables for correctness and checks where a specific file (or wildcard) is in the corresponding environment variable.
Option --pe-check checks PE-files for correct checksum and tries to print the resource version information.
C-sources and Makefiles for MinGW, OpenWatcom, Cygwin (little tested) and MSVC are included. Also a MSVC Solution-file is included.
The <wildcard> can contain a POSIX-style range. E.g. "foo/[a-d]bar".
But the sub-dir cannot contain any wildcards. Example (on my PC):
   05 Jan 2002 - 17:37:00: f:\windows\system32\msvcr70.dll
   04 Mar 2010 - 19:06:06: f:\windows\system32\msvcr71.dll
   19 Mar 2003 - 09:03:52: f:\windows\system32\msvcr71d.dll
   29 Jul 2008 - 08:05:08: f:\windows\system32\msvcr90.dll
   29 Jul 2008 - 08:05:08: f:\windows\system32\msvcr90d.dll
   22 Apr 2003 - 14:53:38: g:\Programfiler\Sysinternals\msvcr70.dll
   07 Nov 2007 - 07:19:34: g:\MinGW32\bin\CMake2.8\bin\msvcr90.dll
   7 matches found for "msvcr[7-9]*.dll".
  
  1. The option "--path" also checks the registry keys
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths and
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
  2. Python must be installed on %PATH. Also searches inside Python EGGs (zip-files) for a matching <wildcard>.
    This uses the zipfile module which is standard in all Pythons.
  3. Everything database is a search engine for NTFS drives.
    Ref. http://www.voidtools.com/support/everything/

Ettercap-win.zip
EtterCap network sniffer and hack tool. Binaries and full source for MSVC/MinGW.
Goto https://github.com/Ettercap/ettercap/ for the latest version. This update has plug-ins for HTTPS and BIND hacking.
But Lua-scripting does not work. I have no idea why.
An example of the GTK-interface running with my Wsock-tracer on the side. Started as:
  @echo off
  start "EtterCap" /normal /win /wait ettercap.exe %* -G -i %PCAP_DEVICE% --unoffensive --dns
  

Ettercap-win-diffs.zip
My private patches and sources to make EtterCap compile using MSVC-2015 and MinGW using a monolitic GNU-makefile.

exc-abort.zip
exc-abort v0.2: A DLL that does the "simple" task of giving you a backtrace in case of an abort() or when an exception occurs.
It uses the Stack-walker code by Jochen Kalmbach. The StackWalker is C++ code, but the exc-abort.dll
can be used in pure C-programs simply by a LoadLibrary("exc-abort.dll").
An example backtrace from a C++ program:
    c:\> test-cl.exe -abort
    Calling abort().
    Got SIGABRT. Backtrace:
      stackwalker.cpp (1046): StackWalker::ShowCallstack
      exc-abort.cpp (95): new_abort_handler
      winsig.c (586): raise
      abort.c (74): abort
      test.cpp (33): foo::func3
      test.cpp (38): foo::func2
      test.cpp (43): foo::func1
      test.cpp (86): foo::test_abort
      test.cpp (114): main
      crtexe.c (555): __tmainCRTStartup
      crtexe.c (371): mainCRTStartup
      7C817077 (kernel32): (filename not available): RegisterWaitForInputIdle
  
(the namespace "foo" is used here just to test the C++ un-decorations done by StackWalker). Compiles with both GCC (tested only v.4.5) and Visual-C v16. Full source, makefile and some cl/gcc examples in above .zip-file.

FirewallLog.zip
FirewallLog v1.0: A tool to analyse the Windows firewall log file. Or ICF (Internet Connection Firewall). To use, extract all the files in the .zip in it's own directory (I'm too lazy to make an installer...).
The programs parses the ICF-log file(s), groups entries in a tree-view; one list for each day from the log-file.
Some features: Things on the to-do list: C++/MFC source is not available at the moment. I want to convert the whole thing to some more
up-to-date GUI framework. Maybe wxWidgets. Any hints?

gmp-windows.zip
Makefiles for GNU Multi Precision Library 5.1 (gmp).
Note: these makefiles are rather incomplete. And I would not recommend anyone to use GMP, but instead the more Windows-friendly MPIR library. See below.

gnulib-windows.zip
GNU Makefiles and Python scripts to build Gnulib for MSVC and MinGW. Also contains a gnulib.pdf.
Go here to get GnuLib.

gnumake-windows.zip
Makefile for GNU Make 4.x using a single makefile to build using MSVC, clang-cl or MinGW (32/64-bit) versions.
Usage:   make -f Makefile.Windows CC=[cl | clang-cl | gcc] [all | clean | vclean | depend | check | install]
Note:  make must be e.g. mingw32-make.exe or MSys's make.exe as gnumake.exe cannot generate itself.

I've added an resource-file with a GNU-make icon and a version section.
It also briefly demonstrates (mk_test.dll) the new DLL load-feature (LOAD file.dll) in GNU-make 4.0.
file.dll can now extend GNU-make with new functions and features. E.g.:
  set GNUMAKEFLAGS=--debug
  gnumake -f Makefile.Windows test_dll
  
briefly show how a DLL-function is enabled and called.

gnuradio-windows.zip
A set of GNU Makefiles for building GNU-Radio for MSVC, clang-cl and MinGW (the latter 2 are not very well tested).
The .zip-file includes a GnuRadio.chm (Compressed HTML file built using Sphinx and Doxygen).

libevent-win.zip
GNU Makefiles (MinGW/MSVC) for libevent. This is an event notification library. On Windows the IOCP API is at the core of this library.
Pretty cool stuff if you want to handle servers with thousands of clients.
Run "make -f Makefile.MSVC depend all" to build and test the whole shebang using MSVC.
(or with MinGW: "make -f Makefile.MinGW depend all".)

lynx-win.zip
A GNU-Makefile for Lynx, the text-mode Web-browser. This makefile builds for MinGW, MSVC or clang-cl (all 32-bit).
Includes a lynx.exe with OpenSSL support.

lwip-windows.zip
LwIP 2.x: A set of Makefiles to build the Lightweight tcp/ip stack on Windows. ("Lightweight" is an understatement).
Windows targets include static libraries (liblwip.a and lwip.lib), import libraries (liblwip.dll.a and lwip_imp.lib) and lwip.dll.
MSVC and MinGW are supported at the moment. Watcom (Win32) support is planned.
Most things seems to work:
     f:\MinGW32\src\inet\lwip> test-app.exe
     Starting lwIP, local interface IP is 10.0.0.8
      0: \\.\airpcap00
          Desc: "AirPcap USB wireless capture adapter nr. 00"
      1: NPF_GenericDialupAdapter
          Desc: "Adapter for generic dialup and VPN capture"
      2: NPF_{7F56352E-EF2F-49F4-844C-BA1FA0105667}
          Desc: "MS Tunnel Interface Driver"
      3: NPF_{8D3A23A7-9C6C-408B-A23B-6736F9E56510}
          Desc: "Realtek 10/100/1000 Ethernet NIC
      4: NPF_{75451EE7-5145-471A-BAF5-124BE8439D10}
          Desc: "WAN (PPP/SLIP) Interface"
     Using adapter_num: 3
     Using adapter: "Realtek 10/100/1000 Ethernet NIC
     status_callback==UP, local interface IP is 10.0.0.8
     ping: send 10.0.0.1
     ping: recv 10.0.0.1 0 ms
     ping: send 10.0.0.1
     ping: recv 80.202.225.1 1 ms
     ping: drop
     ping: recv 10.0.0.1 3 ms
     ping: send 10.0.0.1
     ping: recv 10.0.0.1 0 ms
     ping: send 10.0.0.1
     ping: recv 80.202.225.1 1 ms
     ping: drop
     ping: recv 10.0.0.1 4 ms
     ping: send 10.0.0.1
     ping: recv 10.0.0.1 1 ms
     ping: send 10.0.0.1
     ping: recv 10.0.0.1 1 ms
     3com.com: 15.192.45.139
   
For lwIP-MSDOS, see the MSDOS section above.

mpir-windows.zip
Makefiles for GNU Multi Precision Library 5.x (MPIR). Goto Github for the latest sources.

nmap-windows.zip
A set of GNU makefiles for nmap using MinGW or MSVC. The required DLLs for OpenSSL and WinPcap are not part og this .zip.
Read the notes and instructions in the included Readme.MinGW-MSVC. Remember to unzip preserving the directory structure.

openssl-windows.zip
Makefiles for OpenSSL targeting MinGW and MSVC. I was really tired of the messy build procedure of OpenSSL, so I wrote this GNU Make based makefile.
The OpenSSL internals is nearly impossible to understand with all the hacks that have built up over the years. E.g. OPENSSL_EXPORT_VAR_AS_FUNCTION,
ms/uplink.c and the generated .def-files etc. No one seems to want to clear up this mess. I just wanted to make the building a bit simpler for myself.

Note: the MSVC version uses SSE2 instructions. Remove -arch:SSE2 from MSVC_CFLAGS if you don't have a SSE2 enabled processor (who doesn't these days?).
Use it as e.g.:
   make -f Makefile.Windows CC=cl clean all

pe-dump2.zip
Matt Pietrek's PEdump program updated to dump 64-bit modules. I've done lot of cleanups to make it build without warnings using MinGW (g++ v4.7.3).
The noise-level from g++ was terrible! This .zip includes all sources, the binaries, GNU Makefiles and Visual Studio project files.

sylpheed-windows.zip
Makefile for the Sylpheed email and news client. Needs GTK-Win32 to build. Note: It really rocks!.

tcptraceroute-win.zip
Michael Toren's tcptraceroute (v1.5-beta 6) adapted for MinGW and MSVC6.
This .zip includes a binary. Requires libpcap and libnet to compile.

tor-windows.zip
Makefiles for the anonymity client software Tor (The Onion Router). Tor protects your privacy and defends against network surveillance and traffic analysis.
If you're fed up with autoconf, this is a set of makefiles to build Tor using MinGW or MSVC (lib*.a, lib*.lib and the main program
tor.exe and some tools). Configuration (editing '~/torrc') is not for the faint-hearted. So beware.
Requires zlib, libevent and OpenSSL. libevent for MinGW is above. libevent for MSVC should compile out-of-the-box.

Win32plusplus.zip
A set of GNU-makefiles to build all Samples & Tutorial of the excellent Win32++ project. Go to it's Homepage to download it.

wireshark-windows.zip
Some huge monolitic Makefiles for MinGW and MS Visual-C. I got frustrated with the build steps and cumbersome official Nmake makefiles
for the Wireshark project. Hence I made my own GNU Makefiles. There are only 2 makefiles; one targeting MinGW versions of all Wireshark programs.
And one for MSVC. Allthough not perfect yet (improvements welcome), but they works for me.
Maybe others would find them useful.

wsock_trace.zip
Please go to the Github page since the version here is not up-to-date.

A small and simple drop-in tracer for most normal Winsock calls. Works best for MSVC since the stack-walking code requires the program's PDB
symbol-file to be present. And unfortunately MinGW/CygWin doesn't produce PDB-symbols.
They instead need the old archaic BFD library. And I haven't got that to work yet.
An example output-trace from C-ares' adig:
adig -t PTR 89.42.216.144

This library uses a config-file in your %HOME. The printed colours etc. are configurable.
Optionally, GeoIP-information is printed for all Winsock calls that uses an IPv4/6 address.

bsod-joke.c
Windows BSOD joke Finally a "Blue-Screen-of-Death" joke you can perform on someone if they are running Win-XP.
The program puts the console screen in full sized text-mode as Windows XP, Vista and Windows 7 does.
Doesn't work well on Windows 8 or later since it fails to make the console go full-screen (hardware mode).
You have to compile it yourself using:
MS Visual-C: cl -Fe./bsod-joke.exe bsod-joke.c winmm.lib user32.lib
MinGW/Cygwin: gcc -o bsod-joke.exe bsod-joke.c -lwinmm
Rest a sure, pressing any key prints Only joking!.




Last updated: 20 March 2023,
Gisle Vanem -- <gvanem@yahoo.no>

This site should be IPv6 ready: IPv6 ready