Nmap Development mailing list archives

Request for updated bit manipulation library


From: Mak Kolybabi <mak () kolybabi com>
Date: Tue, 14 Dec 2010 12:43:12 -0600

I have a need for the ability to perform bitwise operations on 64-bit integers.
I have been struggling with strange behaviour with the current bit library when
the numbers get too large. The website Nmap's bit library originally came from
has a new version, and its changes mention that there were issues with shifting
previously. Any chance someone would be kind enough to integrate the newer
version of the library into Nmap?

The odd behaviour is as follows (script attached):

NSE: Starting bit-test against 127.0.0.1.
NSE: 0000000000000000 = 0000000000000000 << 8
NSE: 00000000000000ff = 0000000000000000 or 0xFF
NSE: 000000000000ff00 = 00000000000000ff << 8
NSE: 000000000000ffff = 000000000000ff00 or 0xFF
NSE: 0000000000ffff00 = 000000000000ffff << 8
NSE: 0000000000ffffff = 0000000000ffff00 or 0xFF
NSE: 00000000ffffff00 = 0000000000ffffff << 8
NSE: 00000000ffffffff = 00000000ffffff00 or 0xFF
NSE: 000000ffffffff00 = 00000000ffffffff << 8
NSE: 000000ffffffffff = 000000ffffffff00 or 0xFF
NSE: 0000ffffffffff00 = 000000ffffffffff << 8
NSE: 0000ffffffffffff = 0000ffffffffff00 or 0xFF
NSE: 00ffffffffffff00 = 0000ffffffffffff << 8
NSE: 0100000000000000 = 00ffffffffffff00 or 0xFF
NSE: 0000000000000000 = 0100000000000000 << 8
NSE: 00000000000000ff = 0000000000000000 or 0xFF
NSE: 000000000000ff00 = 00000000000000ff << 8
NSE: 000000000000ffff = 000000000000ff00 or 0xFF
NSE: 0000000000ffff00 = 000000000000ffff << 8
NSE: 0000000000ffffff = 0000000000ffff00 or 0xFF
NSE: 00000000ffffff00 = 0000000000ffffff << 8
NSE: 00000000ffffffff = 00000000ffffff00 or 0xFF
NSE: 000000ffffffff00 = 00000000ffffffff << 8
NSE: 000000ffffffffff = 000000ffffffff00 or 0xFF
NSE: 0000ffffffffff00 = 000000ffffffffff << 8
NSE: 0000ffffffffffff = 0000ffffffffff00 or 0xFF
NSE: 00ffffffffffff00 = 0000ffffffffffff << 8
NSE: 0100000000000000 = 00ffffffffffff00 or 0xFF
NSE: 0000000000000000 = 0100000000000000 << 8
NSE: 00000000000000ff = 0000000000000000 or 0xFF
NSE: 000000000000ff00 = 00000000000000ff << 8
NSE: 000000000000ffff = 000000000000ff00 or 0xFF
NSE: Finished bit-test against 127.0.0.1.

--
Mak Kolybabi
<mak () kolybabi com>

() ASCII Ribbon Campaign | Against HTML e-mail
/\  www.asciiribbon.org  | Against proprietary extensions

Attachment: bit-test.nse
Description:

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: