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 


Hide Lua Script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
landworld
How do I cheat?
Reputation: 0

Joined: 23 Jan 2024
Posts: 2

PostPosted: Tue Jan 23, 2024 1:16 am    Post subject: Hide Lua Script Reply with quote

Hello

I want hide lua script.

Below is my CT file,

-----------------------------------------------------------

local my_script_path = ("%sScripts\\%s.lua"):format(TrainerOrigin, script_name)

local file = io.open(my_script_path, "rb")

-----------------------------------------------------------

When released it, other users can open ~~~.lua and read source code.
I want hide that. but I have no idea.



Now that I think about it,

Remember the size of the CT file so that the lua script does not print by CT. (it means can't modify the internal code)

And then other programs such as Winform (check the size of the CT file) generate the lua script and delete it when read lua scripts.

However, the problem is that the timing of CT reading the lua script is from BreakPoint in the game, so it's hard to decide when to delete it.



Or Is it possible rebuild customized CT, it has my CT code and can't visible code.

Welcome all the inspirational keywords and topics.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Tue Jan 23, 2024 2:14 am    Post subject: Reply with quote

Warning:
Do not forget that all the answers to such issues will also provide new ideas to thieves.

Consider this suggestion;
Since your command that calls existing lines of code is still in .CT, running it or transferring it to another file (file.write()) or printing the output (print()) are still among the first steps the thief can take.

The tips I gave above have results that make it possible to disable "load()()" or "loadstring()()", work with "io.write()" or "print()" and get the line of code as a string.
The next steps are to reverse the obfuscation in Lua.

Recommended;
Rather than how you load the code, the obfuscation we add to it is that you increase its length and complexity.

This leads you to try the thief's patience.

Otherwise; Note that Lua contains the scrambled string and the decoding code it needs to read, load, and execute in the same line.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
landworld
How do I cheat?
Reputation: 0

Joined: 23 Jan 2024
Posts: 2

PostPosted: Tue Jan 23, 2024 11:48 pm    Post subject: Reply with quote

Thank you. I wasn't considering obfuscation at all. It is very helpful.


Now, I'm running it with LuaScript included in my trainer.
But the code is still reading the lua script from my local PC.

How do I access lua scripts from 'Extra Files' that I added when I built trainers?
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Wed Jan 24, 2024 12:07 pm    Post subject: Reply with quote

You can find more examples by using the search engine in the forum.
Here are some examples;

Code:
function loadTableCode(n)
    local t = findTableFile(n)
    if t ~= nil then
        local s = t.Stream
        local c = readStringLocal(s.Memory, s.Size)
        code, err = loadstring(c)
         if err then
           print(err)
         else
          code()
         end
    end
end

--[[ --table file text:
c1 = 1111
return c1
]]
--table name "ssr11.txt"

loadTableCode("ssr11.txt")
print(c1)

--###############################--

function loadFileCode(path)
    local file = io.open(path, "r")
    if file then
        c = file:read("*all")
        file:close()
        code, err = loadstring(c)
         if err then
           print(err)
         else
          code()
         end
    end
end

--[[ -- file code
function ex1(s1,s2)
t = tonumber(s1) + tonumber(s2)
return t
end
]]
-- path: your file path!

path = [[C:\ssr12.txt]]
a1 = loadFileCode(path)
print(ex1(11,23))
a1.Destroy() --kill a1 or path (ssr12.txt) codes ..
print(ex1(22,43)) -- error: "attempt to index a nil value (global 'a1')"

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
hoainghinhansinh
How do I cheat?
Reputation: 0

Joined: 19 Jan 2024
Posts: 3

PostPosted: Wed Jan 24, 2024 1:59 pm    Post subject: Reply with quote

I need your help AylinCE, to make a script to search for String, Aob or mix of them, such like 02 00 "99" to replace with 03 00 "100"
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Wed Jan 24, 2024 4:09 pm    Post subject: Reply with quote

Quote:
First verify that this issue has been concluded.
Different titles may be required for different topics.


Once you examine it a bit, you will understand the logic.
You can take whatever works for you from the code.

Code:
function byteTableToAobString(s,ops)
t = {}
  if ops==2 then t=wordToByteTable(tonumber(s))
  elseif ops==4 then t=dwordToByteTable(tonumber(s))
  elseif ops==8 then t=qwordToByteTable(tonumber(s))
  elseif ops=="d" then t=doubleToByteTable(tonumber(s))
  elseif ops=="f" then t=floatToByteTable(tonumber(s))
  elseif ops=="s" then t=stringToByteTable(tostring(s))
  elseif ops=="w" then t=wideStringToByteTable(tostring(s))
  end
  for k,v in ipairs(t) do t[k] = ('%02X'):format(v) end
return table.concat(t, ' ')
end


function multiAobs(search,replace,ops)
Value = byteTableToAobString(replace,ops)
--print(Value)
cnt = 0
aobs1=AOBScan(tostring(search),'+W*X-C')
 if aobs1==nil then
  showMessage("code not found!");
  else
   cnt = aobs1.count
   for i=0, aobs1.count -1 do
    addr1 = aobs1[i]
    --print(addr1)
    autoAssemble(tostring(addr1)..":\ndb "..tostring(Value))
   end
   aobs1.Destroy()
 end
 return cnt
end

--multiAobs("02 00",99,2)
a1 = multiAobs("03 00",100,2)
print("replace count: "..a1)

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
hoainghinhansinh
How do I cheat?
Reputation: 0

Joined: 19 Jan 2024
Posts: 3

PostPosted: Thu Jan 25, 2024 5:58 am    Post subject: Reply with quote

Hehe im total blind about coding, im just an end-user, i ll pay you for a released version of it. Can you PM me? Im new and unable to send message.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Thu Jan 25, 2024 9:04 am    Post subject: Reply with quote

hoainghinhansinh wrote:
Hehe im total blind about coding, im just an end-user, i ll pay you for a released version of it. Can you PM me? Im new and unable to send message.


Always provide your support via Cheat Engine. (CE-- Contact Help menu or DarkByte (And don't ask him irrelevant questions.))

I can provide an example usage in a form.
It will be organized under this title.

--##############################--

Edited:
The codes below will probably seem unfamiliar to you.

I hope that you will examine these codes, use them, ask questions here when you get stuck while developing them, and eventually learn how to use them.

Copy the code, enter it into CE-->Table-->Lua Script and paste it there and click the "Execute" button.

The usage test of the opened form is shown in the picture.

Code:
if myForm1 then myForm1.Destroy() myForm1=nil end
DP1=getScreenDPI()/96
myForm1=createForm()
myForm1.height=226*DP1 myForm1.width=270*DP1 myForm1.left=166*DP1 myForm1.top=93*DP1
myForm1.PopupMode=0 myForm1.caption="Search & Replace"
myForm1.Position="poDesktopCenter" myForm1.BorderStyle="bsSingle"  myForm1.ShowInTaskBar="stAlways"
-------------------------
local frmTbl1 = {}
----------------------- frmTbl1.CE_Box1 ----- 
frmTbl1.CE_Box1=createComboBox(myForm1)
frmTbl1.CE_Box1.AutoSize=true
frmTbl1.CE_Box1.height=27*DP1 frmTbl1.CE_Box1.width=130*DP1 frmTbl1.CE_Box1.left=20*DP1 frmTbl1.CE_Box1.top=10*DP1
frmTbl1.CE_Box1.Font.Style="fsBold"
frmTbl1.CE_Box1.ReadOnly=true frmTbl1.CE_Box1.Style="csDropDownList"
-----------------------
----------------------- frmTbl1.CE_Btn1 ----- 
frmTbl1.CE_Btn2=createButton(myForm1)
frmTbl1.CE_Btn2.AutoSize=false
frmTbl1.CE_Btn2.height=27*DP1 frmTbl1.CE_Btn2.width=90*DP1 frmTbl1.CE_Btn2.left=160*DP1 frmTbl1.CE_Btn2.top=10*DP1
frmTbl1.CE_Btn2.caption="UPDATE"
frmTbl1.CE_Btn2.Font.Style="fsBold" frmTbl1.CE_Btn2.Font.Size=12*DP1
-----------------------
----------------------- frmTbl1.CE_Edt1 ----- 
frmTbl1.CE_Edt1=createEdit(myForm1)
frmTbl1.CE_Edt1.AutoSize=true
frmTbl1.CE_Edt1.height=27*DP1 frmTbl1.CE_Edt1.width=230*DP1 frmTbl1.CE_Edt1.left=20*DP1 frmTbl1.CE_Edt1.top=50*DP1
frmTbl1.CE_Edt1.Font.Style="fsBold"
-----------------------
----------------------- frmTbl1.CE_Edt2 ----- 
frmTbl1.CE_Edt2=createEdit(myForm1)
frmTbl1.CE_Edt2.AutoSize=true
frmTbl1.CE_Edt2.height=27*DP1 frmTbl1.CE_Edt2.width=230*DP1 frmTbl1.CE_Edt2.left=20*DP1 frmTbl1.CE_Edt2.top=90*DP1
frmTbl1.CE_Edt2.Font.Style="fsBold"
-----------------------
----------------------- frmTbl1.CE_Lbl1 ----- 
frmTbl1.CE_Lbl1=createLabel(myForm1)
frmTbl1.CE_Lbl1.AutoSize=false
frmTbl1.CE_Lbl1.height=19*DP1 frmTbl1.CE_Lbl1.width=230*DP1 frmTbl1.CE_Lbl1.left=20*DP1 frmTbl1.CE_Lbl1.top=120*DP1
frmTbl1.CE_Lbl1.caption="Format Aobs: ..."
frmTbl1.CE_Lbl1.alignment="taLeftJustify"
frmTbl1.CE_Lbl1.Font.Style="fsBold" frmTbl1.CE_Lbl1.Font.Size=10*DP1
-----------------------
----------------------- frmTbl1.CE_Box2 ----- 
frmTbl1.CE_Box2=createComboBox(myForm1)
frmTbl1.CE_Box2.AutoSize=true
frmTbl1.CE_Box2.height=27*DP1 frmTbl1.CE_Box2.width=230*DP1 frmTbl1.CE_Box2.left=20*DP1 frmTbl1.CE_Box2.top=145*DP1
frmTbl1.CE_Box2.ReadOnly=true frmTbl1.CE_Box2.Style="csDropDownList"
-----------------------
----------------------- frmTbl1.CE_Btn1 ----- 
frmTbl1.CE_Btn1=createButton(myForm1)
frmTbl1.CE_Btn1.AutoSize=false
frmTbl1.CE_Btn1.height=27*DP1 frmTbl1.CE_Btn1.width=230*DP1 frmTbl1.CE_Btn1.left=20*DP1 frmTbl1.CE_Btn1.top=180*DP1
frmTbl1.CE_Btn1.caption="ENABLE"
frmTbl1.CE_Btn1.Font.Style="fsBold" frmTbl1.CE_Btn1.Font.Size=12*DP1
-----------------------

--################################################################--
--################################################################--
--################################################################--
local format1=""
function byteTableToAobString(s,ops)
t = {}
  if ops==2 then t=wordToByteTable(tonumber(s))
  elseif ops==4 then t=dwordToByteTable(tonumber(s))
  elseif ops==8 then t=qwordToByteTable(tonumber(s))
  elseif ops=="d" then t=doubleToByteTable(tonumber(s))
  elseif ops=="f" then t=floatToByteTable(tonumber(s))
  elseif ops=="s" then t=stringToByteTable(tostring(s))
  elseif ops=="w" then t=wideStringToByteTable(tostring(s))
  end
  for k,v in ipairs(t) do t[k] = ('%02X'):format(v) end
return table.concat(t, ' ')
end

function multiAobs(search,replace,ops)
Value = byteTableToAobString(replace,ops)
frmTbl1.CE_Lbl1.caption="Format Aobs: "..Value
cnt = 0
aobs1=AOBScan(tostring(search),'+W*X-C')
 if aobs1==nil then
  showMessage("code not found!");
  else
   cnt = aobs1.count
   for i=0, aobs1.count -1 do
    addr1 = aobs1[i]
    --print(addr1)
    autoAssemble(tostring(addr1)..":\ndb "..tostring(Value))
   end
   aobs1.Destroy()
 end
 return cnt
end

frmTbl1.CE_Box1.text="Click UPDATE"

function updatePrcss1()
frmTbl1.CE_Box1.Clear()
frmTbl1.CE_Box1.Items.Add("Select Process")
list = getProcesslist()
 for i,k in pairs(list) do
  frmTbl1.CE_Box1.Items.Add(k)
 end
 frmTbl1.CE_Box1.ItemIndex=0
end

frmTbl1.CE_Box1.OnChange=function()
prcssName = frmTbl1.CE_Box1.text
pid1 = getProcessIDFromProcessName(prcssName)
  if pid1~=nil then
   openProcess(prcssName)
  else
   showMessage("The selected transaction does not appear to be open.\nPlease click the update button.")
   frmTbl1.CE_Box1.ItemIndex=0
  end
end

frmTbl1.CE_Box2.Items.Add("Select Replace Formats")
frmTbl1.CE_Box2.Items.Add("2 Byte")
frmTbl1.CE_Box2.Items.Add("4 Byte")
frmTbl1.CE_Box2.Items.Add("8 Byte")
frmTbl1.CE_Box2.Items.Add("Double")
frmTbl1.CE_Box2.Items.Add("Float")
frmTbl1.CE_Box2.Items.Add("String")
frmTbl1.CE_Box2.Items.Add("WideString")
frmTbl1.CE_Box2.ItemIndex=0

frmTbl1.CE_Box2.OnChange=function()
 indx1 = frmTbl1.CE_Box2.ItemIndex
  if indx1==1 then format1=2 end
  if indx1==2 then format1=4 end
  if indx1==3 then format1=8 end
  if indx1==4 then format1="d" end
  if indx1==5 then format1="f" end
  if indx1==6 then format1="s" end
  if indx1==7 then format1="w" end
 end
frmTbl1.CE_Btn1.OnClick = function()
  if format1=="" then
   showMessage("Please choose a format for the exchange code!")
  else
    if frmTbl1.CE_Edt1.Text=="" or frmTbl1.CE_Edt2.Text=="" then
      showMessage("Empty code box detected!")
    else
      a1 = multiAobs(frmTbl1.CE_Edt1.Text,frmTbl1.CE_Edt2.Text,format1)
      showMessage("replace count: "..a1)
    end
  end
end

frmTbl1.CE_Btn2.OnClick = updatePrcss1



ek1.PNG
 Description:
 Filesize:  34.11 KB
 Viewed:  1519 Time(s)

ek1.PNG



_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Thu Jan 25, 2024 5:06 pm    Post subject: Reply with quote

Version adapted to your situation;
Tested with "notepad.exe" for sample use.

Code:
if myForm1 then myForm1.Destroy() myForm1=nil end
DP1=getScreenDPI()/96
myForm1=createForm()
myForm1.height=226*DP1 myForm1.width=270*DP1 myForm1.left=166*DP1 myForm1.top=93*DP1
myForm1.PopupMode=0 myForm1.caption="Search & Replace"
myForm1.Position="poDesktopCenter" myForm1.BorderStyle="bsSingle"  myForm1.ShowInTaskBar="stAlways"
-------------------------
local frmTbl1 = {}
----------------------- frmTbl1.CE_Box1 ----- 
frmTbl1.CE_Box1=createComboBox(myForm1)
frmTbl1.CE_Box1.AutoSize=true
frmTbl1.CE_Box1.height=27*DP1 frmTbl1.CE_Box1.width=130*DP1 frmTbl1.CE_Box1.left=20*DP1 frmTbl1.CE_Box1.top=10*DP1
frmTbl1.CE_Box1.Font.Style="fsBold"
frmTbl1.CE_Box1.ReadOnly=true frmTbl1.CE_Box1.Style="csDropDownList"
-----------------------
----------------------- frmTbl1.CE_Btn1 ----- 
frmTbl1.CE_Btn2=createButton(myForm1)
frmTbl1.CE_Btn2.AutoSize=false
frmTbl1.CE_Btn2.height=27*DP1 frmTbl1.CE_Btn2.width=90*DP1 frmTbl1.CE_Btn2.left=160*DP1 frmTbl1.CE_Btn2.top=10*DP1
frmTbl1.CE_Btn2.caption="UPDATE"
frmTbl1.CE_Btn2.Font.Style="fsBold" frmTbl1.CE_Btn2.Font.Size=12*DP1
-----------------------
----------------------- frmTbl1.CE_Edt1 ----- 
frmTbl1.CE_Edt1=createEdit(myForm1)
frmTbl1.CE_Edt1.AutoSize=true
frmTbl1.CE_Edt1.height=27*DP1 frmTbl1.CE_Edt1.width=150*DP1 frmTbl1.CE_Edt1.left=20*DP1 frmTbl1.CE_Edt1.top=50*DP1
frmTbl1.CE_Edt1.Font.Style="fsBold"
-----------------------
----------------------- frmTbl1.CE_Edt2 ----- 
frmTbl1.CE_Edt2=createEdit(myForm1)
frmTbl1.CE_Edt2.AutoSize=true
frmTbl1.CE_Edt2.height=27*DP1 frmTbl1.CE_Edt2.width=70*DP1 frmTbl1.CE_Edt2.left=180*DP1 frmTbl1.CE_Edt2.top=50*DP1
frmTbl1.CE_Edt2.Font.Style="fsBold"
-----------------------
----------------------- frmTbl1.CE_Lbl1 ----- 
frmTbl1.CE_Lbl1=createLabel(myForm1)
frmTbl1.CE_Lbl1.AutoSize=false
frmTbl1.CE_Lbl1.height=19*DP1 frmTbl1.CE_Lbl1.width=230*DP1 frmTbl1.CE_Lbl1.left=20*DP1 frmTbl1.CE_Lbl1.top=80*DP1
frmTbl1.CE_Lbl1.caption="Format Aobs: ..."
frmTbl1.CE_Lbl1.alignment="taLeftJustify"
frmTbl1.CE_Lbl1.Font.Style="fsBold" frmTbl1.CE_Lbl1.Font.Size=10*DP1
-----------------------
----------------------- frmTbl1.CE_Edt3 ----- 
frmTbl1.CE_Edt3=createEdit(myForm1)
frmTbl1.CE_Edt3.AutoSize=true
frmTbl1.CE_Edt3.height=27*DP1 frmTbl1.CE_Edt3.width=150*DP1 frmTbl1.CE_Edt3.left=20*DP1 frmTbl1.CE_Edt3.top=100*DP1
frmTbl1.CE_Edt3.Font.Style="fsBold"
-----------------------
----------------------- frmTbl1.CE_Edt4 ----- 
frmTbl1.CE_Edt4=createEdit(myForm1)
frmTbl1.CE_Edt4.AutoSize=true
frmTbl1.CE_Edt4.height=27*DP1 frmTbl1.CE_Edt4.width=70*DP1 frmTbl1.CE_Edt4.left=180*DP1 frmTbl1.CE_Edt4.top=100*DP1
frmTbl1.CE_Edt4.Font.Style="fsBold"
-----------------------
----------------------- frmTbl1.CE_Lbl2 ----- 
frmTbl1.CE_Lbl2=createLabel(myForm1)
frmTbl1.CE_Lbl2.AutoSize=false
frmTbl1.CE_Lbl2.height=19*DP1 frmTbl1.CE_Lbl2.width=230*DP1 frmTbl1.CE_Lbl2.left=20*DP1 frmTbl1.CE_Lbl2.top=130*DP1
frmTbl1.CE_Lbl2.caption="Format Aobs: ..."
frmTbl1.CE_Lbl2.alignment="taLeftJustify"
frmTbl1.CE_Lbl2.Font.Style="fsBold" frmTbl1.CE_Lbl2.Font.Size=10*DP1
-----------------------
----------------------- frmTbl1.CE_Box2 ----- 
frmTbl1.CE_Box2=createComboBox(myForm1)
frmTbl1.CE_Box2.AutoSize=true
frmTbl1.CE_Box2.height=27*DP1 frmTbl1.CE_Box2.width=230*DP1 frmTbl1.CE_Box2.left=20*DP1 frmTbl1.CE_Box2.top=155*DP1
frmTbl1.CE_Box2.ReadOnly=true frmTbl1.CE_Box2.Style="csDropDownList"
-----------------------
----------------------- frmTbl1.CE_Btn1 ----- 
frmTbl1.CE_Btn1=createButton(myForm1)
frmTbl1.CE_Btn1.AutoSize=false
frmTbl1.CE_Btn1.height=27*DP1 frmTbl1.CE_Btn1.width=230*DP1 frmTbl1.CE_Btn1.left=20*DP1 frmTbl1.CE_Btn1.top=190*DP1
frmTbl1.CE_Btn1.caption="ENABLE"
frmTbl1.CE_Btn1.Font.Style="fsBold" frmTbl1.CE_Btn1.Font.Size=12*DP1
-----------------------

--################################################################--
--################################################################--
--################################################################--
local format1=""
function byteTableToAobString(s,ops)
t = {}
  if ops==2 then t=wordToByteTable(tonumber(s))
  elseif ops==4 then t=dwordToByteTable(tonumber(s))
  elseif ops==8 then t=qwordToByteTable(tonumber(s))
  elseif ops=="d" then t=doubleToByteTable(tonumber(s))
  elseif ops=="f" then t=floatToByteTable(tonumber(s))
  elseif ops=="s" then t=stringToByteTable(tostring(s))
  elseif ops=="w" then t=wideStringToByteTable(tostring(s))
  end
  for k,v in ipairs(t) do t[k] = ('%02X'):format(v) end
return table.concat(t, ' ')
end

function lengFixAobs(s,r)
s1 = math.floor(#s / 3)
r1 = math.floor(#r / 3)
res = ""
 if s1>r1 then
   for i=1, s1 - r1 do
    res = res.." 00"
   end
 end
  return res
end

function multiAobs(search,replace)
cnt = 0
aobs1=AOBScan(tostring(search),'+W*X-C')
 if aobs1==nil then
  showMessage("code not found!");
  else
   cnt = aobs1.count
   for i=0, aobs1.count -1 do
    addr1 = aobs1[i]
    --print(addr1)
    autoAssemble(tostring(addr1)..":\ndb "..tostring(replace))
   end
   aobs1.Destroy()
 end
 return cnt
end

frmTbl1.CE_Box1.text="Click UPDATE"

function updatePrcss1()
frmTbl1.CE_Box1.Clear()
frmTbl1.CE_Box1.Items.Add("Select Process")
list = getProcesslist()
 for i,k in pairs(list) do
  frmTbl1.CE_Box1.Items.Add(k)
 end
 frmTbl1.CE_Box1.ItemIndex=0
end

frmTbl1.CE_Box1.OnChange=function()
prcssName = frmTbl1.CE_Box1.text
pid1 = getProcessIDFromProcessName(prcssName)
  if pid1~=nil then
   openProcess(prcssName)
  else
   showMessage("The selected transaction does not appear to be open.\nPlease click the update button.")
   frmTbl1.CE_Box1.ItemIndex=0
  end
end

frmTbl1.CE_Box2.Items.Add("Select Replace Formats")
frmTbl1.CE_Box2.Items.Add("2 Byte")
frmTbl1.CE_Box2.Items.Add("4 Byte")
frmTbl1.CE_Box2.Items.Add("8 Byte")
frmTbl1.CE_Box2.Items.Add("Double")
frmTbl1.CE_Box2.Items.Add("Float")
frmTbl1.CE_Box2.Items.Add("String")
frmTbl1.CE_Box2.Items.Add("WideString")
frmTbl1.CE_Box2.ItemIndex=0

frmTbl1.CE_Box2.OnChange=function()
 indx1 = frmTbl1.CE_Box2.ItemIndex
  if indx1==1 then format1=2 end
  if indx1==2 then format1=4 end
  if indx1==3 then format1=8 end
  if indx1==4 then format1="d" end
  if indx1==5 then format1="f" end
  if indx1==6 then format1="s" end
  if indx1==7 then format1="w" end
 end

frmTbl1.CE_Btn1.OnClick = function()
  if format1=="" then
   showMessage("Please choose a format for the exchange code!")
  else
    if frmTbl1.CE_Edt1.Text=="" or frmTbl1.CE_Edt2.Text==""
      or frmTbl1.CE_Edt3.Text=="" or frmTbl1.CE_Edt4.Text=="" then
      showMessage("Empty code box detected!")
    else
      code1 = frmTbl1.CE_Edt1.Text.." "..byteTableToAobString(frmTbl1.CE_Edt2.Text,format1)
      code2 = frmTbl1.CE_Edt3.Text.." "..byteTableToAobString(frmTbl1.CE_Edt4.Text,format1)
      value = code2..lengFixAobs(code1,code2)
      frmTbl1.CE_Lbl1.caption = code1
      frmTbl1.CE_Lbl2.caption = value
      a1 = multiAobs(code1,value)
      showMessage("replace count: "..a1)
    end
  end
end

frmTbl1.CE_Btn2.OnClick = updatePrcss1



ek2.PNG
 Description:
 Filesize:  35.39 KB
 Viewed:  1487 Time(s)

ek2.PNG



_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Fri Jan 26, 2024 1:33 am    Post subject: Reply with quote

Change the following line within the "lengFixAobs(s, r)" function.
-- edit
res = res.." 00"

-- use
res = res.." 00 00"

Also, do not write the aobs signature combined as space calculations are made.

0600000000

-- use
06 00 00 00

Also, please remove images from your posts to avoid third-party eyes.
(Images or directories containing the game name or "gameName.exe".)

CEF has a strict policy of not supporting online game piracy and please let's not leave CE in a difficult situation regarding this matter.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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