Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Solved] How to add a pointer from an 64-bit opcode?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Fighter19
Newbie cheater
Reputation: 0

Joined: 09 Jan 2015
Posts: 15

PostPosted: Mon May 25, 2015 6:02 pm    Post subject: [Solved] How to add a pointer from an 64-bit opcode? Reply with quote

Hi there, I have a problem with adding a 64-bit pointer from an OpCode to the codelist.
I'd need to add the size of the instruction and the position of the OpCode to the pointer used inside the instruction. My problem is, I can't insert a symbol, which represents the location of the function into the offset box when adding an address manually. It just doesn't add the position (shows +???????).
My guess is you can't enter 64-bit addresses into the pointer offset box.


Last edited by Fighter19 on Tue May 26, 2015 6:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon May 25, 2015 8:30 pm    Post subject: Reply with quote

You want to insert a symbol as the base pointer? Works just fine.
You want to insert a symbol as an offset to some other base? Why?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue May 26, 2015 9:12 am    Post subject: This post has 1 review(s) Reply with quote

Quote:
from an OpCode to the codelist


Open Memory Browser, highlight your opcode.
Be sure that all columns are visible and wide enough (address, bytes, opcode, comment).

Do a screenshot, post it here.


Probably it is RIP based encoded address. (rip-related addressing)


opcode at address 400500 uses normal addressing
opcodes at address 400510 and 400517 use rip based addressing.
All of them read value at address 400600.


In that case, better use Lua and disassembler object.



Here, example solution (copy whole and paste into CE bottom part):


Code:
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"main"</Description>
      <Options moHideChildren="1"/>
      <LastState Activated="0"/>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>


[ENABLE]
{$Lua}


local opcodeAddress='400510'
local nameOfRegisteredBase='myPtrBase'

function retrieveAddress(opcodeAddress)
  if dis==nil then dis=createDisassembler() end
  local opcode=dis.disassemble(opcodeAddress)
  return dis.LastDisassembleData.modrmValue
end

function registerBaseOfPointer(opcodeAddress,name)
  local base=retrieveAddress(opcodeAddress)
  unregisterSymbol(name)
  registerSymbol(name,base,true)
end

if not syntaxcheck then
  registerBaseOfPointer(opcodeAddress,nameOfRegisteredBase)
end
{$Asm}

[DISABLE]




</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>1</ID>
          <Description>"pointer1"</Description>
          <LastState Value="??" Activated="0" RealAddress="00000000"/>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>myPtrBase</Address>
          <Offsets>
            <Offset>4</Offset>
            <Offset>0</Offset>
            <Offset>DC</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>2</ID>
          <Description>"pointer2"</Description>
          <LastState Value="??" Activated="0" RealAddress="00000000"/>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>myPtrBase</Address>
          <Offsets>
            <Offset>8</Offset>
            <Offset>0</Offset>
            <Offset>DC</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
</CheatTable>




Inside "main" script you have to edit those lines:
Code:
local opcodeAddress='400510'
local nameOfRegisteredBase='myPtrBase'



After enabling this script, you can use pointers normally, and use the registered base of pointer.



example.CT
 Description:

Download
 Filename:  example.CT
 Filesize:  1.96 KB
 Downloaded:  745 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
Fighter19
Newbie cheater
Reputation: 0

Joined: 09 Jan 2015
Posts: 15

PostPosted: Tue May 26, 2015 5:46 pm    Post subject: Reply with quote

Thank you for your answers so far, I'll have a look at it, right now, I have written a LUA script (what I'm really a noob at) which calculates the value I need. I think I'll replace it with the solution mgr.inz.Player, because I like it way more. (Is way more clean). Actually that's what I've been looking for, thank you!
Again, thank you, you solved my problem!

Code:

local CTAL=getAddressList()
local mr=CTAL.createMemoryRecord();
mr.setDescription('DebugKeysEnabled')

offset = readInteger(getAddress('GSGE.Debug::handleInput+22')) --Get offset
resAddress = offset + getAddress('GSGE.Debug::handleInput+1F') + 7 --To obtain address add the offset + the current position + 7 (inst. size) to it
mr.Address=string.format( '%x', resAddress )
mr.setType(vtByte)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites