Jump to content
  • -1

Finding and changing the field offset using the Guardian game script


Question

Posted

Hi. I already know how to do this, but there was a problem with one game. With Feild offset finder everything is found and easily changed, but the script does not find anything. Class: ActorCameraController. Fields: public struct ActorCameraController.State Outside; // 0x60. function metaDataOffsets(). I tried to write the field name in different ways, nothing helps. Maybe there is a way to search without the field name? 

function metaDataOffsets()

  startAddressDat = 0

  endAddressDat = 0

  local rangesDat = gg.getRangesList("global-metadata.dat")

  for i, v in ipairs(rangesDat) do

    if v.state == "O" then

      startAddressDat = v.start

      endAddressDat = rangesDat[i]["end"]

      break

    end

  end

end

metaDataOffsets()

 

function stringNames()

  Class_ActorCameraController = "h004163746f7243616d657261436f6e74726f6c6c657200"

end

stringNames()

 

function searchString(className)

  gg.clearResults()

  gg.searchNumber(className, gg.TYPE_BYTE, nil, nil, startAddressDat, endAddressDat)

  gg.searchPointer(0)

  local a = gg.getResults(5)

  for i, v in ipairs(a) do

    v.address = v.address - classOffset

  end

  gg.loadResults(a)

end

 

function isProcess64Bit()

  local regions = gg.getRangesList()

  local lastAddress = regions[#regions]["end"]

  return (lastAddress >> 32) ~= 0

end

 

function validISA()

  instructionSetArchitecture = 0

 if isProcess64Bit() == true then

  instructionSetArchitecture = 64

 else

  instructionSetArchitecture = 32

 end

  return instructionSetArchitecture

end

validISA()

 

function instructionsOffset()

  if instructionSetArchitecture == 32 then

    hexConvert = 0xFFFFFFFF

    dataType = 4

    classOffset = 0x8

  else

    dataType = 32

    classOffset = 0x10

  end

end

instructionsOffset()

 

function offset_actorCameraController()

  if instructionSetArchitecture == 32 then

  else

    offset_Outside = 0x60

  end

end

offset_actorCameraController()

function ActorCameraController()

  gg.clearResults()

  searchString(Class_ActorCameraController)

  gg.searchPointer(0)

  local instances_ActorCameraController = gg.getResults(gg.getResultsCount())

  gg.clearResults()

  local ActorCameraController_Outside = {}

  for i, v in ipairs(instances_ActorCameraController) do

    ActorCameraController_Outside[i] = {address = v.address + offset_Outside, flags = gg.TYPE_FLOAT}

  end

  gg.loadResults(ActorCameraController_Outside)

end

11 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, Trews27 said:

Hi. I already know how to do this, but there was a problem with one game. With Feild offset finder everything is found and easily changed, but the script does not find anything. Class: ActorCameraController. Fields: public struct ActorCameraController.State Outside; // 0x60. function metaDataOffsets(). I tried to write the field name in different ways, nothing helps. Maybe there is a way to search without the field name? 

function metaDataOffsets()
    startAddressDat = 0
    endAddressDat = 0
    local rangesDat = gg.getRangesList("global-metadata.dat")
    for i, v in ipairs(rangesDat) do
        if v.state == "O" then
            startAddressDat = v.start
            endAddressDat = rangesDat[i]["end"]
            break
        end
    end
end

metaDataOffsets()

function stringNames()
    Class_ActorCameraController = "h004163746f7243616d657261436f6e74726f6c6c657200"
end

stringNames()

function searchString(className)
    gg.clearResults()
    gg.searchNumber(className, gg.TYPE_BYTE, nil, nil, startAddressDat, endAddressDat)
    gg.searchPointer(0)
    local a = gg.getResults(5)
    for i, v in ipairs(a) do
        v.address = v.address - classOffset
    end
    gg.loadResults(a)
end

function isProcess64Bit()
    local regions = gg.getRangesList()
    local lastAddress = regions[#regions]["end"]
    return (lastAddress >> 32) ~= 0
end

function validISA()
    instructionSetArchitecture = 0
    if isProcess64Bit() == true then
        instructionSetArchitecture = 64
    else
        instructionSetArchitecture = 32
    end
    return instructionSetArchitecture
end

validISA()

function instructionsOffset()
    if instructionSetArchitecture == 32 then
        hexConvert = 0xFFFFFFFF
        dataType = 4
        classOffset = 0x8
    else
        dataType = 32
        classOffset = 0x10
    end
end

instructionsOffset()

function offset_actorCameraController()
    if instructionSetArchitecture == 32 then
    else
        offset_Outside = 0x60
    end
end

offset_actorCameraController()

function ActorCameraController()
    gg.clearResults()
    searchString(Class_ActorCameraController)
    gg.searchPointer(0)
    local instances_ActorCameraController = gg.getResults(gg.getResultsCount())
    gg.clearResults()
    local ActorCameraController_Outside = {}
    for i, v in ipairs(instances_ActorCameraController) do
        ActorCameraController_Outside[i] = {address = v.address + offset_Outside, flags = gg.TYPE_FLOAT}
    end

    gg.loadResults(ActorCameraController_Outside)
end

 

Did you enable the correct memory ranges when performing pointer search ? Enable all of them and run the script. See if it works? If it works, add the memory ranges in your script.

  • 0
Posted
7 hours ago, Trews27 said:

Hi. I already know how to do this, but there was a problem with one game. With Feild offset finder everything is found and easily changed, but the script does not find anything. Class: ActorCameraController. Fields: public struct ActorCameraController.State Outside; // 0x60. function metaDataOffsets(). I tried to write the field name in different ways, nothing helps. Maybe there is a way to search without the field name? 

function metaDataOffsets()

  startAddressDat = 0

  endAddressDat = 0

  local rangesDat = gg.getRangesList("global-metadata.dat")

  for i, v in ipairs(rangesDat) do

    if v.state == "O" then

      startAddressDat = v.start

      endAddressDat = rangesDat[i]["end"]

      break

    end

  end

end

metaDataOffsets()

 

function stringNames()

  Class_ActorCameraController = "h004163746f7243616d657261436f6e74726f6c6c657200"

end

stringNames()

 

function searchString(className)

  gg.clearResults()

  gg.searchNumber(className, gg.TYPE_BYTE, nil, nil, startAddressDat, endAddressDat)

  gg.searchPointer(0)

  local a = gg.getResults(5)

  for i, v in ipairs(a) do

    v.address = v.address - classOffset

  end

  gg.loadResults(a)

end

 

function isProcess64Bit()

  local regions = gg.getRangesList()

  local lastAddress = regions[#regions]["end"]

  return (lastAddress >> 32) ~= 0

end

 

function validISA()

  instructionSetArchitecture = 0

 if isProcess64Bit() == true then

  instructionSetArchitecture = 64

 else

  instructionSetArchitecture = 32

 end

  return instructionSetArchitecture

end

validISA()

 

function instructionsOffset()

  if instructionSetArchitecture == 32 then

    hexConvert = 0xFFFFFFFF

    dataType = 4

    classOffset = 0x8

  else

    dataType = 32

    classOffset = 0x10

  end

end

instructionsOffset()

 

function offset_actorCameraController()

  if instructionSetArchitecture == 32 then

  else

    offset_Outside = 0x60

  end

end

offset_actorCameraController()

function ActorCameraController()

  gg.clearResults()

  searchString(Class_ActorCameraController)

  gg.searchPointer(0)

  local instances_ActorCameraController = gg.getResults(gg.getResultsCount())

  gg.clearResults()

  local ActorCameraController_Outside = {}

  for i, v in ipairs(instances_ActorCameraController) do

    ActorCameraController_Outside[i] = {address = v.address + offset_Outside, flags = gg.TYPE_FLOAT}

  end

  gg.loadResults(ActorCameraController_Outside)

end

Try perhaps this:

function metaDataOffsets()
    startAddressDat = 0
    endAddressDat = 0
    local rangesDat = gg.getRangesList("global-metadata.dat")
    for i, v in ipairs(rangesDat) do
        if v.state == "O" then
            startAddressDat = v.start
            endAddressDat = rangesDat[i]["end"]
            break
        end
    end
end

metaDataOffsets()

function stringNames()
    Class_ActorCameraController = "h004163746f7243616d657261436f6e74726f6c6c657200"
end

stringNames()

function searchString(className)
    gg.clearResults()
	gg.setRanges(gg.REGION_OTHER)
    gg.searchNumber(className, gg.TYPE_BYTE, nil, nil, startAddressDat, endAddressDat)
	local t = gg.getResults(gg.getResultsCount())
	gg.setRanges(gg.REGION_C_ALLOC)
	gg.loadResults(t)
    gg.searchPointer(0)
    local a = gg.getResults(5)
    for i, v in ipairs(a) do
        v.address = v.address - classOffset
    end
    gg.loadResults(a)
end

function isProcess64Bit()
    local regions = gg.getRangesList()
    local lastAddress = regions[#regions]["end"]
    return (lastAddress >> 32) ~= 0
end

function validISA()
    instructionSetArchitecture = 0
    if isProcess64Bit() == true then
        instructionSetArchitecture = 64
    else
        instructionSetArchitecture = 32
    end
    return instructionSetArchitecture
end

validISA()

function instructionsOffset()
    if instructionSetArchitecture == 32 then
        hexConvert = 0xFFFFFFFF
        dataType = 4
        classOffset = 0x8
    else
        dataType = 32
        classOffset = 0x10
    end
end

instructionsOffset()

function offset_actorCameraController()
    if instructionSetArchitecture == 32 then
    else
        offset_Outside = 0x60
    end
end

offset_actorCameraController()

function ActorCameraController()
    gg.clearResults()
    searchString(Class_ActorCameraController)
	gg.setRanges(gg.REGION_ANONYMOUS)
    gg.searchPointer(0)
    local instances_ActorCameraController = gg.getResults(gg.getResultsCount())
    gg.clearResults()
    local ActorCameraController_Outside = {}
    for i, v in ipairs(instances_ActorCameraController) do
        ActorCameraController_Outside[i] = {address = v.address + offset_Outside, flags = gg.TYPE_FLOAT}
    end
    gg.loadResults(ActorCameraController_Outside)
end

 

  • 0
Posted
4 hours ago, Trews27 said:

The result is the same. The script is executed, no errors, no values found.

And you sure the game you running is 64 bit? You need to comment each part of the code in which it's doing a search and see where it doesn't show results. 

  • 0
Posted
1 hour ago, Trews27 said:

Yes, the game is definitely 64-bit.

Did you try running your old script and enabling all memory ranges?

  • 0
Posted

All the values I found were in the anonymous area. Yes, I tried, the result is the same. The whole search takes 1-2 seconds, it seems the script does not search anything at all.

  • 0
Posted

Here is another field and class. But with this search method the result is the same. class AtmosphereFrames.FogFrame public System.Single End; // 0x38

  • 0
Posted
24 minutes ago, Trews27 said:

All the values I found were in the anonymous area. Yes, I tried, the result is the same. The whole search takes 1-2 seconds, it seems the script does not search anything at all.

Oke, search it manually. Enable the OTHER region and search your string: h004163746f7243616d657261436f6e74726f6c6c657200

  • 0
Posted
50 minutes ago, Trews27 said:

Found

Oke, then do pointer search on the first printable character, then offset -0x10

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