funcion file_exists(name)local f = io.open(name,"r")if f~=nilthen
io.close(f)returntrueelsereturnfalseendendlocal gg = gg
gg.clearResults()
past_addresses_filename ="/storage/emulated/0/Notes/past-data.txt"local past_addresses ={}if file_exists(past_addresses_filename)thenfor line in io.lines(past_addresses_filename)do
s = line:gsub('%\n','')
past_addresses[s]=1endend
gg.searchNumber('1,000,000,000D;4106~4108::8', gg.TYPE_FLOAT)local final_table ={}local table = gg.getResults(500)for i =1,#table doif past_addresses[table[i]['address']]~=nilthen goto continue end
v = table[i]if(v.value >999999999and v.value <1000000001)then
final_table[n]= table[i]
final_table[n]['value']=16
final_table[n]['freeze']=true
past_addresses[v.address]=1endif(v.value >3016and v.value <3018)then
final_table[n]= table[i]
final_table[n]['value']=1000000
final_table[n]['freeze']=true
past_addresses[v.address]=1end::continue::end
gg.setValues(final_table)
gg.addListItems(final_table)
f = io.open(past_addresses_filename,"w")for key,value in final_table do
f:write(tostring(key)..'\n')end
io.close(f)
So basically, I have to search for this group: '1,000,000,000D;4106~4108::8' with using the float type in gg.searchNumber(). It's easy to see that: when i%2==1, v.value in range (10^9 -1 ~ 10^9 + 1); when i%2==0, v.value in range(3016, 3018).
However, since the 1st value is a dword, it might get become a completely different number when parsed as a float.
For example, number 0x000002A7 = 679 (dword) = 9.51481657276550791157212387054E-43 (float).
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
luanoob
So basically, I have to search for this group: '1,000,000,000D;4106~4108::8' with using the float type in gg.searchNumber(). It's easy to see that: when i%2==1, v.value in range (10^9 -1 ~ 10^9 + 1); when i%2==0, v.value in range(3016, 3018).
However, since the 1st value is a dword, it might get become a completely different number when parsed as a float.
For example, number 0x000002A7 = 679 (dword) = 9.51481657276550791157212387054E-43 (float).
So in the above code, how do I ensure that
are parsing v.value as dword in the 1st one, then as float in the second one?
In another language, I can do something like, what's the equivalent for Lua?
Thank you
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.