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 


[LUA] How to make an .exe ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
dny4pvp
Newbie cheater
Reputation: 0

Joined: 01 Aug 2022
Posts: 10

PostPosted: Wed Aug 21, 2024 11:06 pm    Post subject: [LUA] How to make an .exe ? Reply with quote

Hello everyone, I also have a lua script made with a gui (you can see it below), I'm interested in knowing how I could compile it and run it outside the cheat engine, or how I could use it as would I have any possibility on an .exe version? Thank you very much, I am waiting for an answer, I know for sure that you are very wonderful people!


Code:
local baseAddress = getAddress("Pegasus2.exe+01384C8C")
local readOffsets = {0x9C, 0x8, 0x4, 0x8, 0x8, 0x4, 0x0, 0x14, 0x8}
local writeOffsets = {0xB0, 0x8, 0x4, 0x0, 0x14, 0x8}

local initialWriteValue = nil
local finalReadAddress = nil
local finalWriteAddress = nil
local value = nil

function resolvePointer(base, offsets)
    local address = base
    for _, offset in ipairs(offsets) do
        address = readPointer(address) + offset
    end
    return address
end

function updateAddressesAndValues()
    finalReadAddress = resolvePointer(baseAddress, readOffsets)
    finalWriteAddress = resolvePointer(baseAddress, writeOffsets)
    value = readInteger(finalReadAddress)
    initialWriteValue = readInteger(finalWriteAddress)
end

function damageHackOn()
    if not finalWriteAddress or not value then
        return
    end
    writeInteger(finalWriteAddress, value)
end

function damageHackOff()
    if initialWriteValue and finalWriteAddress then
        writeInteger(finalWriteAddress, initialWriteValue)
    end
end

local form = createForm()
form.Caption = 'h9p - Damage Hack'
form.Width = 300
form.Height = 100
form.Position = poScreenCenter

form.Icon = createIcon() 

local damageHackOnButton = createButton(form)
damageHackOnButton.Caption = 'Damage-Hack ON'
damageHackOnButton.Left = 10
damageHackOnButton.Top = 20
damageHackOnButton.Width = 130
damageHackOnButton.Height = 40
damageHackOnButton.OnClick = function()
    updateAddressesAndValues()
    damageHackOn()
end

local damageHackOffButton = createButton(form)
damageHackOffButton.Caption = 'Damage-Hack OFF'
damageHackOffButton.Left = 150
damageHackOffButton.Top = 20
damageHackOffButton.Width = 130
damageHackOffButton.Height = 40
damageHackOffButton.OnClick = function()
    damageHackOff()
end

updateAddressesAndValues()
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Aug 21, 2024 11:44 pm    Post subject: Reply with quote

put the script in table-lua script

and then save the table with .exe as extension

_________________
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
Back to top
View user's profile Send private message MSN Messenger
dny4pvp
Newbie cheater
Reputation: 0

Joined: 01 Aug 2022
Posts: 10

PostPosted: Thu Aug 22, 2024 8:15 pm    Post subject: Reply with quote

Dark Byte wrote:
put the script in table-lua script

and then save the table with .exe as extension

Mr. Dark Byte, I have the request to ask you if possible some advice regarding what I want to do, I want to obfucated this script in LUA or the attempt to make this GUI with all its functions using a serial-key or something related to its encryption and use by only one person, can you give me some ideas please? Since the shared script can be used by an unlimited number of people, I would like to adjust it in such a way that it can only be used through a serial key, because of this I thought that I could export it in an exe. Thank you for all your patience, sir!
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 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