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 


a bug bout Assemble custom value types,7.1,7.2。

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 74

PostPosted: Mon Sep 06, 2021 7:21 am    Post subject: a bug bout Assemble custom value types,7.1,7.2。 Reply with quote

There is a bug in CE, after the target process is attached and then registered a assembly custom value type ,
the value cannot be read and written correctly.
Haven't tried 7.3。But it doesn’t seem to be in the repair list。
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25281
Location: The netherlands

PostPosted: Mon Sep 06, 2021 8:06 am    Post subject: Reply with quote

Check your custom type. Does it properly implement both read AND writes?

Also, keep in mind the custom types run inside CE , NOT inside the target process

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 74

PostPosted: Mon Sep 06, 2021 8:23 am    Post subject: Reply with quote

The same script, first open the script, then attaching the game ,it is correct.
When attaching the game first and then loading the same script, it is wrong.
The author said it was a bug in ce .

Code:

if not ARCGameEngine then
   ARCGameEngine = registerCustomTypeAutoAssembler([[
      alloc(TypeName, 14)
      alloc(UsesFloat, 1)
      alloc(CallMethod, 1)
      alloc(ConvertRoutine, 16)
      alloc(ConvertBackRoutine, 20)
      alloc(ByteSize, 4)
      alloc(AGEBitsMasker, 4)
      alloc(PreferedAlignment, 4)
      registerSymbol(AGEBitsMasker)
      
      TypeName:
      db 'ARCGameEngine', 00
      
      CallMethod:
      db #1
      
      ConvertRoutine:
      [32-bit]
      mov ecx, [rsp+04]
      [/32-bit]
      mov eax, [rcx]
      xor eax, [AGEBitsMasker]
      ror eax, 0E
      ret

      ConvertBackRoutine:
      [32-bit]
      mov ecx, [rsp+04]
      mov eax, [rsp+0C]
      [/32-bit]
      rol ecx, 0E
      xor ecx, [AGEBitsMasker]
      [64-bit]
      db 41
      [/64-bit]
      mov [rax], ecx
      ret
      
      ByteSize:
      dd #4
      
      PreferedAlignment:
      dd #-1
   ]])
   
   if ARCGameEngine then
      for i = MainForm.VarType.Items.Count - 1, 0, -1 do
         if MainForm.VarType.Items[i] == ARCGameEngine.name then
            MainForm.VarType.ItemIndex = i
            if MainForm.VarType.OnChange then
               MainForm.VarType:OnChange()
            end
            break
         end
      end
   end
end

function MainForm.OnProcessOpened(pid, handle, caption)
   if process == "AGE.EXE" then
      local COMethod = readPointer(readPointer(executeCodeEx(0, nil, "AGE!GetClassObject", "AGE:IAGEService")) + 0x0C)
      local isModern = readBytes(COMethod, 1) == 0xE9 and 8 or 0
      if isModern ~= 0 then
         COMethod = COMethod + 5 + readInteger(COMethod + 1, true)
      end
      local baseAddr = readPointer(readInteger(COMethod + 1)) + readInteger(COMethod + 7, true)
      local isLatest = readPointer(baseAddr + 0x24) ~= getAddress("kernel32.dll") and 12 or 0
      
      local startAddress = readPointer(baseAddr - 0x1470 + isModern)
      local stopAddress = startAddress + readInteger(baseAddr - 0x1488 + isModern) * 4
      
      unregisterSymbol("COM3")
      registerSymbol("COM3", startAddress)
      
      unregisterSymbol("AUX")
      registerSymbol("AUX", baseAddr + 0x20 + isLatest)
      
      MaskValue = readInteger("AUX")
      writeIntegerLocal("AGEBitsMasker", MaskValue)
      
      MainForm.FromAddress.Text = ("%08X"):format(startAddress)
      MainForm.ToAddress.Text   = ("%08X"):format(stopAddress)
      
      function AddressList.OnAddressChange(list, row)
         if row.Type == vtCustom then
            local addr = row.Address
            if '0' <= addr and addr <= '9' then
               local curr = row.CurrentAddress
               if startAddress <= curr and curr < stopAddress then
                  row.Address = ("COM3+%06X"):format(curr - startAddress)
               end
            end
         end
      end
      AddressList.OnDescriptionChange = AddressList.OnAddressChange
      AddressList.OnValueChange = AddressList.OnAddressChange
   end
end

openProcess(getWindowProcessID(findWindow(utf8ToAnsi("ARCGameEngine"), nil)))
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25281
Location: The netherlands

PostPosted: Mon Sep 06, 2021 9:07 am    Post subject: Reply with quote

I don't have this game so I can't check, but I assume it goes wrong at the setting of AGEBitsMasker in "function MainForm.OnProcessOpened(pid, handle, caption)"

Can you add some debug info there to see why the mask you set is not what it should be

(Also, don't run this script more than once)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 74

PostPosted: Mon Sep 06, 2021 9:45 am    Post subject: Reply with quote

The script is downloaded from here, made by sceawung
necocan-index.rick-addison.com/bbs/patio.cgi?read=64&ukey=1
Difficult to read Japanese with Google Translate.
the author sceawung does not seem to explain what he wrote.
What does this lua mean, maybe only the sceawung knows。
Most users of this website don’t even know ce.
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