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 


Custom 'AOB Injection' Templates [ver. 1.3.1]
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting -> Lua Extensions
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 146

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

PostPosted: Mon Mar 06, 2017 2:02 pm    Post subject: Reply with quote

Version 1.3

Quote:
Would it be possible to change the default 'INJECT' name to something else -- for example 'temp' or 'example'?

Done. Added new "defaultSymbolName" option. You can use it for each template. If not provided, 'example' will be used.

Quote:
Also, would it be possible to incorporate non-clickable menu line separators (e.g. to separate our custom script entries)?

Done. And added new "submenu" option. You can use it for each template.


Also, it should work properly when AA window is called from "not main Memory Viewer"


Edit:
And below post taken into account.

_________________


Last edited by mgr.inz.Player on Mon Mar 06, 2017 3:37 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Csimbi
Grandmaster Cheater Supreme
Reputation: 66

Joined: 14 Jul 2007
Posts: 1914

PostPosted: Mon Mar 06, 2017 2:56 pm    Post subject: Reply with quote

Thank you, Doctor Wink

I've done some minor tweaking since the last build you guys helped me make.
Here it is in case you'd roll it back into the new 1.3 build:

Code:
{
displayName="Csimbi's AOB",
submenu="Csimbi's AOB Injection Templates",
templateSections=
[==[
<<INFO>>
// Game   : %processName%
// Version:
// Date   :
// Author : %authorName%
<<INFO_END>>

<<ENABLE>>
aobscan%isModuleScan%(aob%cheatName%,%moduleNameC%%searchPattern%)

alloc(newmem%cheatName%,4096,aob%cheatName%)

label(aob%cheatName%_r)
label(aob%cheatName%_i)
registersymbol(aob%cheatName%_r)
registersymbol(aob%cheatName%_i)

label(lbl%cheatName%)
label(lbl%cheatName%Skip)
label(lbl%cheatName%Ret)

label(bEnable%cheatName%)
registersymbol(bEnable%cheatName%)

newmem%cheatName%:
bEnable%cheatName%:
dd 1

lbl%cheatName%:
%CoriginalCodeLines%
//db %originalBytes%
readmem(aob%cheatName%%aobAdjust%,%replacedInstructionsSize%)

cmp dword ptr [bEnable%cheatName%],1
jne short lbl%cheatName%Skip
// Place your code here

lbl%cheatName%Skip:
jmp lbl%cheatName%Ret
aob%cheatName%_i:
readmem(aob%cheatName%%aobAdjust%,%replacedInstructionsSize%)

//%injectAddress%:
aob%cheatName%%aobAdjust%:
aob%cheatName%_r:
jmp lbl%cheatName%
%nopLines%
lbl%cheatName%Ret:

<<ENABLE_END>>

<<DISABLE>>
//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%
aob%cheatName%_r:
readmem(aob%cheatName%_i,%replacedInstructionsSize%)

unregistersymbol(aob%cheatName%_r)
unregistersymbol(aob%cheatName%_i)

unregistersymbol(bEnable%cheatName%)

dealloc(newmem%cheatName%)

%additionalInfo%
<<DISABLE_END>>
]==]
},
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 74

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Mon Mar 06, 2017 5:50 pm    Post subject: Reply with quote

Thanks, mgr.inz.Player!

I will take a look at this as soon as I am able.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 74

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Wed Mar 08, 2017 10:30 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
++METHOS wrote:
Also, would it be possible to incorporate non-clickable menu line separators (e.g. to separate our custom script entries)?
Done. And added new "submenu" option. You can use it for each template.
-Can you provide examples for their usage (for separator and sub-menu)? Very Happy

By the way, would it be possible to create something that will allow us to also incorporate table entries for our custom templates? For example:

Template to store address:

Code:
//Target:  firefox.exe
//Author:  ++METHOS

[ENABLE]

{====================  example  ====================}

aobscanmodule(aob_example,firefox.exe,8B 48 3C 03 C8 0F)
alloc(newmem_example,1024,firefox.exe)

label(return_example)
label(originalcode_example)
label(example_address)

registersymbol(aob_example)
registersymbol(example_address)


newmem_example:
push edi
lea edi,[eax+3C]
mov [example_address],edi
pop edi

originalcode_example:
mov ecx,[eax+3C]
add ecx,eax
jmp return_example

example_address:
dd 0

aob_example:
jmp newmem_example
return_example:


[DISABLE]
dealloc(newmem_example)
aob_example:
db 8B 48 3C 03 C8

unregistersymbol(aob_example)
unregistersymbol(example_address)


Can we set this example script up to also add custom pointer address to our table with the address value of example_address?

I have teleport and vac templates, for example, that I always have to add the custom symbols to my table after I create the script: save1, save2, load1, load2, vac_enable, xyz etc., and being able to have these entries generated automatically would save me a lot of time. Very Happy

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

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

PostPosted: Sun Mar 12, 2017 5:05 am    Post subject: This post has 1 review(s) Reply with quote

Quote:
Can you provide examples for their usage (for separator and sub-menu)?


"Alternative AOB" entry will be inside "custom AOB Injection Templates" sub-menu.

There is separator:



Quote:
example script up to also add custom pointer address to our table with the address value of example_address

Yes. It is possible with CE6.6+ from SVN (at least in my fixed build). We have to wait for next official release.

Explanation: currently, lua block inside AA script doesn't know in which memrec it is executed.
In next CE version we can use new local variable "memrec".
add a memrec to auto assemble lua code if applicable

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

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sun Mar 12, 2017 6:17 am    Post subject: Reply with quote

Thank you, so much, mgr.inz.Player.

The sub-menus are working great!

Having the memrec feature will be awesome! Very Happy It will allow me to automate just about everything. I don't suppose that it would also allow me to automate hotkey assignment? Haha...that's getting lazy, I know. That part is not necessary. Very Happy

By the way, I am still unable to get the additional separators working. Maybe I did not communicate well on that. I keep trying different things, but I am just guessing with this. With your script, is it possible to create these separators in the same way that we can with the sub-menus -- to separate our custom templates? For example, I have a sub-menu that is only for x64 templates. Inside of that sub-menu, I would like to separate stealth templates from 2-D templates and 3-D templates etc..

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

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

PostPosted: Sun Mar 12, 2017 6:38 am    Post subject: Reply with quote

++METHOS wrote:
I don't suppose that it would also allow me to automate hotkey assignment? Haha...that's getting lazy, I know. That part is not necessary. Very Happy

Should be possible. With memrec variable we can add much more...

Currently, without memrec local variable, we have to use getMemoryRecordByDescription if we want to create memory records appended to main memory record. And description must be equal. If more entries with the same description, only the first one is provided.
Code:
[ENABLE]
{$Lua}
 if syntaxcheck then return end
 local al=getAddressList()
 local mainMR = al.getMemoryRecordByDescription('The test')
 while mainMR.Count>0 do mainMR[0].destroy() end

 for slot=1,5 do
   local newMR = al.createMemoryRecord()
   newMR.Type = vtDword
   newMR.Description = 'Slot '..(slot)
   newMR.appendToEntry(mainMR)
 end
{$Asm}

[DISABLE]
{$Lua}
 if syntaxcheck then return end
 local mainMR = getAddressList().getMemoryRecordByDescription('The test')
 while mainMR.Count>0 do mainMR[0].destroy() end
{$Asm}





With memrec variable it will be more universal (we don't have to use get by description function):
Code:
[ENABLE]
{$Lua}
 if syntaxcheck then return end
 local al=getAddressList()
 while memrec.Count>0 do memrec[0].destroy() end

 for slot=1,5 do
   local newMR = al.createMemoryRecord()
   newMR.Type = vtDword
   newMR.Description = 'Slot '..(slot)
   newMR.appendToEntry(memrec)
 end
{$Asm}

[DISABLE]
{$Lua}
 if syntaxcheck then return end
 while memrec.Count>0 do memrec[0].destroy() end
{$Asm}






++METHOS wrote:
By the way, I am still unable to get the additional separators working. Maybe I did not communicate well on that. I keep trying different things, but I am just guessing with this. With your script, is it possible to create these separators in the same way that we can with the sub-menus -- to separate our custom templates? For example, I have a sub-menu that is only for x64 templates. Inside of that sub-menu, I would like to separate stealth templates from 2-D templates and 3-D templates etc..

Ohhh, I got it. I can add this feature with ease.

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

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sun Mar 12, 2017 6:50 am    Post subject: Reply with quote

Awesome! Thanks, so much, mgr.inz.Player.

The new memrec feature sounds awesome.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 146

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

PostPosted: Sun Mar 12, 2017 7:58 am    Post subject: This post has 1 review(s) Reply with quote

Latest version 1.3.1 will make separators automatically.

Based on provided group. Example below:

Code:
{
displayName="Alternative AOB",
submenu='custom AOB Injection Templates',
group=1,
templateSections=''
},

{
displayName="Alternative AOB with bracketsRegsOffset",
submenu='custom AOB Injection Templates',
group=2,
templateSections=''
},

{
displayName="Alternative AOB with Stealth",
submenu='custom AOB Injection Templates',
group=2,
templateSections=''
},

Should look like this:






Now with changed group from 2 to 1 for "Alternative AOB with Stealth"
Code:
{
displayName="Alternative AOB",
submenu='custom AOB Injection Templates',
group=1,
templateSections=''
},

{
displayName="Alternative AOB with bracketsRegsOffset",
submenu='custom AOB Injection Templates',
group=2,
templateSections=''
},

{
displayName="Alternative AOB with Stealth",
submenu='custom AOB Injection Templates',
group=1,
templateSections=''
},

Should look like this:

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

Joined: 29 Oct 2010
Posts: 3601

PostPosted: Sun Mar 12, 2017 8:07 am    Post subject: Reply with quote

Great!

I will try to test this later. +rep will have to be later, also. Very Happy

Thanks!
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 Lua Scripting -> Lua Extensions All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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