Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: Ncat on MinGW - report
From: Jacek Wielemborek <wielemborekj1 () gmail com>
Date: Sun, 11 Aug 2013 22:39:02 +0200

2013/8/11 Gisle Vanem <gvanem () broadpark no>:
"Jacek Wielemborek" <wielemborekj1 () gmail com> wrote:

It turns out that Nbase compiles fine without this include, so I just
commented it out. Then, there will be a bunch of this kind of errors:

nbase_winconfig.h:177:24: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'int64_t'

Well, simple. nbase/nbase_winconfig.h should have something like:

#ifndef __MINGW32__
  typedef signed __int64 int64_t;

I reported this almost 3 years ago:

Interesting. Looks like MinGW wasn't really a priority there. Anyway,
thanks for the #ifndef suggestion, I'll try it out.

In your diff:

+//typedef unsigned __int8 uint8_t;
+//typedef unsigned __int16 uint16_t;
+//typedef unsigned __int32 uint32_t;
+//typedef unsigned __int64 uint64_t;

Doesn't this break other Win32 comilers? Like MSVC.

Yes it did. I didn't care about breaking MSVC in my experiment - if I
wanted to provide autoconf and keep MSVC compability, I wouldn't be
able to do it overnight.

+#include "winsock2.h"

Better make that '#include <winsock2.h>'.

ncat_ssl.c:139:29: fatal error: openssl/applink.c: No such file or
#include <openssl/applink.c>

An old story.

Could you elaborate?


Did you make sure '-D_WIN32_WINNT=0x0501' or above?

Do you mean this error:

ncat_main.o: bad reloc address 0x0 in section `.data'

It disappeared in the further linking stage. Anyway, I didn't add the
-D and I have no idea what it does.

Looks like we need some more libs! The ones we're lacking are:
-lwsock32 -lgdi32 -lws2_32. Now, the final problem:

'-lws2_32' should be enough. What symbols do you need from '-lgdi32'?

undefined reference to `_imp__CreateDCA () 16'
undefined reference to `_imp__CreateCompatibleDC () 4'
undefined reference to `_imp__GetDeviceCaps () 8'
undefined reference to `_imp__CreateCompatibleBitmap () 12'
undefined reference to `_imp__SelectObject () 8'
undefined reference to `_imp__GetObjectA () 12'
undefined reference to `_imp__BitBlt () 36'
undefined reference to `_imp__GetBitmapBits () 12'
undefined reference to `_imp__DeleteObject () 4'
undefined reference to `_imp__DeleteDC () 4'
Sent through the dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]