1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

nse_check_globals cleanup

This commit is contained in:
patrik
2013-01-28 04:28:38 +00:00
parent 37ab88e840
commit d79e431e7a
2 changed files with 11 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
local bit = require "bit"
local stdnse = require "stdnse"
local math = require "math"
local nmap = require "nmap"
local strbuf = require "strbuf"
local string = require "string"
local table = require "table"
local shortport = require "shortport"
@@ -310,11 +312,11 @@ local dec_data = function(str, len, key)
-- skip the header (first 20 bytes)
local data = { string.byte(str, 21, 20 + len) }
a1 = bit.band(key, 0xFF)
local a1 = bit.band(key, 0xFF)
if a1 == 0 then
return table.concat(data)
end
a2 = bit.rshift(key, 8)
local a2 = bit.rshift(key, 8)
for i = 1,len do
data[i] = bit.band(data[i] - (crypt_data[a2 + 1] + ((i - 1) % 72)), 0xFF)