Nmap Development mailing list archives

Re: Detecting/parsing a hex string


From: David Fifield <david () bamsoftware com>
Date: Wed, 8 Oct 2008 21:51:02 -0600

On Wed, Oct 08, 2008 at 08:23:52PM -0600, Patrick Donnelly wrote:
On Wed, Oct 8, 2008 at 12:22 PM, David Fifield <david () bamsoftware com> wrote:
a = "414243"
if string.find(a, "^%x+$") then
  a = string.gsub(a, "%x%x", function(a) return
string.char(tonumber(a, 16)) end) --> a = "ABC"
end

I suspect this won't work when the string is long enough to overflow the
capacity of a double, which a 128-bit key will be.

The code I gave works on two characters at a time...

Ah, you're completely correct of course. Forgive me for not reading
carefully enough.

David Fifield

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


Current thread: