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 


CE Request

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Jan 18, 2016 5:54 am    Post subject: CE Request Reply with quote

Allow multiple entries inside the cheat table to be batch-edited for assigning hotkey and setting group config options. Currently, even with multiple entries highlighted, only the one entry that is right-clicked is affected. I know child entries can be used, but that is limited and is not always preferred.

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

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

PostPosted: Fri Jul 22, 2016 8:20 pm    Post subject: This post has 1 review(s) Reply with quote

Quick and dirty function for CE6.5.1 64bit

Every memoryrecod has Hotkeylist object (TList class).

So the idea is:
1. e.g. you have 5 entries/memrecs, set hotkey(s) to at least one, highlight them (one with hotkey and 4 without) and rightclick to bring popup menu.
2. below autorun script will go through all selected/highlighted memrecs in addresslist.
3. it will find the one with hotkeys, and use it as the source
4. in other selected memrecs, it will replace the pointer to Hotkeylist, so it will point to "source Hotkeylist"
5. from now on, changing hotkeys in one memrec (of those 5) will change for the other 4.
6. Now save the CT file.


6. because this method is "hackish" and few memrecs will share the same object:
a) save it as new CT file (do not overwrite the original). And just close CE.
b) and do not delete any of the altered memrecs when you just used this function (removing one will free shared Hotkeylist, and this will lead to "access violation" in other memrecs). Just do step 6a, then launch CE, open CT file, and you can edit without any issues, there's no longer shared Hotkeylist object.



Code:
function duplicateHotkeysForSelectedMemRecs()
  if not (getCEVersion()==6.51) then return end
  if not cheatEngineIs64Bit() then return end

  if messageDialog("'Duplicate Hotkeys for selected MemRecs'\nAre you sure?",mtInformation,mbYes,mbNo) == mrNo then
    return
  end

  local AL=getAddressList()

  local indexOfMR=nil

  -- find MR with hotkeys
  for i=0,AL.Count-1 do
    if AL[i].Selected and AL[i].HotkeyCount>0 then
      indexOfMR = i
      break
    end
  end

  if indexOfMR==nil then return end

  local addressOfMR = userDataToInteger(AL[indexOfMR])
  local addressOfHotkeylistTList = readQwordLocal(addressOfMR + 0x48) -- Hotkeylist: TList; //at offset 0x48

  -- replace Hotkeylist for all selected MRs
  for i=0,AL.Count-1 do
    if i~=indexOfMR and AL[i].Selected then
      local addressOfOtherMR = userDataToInteger(AL[i])
      writeQwordLocal(addressOfOtherMR+0x48,addressOfHotkeylistTList)
    end
  end

end

local PopupMenu2=getMainForm().findComponentByName("PopupMenu2")
local duplicateHotkeys = createMenuItem(PopupMenu2)
duplicateHotkeys.Caption= "Duplicate Hotkeys for selected MemRecs"
duplicateHotkeys.Name = "duplicateHotkeysForSelectedMemRecs"
duplicateHotkeys.OnClick = duplicateHotkeysForSelectedMemRecs
PopupMenu2.Items.add(duplicateHotkeys)

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jul 23, 2016 4:48 am    Post subject: Reply with quote

Thanks, mgr.inz.Player! Sounds a bit tricky. I hope you don't mind...I will have to test this out later, when I have more time. Thank you so much for taking the time! Very Happy

EDIT:
I decided to do a quick test on this and I am unable to get it working properly. I do not know if another LUA plugin is interfering, or if I am just doing something wrong.

The steps that I took:

Saved script as .LUA and placed in autorun folder.

1. Opened table.
2. Highlighted a single entry and assigned a hotkey to it.
3. Highlighted multiple entries, including the first entry, and chose to duplicated hotkeys across multiple entries.
4. Checked empty entries to see if hotkey was copied over - it was not.
5. Manually assigned the same hotkey to one of the empty entries to see if it would be copied over to any of the other entries - it was not.

1. Opened table.
2. Highlighted a single entry and assigned a hotkey to it.
3. Highlighted multiple entries, including the first entry, and chose to duplicated hotkeys across multiple entries.
4. Save the table, did not replace original and closed CE.
5. Opened newly revised table to check if newly assigned hotkeys copied over - they did not.
6. Tried to assign a hotkey to one of the empty entries to see if they would copy over - they did not.

1. Opened table.
2. Highlighted a multiple entries and assigned a hotkey to them.
3. Highlighted the same, multiple entries and chose to duplicated hotkeys across multiple entries.
4. Save the table, did not replace original and closed CE.
5. Opened newly revised table to check if newly assigned hotkeys copied over - they did not.
6. Tried to assign a hotkey to one of the empty entries to see if they would copy over - they did not.

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

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

PostPosted: Sat Jul 23, 2016 6:31 am    Post subject: Reply with quote

official ce651
_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jul 23, 2016 6:43 am    Post subject: Reply with quote

Cool. Works great! Thanks!
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Sun Jul 24, 2016 7:49 am    Post subject: This post has 1 review(s) Reply with quote

In official CE651 memory record has "Hotkeylist: TList" at offset 0x48.
In other releases it can change. There is a method to find correct offset for your CE version:


1 start CE, attach CE to itself
2 add one memory record (can be simple address, pointer or AA script)
3 assign few hotkeys to that entry, e.g. three
4 do 4byte scan with value 3
5 assign another hotkey to that entry (or delete), e.g. now you have four
6 do 4byte scan with value 4 (number of currently assigned hotkeys)
7 you will find address of FCount
8 do print( getAddressList()[0] ) you will get address of memory record
9 then use structure spider.


For me it is:
FCount - 09F5AE40
memory record - 0C6B7E40



As you see, this "[[memrec+80]+8]+10" points to FCount and "[memrec+80]+0" points to TList

Address of TList is at "memrec+80"


So, I have to use 0x80 in the script for my current CE version (custom build).

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jul 24, 2016 7:56 am    Post subject: Reply with quote

Thanks, mgr.inz.Player. It's good to know. Hopefully, DB can implement a permanent solution. If not, I am happy with this. Thank you. (+rep when I can)
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Sun Jul 24, 2016 8:41 am    Post subject: Reply with quote

mgr.inz.Player wrote:
In official CE651 memory record has "Hotkeylist: TList" at offset 0x48.
In other releases it can change. There is a method to find correct offset for your CE version:


1 start CE, attach CE to itself
2 add one memory record (can be simple address, pointer or AA script)
3 assign few hotkeys to that entry, e.g. three
4 do 4byte scan with value 3
5 assign another hotkey to that entry (or delete), e.g. now you have four
6 do 4byte scan with value 4 (number of currently assigned hotkeys)
7 you will find address of FCount
8 do print( getAddressList()[0] ) you will get address of memory record
9 then use structure spider.


For me it is:
FCount - 09F5AE40
memory record - 0C6B7E40



As you see, this "[[memrec+80]+8]+10" points to FCount and "[memrec+80]+0" points to TList

Address of TList is at "memrec+80"


So, I have to use 0x80 in the script for my current CE version (custom build).


thanks for the info. i had been meaning to find where the hotkeys were, but i was only comparing the first level for memory record lol and only found the isEditing flag.

just a side question, when structure dissect locks a structure, how much of the memory is shadowcopied? just the structure itself or a fixed region of memory around it?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Sun Jul 24, 2016 9:07 am    Post subject: Reply with quote

predprey wrote:
just a side question, when structure dissect locks a structure, how much of the memory is shadowcopied? just the structure itself or a fixed region of memory around it?



Code:
  if parent.parent.MainStruct<>nil then
    size:=max(8192, parent.parent.MainStruct.getStructureSize)
  else
    size:=8192;


Maximum 8192 bytes. Or as much as structure size, not bigger than 8192 bytes.

Edit:
Damn, there is max not min. So:
Minimum 8192 bytes. Or as much as structure size.

_________________


Last edited by mgr.inz.Player on Sun Jul 24, 2016 2:29 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Sun Jul 24, 2016 9:35 am    Post subject: Reply with quote

mgr.inz.Player wrote:
predprey wrote:
just a side question, when structure dissect locks a structure, how much of the memory is shadowcopied? just the structure itself or a fixed region of memory around it?



Code:
  if parent.parent.MainStruct<>nil then
    size:=max(8192, parent.parent.MainStruct.getStructureSize)
  else
    size:=8192;


Maximum 8192 bytes. Or as much as structure size, not bigger than 8192 bytes.


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

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

PostPosted: Thu Jul 28, 2016 3:23 pm    Post subject: This post has 1 review(s) Reply with quote

@++METHOS
can you try this extension (for official ce651).



hotkeyBulkEdit.lua
 Description:

Download
 Filename:  hotkeyBulkEdit.lua
 Filesize:  2.92 KB
 Downloaded:  1010 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Jul 28, 2016 3:41 pm    Post subject: Reply with quote

Works great, mgr.inz.Player! This is a lot better. Thanks!

I couldn't get it to work at first, because I didn't know that you had to press apply before clicking on the 'bulk edit' button. Also, there is a 0 in the bottom-right corner, for some reason. This is true, even if I set multiple hotkeys using bulk edit.

Great work! Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Thu Jul 28, 2016 4:01 pm    Post subject: Reply with quote

If someone is want to see it in action, here's a demo:

Link

It just alters (set the same TList for all selected MR), saves to TEMP, restore original TList(so destroy will work without issues), loads table from TEMP





++METHOS wrote:
Also, there is a 0 in the bottom-right corner, for some reason.

I got this 0 even when I remove all extensions (I renamed autorun folder). Try this: set few hotkeys manually in one MR, and then reopen hotkey window.

I think this value is:
max(hk1.ID, hk2.ID, ....)


++METHOS wrote:
Great work! Very Happy

No problem.

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Jul 28, 2016 4:10 pm    Post subject: Reply with quote

Not sure about the 0, but it's not important.

Looks like another plugin for you. Very Happy You should add it to the plugin sub-forum. Hopefully, some of these feature that are being created with LUA can be permanently added to CE, or to the autorun folder, by default. I don't imagine it would be too difficult to maintain compatibility with LUA updates. I owe you +reps.
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Sat Jul 30, 2016 12:31 am    Post subject: Reply with quote

For official CE651. Here's a WIP Batch Add Hotkey extension. It's a ASM hack and uses CE's native code to add to all selected records. Records need to be highlighted when you press the apply button in the create interface. Probably won't work with other CE versions since the pointers and aob would be different.

I tried using LuaCallFunction but it seems to get into an infinite loop and freeze after the syscall to execute the lua code. If someone can tell me how to avoid that I may be able to make this extension compatible with more versions of CE. I tried running the LuaCall in a native thread, didn't work either.

P.S. love how the extension subsection is getting livelier Very Happy

EDIT: Download moved to CEnhancer thread. See signature below.

_________________
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