Search the Community
Showing results for tags 'Virtual memory'.
Hi, I want to make script that can check instruction set architecture of the game. I'm using emulator, gg.getTargetInfo() does not work. I want to writte as less as possible but clear and effecient Currently im using path name to filter out strings. function ISACheck() -- possible instruction sets local ISA_x64Emulator = "/x86_64/" -- 64 bit emulator local ISA_x64 = "/arm64/" -- 64 bit local ISA_x32Emulator = "/x86/" -- 32 bit emulator local ISA_x32 = "/arm/" -- 32 bit local ranges = gg.getRangesList('base.odex') if #ranges == 0 then ranges = gg.getRangesList('classes.dex') end for i, v in ipairs(ranges) do if v.state == "Xa" then if string.find(v.internalName, ISA_x64Emulator) ~= nil or string.find(v.internalName, ISA_x64) ~= nil then instructionSetArchitecture = 64 dataType = gg.TYPE_QWORD elseif string.find(v.internalName, ISA_x32Emulator) ~= nil or string.find(v.internalName, ISA_x32) ~= nil then instructionSetArchitecture = 32 dataType = gg.TYPE_DWORD else print('Does not recognize instruction set') os.exit() end end end print(instructionSetArchitecture) end ISACheck() But this script quite long for its objective i think. 1.) If current script can be optimized, please post it. 2.) So i wanted to ask if it would be reasonable to use the ["end"] key in gg.getRangesList() to decide if the game is 64 or 32bit by putting a condition on that address if it exceeds 32bit? But it also got me to the next question. 3.) Games of 32bit are always loaded in memory addresses of max 32bit. But 64bit games uses 32bit memory addresses but also memory addresses of max 64bit. But is this "always" the case? Can it happen that a 64bit game is loaded at only memory addresses of max 32bit in size? It would make the whole calculating address size useless i think. 4.) Or if there is a more efficient way to get instruction set architecture. Please let me know. Please keep note, the game being a split.apk should not intervene with getting the instruction set architecture.