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.6]
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 217

Joined: 07 Nov 2008
Posts: 4438
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
I post too much
Reputation: 91

Joined: 14 Jul 2007
Posts: 3093

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: 92

Joined: 29 Oct 2010
Posts: 4197

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: 92

Joined: 29 Oct 2010
Posts: 4197

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: 217

Joined: 07 Nov 2008
Posts: 4438
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: 92

Joined: 29 Oct 2010
Posts: 4197

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: 217

Joined: 07 Nov 2008
Posts: 4438
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: 92

Joined: 29 Oct 2010
Posts: 4197

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: 217

Joined: 07 Nov 2008
Posts: 4438
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: 92

Joined: 29 Oct 2010
Posts: 4197

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
mgr.inz.Player
I post too much
Reputation: 217

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

PostPosted: Wed Jun 21, 2017 12:37 pm    Post subject: Reply with quote

Updated to 1.3.2. New version doesn't use getNameFromAddress, it uses my giveModuleAndOffset function, so "address prompt" will suggest address in modulename+offsetname notation. (it's a workaround for CE6.7 bug which happens in some games)
_________________
Back to top
View user's profile Send private message MSN Messenger
DarkIceCore
Expert Cheater
Reputation: 0

Joined: 10 Jun 2012
Posts: 102
Location: Moscow

PostPosted: Sat Jun 24, 2017 6:06 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
Updated to 1.3.2. New version doesn't use getNameFromAddress, it uses my giveModuleAndOffset function, so "address prompt" will suggest address in modulename+offsetname notation. (it's a workaround for CE6.7 bug which happens in some games)

big thx for this idea, your work and working examples.
but i made for myself something more universal. if anyone interested in this, here is 3 different samples below.

by the way, i also use instead of "jmp RETURN" combination of your constants (locals/templates):
Code:

jmp aob_%cheatName%%aobAdjust%+%replacedInstructionsSize%

i know that it's not "very clear" but easy for workaround.

some question:
how can i automate add/print bytes that are around (before and after) %searchPattern% or %originalBytes%, to my template, by manipulation with your constants?

example, what i mean:
our inject point is:
Code:

"notepad++.exe"+F5E59: 76 09                          -  jna notepad++.exe+F5E64
"notepad++.exe"+F5E5B: 39 98 E8 00 B8 00              -  cmp [eax+notepad++.exe+E8],ebx
"notepad++.exe"+F5E61: 0F 95 C3                       -  setne bl
// ---------- INJECTING HERE ----------
"notepad++.exe"+F5E64: 89 5D E4                       -  mov [ebp-1C],ebx
"notepad++.exe"+F5E67: E8 9A 50 00 00                 -  call notepad++.exe+FAF06
// ---------- DONE INJECTING  ----------
"notepad++.exe"+F5E6C: 85 C0                          -  test eax,eax
"notepad++.exe"+F5E6E: 75 08                          -  jne notepad++.exe+F5E78
"notepad++.exe"+F5E70: 6A 1C                          -  push 1C

lets say, that %searchPattern% and %originalBytes% there are same and is:
Code:

89 5D E4 E8 9A 50 00 00

how can i automate add bytes that are before:
Code:

76 09 39 98 E8 00 B8 00 0F 95 C3

and after:
Code:

85 C0 75 08 6A 1C

? )

here is my templates:
small change of bytes
Code:

{
displayName="DarkIceCore mandarin",
templateSections=
[==[
<<INFO>>
// Game   : %processName%
// Date   : %Date%
<<INFO_END>>

<<ENABLE>>
aobscan%isModuleScan%(%cheatName%AOB,%moduleNameC%%searchPattern%)
registersymbol(%cheatName%AOB)
//%injectAddress%:
%cheatName%AOB%aobAdjust%:
  db %originalBytes%
//db %originalBytes%

////////////////////////
//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%

<<ENABLE_END>>

<<DISABLE>>
%cheatName%AOB%aobAdjust%:
  db %originalBytes%

//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%

unregistersymbol(%cheatName%AOB)

////////////////AOB manual adjust %cheatName%AOB//////////////////
//AOB +%aobAdjust% hex//RETURN +%replacedInstructionsSize% hex//
//%searchPattern%
//%searchPattern%
//


%additionalInfo%
<<DISABLE_END>>
]==]
},


small inject with "visual indicator"/pointer for table
Code:

{
displayName="DarkIceCore Small indi",
templateSections=
[==[
<<INFO>>
// Game   : %processName%
// Date   : %Date%
<<INFO_END>>

<<ENABLE>>
aobscan%isModuleScan%(%cheatName%AOB,%moduleNameC%%searchPattern%)
alloc(%cheatName%,1024%CmoduleName%) //%injectAddress%
///////////////////////////////////////
label(%cheatName%_indi)
//
registersymbol(%cheatName%)
registersymbol(%cheatName%AOB)
registersymbol(%cheatName%_indi)
////////////////////////////////////////
%cheatName%:
%_originalCodeLines%
  mov [%cheatName%_indi],[%regsOffset%]
  jmp %cheatName%AOB%aobAdjust%+%replacedInstructionsSize%
//

//db/dw/dd(float)/dq(double)//
%cheatName%_indi:
  dq 0
//

//AOB +%aobAdjust% hex//RETURN +%replacedInstructionsSize% hex//
%cheatName%AOB%aobAdjust%:
  jmp %cheatName%
%_nopLines%
  jmp %cheatName%AOB%aobAdjust%+%replacedInstructionsSize% 
// 

////////////////////////
//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%

<<ENABLE_END>>

<<DISABLE>>
%cheatName%AOB%aobAdjust%:
  db %originalBytes%

//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%

unregistersymbol(%cheatName%)
unregistersymbol(%cheatName%AOB)
unregistersymbol(%cheatName%_indi)
dealloc(%cheatName%)

////////////////AOB manual adjust %cheatName%AOB//////////////////
//AOB +%aobAdjust% hex//RETURN +%replacedInstructionsSize% hex//
//%searchPattern%
//%searchPattern%
//

%additionalInfo%
<<DISABLE_END>>
]==]
},


big with compare
Code:

{
displayName="DarkIceCore Big chi",
templateSections=
[==[
<<INFO>>
// Game   : %processName%
// Date   : %Date%
<<INFO_END>>

<<ENABLE>>
aobscan%isModuleScan%(%cheatName%AOB,%moduleNameC%%searchPattern%)
alloc(%cheatName%,2048%CmoduleName%) //%injectAddress%
///////////////////////////////////////
label(%cheatName%_indi)
//label(%cheatName%_cmp)
//label(%cheatName%_org)
//
registersymbol(%cheatName%)
registersymbol(%cheatName%AOB)
registersymbol(%cheatName%_indi)
//registersymbol(%cheatName%_cmp)
//registersymbol(%cheatName%_org)
////////////////////////////////////////
%cheatName%:
%_originalCodeLines%
  mov [%cheatName%_indi],[%regsOffset%]
  jmp %cheatName%AOB%aobAdjust%+%replacedInstructionsSize%
//

//
//%cheatName%_cmp:
//cmp
//je/jne %cheatName%_org
//mov
%CoriginalCodeLines%
//jmp %cheatName%AOB%aobAdjust%+%replacedInstructionsSize%
//

//
//%cheatName%_org:
%CoriginalCodeLines%
//jmp %cheatName%AOB%aobAdjust%+%replacedInstructionsSize%
//

//db/dw/dd(float)/dq(double)//
%cheatName%_indi:
  dq 0
//

//AOB +%aobAdjust% hex//RETURN +%replacedInstructionsSize% hex//
%cheatName%AOB%aobAdjust%:
  jmp %cheatName%
%_nopLines%
  jmp %cheatName%AOB%aobAdjust%+%replacedInstructionsSize%
// 

////////////////////////
//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%

<<ENABLE_END>>

<<DISABLE>>
%cheatName%AOB%aobAdjust%:
  db %originalBytes%

//%injectAddress%:
%CoriginalCodeLines%
//db %originalBytes%

unregistersymbol(%cheatName%)
unregistersymbol(%cheatName%AOB)
unregistersymbol(%cheatName%_indi)
//unregistersymbol(%cheatName%_cmp)
//unregistersymbol(%cheatName%_org)
dealloc(%cheatName%)

////////////////AOB manual adjust %cheatName%AOB//////////////////
//AOB +%aobAdjust% hex//RETURN +%replacedInstructionsSize% hex//
//%searchPattern%
//%searchPattern%
//


%additionalInfo%
<<DISABLE_END>>
]==]
},
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Sat Jul 28, 2018 9:29 am    Post subject: Reply with quote

Using a name such as "mp" confuses the scripts logic as it mistakes the 'mp' in 'jmp' as the cheat name and mistakes its following code for being the %aobAdjust% string.

To fix, change:
Code:
local aobAdjust          = newScript:match('code:.-'..cheatName..'(.-):')

to
Code:
local aobAdjust          = newScript:match('code:.-%f[%a]'..cheatName..'(.-):')


Using "jmp" as the cheat name still bugs out, though I have not yet need such a cheat name yet.
Back to top
View user's profile Send private message
Scorm
Newbie cheater
Reputation: 0

Joined: 06 Dec 2018
Posts: 11

PostPosted: Fri Dec 14, 2018 7:12 am    Post subject: Reply with quote

On CE 6.8.1, when loading the template : "Error:...eat Engine 6.8.1\autorun\customAOBInjectionTemplates.lua:365: attempt to perform arithmetic on a nil value (local 'size')"

Code:
local function giveModuleAndOffset(address)
    local modulesTable,size = enumModules(),0
    for i,v in pairs(modulesTable) do
      size = getModuleSize(v.Name)
      if address>=v.Address and address<=v.Address+size  --Problematic line
        then return '"'..v.Name..'"+'..string.format('%X',address-v.Address) end
    end
    return getNameFromAddress(address)
  end


I don't know if you ever planned to support this version. Anyways I'm not very resourceful in LUA and know nothing about the different versions/engines.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 91

Joined: 14 Jul 2007
Posts: 3093

PostPosted: Sat Dec 15, 2018 6:58 am    Post subject: Reply with quote

Weird. I am using it (well two-three of them) almost every day and I have never seen this error.
Could you have some other LUA files installed that may interfere?

BTW, which template are you trying to use?
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 Extensions All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 5 of 7

 
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