Thanks Geo. Fixed and works for steam version:
Code: Select all
<?xml version="1.0" encoding="utf-8"?><CheatTable CheatEngineTableVersion="34"><CheatEntries><CheatEntry><ID>1</ID><Description>"Geo Stuff"</Description><Options moHideChildren="1" moActivateChildrenAsWell="1" moDeactivateChildrenAsWell="1"/><VariableType>Auto Assembler Script</VariableType><AssemblerScript Async="1">{$lua}
if syntaxcheck then return end
[ENABLE]
if not process or not enumModules()[1] then error("Process was not selected or is nil.") end
local starttime=os.time()
local count = 0
while not miMonoTopMenuItem or not miMonoTopMenuItem.miMonoActivate or miMonoTopMenuItem.miMonoActivate.Visible == false do
count = count + 1
sleep(1)
if count >= 5000 then return end
end
miDotNetInfoClick(miMonoTopMenuItem)
if monopipe and monopipe.IL2CPP then
if not monoSymbolList then
error("Mono cannot enum symbols.")
return
end
local MonoSymbolEnumTimeout=0
while (not monoSymbolList or monoSymbolList.FullyLoaded == nil or monoSymbolList.FullyLoaded == false) do
MonoSymbolEnumTimeout=MonoSymbolEnumTimeout+1
if MonoSymbolEnumTimeout>20000 then break end
sleep(1)
end
if (not monoSymbolList or monoSymbolList.FullyLoaded == nil or monoSymbolList.FullyLoaded == false) then
error("Mono features are not working.")
return
end
else
local MonoSymbolEnumTimeout=0
while monoBase == nil or monobase == 0 or monopipe.Connected == false do
MonoSymbolEnumTimeout=MonoSymbolEnumTimeout+1
if MonoSymbolEnumTimeout>20000 then break end
sleep(1)
end
if monoBase==nil or monobase==0 or monopipe.Connected == false then
error("Mono features are not working.")
return
end
end
if monopipe and monoBase then showMessage("Mono features are available.") end
getLuaEngine().close()
[DISABLE]
{$asm}
</AssemblerScript><CheatEntries><CheatEntry><ID>2</ID><Description>"Setup"</Description><Options moHideChildren="1" moManualExpandCollapse="1" moActivateChildrenAsWell="1" moDeactivateChildrenAsWell="1"/><GroupHeader>1</GroupHeader><CheatEntries><CheatEntry><ID>3</ID><Description>"Create Global Classes/Fields/Methods"</Description><Options moActivateChildrenAsWell="1" moDeactivateChildrenAsWell="1"/><VariableType>Auto Assembler Script</VariableType><AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then return end
local assemblyId = mono_getAssemblyFromName("Assembly-CSharp")
if assemblyId then
local imageId = mono_getImageFromAssembly(assemblyId)
ModifyAllGlobalClassesFieldsMethods(imageId, false, false, true, true, true, {}, {}, {})
end
assemblyId = mono_getAssemblyFromName("AnotherChronicle")
if assemblyId then
local imageId = mono_getImageFromAssembly(assemblyId)
ModifyAllGlobalClassesFieldsMethods(imageId, false, false, false, true, true, {"Tree", "Utility", "QuestSpace", "NAdditionalEffect", "AHA_Domain", "AnnounceSectionNameSpace", "Envy"}, {"IEatAbilityCtrl", "Eat_Ability", "LevelEffect", "ISloth", "IShortcut", "IAutomatedShortcut", "Achievement", "ActionContainer", "CheckActions", "Formation", "IBulkDealing", "NextAlly_Target", "IBattleEffect", "IListLocation_BattleEffect", "IBattleUnitTarget", "IDeepCopy", "IBestiary", "ICompleteCondition", "IConsumeItem", "Dealing", "IDrop", "Ally", "BattleUnit", "Base_", "IDungeon", "IEnemy", "ISkill", "IBaseStats", "IMagStats", "IToReset", "IEffect", "ILevelFactor", "ISkillUICtrl", "IPartyTemplate", "Default_", "EnumCtrl", "FilterToggle", "OfflineBonusWriter", "FolderInfo", "IHighlight", "IAnnounce", "COMP_PACKER", "ISetSource", "IRestriction", "IComponent", "IDetail", "IInteractable", "IClick", "IHoverAction", "IToggleClick", "IOnlyAction", "ISetActive", "IReleaseComplete", "IPaid", "ICalculateMethod", "IFilter", "IJudgeToFilter", "Filter_Tag", "JudgeTagFilter", "FilteredSetActive", "ILevel", "IUICtrl", "ISliderAction", "IIncreaseAmount", "ICooldown", "IMonoSeparated", "INeed", "IStats", "ISentenceTranslator", "ILuckBonusInfo", "IMonthlyRewardInfo", "INew", "LevelOfflineUnit", "IOfflineBonus", "IInitCostFactor", "ICompleteEffefctFactor", "IIntervalFactor", "IWholeAmount", "IAgent", "IAgentAccepter", "IGetTime", "IRankUpFunction", "IResource", "IRight", "IRubyIteminfo", "Sorted_SetActive", "IChronicleInfo", "IHistory", "IUIState", "IUnlock", "Narou1", "IAnimation", "ILog", "Conditional", "IIdleAction", "SingletonPopUp", "ISeedsHolder", "saveClass", "SavableArray", "SaveManager", "SaveSelectManager", "ISaveLocation", "SaveElement", "ISaveExecutor", "SingletonMonoBehaviour", "UsefulMethod", "UsefulStatic", "Button_Tree", "TemplateList", "ForeignWords", "ICondition", "DLC", "IIntDateRepository", "IClearDateEvent", "GameEvent_Dungeon", "INamedValue", "IContainer"}, {"AscendedAction", "CreateSkillCombination"})
end
assemblyId = mono_getAssemblyFromName("ACTk.Runtime")
if assemblyId then
local imageId = mono_getImageFromAssembly(assemblyId)
ModifyAllGlobalClassesFieldsMethods(imageId, false, true, true, true, true, {"Genuine"}, {"ACTkDetectorBase", "KeepAliveBehaviour"}, {"crypt"})
end
local assemblies = mono_enumAssemblies()
for _, assembly in ipairs(assemblies) do
local imageId = mono_getImageFromAssembly(assembly)
local assemblyName = mono_image_get_name(imageId)
ModifyAllGlobalClassesFieldsMethods(imageId, false, true, true, true, false, {"UniRx"}, {"ConfiguredValueTaskAwaiter", "Awaiter", "Entry", "ConditionalElement", "OnNextNotification", "Aggregate", "CombineLatest", "ContinueWith", "DistinctUntilChanged", "FromEventPattern", "FromEvent", "Last", "Pairwise", "Sample", "Scan", "Single", "Throttle", "TreeSubSet", "Node", "Slot", "Mutables", "GroupKeyData", "Boxed"}, {})
end
local assemblyId = mono_getAssemblyFromName("mscorlib")
if assemblyId then
local imageId = mono_getImageFromAssembly(assemblyId)
local classId = mono_image_findClass(imageId, "System", "IntPtr")
if classId then
local methodId = mono_class_findMethod(classId, "get_Size")
if methodId then
local addr = mono_compile_method(methodId)
if not _System then _System = {} end
if not _System.IntPtr then _System.IntPtr = {} end
_System.IntPtr.get_Size = addr
end
end
end
unregisterSymbol("_System.IntPtr.size")
autoAssemble([[
aobscanregion(_System.IntPtr.size,_System.IntPtr.get_Size,_System.IntPtr.get_Size+10,B8)
registersymbol(_System.IntPtr.size)
]])
_System.IntPtr.size = readInteger(GetAddress("_System.IntPtr.size")+1)
unregisterSymbol("_System.IntPtr.size")
collectgarbage()
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
local assemblyId = mono_getAssemblyFromName("Assembly-CSharp.dll")
if assemblyId then
local imageId = mono_getImageFromAssembly(assemblyId)
ModifyAllGlobalClassesFieldsMethods(imageId, true, false, true, true, true, {}, {}, {})
end
local assemblies = mono_enumAssemblies()
for _, assembly in ipairs(assemblies) do
local imageId = mono_getImageFromAssembly(assembly)
local assemblyName = mono_image_get_name(imageId)
ModifyAllGlobalClassesFieldsMethods(imageId, true, true, true)
end
if _System and _System.IntPtr then _System.IntPtr.size = nil end
collectgarbage()
{$asm}
</AssemblerScript></CheatEntry></CheatEntries></CheatEntry><CheatEntry><ID>4</ID><Description>"Addresses"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><GroupHeader>1</GroupHeader><CheatEntries><CheatEntry><ID>5</ID><Description>"BASE"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><ShowAsSigned>0</ShowAsSigned><GroupHeader>1</GroupHeader><Address>BASE.staticAddress</Address><CheatEntries><CheatEntry><ID>6</ID><Description>"Main"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><ShowAsSigned>0</ShowAsSigned><GroupHeader>1</GroupHeader><Address>+0</Address><Offsets><Offset>0</Offset></Offsets><CheatEntries><CheatEntry><ID>7</ID><Description>"Rsc"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><ShowAsSigned>0</ShowAsSigned><GroupHeader>1</GroupHeader><Address>+Main.rsc</Address><Offsets><Offset>0</Offset></Offsets><CheatEntries><CheatEntry><ID>8</ID><Description>"Get Resource By Kind"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
CreateStringInputForm("BASEMainRscResourcesResourceIndexByKind", "Choose Resource", "Input the Resource Type:", false, nil, nil, function(var, varName)
local resourceKindArray = {"nothing", "exp", "action", "stamina", "mp", "fire", "water", "wind", "earth", "thunder", "ice", "light", "dark", "inspiration", "movement", "habit", "will", "gold", "destiny", "rune", "runeStone", "blessing", "woodenStatue", "goddessStatue", "stoneStatue", "statueOfMuscle", "seaBreezeAmulet", "shrine", "weed", "herb", "mandragora", "flower", "wreath", "medicine", "potion", "elixir", "spiritWater", "holyWater", "fairyDrop", "goddessBlessing", "wood", "firewood", "stone", "scrapMetal", "rareMetal", "steel", "mithril", "pelt", "leather", "durableLeather", "muddy_mucus", "dung", "manure", "stench", "smellySachet", "magicFiber", "dragonClaw", "dragonLiver", "physicalpoint", "magicalpoint", "specialpoint", "wheat", "bread", "mushroom", "apple", "slimeJelly", "wine", "fish", "salt", "olive", "honey", "milk", "butter", "egg", "beef", "pork", "chicken", "mysteriousMeat", "bakedApple", "beefSteak", "porkSteak", "chickenSteak", "meatFestival", "grilledFish", "anchovySandwich", "honeyToast", "honeyApple", "butterToast", "mushroomSaute", "creamStew", "meunier", "baconEgg", "iceCream", "dessertCarnival", "ruby", "sapphire", "emerald", "topaz", "rustySword", "holySword", "engagementRing", "artificialArm", "sin_gluttony", "sin", "guildPoint", "cactus", "palm", "elasticLeather", "desertSaute", "cactusSteak", "driedFruit", "warriorPoint", "sorcererPoint", "tamerPoint", "ePoint1", "ePoint2", "potato", "corn", "griffonFeather", "paper", "book", "bakedPotato", "cornSoup"}
local address = readPointer(BASE.staticAddress)
address = readPointer(address + Main.rsc)
address = readPointer(address + ResourceCtrl.resources)
local baseArrayAddr = address
local count = readInteger(address + _System.IntPtr.size*3)
local found = false
local kind = var
for i=0,count do
address = readPointer(baseArrayAddr + i*_System.IntPtr.size + _System.IntPtr.size*4)
if address and address > 0 then
local kindIndex = readInteger(address + Resource.kind) + 1
if resourceKindArray[kindIndex] == kind then
found = true
formVariables[varName] = i
break
end
end
end
if not found then
formVariables[varName] = 0
showMessage("Resource Kind not found.")
end
end)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
formVariables.BASEMainRscResourcesResourceIndexByKind = nil
{$asm}
</AssemblerScript><CheatEntries><CheatEntry><ID>9</ID><Description>"Resource"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><ShowAsSigned>0</ShowAsSigned><GroupHeader>1</GroupHeader><Address>+ResourceCtrl.resources</Address><Offsets><Offset>0</Offset><Offset>+formVariables.BASEMainRscResourcesResourceIndexByKind*_System.IntPtr.size+_System.IntPtr.size*4</Offset></Offsets><CheatEntries><CheatEntry><ID>10</ID><Description>"Kind"</Description><DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:nothing
1:exp
2:action
3:stamina
4:mp
5:fire
6:water
7:wind
8:earth
9:thunder
10:ice
11:light
12:dark
13:inspiration
14:movement
15:habit
16:will
17:gold
18:destiny
19:rune
20:runeStone
21:blessing
22:woodenStatue
23:goddessStatue
24:stoneStatue
25:statueOfMuscle
26:seaBreezeAmulet
27:shrine
28:weed
29:herb
30:mandragora
31:flower
32:wreath
33:medicine
34:potion
35:elixir
36:spiritWater
37:holyWater
38:fairyDrop
39:goddessBlessing
40:wood
41:firewood
42:stone
43:scrapMetal
44:rareMetal
45:steel
46:mithril
47:pelt
48:leather
49:durableLeather
50:muddy_mucus
51:dung
52:manure
53:stench
54:smellySachet
55:magicFiber
56:dragonClaw
57:dragonLiver
58:physicalpoint
59:magicalpoint
60:specialpoint
61:wheat
62:bread
63:mushroom
64:apple
65:slimeJelly
66:wine
67:fish
68:salt
69:olive
70:honey
71:milk
72:butter
73:egg
74:beef
75:pork
76:chicken
77:mysteriousMeat
78:bakedApple
79:beefSteak
80:porkSteak
81:chickenSteak
82:meatFestival
83:grilledFish
84:anchovySandwich
85:honeyToast
86:honeyApple
87:butterToast
88:mushroomSaute
89:creamStew
90:meunier
91:baconEgg
92:iceCream
93:dessertCarnival
94:ruby
95:sapphire
96:emerald
97:topaz
98:rustySword
99:holySword
100:engagementRing
101:artificialArm
102:sin_gluttony
103:sin
104:guildPoint
105:cactus
106:palm
107:elasticLeather
108:desertSaute
109:cactusSteak
110:driedFruit
111:warriorPoint
112:sorcererPoint
113:tamerPoint
114:ePoint1
115:ePoint2
116:potato
117:corn
118:griffonFeather
119:paper
120:book
121:bakedPotato
122:cornSoup
</DropDownList><ShowAsSigned>0</ShowAsSigned><VariableType>4 Bytes</VariableType><Address>+Resource.kind</Address></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry><CheatEntry><ID>11</ID><Description>"S"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><ShowAsSigned>0</ShowAsSigned><GroupHeader>1</GroupHeader><Address>+Main.S</Address><Offsets><Offset>0</Offset></Offsets><CheatEntries><CheatEntry><ID>12</ID><Description>"Get Current Resource By Kind"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
CreateStringInputForm("BASEMainSCurrentResourceIndexByKind", "Choose Resource", "Input the Resource Type:", false, nil, nil, function(var, varName)
local resourceKindArray = ResourceKind.enumTable
local address = readPointer(BASE.staticAddress)
address = readPointer(address + Main.S)
address = readPointer(address + Save.current_resource)
local baseArrayAddr = address
local count = readInteger(address + _System.IntPtr.size*3)
local found = false
local kind = var
for i=0,count do
if resourceKindArray[i+1] == kind then
found = true
formVariables[varName] = i
break
end
end
if not found then
formVariables[varName] = 0
showMessage("Resource Kind not found.")
end
end)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
formVariables.BASEMainSCurrentResourceIndexByKind = nil
{$asm}
</AssemblerScript><CheatEntries><CheatEntry><ID>13</ID><Description>"Value"</Description><ShowAsSigned>0</ShowAsSigned><VariableType>Double</VariableType><Address>+Save.current_resource</Address><Offsets><Offset>formVariables.BASEMainSCurrentResourceIndexByKind*8+_System.IntPtr.size*4</Offset></Offsets></CheatEntry></CheatEntries></CheatEntry><CheatEntry><ID>14</ID><Description>"Get Permanent Resource By Kind (Obscured)"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
CreateStringInputForm("BASEMainSPermanentResourceActIndexByKind", "Choose Resource", "Input the Resource Type:", false, nil, nil, function(var, varName)
local resourceKindArray = PermanentResourceKind.enumTable
local address = readPointer(BASE.staticAddress)
address = readPointer(address + Main.S)
address = readPointer(address + Save.value_PermanentResource_act)
local baseArrayAddr = address
local count = readInteger(address + _System.IntPtr.size*3)
local found = false
local kind = var
for i=0,count do
if resourceKindArray[i+1] == kind then
found = true
formVariables[varName] = i
break
end
end
if not found then
formVariables[varName] = 0
showMessage("Resource Kind not found.")
end
end)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
formVariables.BASEMainSPermanentResourceActIndexByKind = nil
{$asm}
</AssemblerScript><CheatEntries><CheatEntry><ID>15</ID><Description>"Value"</Description><ShowAsSigned>0</ShowAsSigned><VariableType>Double</VariableType><Address>+Save.value_PermanentResource_act</Address><Offsets><Offset>formVariables.BASEMainSPermanentResourceActIndexByKind*8*6+_System.IntPtr.size*4-CodeStage.AntiCheat.ObscuredTypes.ObscuredDouble.currentCryptoKey+CodeStage.AntiCheat.ObscuredTypes.ObscuredDouble.fakeValue</Offset></Offsets></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry><CheatEntry><ID>16</ID><Description>"Scripts"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><GroupHeader>1</GroupHeader><CheatEntries><CheatEntry><ID>17</ID><Description>"Permanent Resource Force Purchasable"</Description><Options moHideChildren="1" moDeactivateChildrenAsWell="1"/><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
RegisterGlobalMethod("PermanentRsc_Dealing.CanPurchase")
{$asm}
aobscanregion(Permanent_Resource_Force_Purchasable,PermanentRsc_Dealing.CanPurchase,PermanentRsc_Dealing.CanPurchase+5000,66 * * * 0F 86 * * * * 33 C0 EB)
Permanent_Resource_Force_Purchasable+04:
db 90 E9
registersymbol(Permanent_Resource_Force_Purchasable)
unregistersymbol(PermanentRsc_Dealing.CanPurchase)
[DISABLE]
Permanent_Resource_Force_Purchasable+04:
db 0F 86
unregistersymbol(Permanent_Resource_Force_Purchasable)
</AssemblerScript></CheatEntry></CheatEntries></CheatEntry></CheatEntries></CheatEntry></CheatEntries><UserdefinedSymbols/><LuaScript>function cycleFullCompact(sender, force)
local state = not(compactMenuItem.Caption == 'Compact View')
if force~=nil
then state = not force
end
compactMenuItem.Caption = state and 'Compact View' or 'Full View'
getMainForm().Splitter1.Visible = state
getMainForm().Panel4.Visible = state
getMainForm().Panel5.Visible = state
end
function addCompactMenu()
if compactMenuItem and compactMenuItem.Exists then return end
local menuItems = getMainForm().Menu.Items
compactMenuItem = createMenuItem(menuItems)
menuItems.add(compactMenuItem)
compactMenuItem.Caption = 'Compact View'
compactMenuItem.OnClick = cycleFullCompact
compactMenuItem.Exists = true
end
addCompactMenu()
function readIntegerSigned(addr)
local val=readInteger(addr)
local sign=bAnd(val,0x80000000)
return sign==0 and val or val-0x100000000
end
function readByteSigned(addr)
local val=readBytes(addr, 1, false)
local sign=bAnd(val,0x80)
return sign==0 and val or val-0x100
end
function mono_getAssemblyFromName(assemblyName)
local assemblyIds = mono_enumAssemblies()
if not assemblyIds then return nil end
for _, assemblyId in ipairs(assemblyIds) do
local imageId = mono_getImageFromAssembly(assemblyId)
local name = mono_image_get_name(imageId)
if name == assemblyName then
return assemblyId
end
end
return nil
end
function CreateGlobalDelimitedVariable(varString, delimiter, removeStrings)
local var = _G
if not delimiter then delimiter = '.' end
local nameParts = {}
for part in string.gmatch(varString, "([^" .. delimiter .. "]+)") do
local partName = part
if removeStrings then
for i, rs in pairs(removeStrings) do
partName = partName:gsub(rs, "")
end
end
table.insert(nameParts, partName)
end
for i, part in ipairs(nameParts) do
if not var[part] then var[part] = {} end
var = var[part]
end
return var
end
function RegisterMonoMethodAddress(classNamespace, className, methodName, delimiter, createGlobal)
if not delimiter then delimiter = '.' end
local mId = mono_findMethod(classNamespace, className, methodName)
if mId == 0 then
mId = mono_findMethod("", className, methodName)
local errorMsg = "Cannot find the " .. className .. delimiter .. methodName .. " method to register"
if mId == 0 then error(errorMsg) end
if classNamespace ~= string.match(mono_class_getFullName(mono_method_getClass(mId)), "(.*)[" .. delimiter .. "]") then error(errorMsg) end
end
local mAddr = mono_compile_method(mId)
if mAddr then
local symbolName = classNamespace .. delimiter .. className .. delimiter .. methodName
if not classNamespace or classNamespace == '' then symbolName = className .. delimiter .. methodName end
if createGlobal then
if not classNamespace or classNamespace == '' then _G[className][methodName] = mAddr
else
local varName = classNamespace .. delimiter .. className
local gVar = CreateGlobalDelimitedVariable(varName, delimiter)
gVar[methodName] = mAddr
end
end
unregisterSymbol(symbolName)
registerSymbol(symbolName, mAddr, true)
return mAddr
end
return nil
end
function RegisterGlobalMethod(varString, delimiter, removeStrings)
if not delimiter then delimiter = '.' end
if not varString:find(delimiter) then return end
local methodName = string.match(varString, ".*[" .. delimiter .. "](.*)")
local classFullName = string.match(varString, "(.*)[" .. delimiter .. "]")
local className = classFullName
local classNamespace = ""
local baseVar = nil
if classFullName:find("["..delimiter.."]") then
className = string.match(classFullName, ".*[" .. delimiter .. "](.*)")
classNamespace = string.match(classFullName, "(.*)[" .. delimiter .. "]")
baseVar = CreateGlobalDelimitedVariable(classFullName, delimiter, removeStrings)
else
if not _G[classFullName] then
_G[classFullName] = {}
end
baseVar = _G[classFullName]
end
unregisterSymbol(varString)
if not baseVar[methodName] then
RegisterMonoMethodAddress(classNamespace, className, methodName, delimiter, true)
else
registerSymbol(varString, baseVar[methodName], true)
end
end
function ModifyAllGlobalClassesFieldsMethods(imageId, remove, safe, suppress, createFields, createMethods, excludedNamespaces, excludedClassNames, excludedMethodNames)
if not imageId then return end
local excludedClassIds = {}
local classIds = mono_image_enumClasses(imageId)
for i, class in ipairs(classIds) do
if class.class and class.class > 0 then
if not tableContainsValue(excludedClassIds, classId) then
ModifyGlobalClassesFieldsMethods(class.class, imageId, remove, safe, suppress, createFields, createMethods, excludedNamespaces, excludedClassNames, excludedMethodNames)
end
table.insert(excludedClassIds, class.class)
end
end
end
function ModifyGlobalClassesFieldsMethods(classId, imageId, remove, safe, suppress, createFields, createMethods, excludedNamespaces, excludedClassNames, excludedMethodNames)
if not classId or classId == 0 then return end
if createFields == nil then createFields = true end
if assemblyName == '' then assemblyName = nil end
if not excludedClassIds then excludedClassIds = {} end
local className = mono_class_getName(classId)
local classFullName = mono_class_getFullName(classId)
local classNamespace = mono_class_getNamespace(classId)
local excluded = false
local var = _G
if (not classNamespace or classNamespace == '') and classFullName ~= className then
classNamespace = string.match(classFullName, "(.*)[.]")
end
if classNamespace and classNamespace ~= '' then
excluded = stringFoundInTable(classNamespace, excludedNamespaces)
if excluded then return end
classNamespace = classNamespace:gsub("^(System)", "_System")
var = CreateGlobalDelimitedVariable(classNamespace, '.', {"`1", "`"})
else
local nestedClassParentIdList = {}
if mono_class_getNestingType then
local nestedClassParentId = mono_class_getNestingType(classId)
while nestedClassParentId and nestedClassParentId > 0 do
table.insert(nestedClassParentIdList, 1, nestedClassParentId)
nestedClassParentId = mono_class_getNestingType(classId)
end
end
if nestedClassParentIdList[1] then classNamespace = mono_class_getNamespace(nestedClassParentIdList[1]) end
for i, parentClassId in pairs(nestedClassParentIdList) do
local parentClassName = mono_class_getName(parentClassId)
parentClassName = parentClassName:gsub("`1", ""):gsub("`", "")
if not var[parentClassName] then var[parentClassName] = {} end
var = var[parentClassName]
end
end
if not className then return end
local classVarName = className:gsub("`1", ""):gsub("`", ""):gsub("<", ""):gsub(">", "")
excluded = stringFoundInTable(className, excludedClassNames)
if not excluded then if className:find("c__Iterator") or className:find("Enumerator") then excluded = true end end
if remove or excluded then
var[classVarName] = nil
return
end
table.insert(excludedClassIds, classId)
if var == _G and classVarName == "type" and type(var[classVarName]) == "function" then classVarName = "_" .. classVarName end
if var[classVarName] and type(var[classVarName]) ~= "table" then var[classVarName] = nil end
local domain = mono_enumDomains()[1]
local staticFieldAddr = 0
if safe and className:find("[`<>]") then
staticFieldAddr = 0
else
staticFieldAddr = mono_class_getStaticFieldAddress(domain, classId)
end
if not staticFieldAddr and not suppress then
print(className .. " failed to read static address.")
end
if not var[classVarName] then var[classVarName] = {} end
var[classVarName].staticAddress = staticFieldAddr
if createFields then
CreateGlobalFields(classId, var, classVarName)
end
if createMethods then
CreateGlobalMethods(classId, var, classVarName, className, classNamespace, excludedMethodNames, suppress)
end
end
function CreateGlobalFields(classId, rootVar, className)
for i, field in ipairs(mono_class_enumFields(classId, true)) do
local fieldName = field.name
if field.name:find("<") and field.name:find(">") then
fieldName = string.match(field.name, "<(%w+)>")
elseif field.name:find("[<>]") then
fieldName = field.name:gsub("<", ""):gsub(">", "")
end
if not fieldName then fieldName = field.name end
if fieldName ~= "" then rootVar[className][fieldName] = field.offset end
local parentClass = mono_class_getParent(classId)
if (field.monotype == MONO_TYPE_ENUM) or (parentClass and parentClass > 0 and mono_class_getFullName(parentClass) == "System.Enum") then
if fieldName ~= "enumSeperatorCharArray" and fieldName ~= "enumSeperator" and fieldName ~= "value__" then
if not rootVar[className].enumTable then rootVar[className].enumTable = {} end
if not tableContainsValue(rootVar[className].enumTable, fieldName) then
table.insert(rootVar[className].enumTable, fieldName)
end
end
end
end
end
function CreateGlobalMethods(classId, rootVar, className, oClassName, classNamespace, excludedMethodNames, suppress)
for i, method in ipairs(mono_class_enumMethods(classId)) do
excluded = stringFoundInTable(method.name, excludedMethodNames)
if not excluded then
local methodAddr = mono_compile_method(method.method)
if (not methodAddr or methodAddr == 0) and not suppress then
if classNamespace and classNamespace ~= '' then
print(classNamespace .. '.' .. oClassName .. '.' .. method.name .. " failed to compile.")
else
print(oClassName .. '.' .. method.name .. " failed to compile.")
end
return
end
local methodName = method.name
local count = 2
while rootVar[className][methodName] and rootVar[className][methodName] ~= methodAddr do
methodName = method.name .. count
count = count + 1
end
rootVar[className][methodName] = methodAddr
end
end
end
function stringFoundInTable(str, strTable)
if strTable and strTable ~= {} then
for i, s in ipairs(strTable) do
if str:lower():find(s:lower()) then
return true
end
end
end
return false
end
function tableContainsValue(tbl, val)
if tbl and tbl ~= {} then
for _,v in pairs(tbl) do
if v == val then
return true
end
end
end
return false
end
function CreateStringInputForm(varName, formName, labelText, numbersOnly, width, height, func)
width = width or 180
height = height or 80
if not formVariables then formVariables = {} end
formVariables[varName] = nil
local form = CreateBaseForm(formName, labelText, width, height)
local text_box = createEdit(form)
text_box.setTop(form.Height - 60)
text_box.Width = form.Width - 20
text_box.anchorSideLeft.control=form
text_box.anchorSideLeft.side=asrCenter
local OK_Button = createButton(form)
OK_Button.setTop(form.Height - 30)
OK_Button.Width = form.Width - 20
OK_Button.Caption = 'OK'
OK_Button.anchorSideLeft.control=form
OK_Button.anchorSideLeft.side=asrCenter
OK_Button.onClick = function()
if numbersOnly == true then
local num = tonumber(text_box.Text)
if num then
formVariables[varName] = num
else
formVariables[varName] = 0
end
else formVariables[varName] = text_box.Text end
if func then func(formVariables[varName], varName) end
form.hide()
end
end
function CreateDropdownForm(varName, itemArray, formName, labelText, width, height, func)
if not formVariables then formVariables = {} end
formVariables[varName] = nil
local form = CreateBaseForm(formName, labelText, width, height)
local slot_box = createComboBox(form)
slot_box.setTop(form.Height - 30)
slot_box.Width = form.Width - 20
slot_box.anchorSideLeft.control=form
slot_box.anchorSideLeft.side=asrCenter
for _, item in ipairs(itemArray) do
slot_box.items.add(item)
end
slot_box.onChange = function()
formVariables[varName] = slot_box.ItemIndex
if func then func(formVariables[varName], varName, itemArray[hexItemIndex]) end
form.hide()
end
end
function CreateBaseForm(formName, labelText, width, height)
width = width or 180
height = height or 50
local form = createForm()
m=getmetatable(form)
m.__autodestroy=true
local label = createLabel(form)
form.centerScreen()
form.Width = width
form.Height = height
label.anchorSideLeft.control=form
label.anchorSideLeft.side=asrCenter
label.Width = form.Width - 20
control_setCaption(form, formName)
control_setCaption(label, labelText)
return form
end
</LuaScript></CheatTable>