Script Work 6
Script Work 6
isgood = 0
isbad = 0
if valueflags == "4" then
isbad = 0
i2 = 0
while i2 < #bad and isbad == 0 do
i2 = i2 + 1
if bad[i2] == val then
isbad = 1
end
end
isgood = 0
i2 = 0
while i2 < #good and isgood == 0 do
i2 = i2 + 1
if good[i2] == val then
isgood = 1
end
end
else
isbad = 1
isgood = 0
end
end
function checkuseless(value)
useless = 0
if value < 1000000 or value > 200000000 then
useless = 1
end
end
function checktrap(value)
temp = useless
checkuseless(value)
if useless == 0 then
trap = 0
region = gg.getValuesRange(t[i]).address
if region == 'Jh' then
gg.setRanges(gg.REGION_JAVA_HEAP)
end
if region == 'A' then
gg.setRanges(gg.REGION_ANONYMOUS)
end
if region == 'As' then
gg.setRanges(gg.REGION_ASHMEM)
end
if region == 'B' then
gg.setRanges(gg.REGION_BAD)
end
if region == 'Ca' then
gg.setRanges(gg.REGION_C_ALLOC)
end
if region == 'Cb' then
gg.setRanges(gg.REGION_C_BSS)
end
if region == 'Cd' then
gg.setRanges(gg.REGION_C_DATA)
end
if region == 'Ch' then
gg.setRanges(gg.REGION_C_HEAP)
end
if region == 'Xa' then
gg.setRanges(gg.REGION_CODE_APP)
end
if region == 'Xs' then
gg.setRanges(gg.REGION_CODE_SYS)
end
if region == 'J' then
gg.setRanges(gg.REGION_JAVA)
end
if region == 'O' then
gg.setRanges(gg.REGION_OTHER)
end
if region == 'Ps' then
gg.setRanges(gg.REGION_PPSSPP)
end
if region == 'S' then
gg.setRanges(gg.REGION_STACK)
end
if region == 'V' then
gg.setRanges(gg.REGION_VIDEO)
end
gg.clearResults()
gg.searchNumber(value,gg.TYPE_DWORD)
if gg.getResultsCount() > 8 then
trap = 1
end
end
useless = temp
end
function selectranges()
regions = gg.multiChoice({"IDK what this means (well, it may take a lot longer but rather be safe than
sorry!)","Java and java heap","C data, c alloc, c bsss, and c
heap","Anonymous","Stack","Ashmen","Other","Bad","Xa code app","Xa code system"},nil,"Select the
memory regions your values are in (usually anonymous and sometimes Xa). You can select multiple, but
only select the ones your values are in or it will take longer.")
buildranges = ""
if regions[1] then
buildranges = "gg.REGION_ANONYMOUS | gg.REGION_JAVA_HEAP | gg.REGION_C_DATA |
gg.REGION_C_BSS |gg.REGION_JAVA |gg.REGION_STACK | gg.REGION_ASHMEM |
gg.REGION_OTHER | gg.REGION_BAD | gg.REGION_CODE_APP | gg.REGION_CODE_SYS"
else
if regions [2] then
buildranges = buildranges .. "gg.REGION_JAVA | gg.REGION_JAVA_HEAP |"
end
if regions [3] then
buildranges = buildranges .. "gg.REGION_C_DATA | gg.REGION_C_BSS | gg.REGION_C_HEAP |
gg.REGION_C_ALLOC |"
end
if regions [4] then
buildranges = buildranges .. "gg.REGION_ANONYMOUS |"
end
if regions [5] then
buildranges = buildranges .. "gg.REGION_STACK |"
end
if regions [6] then
buildranges = buildranges .. "gg.REGION_ASHMEM |"
end
if regions [7] then
buildranges = buildranges .. "gg.REGION_OTHER |"
end
if regions [8] then
buildranges = buildranges .. "gg.REGION_BAD |"
end
if regions [9] then
buildranges = buildranges .. "gg.REGION_CODE_APP |"
end
if regions [10] then
buildranges = buildranges .. "gg.REGION_CODE_SYS |"
end
end
gg.setRanges(buildranges)
end
gg.setVisible(false)
gg.alert("This script is NOT a trap value disabler. It removes trap values from your search results.")
menu = gg.multiChoice({"What are trap values?","Remove trap values and / or useless values","Q&A /
Troubleshooting","About","How script works","Contact Me","Exit"},nil,"Script and method made by
HorridModz(User123456789#6424). This script is ONLY for dword values.")
if menu == nil then
os.exit()
end
if menu[7] then
os.exit()
end
if menu[6] then
print("You can contact me on discord at User123456789#6424. To stay updated about all my scripts, you
can follow HorridModz on gameguardian.net.")
gg.setVisible(true)
gg.setVisible(true)
os.exit()
end
if menu[5] then
print("This script has two features: Useless value removal and trap value removal.
To remove useless values, it removes every dword value that is not in the range of encrypted values. This
feature may not always be 100% accurate, but it should work most of the time.
To remove trap values, it uses very simple logic which relies on bad game design (which is why almost all
pg3d scripts exist xD). I found out through testing that trap values are placed multiple times in memory.
However, real values should only appear once, or rarely a couple times. The script simply searches each
values and removes any value that a bunch of results come up for. There may be exceptions, so this
method isn't 100% accurate.")
gg.setVisible(true)
os.exit()
end
if menu[4] then
print("One day, I was editing a bunch of values I fuzzy searched to try and find the right value, and I hit a
trap value and was banned. That gave me the inspiration to make a trap value detector. This script is
pretty simple. It uses a method I came up with myself - see 'How script works' for more.
The UI is heavily inspired by DarkOctet#5778")
gg.setVisible(true)
os.exit()
end
if menu[3] then
print("Q: What is a trap value?
A: See the 'what are trap values' tab.
Q: Why are the time left and percent processed counters so inaccurate?
A: The script uses multiple optimizations to run faster. It has to do more work on some values than others.
The script may progressively get faster, get stuck for a long time on some areas, or go really fast on some
areas because of this. The time left counter expects all values to need to be tested, but sometimes the
script already knows a value is not a trap value. The 'Remove Useless Values' option will make the script
run so much faster that it may halve the time left counter each second, in some cases!
Q: Why does the script say it is processing less results than I originally had?
A: When you have the 'Remove Useless Values' option enabled, the script automatically removes values
that it knows aren't trap values or useful values before it checks each one by one. For some values, the
script does not know until it checks one by one.
Q: Why does the script take so long?
A: The script has many optimizations to speed it up, and a progress monitor to try to make it easier to sit
through. Still, though, it may take a while - because it has to do tests on each value, one by one. The
script is designed for you only having at most a few thousand values.
Q: Is this script 100% safe?
A: No. The script uses all the methods I know of to remove trap values, but that doesn't mean there won't
be mistakes. I don't know how effective this script is for removing trap values, but I know it works.to some
degree. If you have under 100 results after running the script, it should be safe to edit, but I can't
guarantee it.
Q: How does this script work?
A: See the 'How Script Works' section.
Q: What is considered a useless value?
A: Any value that is not in the range of encrypted values is a useless value, because generally all useful
values are encrypted. If a value isn't encrypted, don't use this script!
Q: How long did this script take?
A: A week, about 12 hours of combined work, and 3 very late nights. I put in a lot of effort to make these
free script, thanks for asking!
Still have questions, comments, or concerns? Contact User123456789#6424 on discord!")
gg.setVisible(true)
os.exit()
end
if menu[1] then
print("One of the many ways the developers protect their game from gameguardian hacks is having the
game automatically generate 'trap values'. Trap values are values that mimic real values that store game
data, but actually instantly ban you when you edit them.")
gg.setVisible(true)
os.exit()
end
toremove = gg.multiChoice({"Remove useless values (recommended, also decreases risk of ban or crash
and speeds up script a ton)","Remove trap values"},nil,"Script and method made by
HorridModz(User123456789#6424). This script may take a while to finish - each value should take around
a third of a second to process, depending on device.
DISCLAIMER: This script may NOT be 100% accurate! Edit values at your own risk - bans still have the
possibility to occur, whether by editing trap values or for other reasons .")
lasttoast = 0
progress = "Initializing"
gg.toast(progress)
start = os.time()
if gg.getResultsCount() == 0 then
print("This script is a trap value / useless value remover, not a disabler. You have no search results to
remove trap values / useless values from.")
gg.setVisible(true)
os.exit()
end
gg.setVisible(false)
gg.toast(progress)
gg.setVisible(false)
gg.toast(progress)
initialcount = gg.getResults(9999999999999999)
if toremove[1] then
gg.searchNumber('1000000~200000000',gg.TYPE_DWORD, false, gg.SIGN_EQUAL)
end
if gg.getResultsCount() == 0 then
t = gg.getResults(999999999999999999)
cleansed = {}
resultstoremove = {}
bad = {}
good = {}
else
gg.searchFuzzy()
gg.setVisible(false)
gg.toast(progress)
t = gg.getResults(99999999999999)
cleansed = {}
resultstoremove = {}
bad = {}
good = {}
if toremove == nil then
else
gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_JAVA_HEAP | gg.REGION_C_DATA |
gg.REGION_C_BSS |gg.REGION_JAVA |gg.REGION_STACK | gg.REGION_ASHMEM|
gg.REGION_OTHER | gg.REGION_BAD | gg.REGION_CODE_APP | gg.REGION_CODE_SYS)
gg.setVisible(false)
gg.toast(progress)
i=0
while i < #t do
i=i+1
useless = 0
trap = 0
isbad = 0
isgood = 0
if isgood == 0 then
checkbad(t[i].value,t[i].flags)
if isbad == 0 and toremove[1] then
checkuseless(t[i].value)
end
if isbad == 0 and useless == 0 and toremove[2] then
checktrap(t[i].value)
end
end
if useless + trap + isbad > 0 then
resultstoremove[#resultstoremove + 1] = t[i]
if isbad == 0 then
bad[#bad + 1] = t[i].value
end
else
t[i].name = "Value from trap value remover script"
cleansed[#cleansed + 1] = t[i]
good[#good + 1] = t[i].value
end
if os.time() - lasttoast > 1 then
timeleft = #t - i
timeleft = timeleft / 10
percentdone = i * 10000
percentdone = percentdone / #t
percentdone = percentdone / 100
progress = tostring(i) .. "/" .. #t .. " Values processed, " .. tostring(percentdone) .. "% done processing
Estimated time left: " .. tostring(timeleft) .. " seconds."
gg.toast(progress)
lasttoast = os.time()
end
gg.setVisible(false)
end
end
end
gg.setVisible(false)
gg.clearResults()
gg.clearList()
gg.addListItems(cleansed)
time = os.time() - start
progress = "Done!"
gg.toast(progress)
print("Script successfully executed! Values are in the saved list!")
print("
Summary:
Values processed: " .. tostring(#initialcount) .. ".
Values saved: " .. tostring(#cleansed).. ".
Values removed: " .. tostring(#initialcount - #cleansed) .. ".
Time taken: " .. tostring(time) .. " seconds.
I hope you enjoyed using my script! You can contact me at User123456789#6424.
DISCLAIMER: This script may NOT be 100% accurate! Edit values at your own risk - bans still have the
possibility to occur, whether by editing trap values or for other reasons .")
gg.setVisible(true)