I have found the address of a value in MyGame using Cheat Engine and created a Cheat Table (mygame.ct)
Here is some Lua code I found to change values:
function AOBRep(search, change)
local aob = AOBScan(search)
if aob then
for i=0,aob.Count-1 do
autoAssemble(aob[i]..':\ndb '..change)
end
aob.Destroy()
end
end
function option2()
searchV = 'B8 41 00 00 C8 41 00 00 F4 41' --off
searchV2 = 'B8 41 00 00 AF 43 00 00 AF 43' --on1
replaceV = 'B8 41 00 00 2F 44 00 00 2F 44' --on2
AOBRep(searchV,replaceV)
AOBRep(searchV2,replaceV)
end
function option1()
searchV = 'B8 41 00 00 C8 41 00 00 F4 41' --off
replaceV = 'B8 41 00 00 AF 43 00 00 AF 43' --on
AOBRep(searchV,replaceV)
end
MyForm = createForm(true)
MyForm.Caption = 'My Game'
MyForm.Width = 300
MyForm.Height = 200
mbbo = createButton(MyForm)
mbbo.Left = 20
mbbo.Top = 100
mbbo.Width = 80
mbbo.Height = 40
mbbo.onClick = option2
mbbo.Caption = 'Option2'
ahbf = createButton(MyForm)
ahbf.Left = 6
ahbf.Top = 4
ahbf.Width = 90
ahbf.Height = 50
ahbf.onClick = option1
ahbf.Caption = 'Option1'
I want to convert this Lua code to change Values in C++,
For example convert this the Lua code to change AOB Value B8 41 00 00 C8 41 00 00 F4 41
to B8 41 00 00 AF 43 00 00 AF 43
function option2()
searchV = 'B8 41 00 00 C8 41 00 00 F4 41' --off
searchV2 = 'B8 41 00 00 AF 43 00 00 AF 43' --hs
replaceV = 'B8 41 00 00 2F 44 00 00 2F 44' --mb
AOBRep(searchV,replaceV)
AOBRep(searchV2,replaceV)
end