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 


Find out what address this instruction accesses on trainer

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

Joined: 06 Sep 2022
Posts: 6

PostPosted: Sun Nov 17, 2024 12:43 am    Post subject: Find out what address this instruction accesses on trainer Reply with quote

Hello everyone,

I’ve been using the "Find out what address this instruction accesses" feature on my trainer, but my CEListView only shows the address, whereas the Debug window displays the value. I’ve tried several methods, but I couldn’t make it display the value or separate the columns. Is it possible to:

1. Separate columns to display both the address and value?
2. Adjust the column width to show the full address?
3. Click on the value to change it directly?

Thanks in advance for your help!




Code:

function findQuest()
    local aobScanResults = AOBScan("8B 43 20 83 F8 01 ?? ?? 83 F8 06")
    if aobScanResults == nil then
        print("AOB pattern not found. Retrying...")
        return nil
    end

    local questAddress = tonumber(aobScanResults[0], 16)
    aobScanResults.destroy()
    registerSymbol("quest", questAddress)
    print(string.format("Quest found at address: 0x%X", questAddress))
    return questAddress
end


function initializeColumns()
    if CETrainer and CETrainer.CEListView1 then
        if CETrainer.CEListView1.Columns.Count == 0 then
            print("Initializing Columns in CEListView1...")


            local column1 = CETrainer.CEListView1.Columns:Add()
            column1.Caption = "Address"
            column1.Width = 200


            local column2 = CETrainer.CEListView1.Columns:Add()
            column2.Caption = "Value"
            column2.Width = 150

            print("Columns created successfully with Address on the left and Value on the right.")
        else
            print("Columns already created.")
        end
    else
        print("Error: CETrainer or CEListView1 is nil.")
    end
end


initializeColumns()


function debugger_onBreakpoint()
    local rbxValue = RBX
    if not rbxValue then
        print("Can't read RBX")
        return 1
    end

    local accessedAddress = rbxValue + 0x20
    local memoryValue = readInteger(accessedAddress)

    if memoryValue then
        print("Memory value: " .. memoryValue)

        if CETrainer and CETrainer.CEListView1 then
            print("CETrainer and CEListView1 are valid.")
            local items = CETrainer.CEListView1.Items
            local found = false


            for i = 0, items.Count - 1 do
                local existingItem = items[i]
                if existingItem.Caption == string.format("0x%X", accessedAddress) then

                    existingItem.SubItems[0] = tostring(memoryValue)
                    print("Address found, updated Value to: " .. memoryValue)
                    found = true
                    break
                end
            end


            if not found then
                local newItem = items:Add()
                newItem.Caption = string.format("0x%X", accessedAddress)
                newItem.SubItems:Add(tostring(memoryValue))
                print("New item added with Address and Value.")
            end


            CETrainer.CEListView1.Repaint()
            print("Item count after add: " .. CETrainer.CEListView1.Items.Count)
        else
            print("Error: CEListView1 is not found in CETrainer.")
        end
    else
        print("Error: Memory value is nil.")
    end

    return 1
end


function CETrainer_CEButton1Click(sender)
    local questAddress = findQuest()
    if questAddress then
        debug_setBreakpoint(questAddress)
        print("Breakpoint set at Quest address.")
    else
        print("Can't find Quest. find again")
    end
end



ce.png
 Description:
 Filesize:  144.95 KB
 Viewed:  276 Time(s)

ce.png


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