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 


Proof of concept?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  

Cool idea?
No.
0%
 0%  [ 0 ]
Yes.
100%
 100%  [ 1 ]
Total Votes : 1

Author Message
CraniX
How do I cheat?
Reputation: 0

Joined: 04 Feb 2026
Posts: 1

PostPosted: Wed Feb 04, 2026 10:11 pm    Post subject: Proof of concept? Reply with quote

A poor mans way of brute forcing protected games, this is a proof of concept. The idea is the mini map is black, the script finds certain address's with certain values, changes said values and if there is a visual effect it logs the address responsible.

Code:
-- Cheat Engine Lua Script
-- Monitors color change at user-selected screen position, usually the minimap.
-- Scans region "00007FF400000000" - "00007FF5FFFFFFFF", Potential Fog/Units/Maphack  for value 1024
-- Changes value 1024 → 1279 and checks for user-selected screen position visual change

VK_LBUTTON = 0x01

showMessage("Move your mouse to the area in the game window you want to monitor\nand click the left mouse button.")

-- Wait for left mouse click to select monitor position
local mouse_x, mouse_y
while true do
  if isKeyPressed(VK_LBUTTON) then
    mouse_x, mouse_y = getMousePos()
    break
  end
  sleep(100)
end

showMessage("Monitoring position: " .. mouse_x .. ", " .. mouse_y)

-- ────────────────────────────────────────────────
--          Scan settings
-- ────────────────────────────────────────────────
local start_addr = "00007FF400000000"
local stop_addr  = "00007FF5FFFFFFFF"
local old_value  = "1024"           -- what we're looking for
local new_value  = 1279             -- what we change it to (number, not string)

-- Create and run first scan for exact value 1024 (dword)
local memscan = createMemScan()
memscan.firstScan(soExactValue, vtDword, rtRounded, old_value, "",
                  start_addr, stop_addr,
                  "", "", fsmNotAligned, "", true, false, false, false)
memscan.waitTillDone()

-- Get results
local foundlist = createFoundList(memscan)
foundlist.initialize()

local addresslist = getAddressList()

showMessage("Found " .. foundlist.Count .. " addresses with value " .. old_value .. "\nNow testing each one...")

-- ────────────────────────────────────────────────
--          Test each found address
-- ────────────────────────────────────────────────
for i = 0, foundlist.Count - 1 do
  local addr = foundlist.Address[i]

  -- Read original value (should be 1024, but we read anyway)
  local orig = readInteger(addr)
  if orig == nil then goto continue end

  -- Get color before we change anything
  local before_color = getPixel(mouse_x, mouse_y)

  -- Apply the new value
  writeInteger(addr, new_value)

  -- Give the game 5 seconds to react
  sleep(5000)

  -- Check color after change
  local after_color = getPixel(mouse_x, mouse_y)

  -- If color changed → this address matters
  if before_color ~= after_color then
    showMessage("Color changed at address " .. addr .. " !")

    local mr = addresslist.createMemoryRecord()
    mr.Address     = addr
    mr.Description = "1024 → 1279 affects color at (" .. mouse_x .. ", " .. mouse_y .. ")"
    mr.Type        = vtDword
    mr.ShowAsHex   = false
    -- mr.Active   = true   -- uncomment if you want it frozen/active by default
  else
    -- No visible change → revert immediately
    writeInteger(addr, orig)
  end

  ::continue::
end

-- ────────────────────────────────────────────────
--          Cleanup
-- ────────────────────────────────────────────────
foundlist.destroy()
memscan.destroy()

showMessage("Done!\n\nAddresses that caused a color change were added to the address list.")
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 98

Joined: 14 Jul 2007
Posts: 3360

PostPosted: Sun Feb 08, 2026 7:13 am    Post subject: Reply with quote

Brilliant idea though I am not sure how this would work in practice.
When part of a minimap is revealed, it does not usually go back to being black. More like a fog you mentioned. Some games store minimaps as different layers.
What games have you tried this with so far?
I'd like to try to see it for myself if I have the game...
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