Jump to content
  • 0

Oddities with the ptrace error: Game is protected


BiNoops
 Share

Question

What's the problem:
I have the coordinates of a character and I want to teleport it to the coordinates x = 1575, y = 1356, z = 13.44929885.
When I teleport a character through the Game Guardian interface, everything works and the character teleports.
BUT when I do the same with a script, the game crashes and Game Guardian throws a ptrace error: Game is protected.
How is it possible to fix the crash of the game?

Code in function: 

gg.clearResults() 
gg.setRanges(gg.REGION_C_ALLOC)
gg.sleep(300)
gg.getResults(6666)
gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 688', gg.TYPE_FLOAT)
local x = gg.getResults(9999)
gg.clearResults()
gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 374', gg.TYPE_FLOAT)
local y = gg.getResults(9999)
gg.clearResults()
gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('11.99852752686', gg.TYPE_FLOAT)
local z = gg.getResults(9999)
gg.clearResults()

for repeatC = 1, 99 do
gg.sleep(2000)
    for i, v in ipairs(x) do
        if v.flags == gg.TYPE_FLOAT then
            v.value = '1575'
            v.freeze = true
        end
    end
    gg.addListItems(x)
    gg.clearResults()
    for i, v in ipairs(y) do
        if v.flags == gg.TYPE_FLOAT then
            v.value = '1356'
            v.freeze = true
        end
    end
    gg.addListItems(y)
    gg.clearResults()
	    for i, v in ipairs(z) do
        if v.flags == gg.TYPE_FLOAT then
            v.value = '13.44929885'
            v.freeze = true
        end
    end
    gg.addListItems(z)
    gg.clearResults()

 

Edited by BiNoops
added code in function
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
36 minutes ago, kiynox said:

--- [ @BiNoops ] ---

Вы должны сузить результат по крайней мере до 100. Судя по "gg.getResults(9999)", результатов должно быть много.
--- [ @Collen ] ---
Пожалуйста, переместите эту тему в: ПОМОЩЬ
---

@kiynox
The results are about 50-60, I change the same values 50-60 through the Game Guardian interface, and the game does not crash 😕

Link to comment
Share on other sites

  • 0

[ @BiNoops ]
---
Alright, let's do some troubleshoot:

Quote

Game is protected.

Try to enable the following things:

  • 1. Hide Game Guardian from Game: Level 1-4
  • 2. Bypass for PTrace Protection: freeze / restore
  • 3. Prevent Unload: Level 1-4

----

Quote

BUT when I do the same with a script, the game crashes

Try execute this script and tell me the numbers.

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 688', gg.TYPE_FLOAT)
gg.alert(tostring(gg.getResultsCount()))
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 374', gg.TYPE_FLOAT)
gg.alert(tostring(gg.getResultsCount()))
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('11.99852752686', gg.TYPE_FLOAT)
gg.alert(tostring(gg.getResultsCount()))
gg.clearResults()

---
[ Solution ]

  • - If you want to apply the values, instead of saving it into "Saved Lists", try to use: "gg.setValues". 
  • - Dont do unnecessary loops, using "for" is enough

Here, I have improve your script:

gg.setRanges(gg.REGION_C_ALLOC)
gg.sleep(300)

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 688', gg.TYPE_FLOAT)
local xCoord = gg.getResults(gg.getResultsCount())
local xCotemp = {}
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 374', gg.TYPE_FLOAT)
local yCoord = gg.getResults(gg.getResultsCount())
local yCotemp = {}
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('11.99852752686', gg.TYPE_FLOAT)
local zCoord = gg.getResults(gg.getResultsCount())
local zCotemp = {}
gg.clearResults()

for i, v in ipairs(xCoord) do
	if v.flags == gg.TYPE_FLOAT then
		xCotemp[i].address = v.address
		xCotemp[i].value = '1575'
		xCotemp[i].flags = v.flags
	end
end
gg.setValues(xCotemp)

for i, v in ipairs(yCoord) do
	if v.flags == gg.TYPE_FLOAT then
		yCotemp[i].address = v.address
		yCotemp[i].value = '1356'
		yCotemp[i].flags = v.flags
	end
end
gg.setValues(yCotemp)

for i, v in ipairs(zCoord) do
	if v.flags == gg.TYPE_FLOAT then
		zCotemp[i].address = v.address
		zCotemp[i].value = '13.44929885'
		zCotemp[i].flags = v.flags
	end
end
gg.setValues(zCotemp)

---
[ Problems ]

  • - Since you're looking for floats, it is possible the results can be alot, causing unnecessary things to change and break your game
  • - You're looping 99 times ("for repeatC = 1, 99 do"), this is bad practice. Using ("for i, v ipairs()") is enough. This causing the script to add the same 60 results into saved list for 99 times. Just calculate it yourself: 60x99.
  • - You're changing coordinates (to teleport), it doesn't make sense to freeze the value ("v.freeze = true"). Coordinate is dynamic, it changes once the character is moving. Freezing the value can cause un-intended effects.
  • - Your forgot to close ("for repeatC = 1, 99 do") with ("end").

So try the solution above.
----

Link to comment
Share on other sites

  • 0
48 minutes ago, kiynox said:
		xCotemp[i].address = v.address

 

I didn't forget about the "end", I threw off only what I thought was necessary.
An error occurs in the code that you threw off (the script does not work)
@kiynox

Edited by BiNoops
Link to comment
Share on other sites

  • 0

[ @BiNoops ]
---
I forgot, should works now:

gg.setRanges(gg.REGION_C_ALLOC)
gg.sleep(300)

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 688', gg.TYPE_FLOAT)
local xCoord = gg.getResults(gg.getResultsCount())
local xCotemp = {}
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 374', gg.TYPE_FLOAT)
local yCoord = gg.getResults(gg.getResultsCount())
local yCotemp = {}
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('11.99852752686', gg.TYPE_FLOAT)
local zCoord = gg.getResults(gg.getResultsCount())
local zCotemp = {}
gg.clearResults()

for i, v in ipairs(xCoord) do
	if v.flags == gg.TYPE_FLOAT then
		xCotemp[i] = {
			["address"] = v.address,
			["value"] = '1575',
			["flags"] = v.flags
		}
	end
end
gg.setValues(xCotemp)

for i, v in ipairs(yCoord) do
	if v.flags == gg.TYPE_FLOAT then
		yCotemp[i] = {
			["address"] = v.address,
			["value"] = '1356',
			["flags"] = v.flags
		}
	end
end
gg.setValues(yCotemp)

for i, v in ipairs(zCoord) do
	if v.flags == gg.TYPE_FLOAT then
		zCotemp[i] = {
			["address"] = v.address,
			["value"] = '13.44929885',
			["flags"] = v.flags
		}
	end
end
gg.setValues(zCotemp)

---

 

chingchong.lua

Edited by kiynox
fixes
Link to comment
Share on other sites

  • 0
11 hours ago, kiynox said:

[ @BiNoops ]
---
I forgot, should works now:

gg.setRanges(gg.REGION_C_ALLOC)
gg.sleep(300)

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 688', gg.TYPE_FLOAT)
local xCoord = gg.getResults(gg.getResultsCount())
local xCotemp = {}
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('1 374', gg.TYPE_FLOAT)
local yCoord = gg.getResults(gg.getResultsCount())
local yCotemp = {}
gg.clearResults()

gg.searchNumber('1 688;1 374;11.99852752686', gg.TYPE_FLOAT)
gg.refineNumber('11.99852752686', gg.TYPE_FLOAT)
local zCoord = gg.getResults(gg.getResultsCount())
local zCotemp = {}
gg.clearResults()

for i, v in ipairs(xCoord) do
	if v.flags == gg.TYPE_FLOAT then
		xCotemp[i] = {
			["address"] = v.address,
			["value"] = '1575',
			["flags"] = v.flags
		}
	end
end
gg.setValues(xCotemp)

for i, v in ipairs(yCoord) do
	if v.flags == gg.TYPE_FLOAT then
		yCotemp[i] = {
			["address"] = v.address,
			["value"] = '1356',
			["flags"] = v.flags
		}
	end
end
gg.setValues(yCotemp)

for i, v in ipairs(zCoord) do
	if v.flags == gg.TYPE_FLOAT then
		zCotemp[i] = {
			["address"] = v.address,
			["value"] = '13.44929885',
			["flags"] = v.flags
		}
	end
end
gg.setValues(zCotemp)

---

 

chingchong.lua 1.23 kB · 1 download

Thanks! This work!

 

tips about hiding GG from the game did not help, apparently it was in the script.
About freezing values - sometimes someone can push a character, so I freeze values.
I used the for loop because there are a lot of teleportations. (I didn't show them because the code would take up too much space)
In any case, you helped me, thank you very much!

Edited by BiNoops
Link to comment
Share on other sites

  • 0

[ @BiNoops ]
---

Quote

tips about hiding GG from the game did not help, apparently it was in the script.

You can use these external modules in the future.
---

Quote

I used the for loop because there are a lot of teleportations

If so, I recommend to do teleportations once in a while, trough prompt or interval because you're using "freeze value" here. Then set all of your coordinates into a table:

player_coords = { [1] = {["x"]=1, ["y"]=2, ["z"]=3}, [2] = {["x"]=2, ["y"]=3, ["z"]=4} }

---

Quote

About freezing values - sometimes someone can push a character, so I freeze values

Your "for loop" is apparently the main problem here. You need to remove "freeze value" or atleast clear any items from your savedlist: gg.clearList() before adding a new teleportations.
---
If you have any problem just ask me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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.