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 


Problems with LUA
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 223

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

PostPosted: Wed Oct 26, 2016 4:50 pm    Post subject: Reply with quote

I can try analyzing your code you are working on. Save your work as CT file and attach it here. If you don't want to make it public, send me private message.

Your account probably has some restrictions - new accounts can not give +rep, posts with URL are blocked, you can't send PM. But, you can reply to PM. I will send you PM, just in case.

_________________
Back to top
View user's profile Send private message MSN Messenger
dl748
Advanced Cheater
Reputation: 0

Joined: 05 Mar 2016
Posts: 75

PostPosted: Wed Oct 26, 2016 11:49 pm    Post subject: Reply with quote

I'm fine if you want to look. Also I can't find 6.6.0.1 version and getAddress() returns only a single integer. Just remember its not a completely finished script. There are a lot of testing and print()s


ROTTR.CT
 Description:

Download
 Filename:  ROTTR.CT
 Filesize:  46.21 KB
 Downloaded:  610 Time(s)

Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 223

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

PostPosted: Thu Oct 27, 2016 3:23 am    Post subject: Reply with quote

dl748 wrote:
I can't find 6.6.0.1


Main CE page:



dl748 wrote:
getAddress() returns only a single integer.

from lua documentation file (main.lua)
Code:

MemoryRecord Class:
The memoryrecord objects are the entries you see in the addresslist

properties
  ID: Integer - Unique ID
  Index: Integer - The index ID for this record. 0 is top. (ReadOnly)
  Description: string- The description of the memory record
  ...
  ...

methods
  getDescription()
  setDescription()

  getAddress() : Returns the interpretable addressstring of this record. If it is a pointer, it returns a second result as a table filled with the offsets
  ...
  ...





Below, your table with my modifications:



dl748 ROTTR.CT
 Description:

Download
 Filename:  dl748 ROTTR.CT
 Filesize:  23.15 KB
 Downloaded:  518 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
dl748
Advanced Cheater
Reputation: 0

Joined: 05 Mar 2016
Posts: 75

PostPosted: Thu Oct 27, 2016 7:45 am    Post subject: Reply with quote

No, I mean, I saw that. But I don't see anyway of downloading that version. The links only point to 6.6.0. The About box only shows 6.6 and the windows version information shows "Product Version: 6.6.0" but the file version says "6.6.0.4881". But I don't see anywhere it says 6.6.0.1, even after I reinstalled from the main page.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 223

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

PostPosted: Thu Oct 27, 2016 2:37 pm    Post subject: Reply with quote

If you downloaded CE6.6 before 10/10/2016, 32bit exe will have version 6.6.0.4877 and 64bit exe 6.6.0.4878. Installer CheatEngine66.exe version is 6.6.0.0

If you downloaded CE6.6 after 10/10/2016, 32bit exe will have version 6.6.0.4880 and 64bit exe 6.6.0.4881. Installer CheatEngine66.exe version is 6.6.0.1

There's no big difference, cheats made on both above CE version are compatible.
But when it comes to injecting a code into CE itself, we have to take that into account.





So, you have 6.6.0.1, if you want, you can use the trick mentioned earlier:
Quote:
Or use this Lua script, it will modify CE itself (self inject). It will force usage of stronger version of ReinterpretAddress.
Script only for CE6.6.0.1 released 10/10/2016:
Code:
autoAssemble([[define(address,cheatengine-x86_64.exe+1D2184)
define(bytes,40 88 D6 48 C7 45 F8 00 00 00 00)
assert(address,bytes)
address:
mov sil,01]],true)






Anyway, did you try your table with my modifications?

_________________
Back to top
View user's profile Send private message MSN Messenger
dl748
Advanced Cheater
Reputation: 0

Joined: 05 Mar 2016
Posts: 75

PostPosted: Thu Oct 27, 2016 8:18 pm    Post subject: Reply with quote

Yes but I'm getting an error

Error:[string "local syntaxcheck=......"]:157: attempt to perform arithmetic on a nil value (global 'address')

Which I'm not getting on my original script. Seems like you tried to refactor my signed code, and its failing there.

at the first readPointer() address should be (from my original code that doesn't error)

0000000141645E88

but after the readSignedInteger change, the value is

0000000141645E87, which was not aligned.

I replaced it with the original code and it works fine. but the addresses are still not updating when I check them. "Iteration" prints 4 times before the numbers are updated (4 secs) although it is a bit faster. Strangely though, the unchecking seems to immediately update the values as ?? which is a much improvement and completely workable IMO.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 223

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

PostPosted: Fri Oct 28, 2016 3:47 am    Post subject: Reply with quote

Oh, I see, your implementation of read integer signed is bad.

Code:
function dl748readIntegerSigned(a)
  local val = readInteger(a)
  if val >= 0x80000000 then val = - bAnd(bNot(val),0xFFFFFFFF) end
  return val
end


function readIntegerSigned(a)
  local val = readInteger(a)
  if val==nil then return nil end
  if val>0x7fffffff then val=val-0x100000000 end
  return val
end







Because I refactored it, this:
Code:
      offset = readInteger(address+12)
      address = address + 15
      if offset >= 0x80000000 then
        address = address - bAnd(bNot(offset),0xFFFFFFFF)
      else
        address = address + offset
      end


into this:
Code:
      address = address + 15 + readIntegerSigned(address+12)



I forgot to check your other calculations. In this case you have to use +16. And that makes sense.

AOBScan("48 83 EC ?? E8 ?? ?? ?? ?? 48 8B 1D ?? ?? ?? ?? 48 85 DB 74", "+W-C+X")

signed offset is at +12
and next instruction is at +16

Hint: disassembling those bytes "48 8B 1D 00 00 00 00" (so offset is zero) will give you "mov rbx,[addressofnextinstruction]"
Just google "RIP relative addressing" (or "EIP relative addressing").







About not refreshing addresses, add more debug code. Probably this way of retrieving items is wrong:
Code:
        count = readInteger(currentinv+0x40)
        hashaddr = readPointer(currentinv + 0x28)
        for i=0,count-1 do
          paddr = readPointer(hashaddr + (i*8))
          if paddr ~= 0 then
            processItemList(paddr)
          end
        end









Anyway. I downloaded Steam version of "Rise of the Tomb Raider" and updated my item editor from here:
http://forum.cheatengine.org/viewtopic.php?p=5647684#5647684
(Windows Store version)


to Steam version below. You can check it.



ROTTR Inventory.CT
 Description:

Download
 Filename:  ROTTR Inventory.CT
 Filesize:  6.43 KB
 Downloaded:  621 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
dl748
Advanced Cheater
Reputation: 0

Joined: 05 Mar 2016
Posts: 75

PostPosted: Fri Oct 28, 2016 6:46 am    Post subject: Reply with quote

Right, I compensated the one off in the addition rather than making 2 additive operations. I already knew of that script. The point of the script was to be non-destructive and add a few features like max storage to it. For example, sometimes I like to play without having to worry about inventory limitations.

But thanks for the information.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 223

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

PostPosted: Fri Oct 28, 2016 3:20 pm    Post subject: Reply with quote

"The point of the script was to be non-destructive"
What do you mean?







Back to your original script.
Before I refactored it, I analyzed your code and didn't find any logical errors. Try this:


1. open autorun folder inside your CE installation directory. Create new text file with this content:
Code:
if cheatEngineIs64Bit() then

  local AlwaysStrongReinterpretAddress = autoAssemble([[define(address,cheatengine-x86_64.exe+1D2184)
define(bytes,40 88 D6 48 C7 45 F8 00 00 00 00)
assert(address,bytes)
address:
mov sil,01]],true)

  if AlwaysStrongReinterpretAddress then
   showMessage("always strong reinterpret address enabled")
  else
   showMessage("error: always strong reinterpret address could not be enabled")
  end

end


2. save it as AlwaysStrongReinterpretAddress.lua (not as AlwaysStrongReinterpretAddress.lua.txt)

3. from now on, just after launching 64bit CE you should get "always strong reinterpret address enabled" message.

4. set this option in CE general settings to 50milliseconds:


5. from now on, symbols will be reinterpreted every 0.75 seconds and address list will be refreshed every 50milliseconds.

6. Try your original script.

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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