Jump to content

MAARS

Contributor
  • Posts

    659
  • Joined

  • Last visited

  • Days Won

    25

File Comments posted by MAARS

  1. 43 minutes ago, hemen said:

    Can we search a dino by its name?

    I want to keep the functionality as minimum as possible, so if you want to search dyno by name then dump dyno code and use any text text editor that has a search functionality, another way will be to add the feature to the script by yourself, that why i don't encrypt my code so you can extend it as your wish or even remove what you don't like

    hex converter

       898    8
    22 minutes ago, HorridModz said:

    I wish I would have used this - it would have saved ages!

    Here's my solution:

    function armtohex(fullarm)
    	progressalert("Converting edit value",false)
    	fullhex = ""
    	--Thanks to Enyby for the original arm hex converter I used code from:
    	-- https://gameguardian.net/forum/files/file/2004-arm-converter/
    	for arm in string.gmatch(fullarm,'[^\r\n]+') do 
    		progressalert("Converting edit value",false)
    		local addr = gg.getRangesList('libc.so')
    		for i, v in ipairs(addr) do
    			if v.type:sub(2,2) == 'w' then
    				addr = {{address = v.start, flags = gg.TYPE_DWORD}}
    			end
    		end
    		if not addr[1].address then
    			print("Error occured converting arm code to hex: Failed to get address ", addr)
    			gg.setVisible(true)
    			os.exit()
    		end
    		if is64bit then
    			--Armv8 (64bit)
    			local old = gg.getValues(addr)
    			addr[1].value = '~A8 '..arm
    			local ok, err = pcall(gg.setValues, addr)
    			local out
    			if not ok then
    				err = err:gsub("^.* '1': ", ''):gsub('\nlevel = 1.*$', '')
    				print("Error occured converting arm code to hex: " .. err)
    				gg.setVisible(true)
    				os.exit()
    			else
    				out = gg.getValues(addr)
    				out = out[1].value & 0xFFFFFFFF
    				gg.setValues(old)
    				if not hex then
    					out = string.unpack('>I4', string.pack('<I4', out))
    				end
    				out = string.format('%08X', out)
    				fullhex = fullhex .. out
    			end
    		else
    			--Armv7 (32bit)
    			local old = gg.getValues(addr)
    			addr[1].value = '~A '..arm
    			local ok, err = pcall(gg.setValues, addr)
    			local out
    			if not ok then
    				err = err:gsub("^.* '1': ", ''):gsub('\nlevel = 1.*$', '')
    				print("Error occured converting arm code to hex: " .. err)
    				gg.setVisible(true)
    				os.exit()
    			else
    				out = gg.getValues(addr)
    				out = out[1].value & 0xFFFFFFFF
    				gg.setValues(old)
    				if not hex then
    					out = string.unpack('>I4', string.pack('<I4', out))
    				end
    				out = string.format('%08X', out)
    				fullhex = fullhex .. out
    			end
    		end
    	end
    	return(fullhex)
    end
    
    function hextodecimal(hex)
    	progressalert("Converting edit value",false)
    	--Remove spaces, then reverse bytes (ex: A1 B1 -> B1A1)
    	oldhex = string.gsub(tostring(hex)," ","")
    	hex = ""
    	thisbyte = ""
    	for letterindex = 1, #oldhex do
    		thisbyte = thisbyte .. oldhex:sub(letterindex,letterindex)
    		if #thisbyte == 2 then
    			hex = thisbyte .. hex
    			thisbyte = ""
    		end
    	end
    	if not(string.sub(hex,1,2) == "0x") then
    		hex = "0x" .. hex
    	end
    	return(tonumber(hex))
    	--[[
    	--thanks to ItsSC for this function (found at https://gameguardian.net/forum/topic/31634-converting-decimal-to-hex/)
    	hex = tonumber(hex)
    	gg.alert(tostring(tonumber(hex >= 0 and string.format("%X", tonumber(hex)) or string.format("%X", (hex~ 0xffffffffffffffff <<((math.floor(math.log(math.abs(hex))/math.log(10)) + 1) *4))),16)))
    	return(tonumber(hex >= 0 and string.format("%X", tonumber(hex)) or string.format("%X", (hex~ 0xffffffffffffffff <<((math.floor(math.log(math.abs(hex))/math.log(10)) + 1) *4))),16))
    	--]]
    end

     

    thanks bro, but the purpose of this script was not there convert value to hex bytecodes, it is just for normal hex the base 16

  2. 4 hours ago, S1LV3RC01N said:

    Charging for cheats is stealing

    No one hold your hand to buy it, it is up to you.

    This is like telling a cigarette merchant that he is a killer, bruh, nah people are killing themselves 

    4 hours ago, S1LV3RC01N said:

    careless security violations

    These companies do the same by selling our data

     

    You just looks like an angry developer

    BadCase's Telegram Bot

       556    3

    This is a wonderful project, but It is actually difficult to understand the code or at least for me, next time you build a "massive project" like this please try using module this can make things easier to understand

×
×
  • 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.