Jump to content
  • 0

Why is my game always detected as 64bit?


SamePerson
 Share

Question

I want to make public script automatically detect bit of game, but always detect 64bit even though my game lib is arm-v7a/32bit

Example:

v = gg.getTargetInfo()

if v.x32 then -- if 32BIT goto
 -- 32bit function --
else -- if 64BIT goto
 -- 64bit function --
end

Or

v = gg.getTargetInfo()

function EX()
if v.x32 == true then -- if 32BIT goto
  -- 32bit function --
end
if v.x32 == false then -- if 64BIT goto
  -- 64bit function --
end
end

How can possible i fix it?

*Sorry for my bad english, I was helped by google translate*

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 2

because there is no such gg.targetInfo().x32 you can use
 

local target = gg.getTargetInfo()

if (not target) then
    gg.alert("Failed to get target info.")
    do return end
end

You just have to invert your condition to test for 32 or 64 bit


if (target.x64) then
    -- gg.alert("This script is not compatible with 64-bit.")
    -- do return end
end

 

if (not target.x64) then
    -- gg.alert("This script is not compatible with 32-bit.")
    -- do return end
end

 

Edited by MAARS
Link to comment
Share on other sites

  • 0

[ @SamePerson ]
---
You can just do else-if chain:

v = gg.getTargetInfo()

if v.x64 then
	print('Is x64-bit')
elseif v.x32 then
	print('Is x32-bit')
else --Relocate if "V" is empty / both x64 & x32 doesn't exist.
	print('Target is not found!')
end

---

Link to comment
Share on other sites

  • 0
22 hours ago, Xaviesz said:

[ @SamePerson ]
---
You can just do else-if chain:

v = gg.getTargetInfo()

if v.x64 then
	print('Is x64-bit')
elseif v.x32 then
	print('Is x32-bit')
else --Relocate if "V" is empty / both x64 & x32 doesn't exist.
	print('Target is not found!')
end

---

I guess there is only x64 and it return a bool either true or false , x32 is not valid parameter 
image.thumb.png.991783df241d4b12bfb81d2c5c8ff99a.png
read more

Edited by XEKEX
Link to comment
Share on other sites

  • 0

[ @XEKEX ]
---
You're right, just place with "not" then:

if v.x64 then
	print('Is x64-bit')
elseif (not v.x64) then
	print('Is x32-bit')
else --Relocate if "V" is empty / both x64 & x32 doesn't exist.
	print('Target is not found!')
end

---

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.