Posted: Fri Mar 04, 2022 8:02 pm Post subject: Script to check and filter last bytes of result list
Need a little help with my lua. A while back I made a script that would let me right click on an address in my result list and filter to an ending byte(s) I specified.
-- Set up item removal for click simulation
local menuItemRemove
for i=0, foundList.PopupMenu.Items.Count-1 do
if foundList.PopupMenu.Items[i].Name == "Removeselectedaddresses1" then
menuItemRemove = foundList.PopupMenu.Items[i]
break
end
end
-- Create menu item
local menuItem = createMenuItem(foundList.PopupMenu)
menuItem.Caption = "Remove Non-Matching Byte(s) From Result Set"
-- When menu item is clicked, run this function
menuItem.OnClick = function()
local mybytes = inputQuery("Posty's Byte Matcher", "Enter Byte(s) to match on then click OK", "")
-- Store "Found" results total for for-loop below
local foundList = getMainForm().Foundlist3
local found = foundList.Items.Count
for i = 0, found-1 do
-- Store current and previous values
local item = getMainForm().Foundlist3.Items[i]
end
-- Simulate a click on "Remove selected addresses", which will remove
-- addresses selected from the above for-loop.
menuItemRemove.DoClick()
end
-- Create new right-click menu item in results list
foundList.PopupMenu.Items.insert(menuItemRemove.MenuIndex+1, menuItem)
My HDD crashed a while back and I lost the working script. I know the working solution had something to do with using 'caption'. So, basically - as per the screen shot - if I enter 60 (for example), it'll remove all other addresses that don't have those last bytes (so only addresses that end in 60 will remain). I could enter as few or as many bytes as I want.
I can't seem to recreate it.
This makes it so much easier to refind an address, since (in my experience) the ending byte(s) will be the same for the target addy.
So, I can weed out a lot of bad results quickly. As the script is now, if I initiate the dialog (even if I hit cancel), it will remove ONLY the address I selected. Not the goal. lol
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum