52
"Main"
Auto Assembler Script
{$lua}
local function hex(a, c)
if a == nil then
return "(nil)"
end
local fmt = "%X"
if type(c) == "number" then
fmt = "%0"..c.."X"
end
return string.format(fmt, a)
end
local function readSignedInteger(a)
local v = readInteger(a)
if v > 0x7FFFFFFF then
v = -(0x100000000 - v)
end
return v
end
local function findRecord(parent, desc)
local found
if parent ~= nil and parent.Count > 0 then
local i
for i = 0, parent.Count-1 do
if parent.Child[i].Description == desc then
found = parent.Child[i]
end
end
end
return found
end
local function updateRecord(parent, desc, type, addr, offsets)
local rec = findRecord(parent,desc)
if rec == nil then
rec = getAddressList().createMemoryRecord()
rec.Description = desc
rec.VarType = type
if addr ~= nil then
rec.setAddress(addr, offsets)
end
if parent ~= nil then
rec.appendToEntry(parent)
end
else
local a = rec.Address
if addr ~= a then
rec.setAddress(addr, offsets)
end
end
return rec
end
local function getCodeOffset(addr, off)
local a
local o = readSignedInteger(addr + off)
return addr + o + off + 4
end
local function followAddress(addr, offs, debug)
local i
for i = 1,#offs do
if addr ~= nil then
addr = readPointer(addr + offs[i])
if debug then
print(" "..hex(addr))
end
end
end
return addr
end
local aobscans = {}
if timers == nil then
timers = {}
end
[ENABLE]
local le = getLuaEngine()
le.mOutput.Lines:Clear()
le.cbShowOnPrint.Checked = false
--le:Show()
local function hash(v)
local d = bXor(bAnd(bXor(bAnd(bXor(bAnd(v,0xFF), 0x811C9DC5) * 0x01000193, 0xFFFFFFFF), bAnd(bShr(v,0x8),0xFF)) * 0x01000193, 0xFFFFFFFF), bAnd(bShr(v,0x10), 0xFF))
local c = bXor(bAnd(d * 0x01000193, 0xFFFFFFFF), bAnd(bShr(v,0x18), 0xFF))
local a = bAnd(c * 0x01000193, 0xFFFFFFFF)
return a
end
aobscans["hash"] = AOBScan("A1 ?? ?? ?? ?? 85 C0 75 ?? FF 76 08 FF 15 ?? ?? ?? ?? 83 3D ?? ?? ?? ?? 00 75 ?? 68 30 01 00 00", "-C-W+X")
aobscans["player"] = AOBScan("8B 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 8B D8 85 DB 74 ?? 8B 4F D8", "-C-W+X")
local function Run()
local freezehp = updateRecord(memrec, "Freeze Health", "vtCustom", "0", {})
freezehp.IsGroupHeader = true
local freezemp = updateRecord(memrec, "Freeze Energy", "vtCustom", "0", {})
freezemp.IsGroupHeader = true
if aobscans["hash"] ~= nil and aobscans["hash"].Count > 0 and aobscans["player"] ~= nil and aobscans["player"].Count > 0 then
local playeraddr = followAddress(getAddress(aobscans["player"][0]), { 0x2, 0x0, 0x17E0, 0x10 })
if playeraddr ~= nil then
local playerid = readInteger(playeraddr + 0x8)
local hashaddr = followAddress(getAddress(aobscans["hash"][0]), { 0x1, 0x0 })
if hashaddr ~= nil then
local hashmask = readInteger(hashaddr + 0x40)
local arrayaddr = readPointer(hashaddr + 0x34)
local bucketaddr = readPointer(arrayaddr + bAnd(hash(playerid), hashmask)*8)
--print(hex(bAnd(hash(playerid), hashmask)))
if bucketaddr ~= nil and bucketaddr ~= 0 then
local saddr = bucketaddr
while bucketaddr ~= nil and bucketaddr ~= 0 do
local bucketid = readInteger(bucketaddr + 0x8)
if bucketid == playerid then
break
end
bucketaddr = readPointer(bucketaddr)
if bucketaddr == saddr then
bucketaddr = nil
break
end
end
if bucketaddr ~= nil then
local playeraddr = readPointer(bucketaddr + 0xC)
if playeraddr ~= nil then
local name = readString(readPointer(playeraddr + 0x2824), 0xFF, true)
local pmr = updateRecord(memrec, name, "vtCustom", hex(playeraddr), {})
updateRecord(pmr, "Health", "vtSingle", "+8D0", {})
updateRecord(pmr, "Food", "vtSingle", "+8E4", {})
updateRecord(pmr, "Energy", "vtSingle", "+8E8", {})
updateRecord(pmr, "Max Energy", "vtSingle", "+D2C", {})
updateRecord(pmr, "Max Health", "vtSingle", "+D30", {})
updateRecord(pmr, "Iron Bits", "vtDword", "+D80", {})
updateRecord(pmr, "Level", "vtDword", "+DE8", {})
updateRecord(pmr, "Experience", "vtDword", "+DEC", {})
updateRecord(pmr, "Attribute Points", "vtDword", "+DF0", {})
updateRecord(pmr, "Skill Points", "vtDword", "+DF4", {})
local dmr = updateRecord(pmr, "Divinity Points", "vtCustom", "+DF8", {})
updateRecord(dmr, "Available", "vtDword", "+0", {})
updateRecord(dmr, "Unlocked", "vtDword", "+4", {})
local amr = updateRecord(pmr, "Attributes", "vtCustom", "+90C", { "0", "8", "0" })
updateRecord(amr, "Physique", "vtSingle", "+0", {})
updateRecord(amr, "Cunning", "vtSingle", "+10", {})
updateRecord(amr, "Spirit", "vtSingle", "+20", {})
local fmr = updateRecord(pmr, "Factions", "vtCustom", "+F8C", {})
updateRecord(fmr, "Devil's Crossing", "vtSingle", "+8", {})
updateRecord(fmr, "Aetherials", "vtSingle", "+C", {})
updateRecord(fmr, "Chthonians", "vtSingle", "+10", {})
updateRecord(fmr, "Cronley's Gang", "vtSingle", "+14", {})
updateRecord(fmr, "Rovers", "vtSingle", "+1C", {})
updateRecord(fmr, "Homestead", "vtSingle", "+24", {})
updateRecord(fmr, "The Outcast", "vtSingle", "+2C", {})
updateRecord(fmr, "Order of Death's Vigil", "vtSingle", "+30", {})
updateRecord(fmr, "Undead", "vtSingle", "+34", {})
updateRecord(fmr, "The Black Legion", "vtSingle", "+38", {})
updateRecord(fmr, "Kymon's Chosen", "vtSingle", "+3C", {})
--[[
local startskill = readPointer(playeraddr + 0x678)
local endskill = readPointer(playeraddr + 0x67C)
if startskill < endskill then
while startskill < endskill do
local skilladdr = readPointer(startskill)
print(hex(skilladdr))
startskill = startskill + 4
end
end
]]--
if freezehp.Active then
writeInteger(playeraddr + 0x8D0, readInteger(playeraddr + 0xD30))
end
if freezemp.Active then
writeInteger(playeraddr + 0x8E8, readInteger(playeraddr + 0xD2C))
end
end
end
end
end
end
end
end
Run()
if timers["hash"] == nil then
timers["hash"] = createTimer()
timers["hash"].Interval = getFreezeTimer().Interval
timers["hash"].OnTimer = Run
timers["hash"].Enabled = true
end
[DISABLE]
if timers["hash"] ~= nil then
timers["hash"].Enabled = false
timers["hash"]:Destroy()
timers["hash"] = nil
end
if memrec ~= nil then
while memrec.Count > 0 do
memrec.Child[0]:Delete()
end
end