function bytefromhex(str1) atbl,aleng,aword={},0,"" for word in str1:gmatch("%w+") do table.insert(atbl,word) end aleng=#atbl for i,k in pairs(atbl) do aword=aword..atbl[aleng] aleng=tonumber(aleng) - 1 end num = (tonumber(aword, 16) + 2^31) % 2^32 - 2^31 return math.floor(num) end function addrToAobString(s,opt) local tbl = {} if opt==1 then -- word tbl = wordToByteTable(readBytes(s)) elseif opt==2 then -- dword tbl = dwordToByteTable(readInteger(s)) elseif opt==3 then -- qword tbl = qwordToByteTable(readQword(s)) elseif opt==4 then -- double tbl = doubleToByteTable(readDouble(s)) elseif opt==5 then -- float tbl = floatToByteTable(readFloat(s)) elseif opt==6 then -- dword tbl = stringToByteTable(readString(s)) end for k,v in ipairs(tbl) do tbl[k] = ('%02X'):format(v) end return table.concat(tbl, ' ') end function numToAobString(s,opt) local tbl = {} if opt==1 then -- word tbl = wordToByteTable(tonumber(s)) elseif opt==2 then -- dword tbl = dwordToByteTable(tonumber(s)) elseif opt==3 then -- qword tbl = qwordToByteTable(tonumber(s)) elseif opt==4 then -- double tbl = doubleToByteTable(tonumber(s)) elseif opt==5 then -- float tbl = floatToByteTable(tonumber(s)) elseif opt==6 then -- dword tbl = stringToByteTable(tostring(s)) end for k,v in ipairs(tbl) do tbl[k] = ('%02X'):format(v) end return table.concat(tbl, ' ') end local msgErr2 = [[Please make sure you enter the parameters completely. Test function: ParseByte(1, 2, 3, 4) 1) Code to scan: (Aobs) 2) The beginning of the byte you want to test: number (no hex) 3) Record symbol of the test byte: number (1=Word, 2=Dword, 3=Qword, 4=Double, 5=Float, 6=String) 4) Confirmation of memory to be scanned: true = Reads FoundList results and starts testing. false = Performs an Aobs scan and compares the results. ------------------------------------------------------------------ The results are given as a table and listed accordingly.]] function ParseByte(s,byt1,typ,fl) if s==nil or byt1==nil or typ==nil or fl==nil then showMessage(msgErr2) else byt = ('%02X'):format(byt1) local resTbl = {} if fl==false then local aob = AOBScan(tostring(s)) if (aob == nil) then showMessage("Not found!") else for i=0,aob.Count-1 do local address=stringlist_getString(aob,i) local addrByte = address.."+"..byt local resaobs1 = addrToAobString(addrByte,typ) local resaobs2 = numToAobString("0",typ) if resaobs1~=resaobs2 then resTbl[#resTbl + 1] = address end end end end if fl==true then fs3 = MainForm.Foundlist3 for i=0, fs3.Items.count -1 do local address=tostring(fs3.Items[i].Caption) local addrByte = address.."+"..byt local resaobs1 = addrToAobString(addrByte,typ) local resaobs2 = numToAobString("0",typ) if resaobs1~=resaobs2 then resTbl[#resTbl + 1] = address end end end return resTbl end end