Well..when there is a need - 'make it happen 'Capin'
this stuff wil convert a HEX string to ASCII standard character output.
There is know doubt some pure LUA code for this, I could not find any..
download the file below I constructed (contains Hex-Dec - first 127 chars)
and include in your 'source folder'.
Is someone has something else - could ya offer it up--thanks
this stuff wil convert a HEX string to ASCII standard character output.
There is know doubt some pure LUA code for this, I could not find any..
Code:
-- Functions to convert Hex data(string) to ASCII -- read the 'ASCII.TXT' to a table - at say 'on startup' actions G_HX_CONV_T = TextFile.ReadToTable(_SourceFolder.."\\AutoPlay\\Docs\\ASCII.TXT"); --SOHEXGET function HEXGET() MainWork_str = ""; --strHex = "whatever"; --eg: returned string from say a 'target registry read' --good example is reading the Os 'dos devices' hex strings --HKLM\SYSTEM\MountedDevices\ --read the values to a table and cycle through --restructure returned Hex string for correct ASCII converion strHex = String.Replace(strHex, " ", ",", false); --replace all " " with "," strHex = String.Replace(strHex, "00,", "", false); --now remove all "00," strHex = String.Replace(strHex, ",", "", false); --now remove all "," hxlength = String.ToNumber(String.Length(strHex)); hxmidstr = String.Mid(strHex, 1, 2); while (hxlength > 0) do HEXASCII(); -- call the ASCII converter --reset for next hex find hxmidstr = String.Mid(strHex, 1, 2); hxlength = String.ToNumber(String.Length(strHex)); --for loop if (hxlength == 0) then strASCII = MainWork_str; -- the final converted string Dialog.Message("Hex-ASCII: Debug Info only", strASCII); break; --all done end end --while end --EOHEXGET --SOHexcovert function HEXASCII() for valindex, valline in G_HX_CONV_T do --reset vars Decval = nil; ascichar = nil; hxvalname = nil; hxvalname = String.Find(valline, hxmidstr.."=", 1, true); if (hxvalname == 1) then hxvalpos = String.Find(valline, "=", 1, false); Decval = String.TrimRight(String.Mid(valline, hxvalpos +1, -1), nil); ascichar = String.Char(Decval); MainWork_str = String.Concat(MainWork_str, ascichar); strHex = String.Mid(strHex, 3, -1); --remove converted from string for next break; end end--loop end --EOHexcovert
and include in your 'source folder'.
Is someone has something else - could ya offer it up--thanks
Comment