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 


A script to add consecutive addresses in batches

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 72

PostPosted: Tue Dec 14, 2021 5:10 am    Post subject: A script to add consecutive addresses in batches Reply with quote

If there is no offset, it will continue to add 4 bytes of address to the filled base address,If there is an offset, it will change the top offset and add continuously.

Code:

f = createForm(true)
f.Position=poDesktopCenter
f.Width=300
f.Height=115
f.Caption = 'Add addresses '

local b1=createButton(f)
b1.Left=180
b1.Top=10
b1.caption="add address"
b1.Width=100

local b2=createButton(f)
b2.Left=180
b2.Top=40
b2.caption="add offset"
b2.Width=100

local b3=createButton(f)
b3.Left=180
b3.Top=70
b3.caption="remove offset"
b3.Width=100

local eb=createEdit(f)
eb.Left=10
eb.Top=10
eb.Width=130
eb.TextHint='base address'

local eb1 =createEdit(f)
eb1.Left=10
eb1.Top=40
eb1.Width=130
eb1.Text= 1

bn = 1
local jn = {}
b2.OnClick=function()
 jn[bn] = string.format("ex%d", bn)
 jn[bn]=createEdit(f)
 jn[bn].Left=10
 jn[bn].Top= 70 + 25*bn
 jn[bn].TextHint=string.format("offset%d", bn)
bn = bn + 1
f.Height=f.Height + 25

end

b3.OnClick=function()
bn= bn -1
jn[bn].destroy()
jn[bn]=nil
f.Height=f.Height - 25
end

b1.OnClick=function()
if( bn == 1)
then
gn=tonumber(eb1.Text,16)
for n=0,gn-1 do
local al = getAddressList()
local rec = al.createMemoryRecord()
fl=tonumber(eb.Text)+n*4
kl = tostring(fl)
rec.setAddress(kl)
end

elseif( bn == 2 )
then
gn=tonumber(eb1.Text)
for n = 0,gn-1 do
local al = getAddressList()
local rec = al.createMemoryRecord()
fofst = tonumber(jn[1].Text,16)+ n*4
rec.setAddress(eb.Text)
rec.setOffsetCount(1)
rec.setOffset(0,fofst)
end
elseif( bn > 2 )
then
gn=tonumber(eb1.Text)

for n = 0,gn-1 do
local al = getAddressList()
local rec = al.createMemoryRecord()
fofst = tonumber(jn[1].Text,16)+ n*4

rec.setAddress(eb.Text)
rec.setOffsetCount(bn-1)
rec.setOffset(0,fofst)
for p = 1 ,bn-2 do
s = tonumber(jn[p+1].Text,16)
rec.setOffset(p,s)
end
end

else
print("error")

end
end



offset.JPG
 Description:
 Filesize:  36.97 KB
 Viewed:  716 Time(s)

offset.JPG


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