-
Notifications
You must be signed in to change notification settings - Fork 23
/
copyOffsets.lua
46 lines (41 loc) · 1.23 KB
/
copyOffsets.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--##### Copy Pointer Offsets for Cheat Engine
--##### Author: FreeER
--##### Github: https://github.com/FreeER
--##### Website: https://www.facebook.com/groups/CheatTheGame
--##### YouTube: https://www.youtube.com/channel/UCLy60mbqc3rSvh42jkpCDxw
--[[
http://cheatthegame.net/?view=thread&id=37&part=1#postid-48
adds a context menu option to print offsets for pointers
]]
local function findMenu(mi)
while not mi.Menu do mi = mi.Parent end
return mi.Menu
end
local del_mi = MainForm.Deletethisrecord1
local del_menu = findMenu(del_mi)
local mi = createMenuItem(del_menu)
mi.Caption = 'Print Offsets'
local function printOffsets(memrec)
print(memrec.Description)
local base,offsets=memrec.getAddress()
print(base)
if not offsets then return end
local combined = ('['):rep(#offsets) .. base
for i=#offsets, 1, -1 do
local hex = ('%02X'):format(offsets[i])
print(hex)
combined = ('%s]+%s'):format(combined,hex)
end
print(combined)
print('')
end
mi.OnClick = function()
local al = getAddressList()
local records = al.getSelectedRecords()
for k,v in pairs(records) do
if v.Type ~= vtAutoAssembler and not v.isGroupHeader then
printOffsets(v)
end
end
end
del_menu.Items.insert(del_mi.MenuIndex, mi)