2011-08-04 11:57:53 -06:00
|
|
|
offsets=offsets or {}
|
|
|
|
function offsets.find(startoffset,...)
|
2011-09-17 05:59:10 -06:00
|
|
|
local endadr=GetTextRegion()["end"];
|
|
|
|
--[=[if startoffset== 0 then
|
2011-08-04 11:57:53 -06:00
|
|
|
local text=GetTextRegion()
|
|
|
|
--print("searching in:"..text.name)
|
|
|
|
startoffset=text.start
|
|
|
|
endadr=text["end"]
|
|
|
|
else
|
|
|
|
local reg=GetRegionIn(startoffset)
|
|
|
|
--print("searching in:"..reg.name)
|
2011-09-17 05:59:10 -06:00
|
|
|
if reg==nil then
|
|
|
|
print(string.format("Warning: memory range for search @:%x not found!",startoffset))
|
|
|
|
return 0
|
|
|
|
end
|
2011-08-04 11:57:53 -06:00
|
|
|
endadr=reg["end"]
|
2011-09-17 05:59:10 -06:00
|
|
|
end--]=]
|
2011-08-04 15:22:25 -06:00
|
|
|
--print(string.format("Searching (%x->%x)",startoffset,endadr))
|
2011-08-04 11:57:53 -06:00
|
|
|
local h=hexsearch(startoffset,endadr,...)
|
|
|
|
local pos=h:find()
|
|
|
|
h=nil
|
|
|
|
return pos
|
|
|
|
end
|
|
|
|
function offsets.findall(startoffset,...)
|
|
|
|
local endadr;
|
|
|
|
if startoffset== 0 then
|
|
|
|
local text=GetTextRegion()
|
|
|
|
--print("searching in:"..text.name)
|
|
|
|
startoffset=text.start
|
|
|
|
endadr=text["end"]
|
|
|
|
else
|
|
|
|
local reg=GetRegionIn(startoffset)
|
|
|
|
--print("searching in:"..reg.name)
|
|
|
|
endadr=reg["end"]
|
|
|
|
end
|
|
|
|
local h=hexsearch(startoffset,endadr,...)
|
|
|
|
local pos=h:findall()
|
|
|
|
h=nil
|
|
|
|
return pos
|
|
|
|
end
|
|
|
|
function offsets.base()
|
|
|
|
return Process.getBase()
|
|
|
|
end
|
|
|
|
function offsets.getvectors()
|
|
|
|
return findVectors()
|
|
|
|
end
|
2012-03-30 16:27:26 -06:00
|
|
|
ADDRESS=ANYDWORD
|