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 


Add comment range to the AOB and FullInjection templates

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sun Nov 15, 2020 3:23 pm    Post subject: Add comment range to the AOB and FullInjection templates Reply with quote

This will replace the old AOB and FullInjection templates with a version that requests a variable comment length.

I'm sure you can figure out how to hardcode it to any length you like

Code:

--handy helper function
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

        local radius=10
        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

        local radius=10
        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)


edit: fixed menuFullInjection

_________________
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


Last edited by Dark Byte on Mon Nov 16, 2020 3:11 am; edited 3 times in total
Back to top
View user's profile Send private message MSN Messenger
Csimbi
I post too much
Reputation: 92

Joined: 14 Jul 2007
Posts: 3102

PostPosted: Sun Nov 15, 2020 5:34 pm    Post subject: Reply with quote

Hi DB,
thanks!
Added as attachment for future reference.

edit: fixed menuFullInjection



AACommentLineRadius.lua
 Description:

Download
 Filename:  AACommentLineRadius.lua
 Filesize:  2.37 KB
 Downloaded:  292 Time(s)

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