SadrienHatesU Newbie cheater Reputation: 0
Joined: 08 May 2017 Posts: 14 Location: I don't exist... Unfortunately
|
Posted: Sun Jun 03, 2018 11:29 pm Post subject: Converting a CE table into a .dll to inject into a program. |
|
|
This way I can get practice on actually writing C/C++ code and produce my goal program rather than working with CE's Lua scripting.
I have a very basic .dll injector set up, although recommendations for different ways or even a guide on manual mapping would be appreciated.
Examples:
Code: | aobscan(MainContext_AOB, 00 00 00 00 10 01 04 00 ?? ?? ?? ?? 00 00 00 00 ?? ?? ?? ?? 00 00 00 00) |
Code: | -- Get AddressList Variables, AddressList is an Object named "al":
al = getAddressList()
MouseY = al.getMemoryRecordByDescription("MouseY")
MouseX = al.getMemoryRecordByDescription("MouseX")
MouseZ = al.getMemoryRecordByDescription("MouseZ")
TransientY = al.getMemoryRecordByDescription("TransientY")
TransientX = al.getMemoryRecordByDescription("TransientX")
TransientZ = al.getMemoryRecordByDescription("TransientZ")
ModelY = al.getMemoryRecordByDescription("ModelY")
ModelX = al.getMemoryRecordByDescription("ModelX")
ModelZ = al.getMemoryRecordByDescription("ModelZ")
TargetY = al.getMemoryRecordByDescription("TargetY")
TargetX = al.getMemoryRecordByDescription("TargetX")
TargetZ = al.getMemoryRecordByDescription("TargetZ")
VT = al.getMemoryRecordByDescription("Valid Terrain")
-- Global Real Variables (For Later Use):
transX = tonumber (TransientY.Value)
transY = tonumber (TransientX.Value)
transZ = tonumber (TransientZ.Value)
cursorY = tonumber (MouseY.Value)
cursorX = tonumber (MouseX.Value)
cursorZ = tonumber (MouseZ.Value)
targetPosY = tonumber (TargetY.Value)
targetPosX = tonumber (TargetX.Value)
targetPosZ = tonumber (TargetZ.Value)
validterrain = tonumber (VT.Value)
al = getAddressList()
mr = al.getMemoryRecordByDescription("Gravity")
-- get hotkeys, based on position in list aka index not ID (at least fairly sure it's index)
hk = mr.Hotkey[0]
-- set a function to run the second hotkey after the first has run
-- and the first key has been released
hk.onPostHotKey = function(sender)
timer = createTimer()
timer.Interval = 100 -- check every 100 milliseconds
timer.OnTimer = function(timer)
if not isKeyPressed(hk.keys[1]) then
sender.Owner.Hotkey[1].doHotkey()
timer.destroy()
end
end
end
-- function to make key not repeat --
setGlobalKeyPollInterval(100)
function createNonRepHotkey(func, ...)
local getTickCount=getTickCount
local lastTickCount=0
local function changedBehaviour(sender)
local TC = getTickCount()
--call orig func when elap is bigger than 300ms
if (TC - lastTickCount) > 300 then func(sender) end
lastTickCount = TC
end
local hk = createHotkey(changedBehaviour, ...)
hk.DelayBetweenActivate = 10
return hk
end
-- create the hotkey
ClickToTeleportHK = createNonRepHotkey(function()
-- get the value of Mouse
local valueY = tonumber (MouseY.Value)
local valueX = tonumber (MouseX.Value)
local valueZ = tonumber (MouseZ.Value)
-- divide by 32 and add 0.2
valueY = (valueY /-32) + 0.2
valueX = (valueX /32)
valueZ = (valueZ /32)
-- store the value in Transient Position
TransientY.Value = tostring(valueY)
TransientX.Value = tostring(valueX)
TransientZ.Value = tostring(valueZ)
ModelY.Value = tostring(valueY)
ModelX.Value = tostring(valueX)
ModelZ.Value = tostring(valueZ)
end,
{VK_F6})
-- create the hotkey
TeleportToTargetHK = createHotkey(function()
-- get Target Agent Position
local valueY = tonumber (TargetY.Value)
local valueX = tonumber (TargetX.Value)
local valueZ = tonumber (TargetZ.Value)
-- divide by 32 and add 0.2
valueY = (valueY /-32) + 0.2
valueX = (valueX /32)
valueZ = (valueZ /32)
-- store the value in Transient Position
TransientY.Value = tostring(valueY)
TransientX.Value = tostring(valueX)
TransientZ.Value = tostring(valueZ)
ModelY.Value = tostring(valueY)
ModelX.Value = tostring(valueX)
ModelZ.Value = tostring(valueZ)
end,
{VK_F5})
|
What functions in C should I use to replace AoB scans like this?
Basically, I want to know what functions that already exist can be used to mimic the features of CE and perhaps help to convert my Lua script that worked off of CE addresses into something that works into a lone-standing .dll program.
Thanks
_________________
Um... Hello... Thanks for taking the time to read my pointless signature |
|