-- Author: Dark Byte -- Source: https://forum.cheatengine.org/viewtopic.php?t=616196 -- Version: 1.0 -- Purpose: -- - Changes the number of comment lines you get at the bottom when using the default 'AOB' and FullInjection templates (overrides the default generateAOBInjectionScript function). -- Usage: -- - Copy this LUA file into CE's autorun folder. -- - If you want, you can replace the default number in "local radius=30" to change the number of lines to your liking. -- - Will be applied automatically the next time you run CE. local radius=30 function forEachAndFutureForm(classname, func) local i for i=0,getFormCount()-1 do local f f=getForm(i) if f.ClassName==classname then func(f) end end registerFormAddNotification(function(f) if classname==f.ClassName then func(f) end end) end forEachAndFutureForm('TfrmAutoInject',function(f) f.registerCreateCallback(function(f) if f.ScriptMode=='smAutoAssembler' then f.menuAOBInjection.OnClick=function(s) local address=getNameFromAddress(getMemoryViewForm().DisassemblerView.SelectedAddress) address=inputQuery('Code inject template+', 'On what address do you want the jump?', address) if address==nil then return end local name='INJECT' local counter=1 while f.assemblescreen.Lines.Text:find(name..':') do counter=counter+1 name='INJECT'..counter end name=inputQuery('Code inject template+', 'What do you want to name the symbol for the injection point?', name) if name==nil then return end radius=tonumber(inputQuery('Code inject template+', 'Comment radius?', radius)); if radius==nil then radius=10 end generateAOBInjectionScript(f.assemblescreen.Lines, name, address, radius) end f.menuFullInjection.OnClick=function(s) local address=getNameFromAddress(getMemoryViewForm().DisassemblerView.SelectedAddress) address=inputQuery('Code inject template+', 'On what address do you want the jump?', address) if address==nil then return end radius=tonumber(inputQuery('Code inject template+', 'Comment radius?', radius)); if radius==nil then radius=10 end generateFullInjectionScript(f.assemblescreen.Lines, address, radius) end end end) end)