style: var naming, misc changes
This commit is contained in:
@@ -59,9 +59,8 @@ function getFieldFromName(class, name, shouldBeStatic)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
mono wrappers
|
mono class wrappers
|
||||||
]]
|
]]
|
||||||
-- UNUSED
|
|
||||||
function MonoArray(addr)
|
function MonoArray(addr)
|
||||||
local classId, className = mono_object_getClass(addr)
|
local classId, className = mono_object_getClass(addr)
|
||||||
if not className then error("address did not point to valid object") end
|
if not className then error("address did not point to valid object") end
|
||||||
@@ -92,7 +91,6 @@ function MonoArray(addr)
|
|||||||
return array
|
return array
|
||||||
end
|
end
|
||||||
|
|
||||||
-- UNUSED
|
|
||||||
local stringClass = mono_findClass("System", "String")
|
local stringClass = mono_findClass("System", "String")
|
||||||
local string_Length = getFieldFromName(stringClass, "_stringLength")
|
local string_Length = getFieldFromName(stringClass, "_stringLength")
|
||||||
local string_FirstChar = getFieldFromName(stringClass, "_firstChar")
|
local string_FirstChar = getFieldFromName(stringClass, "_firstChar")
|
||||||
@@ -241,6 +239,15 @@ function MonoClass(namespace, name)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local typeClass = MonoClass("System", "Type")
|
||||||
|
function Type(typeName)
|
||||||
|
local typeStr = mono_new_string(typeName)
|
||||||
|
local getType = typeClass:getMethod("GetType")
|
||||||
|
local typeRet = getType(typeStr)
|
||||||
|
|
||||||
|
print(type(typeRet), typeRet)
|
||||||
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
game
|
game
|
||||||
]]
|
]]
|
||||||
@@ -253,8 +260,6 @@ printf("GameData.Instance field offset: %x", instanceOffset or 0)
|
|||||||
local gameDataInstance = GameDataClass:getStaticField(instanceOffset)
|
local gameDataInstance = GameDataClass:getStaticField(instanceOffset)
|
||||||
printf("GameData: %x", gameDataInstance or 0)
|
printf("GameData: %x", gameDataInstance or 0)
|
||||||
|
|
||||||
local moneySpentHelper = GameDataClass:getMethod("CmdAlterFundsWithoutExperience")
|
local alterFunds = GameDataClass:getMethod("CmdAlterFunds")
|
||||||
|
printf("GameData.CmdAlterFunds: %x", alterFunds._id or 0)
|
||||||
printf("GameData.CmdAlterFundsWithoutExperience: %x", moneySpentHelper._id or 0)
|
alterFunds(gameDataInstance, 13371337)
|
||||||
|
|
||||||
moneySpentHelper(gameDataInstance, -51170)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user