|
|
@ -3,9 +3,9 @@ STD_STRING=0
|
|
|
|
DWORD=1
|
|
|
|
DWORD=1
|
|
|
|
WORD=2
|
|
|
|
WORD=2
|
|
|
|
BYTE=3
|
|
|
|
BYTE=3
|
|
|
|
|
|
|
|
|
|
|
|
function GetTextRegion()
|
|
|
|
function GetTextRegion()
|
|
|
|
ranges__=ranges__ or Process.getMemRanges()
|
|
|
|
ranges__=ranges__ or Process.getMemRanges()
|
|
|
|
|
|
|
|
--print("Ranges:"..#ranges__)
|
|
|
|
for k,v in pairs(ranges__) do
|
|
|
|
for k,v in pairs(ranges__) do
|
|
|
|
--for k2,v2 in pairs(v) do
|
|
|
|
--for k2,v2 in pairs(v) do
|
|
|
|
-- print(string.format("%d %s->%s",k,tostring(k2),tostring(v2)))
|
|
|
|
-- print(string.format("%d %s->%s",k,tostring(k2),tostring(v2)))
|
|
|
@ -15,8 +15,10 @@ function GetTextRegion()
|
|
|
|
--if(v["read"])then num=num+1 end
|
|
|
|
--if(v["read"])then num=num+1 end
|
|
|
|
--if(v["write"])then num=num+10 end
|
|
|
|
--if(v["write"])then num=num+10 end
|
|
|
|
--if(v["execute"]) then num=num+100 end
|
|
|
|
--if(v["execute"]) then num=num+100 end
|
|
|
|
--print(string.format("%d %x->%x %s %d",k,v["start"],v["end"],v.name,num))
|
|
|
|
--if num>=100 then
|
|
|
|
local pos=string.find(v.name,".text")
|
|
|
|
--print(string.format("%d %x->%x %s %d",k,v["start"],v["end"],v.name or "",num))
|
|
|
|
|
|
|
|
--end
|
|
|
|
|
|
|
|
local pos=string.find(v.name,".text") or string.find(v.name,"libs/Dwarf_Fortress")
|
|
|
|
if(pos~=nil) then
|
|
|
|
if(pos~=nil) then
|
|
|
|
return v;
|
|
|
|
return v;
|
|
|
|
end
|
|
|
|
end
|
|
|
|