codekingpro commited on
Commit
8739cbb
·
verified ·
1 Parent(s): 2200542

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +453 -0
  2. 1_Nvidia_Intel_Drivers.html +208 -0
  3. Browsers/ChromeSetup.exe +3 -0
  4. Drivers_and_Runtimes/Rufus/rufus.log +11 -0
  5. Drivers_and_Runtimes/VC_redist.x64.exe +3 -0
  6. Drivers_and_Runtimes/VC_redist.x86.exe +3 -0
  7. Drivers_and_Runtimes/dxwebsetup.exe +3 -0
  8. Drivers_and_Runtimes/rufus-portable.exe +3 -0
  9. Drivers_and_Runtimes/rufus.ini +3 -0
  10. Gaming/CheatEngine/Portable/App/AppInfo/appicon.ico +3 -0
  11. Gaming/CheatEngine/Portable/App/AppInfo/appicon_128.png +3 -0
  12. Gaming/CheatEngine/Portable/App/AppInfo/appicon_16.png +3 -0
  13. Gaming/CheatEngine/Portable/App/AppInfo/appicon_256.png +3 -0
  14. Gaming/CheatEngine/Portable/App/AppInfo/appicon_32.png +3 -0
  15. Gaming/CheatEngine/Portable/App/AppInfo/appicon_75.png +3 -0
  16. Gaming/CheatEngine/Portable/App/AppInfo/appinfo.ini +16 -0
  17. Gaming/CheatEngine/Portable/App/ProgramFiles/CSCompiler.dll +0 -0
  18. Gaming/CheatEngine/Portable/App/ProgramFiles/Cheat Engine.exe +3 -0
  19. Gaming/CheatEngine/Portable/App/ProgramFiles/CheatEngine.chm +3 -0
  20. Gaming/CheatEngine/Portable/App/ProgramFiles/DotNetDataCollector32.exe +3 -0
  21. Gaming/CheatEngine/Portable/App/ProgramFiles/DotNetDataCollector64.exe +3 -0
  22. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/AI128x128.png +3 -0
  23. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/AIDialog.LFM +766 -0
  24. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/LICENSE +21 -0
  25. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/README.md +1 -0
  26. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/aibase.lua +953 -0
  27. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/loadorder.txt +4 -0
  28. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/tools/aitools.lua +1206 -0
  29. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/Place folder based extensions here.txt +4 -0
  30. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/UETools/LICENSE +21 -0
  31. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/UETools/UEInfoScanner.LUA +2238 -0
  32. Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/UETools/UEInfoStructureDissect.LUA +306 -0
  33. Gaming/CheatEngine/Portable/App/ProgramFiles/Kernelmoduleunloader.exe +3 -0
  34. Gaming/CheatEngine/Portable/App/ProgramFiles/Tutorial-i386.exe +3 -0
  35. Gaming/CheatEngine/Portable/App/ProgramFiles/Tutorial-x86_64.exe +3 -0
  36. Gaming/CheatEngine/Portable/App/ProgramFiles/allochook-i386.dll +3 -0
  37. Gaming/CheatEngine/Portable/App/ProgramFiles/allochook-x86_64.dll +3 -0
  38. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/DotNetInfoStaticsDialog.lua +271 -0
  39. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/DotNetInject.lua +444 -0
  40. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/DotNetInterface.lua +685 -0
  41. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/Lua files in this folder get executed automatically.txt +0 -0
  42. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/MethodInvokeDialog.lua +354 -0
  43. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/SpeedhackV3.lua +490 -0
  44. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/addtonewgroup.lua +75 -0
  45. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/android.lua +15 -0
  46. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/autosave.lua +321 -0
  47. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/bigendian.lua +324 -0
  48. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/celib.lua +99 -0
  49. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/ceshare.lua +424 -0
  50. Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/ceshare/ceshare_account.lua +195 -0
.gitattributes CHANGED
@@ -58,3 +58,456 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ Browsers/ChromeSetup.exe filter=lfs diff=lfs merge=lfs -text
62
+ Drivers_and_Runtimes/dxwebsetup.exe filter=lfs diff=lfs merge=lfs -text
63
+ Drivers_and_Runtimes/rufus-portable.exe filter=lfs diff=lfs merge=lfs -text
64
+ Drivers_and_Runtimes/VC_redist.x64.exe filter=lfs diff=lfs merge=lfs -text
65
+ Drivers_and_Runtimes/VC_redist.x86.exe filter=lfs diff=lfs merge=lfs -text
66
+ Gaming/CheatEngine/Portable/App/AppInfo/appicon.ico filter=lfs diff=lfs merge=lfs -text
67
+ Gaming/CheatEngine/Portable/App/ProgramFiles/allochook-i386.dll filter=lfs diff=lfs merge=lfs -text
68
+ Gaming/CheatEngine/Portable/App/ProgramFiles/allochook-x86_64.dll filter=lfs diff=lfs merge=lfs -text
69
+ Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/dlls/MonoDataCollector32.dll filter=lfs diff=lfs merge=lfs -text
70
+ Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/dlls/MonoDataCollector64.dll filter=lfs diff=lfs merge=lfs -text
71
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ced3d10hook.dll filter=lfs diff=lfs merge=lfs -text
72
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ced3d10hook64.dll filter=lfs diff=lfs merge=lfs -text
73
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ced3d11hook.dll filter=lfs diff=lfs merge=lfs -text
74
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ced3d11hook64.dll filter=lfs diff=lfs merge=lfs -text
75
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ced3d9hook.dll filter=lfs diff=lfs merge=lfs -text
76
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ced3d9hook64.dll filter=lfs diff=lfs merge=lfs -text
77
+ Gaming/CheatEngine/Portable/App/ProgramFiles/ceregreset.exe filter=lfs diff=lfs merge=lfs -text
78
+ Gaming/CheatEngine/Portable/App/ProgramFiles/Cheat[[:space:]]Engine.exe filter=lfs diff=lfs merge=lfs -text
79
+ Gaming/CheatEngine/Portable/App/ProgramFiles/cheatengine-i386.exe filter=lfs diff=lfs merge=lfs -text
80
+ Gaming/CheatEngine/Portable/App/ProgramFiles/cheatengine-x86_64-SSE4-AVX2.exe filter=lfs diff=lfs merge=lfs -text
81
+ Gaming/CheatEngine/Portable/App/ProgramFiles/cheatengine-x86_64.exe filter=lfs diff=lfs merge=lfs -text
82
+ Gaming/CheatEngine/Portable/App/ProgramFiles/CheatEngine.chm filter=lfs diff=lfs merge=lfs -text
83
+ Gaming/CheatEngine/Portable/App/ProgramFiles/clibs32/lfs.dll filter=lfs diff=lfs merge=lfs -text
84
+ Gaming/CheatEngine/Portable/App/ProgramFiles/clibs64/lfs.dll filter=lfs diff=lfs merge=lfs -text
85
+ Gaming/CheatEngine/Portable/App/ProgramFiles/d3dhook.dll filter=lfs diff=lfs merge=lfs -text
86
+ Gaming/CheatEngine/Portable/App/ProgramFiles/d3dhook64.dll filter=lfs diff=lfs merge=lfs -text
87
+ Gaming/CheatEngine/Portable/App/ProgramFiles/dbk64.sys filter=lfs diff=lfs merge=lfs -text
88
+ Gaming/CheatEngine/Portable/App/ProgramFiles/DotNetDataCollector32.exe filter=lfs diff=lfs merge=lfs -text
89
+ Gaming/CheatEngine/Portable/App/ProgramFiles/DotNetDataCollector64.exe filter=lfs diff=lfs merge=lfs -text
90
+ Gaming/CheatEngine/Portable/App/ProgramFiles/gtutorial-i386.exe filter=lfs diff=lfs merge=lfs -text
91
+ Gaming/CheatEngine/Portable/App/ProgramFiles/gtutorial-x86_64.exe filter=lfs diff=lfs merge=lfs -text
92
+ Gaming/CheatEngine/Portable/App/ProgramFiles/Kernelmoduleunloader.exe filter=lfs diff=lfs merge=lfs -text
93
+ Gaming/CheatEngine/Portable/App/ProgramFiles/libipt-32.dll filter=lfs diff=lfs merge=lfs -text
94
+ Gaming/CheatEngine/Portable/App/ProgramFiles/libipt-64.dll filter=lfs diff=lfs merge=lfs -text
95
+ Gaming/CheatEngine/Portable/App/ProgramFiles/libmikmod32.dll filter=lfs diff=lfs merge=lfs -text
96
+ Gaming/CheatEngine/Portable/App/ProgramFiles/libmikmod64.dll filter=lfs diff=lfs merge=lfs -text
97
+ Gaming/CheatEngine/Portable/App/ProgramFiles/lua53-32.dll filter=lfs diff=lfs merge=lfs -text
98
+ Gaming/CheatEngine/Portable/App/ProgramFiles/lua53-64.dll filter=lfs diff=lfs merge=lfs -text
99
+ Gaming/CheatEngine/Portable/App/ProgramFiles/luaclient-i386.dll filter=lfs diff=lfs merge=lfs -text
100
+ Gaming/CheatEngine/Portable/App/ProgramFiles/luaclient-x86_64.dll filter=lfs diff=lfs merge=lfs -text
101
+ Gaming/CheatEngine/Portable/App/ProgramFiles/standalonephase2.dat filter=lfs diff=lfs merge=lfs -text
102
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc32-32-linux.dll filter=lfs diff=lfs merge=lfs -text
103
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc32-32.dll filter=lfs diff=lfs merge=lfs -text
104
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc32-64-linux.dll filter=lfs diff=lfs merge=lfs -text
105
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc32-64.dll filter=lfs diff=lfs merge=lfs -text
106
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc32-arm-linux.dll filter=lfs diff=lfs merge=lfs -text
107
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc32-arm64-linux.dll filter=lfs diff=lfs merge=lfs -text
108
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc64-32-linux.dll filter=lfs diff=lfs merge=lfs -text
109
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc64-32.dll filter=lfs diff=lfs merge=lfs -text
110
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc64-64-linux.dll filter=lfs diff=lfs merge=lfs -text
111
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc64-64.dll filter=lfs diff=lfs merge=lfs -text
112
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc64-arm-linux.dll filter=lfs diff=lfs merge=lfs -text
113
+ Gaming/CheatEngine/Portable/App/ProgramFiles/tcc64-arm64-linux.dll filter=lfs diff=lfs merge=lfs -text
114
+ Gaming/CheatEngine/Portable/App/ProgramFiles/Tutorial-i386.exe filter=lfs diff=lfs merge=lfs -text
115
+ Gaming/CheatEngine/Portable/App/ProgramFiles/Tutorial-x86_64.exe filter=lfs diff=lfs merge=lfs -text
116
+ Gaming/CheatEngine/Portable/App/ProgramFiles/vehdebug-i386.dll filter=lfs diff=lfs merge=lfs -text
117
+ Gaming/CheatEngine/Portable/App/ProgramFiles/vehdebug-x86_64.dll filter=lfs diff=lfs merge=lfs -text
118
+ Gaming/CheatEngine/Portable/App/ProgramFiles/vmdisk.img filter=lfs diff=lfs merge=lfs -text
119
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win32/dbgshim.dll filter=lfs diff=lfs merge=lfs -text
120
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win32/sqlite3.dll filter=lfs diff=lfs merge=lfs -text
121
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win32/symsrv.dll filter=lfs diff=lfs merge=lfs -text
122
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win64/dbgshim.dll filter=lfs diff=lfs merge=lfs -text
123
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win64/nethost.dll filter=lfs diff=lfs merge=lfs -text
124
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win64/sqlite3.dll filter=lfs diff=lfs merge=lfs -text
125
+ Gaming/CheatEngine/Portable/App/ProgramFiles/win64/symsrv.dll filter=lfs diff=lfs merge=lfs -text
126
+ Gaming/CheatEngine/Portable/App/ProgramFiles/windowsrepair.exe filter=lfs diff=lfs merge=lfs -text
127
+ Gaming/CheatEngine/Portable/App/ProgramFiles/winhook-i386.dll filter=lfs diff=lfs merge=lfs -text
128
+ Gaming/CheatEngine/Portable/App/ProgramFiles/winhook-x86_64.dll filter=lfs diff=lfs merge=lfs -text
129
+ Gaming/CheatEngine/Portable/CheatEnginePortable.exe filter=lfs diff=lfs merge=lfs -text
130
+ Gaming/NVIDIA/GeForce_Experience_v3.28.0.417.exe filter=lfs diff=lfs merge=lfs -text
131
+ Gaming/Razer_Cortex/RazerCortexInstaller.exe filter=lfs diff=lfs merge=lfs -text
132
+ Gaming/Vortex/Portable/chrome_100_percent.pak filter=lfs diff=lfs merge=lfs -text
133
+ Gaming/Vortex/Portable/chrome_200_percent.pak filter=lfs diff=lfs merge=lfs -text
134
+ Gaming/Vortex/Portable/d3dcompiler_47.dll filter=lfs diff=lfs merge=lfs -text
135
+ Gaming/Vortex/Portable/dxcompiler.dll filter=lfs diff=lfs merge=lfs -text
136
+ Gaming/Vortex/Portable/dxil.dll filter=lfs diff=lfs merge=lfs -text
137
+ Gaming/Vortex/Portable/ffmpeg.dll filter=lfs diff=lfs merge=lfs -text
138
+ Gaming/Vortex/Portable/icudtl.dat filter=lfs diff=lfs merge=lfs -text
139
+ Gaming/Vortex/Portable/libEGL.dll filter=lfs diff=lfs merge=lfs -text
140
+ Gaming/Vortex/Portable/libGLESv2.dll filter=lfs diff=lfs merge=lfs -text
141
+ Gaming/Vortex/Portable/LICENSES.chromium.html filter=lfs diff=lfs merge=lfs -text
142
+ Gaming/Vortex/Portable/locales/af.pak filter=lfs diff=lfs merge=lfs -text
143
+ Gaming/Vortex/Portable/locales/am.pak filter=lfs diff=lfs merge=lfs -text
144
+ Gaming/Vortex/Portable/locales/ar.pak filter=lfs diff=lfs merge=lfs -text
145
+ Gaming/Vortex/Portable/locales/bg.pak filter=lfs diff=lfs merge=lfs -text
146
+ Gaming/Vortex/Portable/locales/bn.pak filter=lfs diff=lfs merge=lfs -text
147
+ Gaming/Vortex/Portable/locales/ca.pak filter=lfs diff=lfs merge=lfs -text
148
+ Gaming/Vortex/Portable/locales/cs.pak filter=lfs diff=lfs merge=lfs -text
149
+ Gaming/Vortex/Portable/locales/da.pak filter=lfs diff=lfs merge=lfs -text
150
+ Gaming/Vortex/Portable/locales/de.pak filter=lfs diff=lfs merge=lfs -text
151
+ Gaming/Vortex/Portable/locales/el.pak filter=lfs diff=lfs merge=lfs -text
152
+ Gaming/Vortex/Portable/locales/en-GB.pak filter=lfs diff=lfs merge=lfs -text
153
+ Gaming/Vortex/Portable/locales/en-US.pak filter=lfs diff=lfs merge=lfs -text
154
+ Gaming/Vortex/Portable/locales/es-419.pak filter=lfs diff=lfs merge=lfs -text
155
+ Gaming/Vortex/Portable/locales/es.pak filter=lfs diff=lfs merge=lfs -text
156
+ Gaming/Vortex/Portable/locales/et.pak filter=lfs diff=lfs merge=lfs -text
157
+ Gaming/Vortex/Portable/locales/fa.pak filter=lfs diff=lfs merge=lfs -text
158
+ Gaming/Vortex/Portable/locales/fi.pak filter=lfs diff=lfs merge=lfs -text
159
+ Gaming/Vortex/Portable/locales/fil.pak filter=lfs diff=lfs merge=lfs -text
160
+ Gaming/Vortex/Portable/locales/fr.pak filter=lfs diff=lfs merge=lfs -text
161
+ Gaming/Vortex/Portable/locales/gu.pak filter=lfs diff=lfs merge=lfs -text
162
+ Gaming/Vortex/Portable/locales/he.pak filter=lfs diff=lfs merge=lfs -text
163
+ Gaming/Vortex/Portable/locales/hi.pak filter=lfs diff=lfs merge=lfs -text
164
+ Gaming/Vortex/Portable/locales/hr.pak filter=lfs diff=lfs merge=lfs -text
165
+ Gaming/Vortex/Portable/locales/hu.pak filter=lfs diff=lfs merge=lfs -text
166
+ Gaming/Vortex/Portable/locales/id.pak filter=lfs diff=lfs merge=lfs -text
167
+ Gaming/Vortex/Portable/locales/it.pak filter=lfs diff=lfs merge=lfs -text
168
+ Gaming/Vortex/Portable/locales/ja.pak filter=lfs diff=lfs merge=lfs -text
169
+ Gaming/Vortex/Portable/locales/kn.pak filter=lfs diff=lfs merge=lfs -text
170
+ Gaming/Vortex/Portable/locales/ko.pak filter=lfs diff=lfs merge=lfs -text
171
+ Gaming/Vortex/Portable/locales/lt.pak filter=lfs diff=lfs merge=lfs -text
172
+ Gaming/Vortex/Portable/locales/lv.pak filter=lfs diff=lfs merge=lfs -text
173
+ Gaming/Vortex/Portable/locales/ml.pak filter=lfs diff=lfs merge=lfs -text
174
+ Gaming/Vortex/Portable/locales/mr.pak filter=lfs diff=lfs merge=lfs -text
175
+ Gaming/Vortex/Portable/locales/ms.pak filter=lfs diff=lfs merge=lfs -text
176
+ Gaming/Vortex/Portable/locales/nb.pak filter=lfs diff=lfs merge=lfs -text
177
+ Gaming/Vortex/Portable/locales/nl.pak filter=lfs diff=lfs merge=lfs -text
178
+ Gaming/Vortex/Portable/locales/pl.pak filter=lfs diff=lfs merge=lfs -text
179
+ Gaming/Vortex/Portable/locales/pt-BR.pak filter=lfs diff=lfs merge=lfs -text
180
+ Gaming/Vortex/Portable/locales/pt-PT.pak filter=lfs diff=lfs merge=lfs -text
181
+ Gaming/Vortex/Portable/locales/ro.pak filter=lfs diff=lfs merge=lfs -text
182
+ Gaming/Vortex/Portable/locales/ru.pak filter=lfs diff=lfs merge=lfs -text
183
+ Gaming/Vortex/Portable/locales/sk.pak filter=lfs diff=lfs merge=lfs -text
184
+ Gaming/Vortex/Portable/locales/sl.pak filter=lfs diff=lfs merge=lfs -text
185
+ Gaming/Vortex/Portable/locales/sr.pak filter=lfs diff=lfs merge=lfs -text
186
+ Gaming/Vortex/Portable/locales/sv.pak filter=lfs diff=lfs merge=lfs -text
187
+ Gaming/Vortex/Portable/locales/sw.pak filter=lfs diff=lfs merge=lfs -text
188
+ Gaming/Vortex/Portable/locales/ta.pak filter=lfs diff=lfs merge=lfs -text
189
+ Gaming/Vortex/Portable/locales/te.pak filter=lfs diff=lfs merge=lfs -text
190
+ Gaming/Vortex/Portable/locales/th.pak filter=lfs diff=lfs merge=lfs -text
191
+ Gaming/Vortex/Portable/locales/tr.pak filter=lfs diff=lfs merge=lfs -text
192
+ Gaming/Vortex/Portable/locales/uk.pak filter=lfs diff=lfs merge=lfs -text
193
+ Gaming/Vortex/Portable/locales/ur.pak filter=lfs diff=lfs merge=lfs -text
194
+ Gaming/Vortex/Portable/locales/vi.pak filter=lfs diff=lfs merge=lfs -text
195
+ Gaming/Vortex/Portable/locales/zh-CN.pak filter=lfs diff=lfs merge=lfs -text
196
+ Gaming/Vortex/Portable/locales/zh-TW.pak filter=lfs diff=lfs merge=lfs -text
197
+ Gaming/Vortex/Portable/resources/app.asar filter=lfs diff=lfs merge=lfs -text
198
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/assets/dotnetprobe.exe filter=lfs diff=lfs merge=lfs -text
199
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/collections/bsdiff.node filter=lfs diff=lfs merge=lfs -text
200
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-baldursgate3/tools/AlphaFS.dll filter=lfs diff=lfs merge=lfs -text
201
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-baldursgate3/tools/LSLib.dll filter=lfs diff=lfs merge=lfs -text
202
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-baldursgate3/tools/LSLibNative.dll filter=lfs diff=lfs merge=lfs -text
203
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-baldursgate3/tools/LZ4.dll filter=lfs diff=lfs merge=lfs -text
204
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-baldursgate3/tools/Newtonsoft.Json.dll filter=lfs diff=lfs merge=lfs -text
205
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-baldursgate3/tools/OpenTK.dll filter=lfs diff=lfs merge=lfs -text
206
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/game-untitledgoose/vortexui filter=lfs diff=lfs merge=lfs -text
207
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-ba2-support/ba2tk.node filter=lfs diff=lfs merge=lfs -text
208
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-bsa-support/bsatk.node filter=lfs diff=lfs merge=lfs -text
209
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-plugin-management/esptk.node filter=lfs diff=lfs merge=lfs -text
210
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-plugin-management/libloot.dll filter=lfs diff=lfs merge=lfs -text
211
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-plugin-management/node-loot.node filter=lfs diff=lfs merge=lfs -text
212
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-savegame-management/GamebryoSave.node filter=lfs diff=lfs merge=lfs -text
213
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/gamebryo-savegame-management/liblz4.dll filter=lfs diff=lfs merge=lfs -text
214
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/mtframework-arc-support/ARCtool.exe filter=lfs diff=lfs merge=lfs -text
215
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/quickbms-support/quickbms_4gb_files.exe filter=lfs diff=lfs merge=lfs -text
216
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/bundledPlugins/theme-switcher/fontmanager.node filter=lfs diff=lfs merge=lfs -text
217
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/duckdb-extensions/v1.5.1/linux_amd64/level_pivot.duckdb_extension filter=lfs diff=lfs merge=lfs -text
218
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/duckdb-extensions/v1.5.1/windows_amd64/level_pivot.duckdb_extension filter=lfs diff=lfs merge=lfs -text
219
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/7z-bin/linux/7zzs filter=lfs diff=lfs merge=lfs -text
220
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/7z-bin/win32/7z.dll filter=lfs diff=lfs merge=lfs -text
221
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/7z-bin/win32/7z.exe filter=lfs diff=lfs merge=lfs -text
222
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@duckdb/node-bindings-win32-x64/duckdb.dll filter=lfs diff=lfs merge=lfs -text
223
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@duckdb/node-bindings-win32-x64/duckdb.node filter=lfs diff=lfs merge=lfs -text
224
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-ipc/dist/Antlr3.Runtime.dll filter=lfs diff=lfs merge=lfs -text
225
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-ipc/dist/Newtonsoft.Json.dll filter=lfs diff=lfs merge=lfs -text
226
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-ipc/dist/XmlScript.dll filter=lfs diff=lfs merge=lfs -text
227
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-native/ModInstaller.Native.dll filter=lfs diff=lfs merge=lfs -text
228
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-native/prebuilds/linux-x64/modinstaller.napi.node filter=lfs diff=lfs merge=lfs -text
229
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-native/prebuilds/linux-x64/ModInstaller.Native.so filter=lfs diff=lfs merge=lfs -text
230
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-native/prebuilds/win32-x64/modinstaller.napi.node filter=lfs diff=lfs merge=lfs -text
231
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@nexusmods/fomod-installer-native/prebuilds/win32-x64/ModInstaller.Native.dll filter=lfs diff=lfs merge=lfs -text
232
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@parcel/watcher-win32-x64/watcher.node filter=lfs diff=lfs merge=lfs -text
233
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/@tailwindcss/oxide-win32-x64-msvc/tailwindcss-oxide.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
234
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/crash-dump/build/Release/windump.node filter=lfs diff=lfs merge=lfs -text
235
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/diskusage/build/Release/diskusage.node filter=lfs diff=lfs merge=lfs -text
236
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/drivelist/build/Release/drivelist.node filter=lfs diff=lfs merge=lfs -text
237
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/android-arm/node.napi.armv7.node filter=lfs diff=lfs merge=lfs -text
238
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/android-arm64/node.napi.armv8.node filter=lfs diff=lfs merge=lfs -text
239
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/darwin-x64/node.napi.node filter=lfs diff=lfs merge=lfs -text
240
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/linux-arm/node.napi.armv6.node filter=lfs diff=lfs merge=lfs -text
241
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/linux-arm/node.napi.armv7.node filter=lfs diff=lfs merge=lfs -text
242
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/linux-arm64/node.napi.armv8.node filter=lfs diff=lfs merge=lfs -text
243
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/linux-x64/node.napi.glibc.node filter=lfs diff=lfs merge=lfs -text
244
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/linux-x64/node.napi.musl.node filter=lfs diff=lfs merge=lfs -text
245
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/win32-ia32/node.napi.node filter=lfs diff=lfs merge=lfs -text
246
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/leveldown/prebuilds/win32-x64/node.napi.node filter=lfs diff=lfs merge=lfs -text
247
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
248
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/native-errors/build/Release/native-errors.node filter=lfs diff=lfs merge=lfs -text
249
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe filter=lfs diff=lfs merge=lfs -text
250
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/ps-list/vendor/fastlist-0.3.0-x86.exe filter=lfs diff=lfs merge=lfs -text
251
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/vortexmt/build/Release/vortexmt.node filter=lfs diff=lfs merge=lfs -text
252
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/winapi-bindings/build/Release/winapi.node filter=lfs diff=lfs merge=lfs -text
253
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/xxhash-addon/prebuilds/linux-arm64/addon.napi.musl.node filter=lfs diff=lfs merge=lfs -text
254
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/xxhash-addon/prebuilds/linux-x64/addon.napi.glibc.node filter=lfs diff=lfs merge=lfs -text
255
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/xxhash-addon/prebuilds/linux-x64/addon.napi.musl.node filter=lfs diff=lfs merge=lfs -text
256
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/xxhash-addon/prebuilds/win32-arm64/addon.napi.node filter=lfs diff=lfs merge=lfs -text
257
+ Gaming/Vortex/Portable/resources/app.asar.unpacked/node_modules/xxhash-addon/prebuilds/win32-x64/addon.napi.node filter=lfs diff=lfs merge=lfs -text
258
+ Gaming/Vortex/Portable/resources/build/VC_redist.x64.exe filter=lfs diff=lfs merge=lfs -text
259
+ Gaming/Vortex/Portable/resources/build/windowsdesktop-runtime-win-x64.exe filter=lfs diff=lfs merge=lfs -text
260
+ Gaming/Vortex/Portable/resources/elevate.exe filter=lfs diff=lfs merge=lfs -text
261
+ Gaming/Vortex/Portable/resources/nsis/icon.ico filter=lfs diff=lfs merge=lfs -text
262
+ Gaming/Vortex/Portable/resources.pak filter=lfs diff=lfs merge=lfs -text
263
+ Gaming/Vortex/Portable/vk_swiftshader.dll filter=lfs diff=lfs merge=lfs -text
264
+ Gaming/Vortex/Portable/Vortex.exe filter=lfs diff=lfs merge=lfs -text
265
+ Gaming/Vortex/Portable/vulkan-1.dll filter=lfs diff=lfs merge=lfs -text
266
+ Internet/IDM/idman642build63.exe filter=lfs diff=lfs merge=lfs -text
267
+ Internet/IDM/idman642build63f.exe filter=lfs diff=lfs merge=lfs -text
268
+ Internet/WARP/Portable/aws_lc_fips_0_13_7_crypto.dll filter=lfs diff=lfs merge=lfs -text
269
+ Internet/WARP/Portable/aws_lc_fips_0_13_7_rust_wrapper.dll filter=lfs diff=lfs merge=lfs -text
270
+ Internet/WARP/Portable/Cloudflare[[:space:]]WARP.exe filter=lfs diff=lfs merge=lfs -text
271
+ Internet/WARP/Portable/warp-cli.exe filter=lfs diff=lfs merge=lfs -text
272
+ Internet/WARP/Portable/warp-dex.exe filter=lfs diff=lfs merge=lfs -text
273
+ Internet/WARP/Portable/warp-diag.exe filter=lfs diff=lfs merge=lfs -text
274
+ Internet/WARP/Portable/warp-svc.exe filter=lfs diff=lfs merge=lfs -text
275
+ Internet/WARP/Portable/warp_ipc.dll filter=lfs diff=lfs merge=lfs -text
276
+ Internet/WARP/Portable/wintun.dll filter=lfs diff=lfs merge=lfs -text
277
+ Media/VLC/Portable/axvlc.dll filter=lfs diff=lfs merge=lfs -text
278
+ Media/VLC/Portable/libvlc.dll filter=lfs diff=lfs merge=lfs -text
279
+ Media/VLC/Portable/libvlccore.dll filter=lfs diff=lfs merge=lfs -text
280
+ Media/VLC/Portable/locale/af/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
281
+ Media/VLC/Portable/locale/an/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
282
+ Media/VLC/Portable/locale/ar/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
283
+ Media/VLC/Portable/locale/as/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
284
+ Media/VLC/Portable/locale/ast/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
285
+ Media/VLC/Portable/locale/be/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
286
+ Media/VLC/Portable/locale/bg/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
287
+ Media/VLC/Portable/locale/bn/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
288
+ Media/VLC/Portable/locale/bn_IN/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
289
+ Media/VLC/Portable/locale/br/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
290
+ Media/VLC/Portable/locale/brx/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
291
+ Media/VLC/Portable/locale/bs/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
292
+ Media/VLC/Portable/locale/ca/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
293
+ Media/VLC/Portable/locale/ca@valencia/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
294
+ Media/VLC/Portable/locale/co/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
295
+ Media/VLC/Portable/locale/cs/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
296
+ Media/VLC/Portable/locale/cy/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
297
+ Media/VLC/Portable/locale/da/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
298
+ Media/VLC/Portable/locale/de/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
299
+ Media/VLC/Portable/locale/el/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
300
+ Media/VLC/Portable/locale/en_GB/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
301
+ Media/VLC/Portable/locale/es/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
302
+ Media/VLC/Portable/locale/es_MX/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
303
+ Media/VLC/Portable/locale/et/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
304
+ Media/VLC/Portable/locale/eu/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
305
+ Media/VLC/Portable/locale/fa/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
306
+ Media/VLC/Portable/locale/fi/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
307
+ Media/VLC/Portable/locale/fr/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
308
+ Media/VLC/Portable/locale/fur/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
309
+ Media/VLC/Portable/locale/fy/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
310
+ Media/VLC/Portable/locale/ga/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
311
+ Media/VLC/Portable/locale/gd/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
312
+ Media/VLC/Portable/locale/gl/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
313
+ Media/VLC/Portable/locale/gu/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
314
+ Media/VLC/Portable/locale/he/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
315
+ Media/VLC/Portable/locale/hi/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
316
+ Media/VLC/Portable/locale/hr/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
317
+ Media/VLC/Portable/locale/hu/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
318
+ Media/VLC/Portable/locale/hy/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
319
+ Media/VLC/Portable/locale/id/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
320
+ Media/VLC/Portable/locale/is/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
321
+ Media/VLC/Portable/locale/it/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
322
+ Media/VLC/Portable/locale/ja/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
323
+ Media/VLC/Portable/locale/ka/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
324
+ Media/VLC/Portable/locale/kk/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
325
+ Media/VLC/Portable/locale/km/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
326
+ Media/VLC/Portable/locale/kn/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
327
+ Media/VLC/Portable/locale/ko/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
328
+ Media/VLC/Portable/locale/ks_IN/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
329
+ Media/VLC/Portable/locale/lt/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
330
+ Media/VLC/Portable/locale/lv/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
331
+ Media/VLC/Portable/locale/mai/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
332
+ Media/VLC/Portable/locale/ml/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
333
+ Media/VLC/Portable/locale/mn/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
334
+ Media/VLC/Portable/locale/mr/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
335
+ Media/VLC/Portable/locale/ms/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
336
+ Media/VLC/Portable/locale/nb/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
337
+ Media/VLC/Portable/locale/ne/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
338
+ Media/VLC/Portable/locale/nl/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
339
+ Media/VLC/Portable/locale/nn/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
340
+ Media/VLC/Portable/locale/oc/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
341
+ Media/VLC/Portable/locale/pa/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
342
+ Media/VLC/Portable/locale/pl/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
343
+ Media/VLC/Portable/locale/pt_BR/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
344
+ Media/VLC/Portable/locale/pt_PT/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
345
+ Media/VLC/Portable/locale/ro/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
346
+ Media/VLC/Portable/locale/ru/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
347
+ Media/VLC/Portable/locale/si/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
348
+ Media/VLC/Portable/locale/sk/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
349
+ Media/VLC/Portable/locale/sl/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
350
+ Media/VLC/Portable/locale/sr/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
351
+ Media/VLC/Portable/locale/sv/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
352
+ Media/VLC/Portable/locale/ta/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
353
+ Media/VLC/Portable/locale/te/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
354
+ Media/VLC/Portable/locale/th/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
355
+ Media/VLC/Portable/locale/tr/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
356
+ Media/VLC/Portable/locale/tt/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
357
+ Media/VLC/Portable/locale/ug/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
358
+ Media/VLC/Portable/locale/uk/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
359
+ Media/VLC/Portable/locale/vi/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
360
+ Media/VLC/Portable/locale/wa/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
361
+ Media/VLC/Portable/locale/zh_CN/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
362
+ Media/VLC/Portable/locale/zh_TW/LC_MESSAGES/vlc.mo filter=lfs diff=lfs merge=lfs -text
363
+ Media/VLC/Portable/npvlc.dll filter=lfs diff=lfs merge=lfs -text
364
+ Media/VLC/Portable/plugins/access/libaccess_mms_plugin.dll filter=lfs diff=lfs merge=lfs -text
365
+ Media/VLC/Portable/plugins/access/libaccess_realrtsp_plugin.dll filter=lfs diff=lfs merge=lfs -text
366
+ Media/VLC/Portable/plugins/access/libaccess_srt_plugin.dll filter=lfs diff=lfs merge=lfs -text
367
+ Media/VLC/Portable/plugins/access/libbluray-j2se-1.4.0.jar filter=lfs diff=lfs merge=lfs -text
368
+ Media/VLC/Portable/plugins/access/libcdda_plugin.dll filter=lfs diff=lfs merge=lfs -text
369
+ Media/VLC/Portable/plugins/access/libdcp_plugin.dll filter=lfs diff=lfs merge=lfs -text
370
+ Media/VLC/Portable/plugins/access/libdshow_plugin.dll filter=lfs diff=lfs merge=lfs -text
371
+ Media/VLC/Portable/plugins/access/libdtv_plugin.dll filter=lfs diff=lfs merge=lfs -text
372
+ Media/VLC/Portable/plugins/access/libdvdnav_plugin.dll filter=lfs diff=lfs merge=lfs -text
373
+ Media/VLC/Portable/plugins/access/libdvdread_plugin.dll filter=lfs diff=lfs merge=lfs -text
374
+ Media/VLC/Portable/plugins/access/libftp_plugin.dll filter=lfs diff=lfs merge=lfs -text
375
+ Media/VLC/Portable/plugins/access/libhttps_plugin.dll filter=lfs diff=lfs merge=lfs -text
376
+ Media/VLC/Portable/plugins/access/liblibbluray_plugin.dll filter=lfs diff=lfs merge=lfs -text
377
+ Media/VLC/Portable/plugins/access/liblive555_plugin.dll filter=lfs diff=lfs merge=lfs -text
378
+ Media/VLC/Portable/plugins/access/libnfs_plugin.dll filter=lfs diff=lfs merge=lfs -text
379
+ Media/VLC/Portable/plugins/access/librist_plugin.dll filter=lfs diff=lfs merge=lfs -text
380
+ Media/VLC/Portable/plugins/access/librtp_plugin.dll filter=lfs diff=lfs merge=lfs -text
381
+ Media/VLC/Portable/plugins/access/libsftp_plugin.dll filter=lfs diff=lfs merge=lfs -text
382
+ Media/VLC/Portable/plugins/access/libvcd_plugin.dll filter=lfs diff=lfs merge=lfs -text
383
+ Media/VLC/Portable/plugins/access/libvdr_plugin.dll filter=lfs diff=lfs merge=lfs -text
384
+ Media/VLC/Portable/plugins/access/libvnc_plugin.dll filter=lfs diff=lfs merge=lfs -text
385
+ Media/VLC/Portable/plugins/access_output/libaccess_output_livehttp_plugin.dll filter=lfs diff=lfs merge=lfs -text
386
+ Media/VLC/Portable/plugins/access_output/libaccess_output_rist_plugin.dll filter=lfs diff=lfs merge=lfs -text
387
+ Media/VLC/Portable/plugins/access_output/libaccess_output_shout_plugin.dll filter=lfs diff=lfs merge=lfs -text
388
+ Media/VLC/Portable/plugins/access_output/libaccess_output_srt_plugin.dll filter=lfs diff=lfs merge=lfs -text
389
+ Media/VLC/Portable/plugins/audio_filter/libmad_plugin.dll filter=lfs diff=lfs merge=lfs -text
390
+ Media/VLC/Portable/plugins/audio_filter/libsamplerate_plugin.dll filter=lfs diff=lfs merge=lfs -text
391
+ Media/VLC/Portable/plugins/audio_filter/libspatialaudio_plugin.dll filter=lfs diff=lfs merge=lfs -text
392
+ Media/VLC/Portable/plugins/audio_filter/libspatializer_plugin.dll filter=lfs diff=lfs merge=lfs -text
393
+ Media/VLC/Portable/plugins/codec/libaom_plugin.dll filter=lfs diff=lfs merge=lfs -text
394
+ Media/VLC/Portable/plugins/codec/libaribsub_plugin.dll filter=lfs diff=lfs merge=lfs -text
395
+ Media/VLC/Portable/plugins/codec/libavcodec_plugin.dll filter=lfs diff=lfs merge=lfs -text
396
+ Media/VLC/Portable/plugins/codec/libcrystalhd_plugin.dll filter=lfs diff=lfs merge=lfs -text
397
+ Media/VLC/Portable/plugins/codec/libd3d11va_plugin.dll filter=lfs diff=lfs merge=lfs -text
398
+ Media/VLC/Portable/plugins/codec/libdav1d_plugin.dll filter=lfs diff=lfs merge=lfs -text
399
+ Media/VLC/Portable/plugins/codec/libdvbsub_plugin.dll filter=lfs diff=lfs merge=lfs -text
400
+ Media/VLC/Portable/plugins/codec/libdxva2_plugin.dll filter=lfs diff=lfs merge=lfs -text
401
+ Media/VLC/Portable/plugins/codec/libfaad_plugin.dll filter=lfs diff=lfs merge=lfs -text
402
+ Media/VLC/Portable/plugins/codec/libflac_plugin.dll filter=lfs diff=lfs merge=lfs -text
403
+ Media/VLC/Portable/plugins/codec/libfluidsynth_plugin.dll filter=lfs diff=lfs merge=lfs -text
404
+ Media/VLC/Portable/plugins/codec/libjpeg_plugin.dll filter=lfs diff=lfs merge=lfs -text
405
+ Media/VLC/Portable/plugins/codec/libkate_plugin.dll filter=lfs diff=lfs merge=lfs -text
406
+ Media/VLC/Portable/plugins/codec/liblibass_plugin.dll filter=lfs diff=lfs merge=lfs -text
407
+ Media/VLC/Portable/plugins/codec/libmft_plugin.dll filter=lfs diff=lfs merge=lfs -text
408
+ Media/VLC/Portable/plugins/codec/libmpg123_plugin.dll filter=lfs diff=lfs merge=lfs -text
409
+ Media/VLC/Portable/plugins/codec/libopus_plugin.dll filter=lfs diff=lfs merge=lfs -text
410
+ Media/VLC/Portable/plugins/codec/libpng_plugin.dll filter=lfs diff=lfs merge=lfs -text
411
+ Media/VLC/Portable/plugins/codec/libqsv_plugin.dll filter=lfs diff=lfs merge=lfs -text
412
+ Media/VLC/Portable/plugins/codec/libschroedinger_plugin.dll filter=lfs diff=lfs merge=lfs -text
413
+ Media/VLC/Portable/plugins/codec/libsdl_image_plugin.dll filter=lfs diff=lfs merge=lfs -text
414
+ Media/VLC/Portable/plugins/codec/libspeex_plugin.dll filter=lfs diff=lfs merge=lfs -text
415
+ Media/VLC/Portable/plugins/codec/libtheora_plugin.dll filter=lfs diff=lfs merge=lfs -text
416
+ Media/VLC/Portable/plugins/codec/libttml_plugin.dll filter=lfs diff=lfs merge=lfs -text
417
+ Media/VLC/Portable/plugins/codec/libtwolame_plugin.dll filter=lfs diff=lfs merge=lfs -text
418
+ Media/VLC/Portable/plugins/codec/libvorbis_plugin.dll filter=lfs diff=lfs merge=lfs -text
419
+ Media/VLC/Portable/plugins/codec/libvpx_plugin.dll filter=lfs diff=lfs merge=lfs -text
420
+ Media/VLC/Portable/plugins/codec/libwebvtt_plugin.dll filter=lfs diff=lfs merge=lfs -text
421
+ Media/VLC/Portable/plugins/codec/libx26410b_plugin.dll filter=lfs diff=lfs merge=lfs -text
422
+ Media/VLC/Portable/plugins/codec/libx264_plugin.dll filter=lfs diff=lfs merge=lfs -text
423
+ Media/VLC/Portable/plugins/codec/libx265_plugin.dll filter=lfs diff=lfs merge=lfs -text
424
+ Media/VLC/Portable/plugins/codec/libzvbi_plugin.dll filter=lfs diff=lfs merge=lfs -text
425
+ Media/VLC/Portable/plugins/d3d11/libdirect3d11_filters_plugin.dll filter=lfs diff=lfs merge=lfs -text
426
+ Media/VLC/Portable/plugins/d3d9/libdirect3d9_filters_plugin.dll filter=lfs diff=lfs merge=lfs -text
427
+ Media/VLC/Portable/plugins/demux/libadaptive_plugin.dll filter=lfs diff=lfs merge=lfs -text
428
+ Media/VLC/Portable/plugins/demux/libasf_plugin.dll filter=lfs diff=lfs merge=lfs -text
429
+ Media/VLC/Portable/plugins/demux/libavi_plugin.dll filter=lfs diff=lfs merge=lfs -text
430
+ Media/VLC/Portable/plugins/demux/libdemux_chromecast_plugin.dll filter=lfs diff=lfs merge=lfs -text
431
+ Media/VLC/Portable/plugins/demux/libflacsys_plugin.dll filter=lfs diff=lfs merge=lfs -text
432
+ Media/VLC/Portable/plugins/demux/libgme_plugin.dll filter=lfs diff=lfs merge=lfs -text
433
+ Media/VLC/Portable/plugins/demux/libh26x_plugin.dll filter=lfs diff=lfs merge=lfs -text
434
+ Media/VLC/Portable/plugins/demux/libmkv_plugin.dll filter=lfs diff=lfs merge=lfs -text
435
+ Media/VLC/Portable/plugins/demux/libmod_plugin.dll filter=lfs diff=lfs merge=lfs -text
436
+ Media/VLC/Portable/plugins/demux/libmp4_plugin.dll filter=lfs diff=lfs merge=lfs -text
437
+ Media/VLC/Portable/plugins/demux/libmpc_plugin.dll filter=lfs diff=lfs merge=lfs -text
438
+ Media/VLC/Portable/plugins/demux/libogg_plugin.dll filter=lfs diff=lfs merge=lfs -text
439
+ Media/VLC/Portable/plugins/demux/libplaylist_plugin.dll filter=lfs diff=lfs merge=lfs -text
440
+ Media/VLC/Portable/plugins/demux/libsid_plugin.dll filter=lfs diff=lfs merge=lfs -text
441
+ Media/VLC/Portable/plugins/demux/libsubtitle_plugin.dll filter=lfs diff=lfs merge=lfs -text
442
+ Media/VLC/Portable/plugins/demux/libts_plugin.dll filter=lfs diff=lfs merge=lfs -text
443
+ Media/VLC/Portable/plugins/demux/libvobsub_plugin.dll filter=lfs diff=lfs merge=lfs -text
444
+ Media/VLC/Portable/plugins/gui/libqt_plugin.dll filter=lfs diff=lfs merge=lfs -text
445
+ Media/VLC/Portable/plugins/gui/libskins2_plugin.dll filter=lfs diff=lfs merge=lfs -text
446
+ Media/VLC/Portable/plugins/lua/liblua_plugin.dll filter=lfs diff=lfs merge=lfs -text
447
+ Media/VLC/Portable/plugins/meta_engine/libtaglib_plugin.dll filter=lfs diff=lfs merge=lfs -text
448
+ Media/VLC/Portable/plugins/misc/libaddonsfsstorage_plugin.dll filter=lfs diff=lfs merge=lfs -text
449
+ Media/VLC/Portable/plugins/misc/libaddonsvorepository_plugin.dll filter=lfs diff=lfs merge=lfs -text
450
+ Media/VLC/Portable/plugins/misc/libgnutls_plugin.dll filter=lfs diff=lfs merge=lfs -text
451
+ Media/VLC/Portable/plugins/misc/libvod_rtsp_plugin.dll filter=lfs diff=lfs merge=lfs -text
452
+ Media/VLC/Portable/plugins/misc/libxml_plugin.dll filter=lfs diff=lfs merge=lfs -text
453
+ Media/VLC/Portable/plugins/mux/libmux_mp4_plugin.dll filter=lfs diff=lfs merge=lfs -text
454
+ Media/VLC/Portable/plugins/mux/libmux_ogg_plugin.dll filter=lfs diff=lfs merge=lfs -text
455
+ Media/VLC/Portable/plugins/mux/libmux_ts_plugin.dll filter=lfs diff=lfs merge=lfs -text
456
+ Media/VLC/Portable/plugins/packetizer/libpacketizer_h264_plugin.dll filter=lfs diff=lfs merge=lfs -text
457
+ Media/VLC/Portable/plugins/packetizer/libpacketizer_hevc_plugin.dll filter=lfs diff=lfs merge=lfs -text
458
+ Media/VLC/Portable/plugins/services_discovery/libmicrodns_plugin.dll filter=lfs diff=lfs merge=lfs -text
459
+ Media/VLC/Portable/plugins/services_discovery/libsap_plugin.dll filter=lfs diff=lfs merge=lfs -text
460
+ Media/VLC/Portable/plugins/services_discovery/libupnp_plugin.dll filter=lfs diff=lfs merge=lfs -text
461
+ Media/VLC/Portable/plugins/spu/libremoteosd_plugin.dll filter=lfs diff=lfs merge=lfs -text
462
+ Media/VLC/Portable/plugins/stream_extractor/libarchive_plugin.dll filter=lfs diff=lfs merge=lfs -text
463
+ Media/VLC/Portable/plugins/stream_out/libstream_out_chromaprint_plugin.dll filter=lfs diff=lfs merge=lfs -text
464
+ Media/VLC/Portable/plugins/stream_out/libstream_out_chromecast_plugin.dll filter=lfs diff=lfs merge=lfs -text
465
+ Media/VLC/Portable/plugins/stream_out/libstream_out_rtp_plugin.dll filter=lfs diff=lfs merge=lfs -text
466
+ Media/VLC/Portable/plugins/text_renderer/libfreetype_plugin.dll filter=lfs diff=lfs merge=lfs -text
467
+ Media/VLC/Portable/plugins/video_chroma/libi420_10_p010_plugin.dll filter=lfs diff=lfs merge=lfs -text
468
+ Media/VLC/Portable/plugins/video_chroma/libi420_nv12_plugin.dll filter=lfs diff=lfs merge=lfs -text
469
+ Media/VLC/Portable/plugins/video_chroma/libi420_rgb_sse2_plugin.dll filter=lfs diff=lfs merge=lfs -text
470
+ Media/VLC/Portable/plugins/video_chroma/libswscale_plugin.dll filter=lfs diff=lfs merge=lfs -text
471
+ Media/VLC/Portable/plugins/video_filter/libblend_plugin.dll filter=lfs diff=lfs merge=lfs -text
472
+ Media/VLC/Portable/plugins/video_filter/libdeinterlace_plugin.dll filter=lfs diff=lfs merge=lfs -text
473
+ Media/VLC/Portable/plugins/video_filter/libpostproc_plugin.dll filter=lfs diff=lfs merge=lfs -text
474
+ Media/VLC/Portable/plugins/video_filter/libpuzzle_plugin.dll filter=lfs diff=lfs merge=lfs -text
475
+ Media/VLC/Portable/plugins/video_output/libcaca_plugin.dll filter=lfs diff=lfs merge=lfs -text
476
+ Media/VLC/Portable/plugins/video_output/libdirect3d11_plugin.dll filter=lfs diff=lfs merge=lfs -text
477
+ Media/VLC/Portable/plugins/video_output/libdirect3d9_plugin.dll filter=lfs diff=lfs merge=lfs -text
478
+ Media/VLC/Portable/plugins/video_output/libdirectdraw_plugin.dll filter=lfs diff=lfs merge=lfs -text
479
+ Media/VLC/Portable/plugins/video_output/libgl_plugin.dll filter=lfs diff=lfs merge=lfs -text
480
+ Media/VLC/Portable/plugins/video_output/libglinterop_dxva2_plugin.dll filter=lfs diff=lfs merge=lfs -text
481
+ Media/VLC/Portable/plugins/video_output/libglwin32_plugin.dll filter=lfs diff=lfs merge=lfs -text
482
+ Media/VLC/Portable/plugins/video_output/libwgl_plugin.dll filter=lfs diff=lfs merge=lfs -text
483
+ Media/VLC/Portable/plugins/video_output/libwingdi_plugin.dll filter=lfs diff=lfs merge=lfs -text
484
+ Media/VLC/Portable/plugins/visualization/libgoom_plugin.dll filter=lfs diff=lfs merge=lfs -text
485
+ Media/VLC/Portable/plugins/visualization/libprojectm_plugin.dll filter=lfs diff=lfs merge=lfs -text
486
+ Media/VLC/Portable/skins/default.vlt filter=lfs diff=lfs merge=lfs -text
487
+ Media/VLC/Portable/skins/fonts/FreeSans.ttf filter=lfs diff=lfs merge=lfs -text
488
+ Media/VLC/Portable/vlc-cache-gen.exe filter=lfs diff=lfs merge=lfs -text
489
+ Media/VLC/Portable/vlc.exe filter=lfs diff=lfs merge=lfs -text
490
+ System_Utils/Fences/Stardock[[:space:]]Fences[[:space:]]6.46[[:space:]](x64)[[:space:]]Multilingual/AMPED/stardock.fences.3.0.5.x64-patch.exe filter=lfs diff=lfs merge=lfs -text
491
+ System_Utils/Fences/Stardock[[:space:]]Fences[[:space:]]6.46[[:space:]](x64)[[:space:]]Multilingual/Fences6-sd-setup.exe filter=lfs diff=lfs merge=lfs -text
492
+ System_Utils/Groupy/Groupy2_setup.exe filter=lfs diff=lfs merge=lfs -text
493
+ System_Utils/Groupy/Patch/Jasi2169[[:space:]]NFO[[:space:]]Viewer.exe filter=lfs diff=lfs merge=lfs -text
494
+ System_Utils/Groupy/Patch/Stardock[[:space:]]Multi[[:space:]]Products[[:space:]]Patch[[:space:]]v2.0.exe filter=lfs diff=lfs merge=lfs -text
495
+ System_Utils/Groupy/Stardock[[:space:]]Groupy[[:space:]]2.31[[:space:]]Multilingual/Groupy2_setup.exe filter=lfs diff=lfs merge=lfs -text
496
+ System_Utils/Runtimes/DirectX_Jun2010_Redist.exe filter=lfs diff=lfs merge=lfs -text
497
+ System_Utils/Runtimes/VisualCppRedist_AIO_x86_x64.exe filter=lfs diff=lfs merge=lfs -text
498
+ System_Utils/WinRAR/Portable/7zxa.dll filter=lfs diff=lfs merge=lfs -text
499
+ System_Utils/WinRAR/Portable/Default.SFX filter=lfs diff=lfs merge=lfs -text
500
+ System_Utils/WinRAR/Portable/Default32.SFX filter=lfs diff=lfs merge=lfs -text
501
+ System_Utils/WinRAR/Portable/Keygen/WinRAR.v5.01_KEYGEN-FFF.exe filter=lfs diff=lfs merge=lfs -text
502
+ System_Utils/WinRAR/Portable/Rar.exe filter=lfs diff=lfs merge=lfs -text
503
+ System_Utils/WinRAR/Portable/RarExt.dll filter=lfs diff=lfs merge=lfs -text
504
+ System_Utils/WinRAR/Portable/RarExt32.dll filter=lfs diff=lfs merge=lfs -text
505
+ System_Utils/WinRAR/Portable/RarExtInstaller.exe filter=lfs diff=lfs merge=lfs -text
506
+ System_Utils/WinRAR/Portable/Uninstall.exe filter=lfs diff=lfs merge=lfs -text
507
+ System_Utils/WinRAR/Portable/UnRAR.exe filter=lfs diff=lfs merge=lfs -text
508
+ System_Utils/WinRAR/Portable/WinCon.SFX filter=lfs diff=lfs merge=lfs -text
509
+ System_Utils/WinRAR/Portable/WinCon32.SFX filter=lfs diff=lfs merge=lfs -text
510
+ System_Utils/WinRAR/Portable/WinRAR.chm filter=lfs diff=lfs merge=lfs -text
511
+ System_Utils/WinRAR/Portable/WinRAR.exe filter=lfs diff=lfs merge=lfs -text
512
+ System_Utils/WinRAR/Portable/Zip.SFX filter=lfs diff=lfs merge=lfs -text
513
+ System_Utils/WinRAR/Portable/Zip32.SFX filter=lfs diff=lfs merge=lfs -text
1_Nvidia_Intel_Drivers.html ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Post-Install Superstation Dashboard</title>
7
+ <style>
8
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');
9
+
10
+ :root {
11
+ --bg-color: #0f172a;
12
+ --glass-bg: rgba(30, 41, 59, 0.7);
13
+ --border-color: rgba(255, 255, 255, 0.1);
14
+ --primary-glow: #38bdf8;
15
+ --nvidia-glow: #22c55e;
16
+ --intel-glow: #3b82f6;
17
+ --text-main: #f8fafc;
18
+ --text-muted: #94a3b8;
19
+ }
20
+
21
+ body {
22
+ margin: 0;
23
+ padding: 0;
24
+ font-family: 'Inter', sans-serif;
25
+ background: var(--bg-color);
26
+ background-image:
27
+ radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.15), transparent 25%),
28
+ radial-gradient(circle at 85% 30%, rgba(34, 197, 94, 0.15), transparent 25%);
29
+ color: var(--text-main);
30
+ min-height: 100vh;
31
+ display: flex;
32
+ justify-content: center;
33
+ align-items: center;
34
+ }
35
+
36
+ .container {
37
+ max-width: 800px;
38
+ width: 90%;
39
+ background: var(--glass-bg);
40
+ backdrop-filter: blur(12px);
41
+ -webkit-backdrop-filter: blur(12px);
42
+ border: 1px solid var(--border-color);
43
+ border-radius: 24px;
44
+ padding: 40px;
45
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
46
+ animation: fadeIn 0.8s ease-out;
47
+ }
48
+
49
+ @keyframes fadeIn {
50
+ from { opacity: 0; transform: translateY(20px); }
51
+ to { opacity: 1; transform: translateY(0); }
52
+ }
53
+
54
+ .header {
55
+ text-align: center;
56
+ margin-bottom: 40px;
57
+ }
58
+
59
+ h1 {
60
+ font-size: 2.5rem;
61
+ margin: 0;
62
+ background: linear-gradient(to right, #38bdf8, #818cf8);
63
+ -webkit-background-clip: text;
64
+ -webkit-text-fill-color: transparent;
65
+ font-weight: 800;
66
+ }
67
+
68
+ .subtitle {
69
+ color: var(--text-muted);
70
+ margin-top: 10px;
71
+ font-size: 1.1rem;
72
+ }
73
+
74
+ .cards {
75
+ display: grid;
76
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
77
+ gap: 20px;
78
+ margin-bottom: 30px;
79
+ }
80
+
81
+ .card {
82
+ background: rgba(255, 255, 255, 0.03);
83
+ border: 1px solid var(--border-color);
84
+ border-radius: 16px;
85
+ padding: 24px;
86
+ transition: all 0.3s ease;
87
+ position: relative;
88
+ overflow: hidden;
89
+ }
90
+
91
+ .card:hover {
92
+ transform: translateY(-5px);
93
+ background: rgba(255, 255, 255, 0.05);
94
+ }
95
+
96
+ .card.nvidia:hover {
97
+ border-color: var(--nvidia-glow);
98
+ box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
99
+ }
100
+
101
+ .card.intel:hover {
102
+ border-color: var(--intel-glow);
103
+ box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
104
+ }
105
+
106
+ .card h2 {
107
+ margin-top: 0;
108
+ font-size: 1.5rem;
109
+ display: flex;
110
+ align-items: center;
111
+ gap: 10px;
112
+ }
113
+
114
+ .card p {
115
+ color: var(--text-muted);
116
+ line-height: 1.6;
117
+ margin-bottom: 24px;
118
+ }
119
+
120
+ .btn {
121
+ display: inline-block;
122
+ text-decoration: none;
123
+ color: white;
124
+ font-weight: 600;
125
+ padding: 12px 24px;
126
+ border-radius: 8px;
127
+ transition: all 0.2s ease;
128
+ text-align: center;
129
+ width: calc(100% - 48px);
130
+ }
131
+
132
+ .btn-nvidia {
133
+ background: linear-gradient(135deg, #16a34a, #22c55e);
134
+ box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
135
+ }
136
+
137
+ .btn-nvidia:hover {
138
+ background: linear-gradient(135deg, #15803d, #16a34a);
139
+ box-shadow: 0 6px 20px rgba(34, 197, 94, 0.6);
140
+ }
141
+
142
+ .btn-intel {
143
+ background: linear-gradient(135deg, #2563eb, #3b82f6);
144
+ box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
145
+ }
146
+
147
+ .btn-intel:hover {
148
+ background: linear-gradient(135deg, #1d4ed8, #2563eb);
149
+ box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
150
+ }
151
+
152
+ .footer-note {
153
+ background: rgba(255, 255, 255, 0.02);
154
+ border-radius: 12px;
155
+ padding: 20px;
156
+ border: 1px dashed var(--border-color);
157
+ color: var(--text-muted);
158
+ }
159
+
160
+ .footer-note strong {
161
+ color: var(--primary-glow);
162
+ }
163
+
164
+ .footer-note ul {
165
+ margin-top: 10px;
166
+ padding-left: 20px;
167
+ }
168
+ .footer-note li {
169
+ margin-bottom: 8px;
170
+ }
171
+ </style>
172
+ </head>
173
+ <body>
174
+
175
+ <div class="container">
176
+ <div class="header">
177
+ <h1>🚀 Post-Install Command Center</h1>
178
+ <div class="subtitle">Fresh Windows? Install these hardware-level drivers before using your portable apps.</div>
179
+ </div>
180
+
181
+ <div class="cards">
182
+ <!-- NVIDIA Card -->
183
+ <div class="card nvidia">
184
+ <h2>🟢 NVIDIA Drivers</h2>
185
+ <p>Essential for gaming, overlays, and GPU acceleration. Click below to download the latest Game Ready drivers or the new NVIDIA App directly from the official source.</p>
186
+ <a href="https://www.nvidia.com/download/index.aspx" target="_blank" class="btn btn-nvidia">Download NVIDIA Drivers</a>
187
+ </div>
188
+
189
+ <!-- Intel Card -->
190
+ <div class="card intel">
191
+ <h2>🔵 Intel Assistant</h2>
192
+ <p>Required to keep your motherboard chipsets, Wi-Fi, and CPU drivers up to date. This service scans your PC automatically.</p>
193
+ <a href="https://www.intel.com/content/www/us/en/support/intel-driver-support-assistant.html" target="_blank" class="btn btn-intel">Download Intel Assistant</a>
194
+ </div>
195
+ </div>
196
+
197
+ <div class="footer-note">
198
+ <strong>🛠️ Next Steps Before Playing:</strong>
199
+ <ul>
200
+ <li>Run <code>VC_redist.x64.exe</code> and <code>VC_redist.x86.exe</code> from your <b>Drivers_and_Runtimes</b> folder.</li>
201
+ <li>Run <code>dxwebsetup.exe</code> to update DirectX.</li>
202
+ <li>Once done, your <b>Portable Apps</b> (WARP, VLC, Vortex, etc.) are 100% ready to use!</li>
203
+ </ul>
204
+ </div>
205
+ </div>
206
+
207
+ </body>
208
+ </html>
Browsers/ChromeSetup.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:932b3f3888595ddc6961ef256b587bb315dddb596545416171d8f8d715daa9af
3
+ size 11698616
Drivers_and_Runtimes/Rufus/rufus.log ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Rufus x64 v4.4.2103 (Portable)
2
+ Windows version: Windows 11 Home x64 (Build 26200.8457)
3
+ Syslinux versions: 4.07/2013-07-25, 6.04/pre1
4
+ Grub versions: 0.4.6a, 2.06
5
+ System locale ID: 0x0409 (en-US)
6
+ Will use default UI locale 0x0409
7
+ SetLGP: Successfully set NoDriveTypeAutorun policy to 0x0000009E
8
+ Localization set to 'en-US'
9
+ Found 517 officially revoked UEFI bootloaders from embedded list
10
+ Found 0 additional revoked UEFI bootloaders from this system's SKUSiPolicy.p7b
11
+ 0 devices found
Drivers_and_Runtimes/VC_redist.x64.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc0ff0eb1dc3f5188ae6300faef32bf5beeba4bdd6e8e445a9184072096b713b
3
+ size 25635768
Drivers_and_Runtimes/VC_redist.x86.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c09f2611660441084ce0df425c51c11e147e6447963c3690f97e0b25c55ed64
3
+ size 13953392
Drivers_and_Runtimes/dxwebsetup.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cf71d098c608c56e07f4655855a886c3102553f648df88458df616b26fd612f
3
+ size 295320
Drivers_and_Runtimes/rufus-portable.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42cdb16f6dd64c4fec30c7a71960fe4d0015862c37e7b02c8dba5c0d68384c74
3
+ size 1432648
Drivers_and_Runtimes/rufus.ini ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ Locale = en-US
2
+ CommCheck64 = 19720968
3
+ UpdateCheckInterval = -1
Gaming/CheatEngine/Portable/App/AppInfo/appicon.ico ADDED

Git LFS Details

  • SHA256: ea53651c29366816b7b2297b4bbeded3201aedec4b9e6eeefa853949cf8076f4
  • Pointer size: 131 Bytes
  • Size of remote file: 384 kB
Gaming/CheatEngine/Portable/App/AppInfo/appicon_128.png ADDED

Git LFS Details

  • SHA256: 7a11e86c9dac275651d9f7a38f64e9729839f5dd5a493a4407978c8c9825154c
  • Pointer size: 130 Bytes
  • Size of remote file: 15 kB
Gaming/CheatEngine/Portable/App/AppInfo/appicon_16.png ADDED

Git LFS Details

  • SHA256: 82d4a2c228b0e9eb875dfe1ba9db2a44a42ed481facf271dfa755e9d816173e0
  • Pointer size: 128 Bytes
  • Size of remote file: 810 Bytes
Gaming/CheatEngine/Portable/App/AppInfo/appicon_256.png ADDED

Git LFS Details

  • SHA256: 4c595d0e943d7f9265d06c6df197f30c1ff99031ea0cfd70a64573aa9b4400ae
  • Pointer size: 130 Bytes
  • Size of remote file: 42.1 kB
Gaming/CheatEngine/Portable/App/AppInfo/appicon_32.png ADDED

Git LFS Details

  • SHA256: 997d201f4fd51bb2c7ddb07c6be5d45dbf3e41b51753137c06d30e2be7ffc710
  • Pointer size: 129 Bytes
  • Size of remote file: 2.37 kB
Gaming/CheatEngine/Portable/App/AppInfo/appicon_75.png ADDED

Git LFS Details

  • SHA256: 6c245b1ff1c46ad5676aee41ea51a700617e04850739f49971dc038aa98eeef8
  • Pointer size: 129 Bytes
  • Size of remote file: 7.28 kB
Gaming/CheatEngine/Portable/App/AppInfo/appinfo.ini ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [Details]
2
+ Name=Cheat Engine Portable
3
+ AppID=CheatEnginePortable
4
+ Publisher=Dark Byte
5
+ Homepage=https://www.cheatengine.org/
6
+ Category=Games
7
+ Description=Cheat Engine is an open-source tool whose sole purpose is to help you use tricks and cheats on your favorite video games.
8
+ Language=Multilingual
9
+
10
+ [Version]
11
+ PackageVersion=7.6.6.9892
12
+ DisplayVersion=7.6.6
13
+
14
+ [Control]
15
+ Icons=1
16
+ Start=CheatEnginePortable.exe
Gaming/CheatEngine/Portable/App/ProgramFiles/CSCompiler.dll ADDED
Binary file (33.7 kB). View file
 
Gaming/CheatEngine/Portable/App/ProgramFiles/Cheat Engine.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5dd11f2b6321f2485cd1ade053930bbff4e773bb32937b014dc05b8e10b59dbd
3
+ size 407456
Gaming/CheatEngine/Portable/App/ProgramFiles/CheatEngine.chm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d52f9d59211f8906ace16525721b1400343bdf720f062cf111d84089f129009
3
+ size 306758
Gaming/CheatEngine/Portable/App/ProgramFiles/DotNetDataCollector32.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f77e9c3c437fb60d7c126d6bc0ebe382a9195404eccb974a4cff99d090157244
3
+ size 196456
Gaming/CheatEngine/Portable/App/ProgramFiles/DotNetDataCollector64.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10bd8e3d071d9e9ac8937eef52c3a765d34534b0de58e01c3fe08595de0ff1bb
3
+ size 225128
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/AI128x128.png ADDED

Git LFS Details

  • SHA256: 382adb984e00cbfbcf2432e04cc1c95a2e4e9fce4374639ca4f6a64346e988d2
  • Pointer size: 130 Bytes
  • Size of remote file: 27.4 kB
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/AIDialog.LFM ADDED
@@ -0,0 +1,766 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ object frmAIDialog: TCEForm
2
+ Left = 698
3
+ Height = 478
4
+ Top = 294
5
+ Width = 1232
6
+ ActiveControl = mInput
7
+ Caption = 'AI Dialog'
8
+ ClientHeight = 478
9
+ ClientWidth = 1232
10
+ DesignTimePPI = 144
11
+ DoubleBuffered = True
12
+ ParentDoubleBuffered = False
13
+ LCLVersion = '4.2.0.0'
14
+ OnCloseQuery = frmAIDialog_FormCloseQuery
15
+ object gbAPIKey: TCEGroupBox
16
+ AnchorSideLeft.Control = Owner
17
+ AnchorSideTop.Control = Owner
18
+ AnchorSideRight.Control = Owner
19
+ AnchorSideRight.Side = asrBottom
20
+ Left = 0
21
+ Height = 93
22
+ Top = 0
23
+ Width = 1232
24
+ Anchors = [akTop, akLeft, akRight]
25
+ AutoSize = True
26
+ Caption = 'Your AI Access'
27
+ ClientHeight = 63
28
+ ClientWidth = 1228
29
+ ParentBackground = False
30
+ ParentFont = False
31
+ TabOrder = 2
32
+ object edtAPIKEY: TCEEdit
33
+ AnchorSideLeft.Control = gbAPIKey
34
+ AnchorSideTop.Control = rbAIAccessPublic
35
+ AnchorSideTop.Side = asrBottom
36
+ AnchorSideRight.Control = btnObtainKey
37
+ Left = 2
38
+ Height = 33
39
+ Top = 29
40
+ Width = 1109
41
+ Anchors = [akTop, akLeft, akRight]
42
+ BorderSpacing.Left = 2
43
+ BorderSpacing.Right = 4
44
+ EchoMode = emPassword
45
+ ParentFont = False
46
+ PasswordChar = '*'
47
+ TabOrder = 3
48
+ TextHint = '<Enter API key here>'
49
+ OnChange = frmAIDialog_edtAPIKEYChange
50
+ SelStart = 0
51
+ SelLength = 0
52
+ TextHintFontColor = clDefault
53
+ TextHintFontStyle = fsBold
54
+ end
55
+ object btnObtainKey: TCEButton
56
+ AnchorSideTop.Control = edtAPIKEY
57
+ AnchorSideTop.Side = asrCenter
58
+ AnchorSideRight.Control = gbAPIKey
59
+ AnchorSideRight.Side = asrBottom
60
+ Left = 1115
61
+ Height = 35
62
+ Top = 28
63
+ Width = 113
64
+ Anchors = [akTop, akRight]
65
+ AutoSize = True
66
+ Caption = 'Obtain Key'
67
+ ParentFont = False
68
+ TabOrder = 4
69
+ OnClick = frmAIDialog_btnObtainKeyClick
70
+ end
71
+ object rbAIAccessPublic: TRadioButton
72
+ AnchorSideLeft.Control = gbAPIKey
73
+ AnchorSideTop.Control = gbAPIKey
74
+ Left = 0
75
+ Height = 29
76
+ Hint = 'The public CE API is just to give you a taste of the AI capabilities on the rare occasion the limit hasn''t been reached. The limit it shared between ALL public api users. The chances of getting to it before the limit is reached are slim'#13#10#13#10'uses gemini-2.5-flash'
77
+ Top = 0
78
+ Width = 283
79
+ Caption = 'Public CE API (Extremely Limited)'
80
+ Checked = True
81
+ Font.Color = clWindowText
82
+ ParentColor = False
83
+ ParentFont = False
84
+ ParentShowHint = False
85
+ ShowHint = True
86
+ TabOrder = 0
87
+ TabStop = True
88
+ end
89
+ object rbAIAccessPatreon: TRadioButton
90
+ AnchorSideLeft.Control = rbAIAccessPublic
91
+ AnchorSideLeft.Side = asrBottom
92
+ Left = 291
93
+ Height = 29
94
+ Hint = 'The Patreon CE API is similar to the public API, but has a slightly higher daily limit (still shared between all patreon members) You sometimes might even get a chance to use it.'#13#10#13#10'uses gemini-2.5-flash'
95
+ Top = 0
96
+ Width = 216
97
+ BorderSpacing.Left = 8
98
+ Caption = 'Patreon CE API (Limited)'
99
+ ParentColor = False
100
+ ParentShowHint = False
101
+ ShowHint = True
102
+ TabOrder = 1
103
+ end
104
+ object rbAIAccessPrivate: TRadioButton
105
+ AnchorSideLeft.Control = rbAIAccessPatreon
106
+ AnchorSideLeft.Side = asrBottom
107
+ AnchorSideTop.Control = gbAPIKey
108
+ Left = 515
109
+ Height = 29
110
+ Hint = 'The recommended way to use the AI tools. Even your free access key would give you more access than the public key as you don''t have to share with other users. And if you do need more feel free to change your account to a paid account. '#13#10#13#10'You can pick whichever compatible LLM model you wish'
111
+ Top = 0
112
+ Width = 316
113
+ BorderSpacing.Left = 8
114
+ Caption = 'Personal Google AI Key (Best option)'
115
+ ParentColor = False
116
+ ParentShowHint = False
117
+ ShowHint = True
118
+ TabOrder = 2
119
+ end
120
+ end
121
+ object gbModelSelection: TCEGroupBox
122
+ AnchorSideTop.Control = gbAPIKey
123
+ AnchorSideTop.Side = asrBottom
124
+ AnchorSideRight.Control = Owner
125
+ AnchorSideRight.Side = asrBottom
126
+ Left = 964
127
+ Height = 81
128
+ Top = 93
129
+ Width = 268
130
+ Anchors = [akTop, akRight]
131
+ AutoSize = True
132
+ BorderSpacing.Bottom = -2
133
+ Caption = 'Current/Default Model'
134
+ ClientHeight = 51
135
+ ClientWidth = 264
136
+ ParentBackground = False
137
+ ParentFont = False
138
+ TabOrder = 3
139
+ object cbModelSelection: TCEComboBox
140
+ AnchorSideLeft.Control = gbModelSelection
141
+ AnchorSideLeft.Side = asrCenter
142
+ AnchorSideTop.Control = gbModelSelection
143
+ AnchorSideRight.Control = gbModelSelection
144
+ AnchorSideRight.Side = asrBottom
145
+ Left = 4
146
+ Height = 33
147
+ Top = 6
148
+ Width = 256
149
+ Anchors = [akTop, akRight]
150
+ BorderSpacing.Left = 4
151
+ BorderSpacing.Top = 6
152
+ BorderSpacing.Right = 4
153
+ BorderSpacing.Bottom = 12
154
+ ItemHeight = 25
155
+ ItemIndex = 0
156
+ Items.Strings = (
157
+ 'gemini-2.5-flash'
158
+ '<loading>'
159
+ )
160
+ ParentFont = False
161
+ TabOrder = 0
162
+ Style = csDropDownList
163
+ Text = 'gemini-2.5-flash'
164
+ end
165
+ end
166
+ object gbOptions: TCEGroupBox
167
+ AnchorSideLeft.Control = gbModelSelection
168
+ AnchorSideTop.Control = gbModelSelection
169
+ AnchorSideTop.Side = asrBottom
170
+ AnchorSideRight.Control = gbAPIKey
171
+ AnchorSideRight.Side = asrBottom
172
+ AnchorSideBottom.Control = Owner
173
+ AnchorSideBottom.Side = asrBottom
174
+ Left = 694
175
+ Height = 414
176
+ Top = 148
177
+ Width = 358
178
+ Anchors = [akTop, akLeft, akRight, akBottom]
179
+ BorderSpacing.Top = 2
180
+ Caption = 'Options'
181
+ ClientHeight = 384
182
+ ClientWidth = 354
183
+ ParentBackground = False
184
+ TabOrder = 4
185
+ Visible = False
186
+ object CECheckbox1: TCECheckBox
187
+ Left = 12
188
+ Height = 29
189
+ Top = 20
190
+ Width = 132
191
+ Caption = 'CECheckbox1'
192
+ TabOrder = 0
193
+ end
194
+ object CECheckbox2: TCECheckBox
195
+ Left = 6
196
+ Height = 29
197
+ Top = 51
198
+ Width = 132
199
+ Caption = 'CECheckbox2'
200
+ TabOrder = 1
201
+ end
202
+ end
203
+ object btnSend: TCEButton
204
+ AnchorSideLeft.Control = gbOptions
205
+ AnchorSideRight.Side = asrBottom
206
+ AnchorSideBottom.Side = asrBottom
207
+ Left = 967
208
+ Height = 35
209
+ Top = 439
210
+ Width = 66
211
+ Anchors = [akLeft, akBottom]
212
+ AutoSize = True
213
+ Font.Size=14
214
+ BorderSpacing.Left = 3
215
+ BorderSpacing.Bottom = 2
216
+ Caption = 'Send'
217
+ TabOrder = 1
218
+ OnClick = frmAIDialog_btnSendClick
219
+ end
220
+ object CEPanel1: TCEPanel
221
+ AnchorSideLeft.Control = Owner
222
+ AnchorSideTop.Control = gbAPIKey
223
+ AnchorSideTop.Side = asrBottom
224
+ AnchorSideRight.Control = gbModelSelection
225
+ AnchorSideBottom.Control = Owner
226
+ AnchorSideBottom.Side = asrBottom
227
+ Left = 0
228
+ Height = 385
229
+ Top = 93
230
+ Width = 964
231
+ Anchors = [akTop, akLeft, akRight, akBottom]
232
+ ClientHeight = 385
233
+ ClientWidth = 964
234
+ ParentBackground = False
235
+ TabOrder = 0
236
+ inline mInput: TSynEdit
237
+ AnchorSideTop.Side = asrBottom
238
+ Left = 3
239
+ Height = 137
240
+ Top = 245
241
+ Width = 958
242
+ Align = alBottom
243
+ BorderSpacing.Left = 2
244
+ BorderSpacing.Right = 2
245
+ BorderSpacing.Bottom = 2
246
+ Color = clWindow
247
+ ParentColor = False
248
+ TabOrder = 0
249
+ Font.Name='Courier New'
250
+ Font.Size=10
251
+ Font.Quality=fqCleartypeNatural
252
+ BorderStyle = bsNone
253
+ Gutter.Visible = False
254
+ Gutter.Width = 95
255
+ Gutter.MouseActions = <>
256
+ RightGutter.Width = 0
257
+ RightGutter.MouseActions = <>
258
+ Keystrokes = <>
259
+ MouseActions = <>
260
+ MouseTextActions = <>
261
+ MouseSelActions = <>
262
+ Options = [eoAutoIndent, eoBracketHighlight, eoGroupUndo, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces]
263
+ VisibleSpecialChars = [vscSpace, vscTabAtLast]
264
+ RightEdge = -1
265
+ SelectedColor.BackPriority = 50
266
+ SelectedColor.ForePriority = 50
267
+ SelectedColor.FramePriority = 50
268
+ SelectedColor.BoldPriority = 50
269
+ SelectedColor.ItalicPriority = 50
270
+ SelectedColor.UnderlinePriority = 50
271
+ SelectedColor.StrikeOutPriority = 50
272
+ BracketHighlightStyle = sbhsBoth
273
+ BracketMatchColor.Background = clNone
274
+ BracketMatchColor.Foreground = clNone
275
+ BracketMatchColor.Style = [fsBold]
276
+ FoldedCodeColor.Background = clNone
277
+ FoldedCodeColor.Foreground = clGray
278
+ FoldedCodeColor.FrameColor = clGray
279
+ MouseLinkColor.Background = clNone
280
+ MouseLinkColor.Foreground = clBlue
281
+ LineHighlightColor.Background = clNone
282
+ LineHighlightColor.Foreground = clNone
283
+ Keystrokes = <
284
+ item
285
+ Command = ecUp
286
+ ShortCut = 38
287
+ end
288
+ item
289
+ Command = ecSelUp
290
+ ShortCut = 8230
291
+ end
292
+ item
293
+ Command = ecScrollUp
294
+ ShortCut = 16422
295
+ end
296
+ item
297
+ Command = ecDown
298
+ ShortCut = 40
299
+ end
300
+ item
301
+ Command = ecSelDown
302
+ ShortCut = 8232
303
+ end
304
+ item
305
+ Command = ecScrollDown
306
+ ShortCut = 16424
307
+ end
308
+ item
309
+ Command = ecLeft
310
+ ShortCut = 37
311
+ end
312
+ item
313
+ Command = ecSelLeft
314
+ ShortCut = 8229
315
+ end
316
+ item
317
+ Command = ecWordLeft
318
+ ShortCut = 16421
319
+ end
320
+ item
321
+ Command = ecSelWordLeft
322
+ ShortCut = 24613
323
+ end
324
+ item
325
+ Command = ecRight
326
+ ShortCut = 39
327
+ end
328
+ item
329
+ Command = ecSelRight
330
+ ShortCut = 8231
331
+ end
332
+ item
333
+ Command = ecWordRight
334
+ ShortCut = 16423
335
+ end
336
+ item
337
+ Command = ecSelWordRight
338
+ ShortCut = 24615
339
+ end
340
+ item
341
+ Command = ecPageDown
342
+ ShortCut = 34
343
+ end
344
+ item
345
+ Command = ecSelPageDown
346
+ ShortCut = 8226
347
+ end
348
+ item
349
+ Command = ecPageBottom
350
+ ShortCut = 16418
351
+ end
352
+ item
353
+ Command = ecSelPageBottom
354
+ ShortCut = 24610
355
+ end
356
+ item
357
+ Command = ecPageUp
358
+ ShortCut = 33
359
+ end
360
+ item
361
+ Command = ecSelPageUp
362
+ ShortCut = 8225
363
+ end
364
+ item
365
+ Command = ecPageTop
366
+ ShortCut = 16417
367
+ end
368
+ item
369
+ Command = ecSelPageTop
370
+ ShortCut = 24609
371
+ end
372
+ item
373
+ Command = ecLineStart
374
+ ShortCut = 36
375
+ end
376
+ item
377
+ Command = ecSelLineStart
378
+ ShortCut = 8228
379
+ end
380
+ item
381
+ Command = ecEditorTop
382
+ ShortCut = 16420
383
+ end
384
+ item
385
+ Command = ecSelEditorTop
386
+ ShortCut = 24612
387
+ end
388
+ item
389
+ Command = ecLineEnd
390
+ ShortCut = 35
391
+ end
392
+ item
393
+ Command = ecSelLineEnd
394
+ ShortCut = 8227
395
+ end
396
+ item
397
+ Command = ecEditorBottom
398
+ ShortCut = 16419
399
+ end
400
+ item
401
+ Command = ecSelEditorBottom
402
+ ShortCut = 24611
403
+ end
404
+ item
405
+ Command = ecToggleMode
406
+ ShortCut = 45
407
+ end
408
+ item
409
+ Command = ecCopy
410
+ ShortCut = 16429
411
+ end
412
+ item
413
+ Command = ecPaste
414
+ ShortCut = 8237
415
+ end
416
+ item
417
+ Command = ecDeleteChar
418
+ ShortCut = 46
419
+ end
420
+ item
421
+ Command = ecCut
422
+ ShortCut = 8238
423
+ end
424
+ item
425
+ Command = ecDeleteLastChar
426
+ ShortCut = 8
427
+ end
428
+ item
429
+ Command = ecDeleteLastChar
430
+ ShortCut = 8200
431
+ end
432
+ item
433
+ Command = ecDeleteLastWord
434
+ ShortCut = 16392
435
+ end
436
+ item
437
+ Command = ecUndo
438
+ ShortCut = 32776
439
+ end
440
+ item
441
+ Command = ecRedo
442
+ ShortCut = 40968
443
+ end
444
+ item
445
+ Command = ecLineBreak
446
+ ShortCut = 13
447
+ end
448
+ item
449
+ Command = ecSelectAll
450
+ ShortCut = 16449
451
+ end
452
+ item
453
+ Command = ecCopy
454
+ ShortCut = 16451
455
+ end
456
+ item
457
+ Command = ecBlockIndent
458
+ ShortCut = 16457
459
+ end
460
+ item
461
+ Command = ecLineBreak
462
+ ShortCut = 16461
463
+ end
464
+ item
465
+ Command = ecInsertLine
466
+ ShortCut = 16462
467
+ end
468
+ item
469
+ Command = ecDeleteWord
470
+ ShortCut = 16468
471
+ end
472
+ item
473
+ Command = ecBlockUnindent
474
+ ShortCut = 16469
475
+ end
476
+ item
477
+ Command = ecPaste
478
+ ShortCut = 16470
479
+ end
480
+ item
481
+ Command = ecCut
482
+ ShortCut = 16472
483
+ end
484
+ item
485
+ Command = ecDeleteLine
486
+ ShortCut = 16473
487
+ end
488
+ item
489
+ Command = ecDeleteEOL
490
+ ShortCut = 24665
491
+ end
492
+ item
493
+ Command = ecUndo
494
+ ShortCut = 16474
495
+ end
496
+ item
497
+ Command = ecRedo
498
+ ShortCut = 24666
499
+ end
500
+ item
501
+ Command = ecGotoMarker0
502
+ ShortCut = 16432
503
+ end
504
+ item
505
+ Command = ecGotoMarker1
506
+ ShortCut = 16433
507
+ end
508
+ item
509
+ Command = ecGotoMarker2
510
+ ShortCut = 16434
511
+ end
512
+ item
513
+ Command = ecGotoMarker3
514
+ ShortCut = 16435
515
+ end
516
+ item
517
+ Command = ecGotoMarker4
518
+ ShortCut = 16436
519
+ end
520
+ item
521
+ Command = ecGotoMarker5
522
+ ShortCut = 16437
523
+ end
524
+ item
525
+ Command = ecGotoMarker6
526
+ ShortCut = 16438
527
+ end
528
+ item
529
+ Command = ecGotoMarker7
530
+ ShortCut = 16439
531
+ end
532
+ item
533
+ Command = ecGotoMarker8
534
+ ShortCut = 16440
535
+ end
536
+ item
537
+ Command = ecGotoMarker9
538
+ ShortCut = 16441
539
+ end
540
+ item
541
+ Command = ecSetMarker0
542
+ ShortCut = 24624
543
+ end
544
+ item
545
+ Command = ecSetMarker1
546
+ ShortCut = 24625
547
+ end
548
+ item
549
+ Command = ecSetMarker2
550
+ ShortCut = 24626
551
+ end
552
+ item
553
+ Command = ecSetMarker3
554
+ ShortCut = 24627
555
+ end
556
+ item
557
+ Command = ecSetMarker4
558
+ ShortCut = 24628
559
+ end
560
+ item
561
+ Command = ecSetMarker5
562
+ ShortCut = 24629
563
+ end
564
+ item
565
+ Command = ecSetMarker6
566
+ ShortCut = 24630
567
+ end
568
+ item
569
+ Command = ecSetMarker7
570
+ ShortCut = 24631
571
+ end
572
+ item
573
+ Command = ecSetMarker8
574
+ ShortCut = 24632
575
+ end
576
+ item
577
+ Command = ecSetMarker9
578
+ ShortCut = 24633
579
+ end
580
+ item
581
+ Command = EcFoldLevel1
582
+ ShortCut = 41009
583
+ end
584
+ item
585
+ Command = EcFoldLevel2
586
+ ShortCut = 41010
587
+ end
588
+ item
589
+ Command = EcFoldLevel3
590
+ ShortCut = 41011
591
+ end
592
+ item
593
+ Command = EcFoldLevel4
594
+ ShortCut = 41012
595
+ end
596
+ item
597
+ Command = EcFoldLevel5
598
+ ShortCut = 41013
599
+ end
600
+ item
601
+ Command = EcFoldLevel6
602
+ ShortCut = 41014
603
+ end
604
+ item
605
+ Command = EcFoldLevel7
606
+ ShortCut = 41015
607
+ end
608
+ item
609
+ Command = EcFoldLevel8
610
+ ShortCut = 41016
611
+ end
612
+ item
613
+ Command = EcFoldLevel9
614
+ ShortCut = 41017
615
+ end
616
+ item
617
+ Command = EcFoldLevel0
618
+ ShortCut = 41008
619
+ end
620
+ item
621
+ Command = EcFoldCurrent
622
+ ShortCut = 41005
623
+ end
624
+ item
625
+ Command = EcUnFoldCurrent
626
+ ShortCut = 41003
627
+ end
628
+ item
629
+ Command = EcToggleMarkupWord
630
+ ShortCut = 32845
631
+ end
632
+ item
633
+ Command = ecNormalSelect
634
+ ShortCut = 24654
635
+ end
636
+ item
637
+ Command = ecColumnSelect
638
+ ShortCut = 24643
639
+ end
640
+ item
641
+ Command = ecLineSelect
642
+ ShortCut = 24652
643
+ end
644
+ item
645
+ Command = ecTab
646
+ ShortCut = 9
647
+ end
648
+ item
649
+ Command = ecShiftTab
650
+ ShortCut = 8201
651
+ end
652
+ item
653
+ Command = ecMatchBracket
654
+ ShortCut = 24642
655
+ end
656
+ item
657
+ Command = ecColSelUp
658
+ ShortCut = 40998
659
+ end
660
+ item
661
+ Command = ecColSelDown
662
+ ShortCut = 41000
663
+ end
664
+ item
665
+ Command = ecColSelLeft
666
+ ShortCut = 40997
667
+ end
668
+ item
669
+ Command = ecColSelRight
670
+ ShortCut = 40999
671
+ end
672
+ item
673
+ Command = ecColSelPageDown
674
+ ShortCut = 40994
675
+ end
676
+ item
677
+ Command = ecColSelPageBottom
678
+ ShortCut = 57378
679
+ end
680
+ item
681
+ Command = ecColSelPageUp
682
+ ShortCut = 40993
683
+ end
684
+ item
685
+ Command = ecColSelPageTop
686
+ ShortCut = 57377
687
+ end
688
+ item
689
+ Command = ecColSelLineStart
690
+ ShortCut = 40996
691
+ end
692
+ item
693
+ Command = ecColSelLineEnd
694
+ ShortCut = 40995
695
+ end
696
+ item
697
+ Command = ecColSelEditorTop
698
+ ShortCut = 57380
699
+ end
700
+ item
701
+ Command = ecColSelEditorBottom
702
+ ShortCut = 57379
703
+ end>
704
+ inline SynLeftGutterPartList1: TSynGutterPartList
705
+ object SynGutterMarks1: TSynGutterMarks
706
+ Width = 36
707
+ MouseActions = <>
708
+ MaxExtraMarksColums = 0
709
+ Options = [sgmoDeDuplicateMarksOnOverflow]
710
+ end
711
+ object SynGutterLineNumber1: TSynGutterLineNumber
712
+ Width = 35
713
+ MouseActions = <>
714
+ MarkupInfo.Background = clBtnFace
715
+ MarkupInfo.Foreground = clNone
716
+ DigitCount = 2
717
+ ShowOnlyLineNumbersMultiplesOf = 1
718
+ ZeroStart = False
719
+ LeadingZeros = False
720
+ end
721
+ object SynGutterChanges1: TSynGutterChanges
722
+ Width = 6
723
+ MouseActions = <>
724
+ ModifiedColor = 59900
725
+ SavedColor = clGreen
726
+ end
727
+ object SynGutterSeparator1: TSynGutterSeparator
728
+ Width = 3
729
+ MouseActions = <>
730
+ MarkupInfo.Background = clWhite
731
+ MarkupInfo.Foreground = clGray
732
+ end
733
+ object SynGutterCodeFolding1: TSynGutterCodeFolding
734
+ Width = 15
735
+ MouseActions = <>
736
+ MarkupInfo.Background = clNone
737
+ MarkupInfo.Foreground = clGray
738
+ MouseActionsExpanded = <>
739
+ MouseActionsCollapsed = <>
740
+ end
741
+ end
742
+ end
743
+ object mOutput: TMarkdownViewer
744
+ Left = 3
745
+ Height = 227
746
+ Top = 3
747
+ Width = 958
748
+ BorderSpacing.Left = 2
749
+ BorderSpacing.Top = 2
750
+ BorderSpacing.Right = 2
751
+ Align = alClient
752
+ Color = clWindow
753
+ TabOrder = 1
754
+ HeaderColor = clNavy
755
+ end
756
+ object CESplitter1: TCESplitter
757
+ Cursor = crVSplit
758
+ Left = 1
759
+ Height = 15
760
+ Top = 230
761
+ Width = 962
762
+ Align = alBottom
763
+ ResizeAnchor = akBottom
764
+ end
765
+ end
766
+ end
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dark Byte
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/README.md ADDED
@@ -0,0 +1 @@
 
 
1
+ Place this in the Extensions folder of Cheat Engine. Overwrite if it already exists
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/aibase.lua ADDED
@@ -0,0 +1,953 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --Proof of concept of implementing LLM callbacks to use with CE without the need to use Python
2
+ --Initially, this script implements the talking to and handling of a google AI type of LLM
3
+ --Feel free to add support for locally executing LLM's
4
+
5
+ --todo: add a voice to text and input the output to the AI, or if possible, enter voice as input directly ?
6
+ -- other AI systems besides google ai , websocket support
7
+
8
+
9
+ --MIT License
10
+ --https://github.com/cheat-engine/AITools
11
+
12
+ local s=getSettings('AITOOLS',true)
13
+ local AIAccess=tonumber(s.AIAccess)
14
+ local PatreonSessionID=s.PatreonSessionID or getCEPatreonSessionID()
15
+ local AIKEY=s.AIKEY
16
+ local jsonparser=require 'json'
17
+ local agreedToSendData=s.agreedToSendData or false
18
+
19
+ modelList=nil
20
+ local waitingForList={} --list of comboboxes waiting for a list of models
21
+
22
+ local pathdelim=(getOperatingSystem()==0) and [[\]] or [[/]]
23
+
24
+ local basepath=extractFilePath(getCurrentScriptPath())
25
+ if basepath==nil then
26
+ basepath=getCheatEngineDir()..'Extensions'..pathdelim..'AITools'..pathdelim
27
+ end
28
+
29
+ local modelNameToNameLookup={} --for AIAccess 2
30
+
31
+
32
+ aitools={}
33
+ aiobjects={} --todo: move to data and free objects when the chat session ends
34
+
35
+ function registerAITool(name, description, properties, required, functionToCall)
36
+ if (name==nil) or (name=='') then
37
+ error('registerAITool: name may not be nil')
38
+ end
39
+ if required==nil then
40
+ required={}
41
+ end
42
+
43
+ if properties==nil then
44
+ properties={}
45
+ end
46
+
47
+ local t={}
48
+ t.name=name
49
+ t.description=description
50
+ t.parameters={}
51
+ t.parameters.type="OBJECT"
52
+ if properties[1] then
53
+ error('Error in registerAITool for '..name..': properties must be an object, not an array')
54
+ end
55
+ t.parameters.properties=properties
56
+ t.parameters.required=required
57
+ setmetatable(t.parameters.required,{isArray=true}) --in case an empty requiredlisty is given
58
+ t.functionToCall=functionToCall
59
+ t.enabled=true
60
+
61
+ aitools[name]=t
62
+ end
63
+
64
+ function find_json_block(text)
65
+ local start_index = nil
66
+ local depth = 0
67
+ local in_string = false
68
+ local escape = false
69
+
70
+ for i = 1, #text do
71
+ local ch = text:sub(i, i)
72
+
73
+ if in_string then
74
+ if escape then
75
+ escape = false
76
+ elseif ch == "\\" then
77
+ escape = true
78
+ elseif ch == '"' then
79
+ in_string = false
80
+ end
81
+ else
82
+ if ch == '"' then
83
+ in_string = true
84
+ elseif ch == "{" then
85
+ if depth == 0 then
86
+ start_index = i
87
+ end
88
+ depth = depth + 1
89
+ elseif ch == "}" and depth > 0 then
90
+ depth = depth - 1
91
+ if depth == 0 then
92
+ local block = text:sub(start_index, i)
93
+ local remainder = text:sub(i + 1)
94
+ return block, remainder
95
+ end
96
+ end
97
+ end
98
+ end
99
+
100
+ return nil, text
101
+ end
102
+
103
+
104
+ local retrieveModelList=nil
105
+ local fillModelList=nil
106
+ local aiRequest=nil
107
+
108
+
109
+ retrieveModelList=function(combobox)
110
+ if combobox then
111
+ combobox.clear()
112
+ end
113
+
114
+ if AIAccess==0 or AIAccess==1 then
115
+ if combobox==nil then return end
116
+
117
+ local limits=getLimits()
118
+
119
+ --return limits.models
120
+
121
+ if limits and limits.models then
122
+ for i=1,#limits.models do
123
+ combobox.items.add(limits.models[i].name)
124
+ end
125
+ else
126
+ if limits.error then
127
+
128
+ messageDialog('Failure obtaining model list:'..limits.error..'\n\r\n\rConsider becoming a patreon member or get an AI key from google. You\'ll have access to better models', mtError)
129
+ return
130
+ else
131
+ combobox.items.add('<Failed obtaining model list>')
132
+ combobox.items.add('<It\'s more than the public one>')
133
+ end
134
+ end
135
+
136
+
137
+ elseif AIAccess==2 then
138
+ local i=getInternet()
139
+ i.Header='x-goog-api-key: '..AIKEY
140
+ jsonModelList=i.getURL('https://generativelanguage.googleapis.com/v1beta/models')
141
+ i.destroy()
142
+
143
+ local jml=jsonparser.decode(jsonModelList)
144
+
145
+ if jml then
146
+ if jml.error then
147
+ messageDialog('Failure obtaining model list:'..jml.error.message, mtError)
148
+ return
149
+ end
150
+
151
+ if jml.models then
152
+ modelList={}
153
+ for i=1,#jml.models do
154
+ local has_generateContent=false
155
+ if jml.models[i].supportedGenerationMethods then
156
+ for j=1,#jml.models[i].supportedGenerationMethods do
157
+ if jml.models[i].supportedGenerationMethods[j]=='generateContent' then
158
+ has_generateContent=true
159
+ break
160
+ end
161
+ end
162
+ if has_generateContent==true then
163
+ if combobox then
164
+ combobox.items.add(jml.models[i].displayName)
165
+ end
166
+ modelList[jml.models[i].displayName]=jml.models[i]
167
+ end
168
+ end
169
+ end
170
+ end
171
+
172
+ end
173
+ end
174
+
175
+ if combobox then
176
+ local i=combobox.items.indexOf(s.DefaultModel)
177
+ if i~=-1 then
178
+ combobox.itemIndex=i
179
+ end
180
+ end
181
+
182
+ end
183
+
184
+
185
+ getLimits=function()
186
+ --returns the limits of the current patreon member
187
+ local r={}
188
+ if AIAccess==2 then
189
+ r.maxtools=math.huge --infinite
190
+ return r
191
+ end
192
+
193
+ local i=getInternet()
194
+
195
+ --jsonparser
196
+ local s
197
+
198
+ if AIAccess==0 then
199
+ s=i.getURL('https://cheatengine.org/ai/limits.php')
200
+ elseif AIAccess==1 then
201
+ local i=getInternet()
202
+ i.Header='CEPATREONID:'..PatreonSessionID
203
+ s=i.getURL('https://cheatengine.org/patreon/ailimits.php')
204
+ end
205
+
206
+ i.destroy()
207
+
208
+ if s then
209
+ r=jsonparser.decode(s)
210
+ else
211
+ r.maxtools=0
212
+ end
213
+
214
+ return r
215
+ end
216
+
217
+
218
+ aiRequest=function(data, message)
219
+ local function handleError(message)
220
+ data.self.mOutput.lines.add('*Error:'..message..'*\n\r')
221
+
222
+ if data.NotifyWhenDone then
223
+ data.NotifyWhenDone(data,'Error:'..message)
224
+ end
225
+ return nil,message
226
+ end
227
+
228
+ if not data.WaitForData and not data.NotifyWhenDone and data.FullAnswerOnly then
229
+ return nil,'The current config will result in no data'
230
+ end
231
+
232
+ _G.lastdata=data
233
+
234
+ if AIAccess~=2 then --having an AI key implies you accepted their terms
235
+ if not agreedToSendData then
236
+
237
+ synchronize(function()
238
+ agreedToSendData=messageDialog('Using the AI features involves sending your AI requests to a server where they could potentially be intercepted. Also your AI requests can be used by Google to improve their AI. Make sure not to never send personal information. Do you agree to this?',mtConfirmation,mbYes,mbNo)==mrYes
239
+ s.agreedToSendData='1'
240
+
241
+ end)
242
+
243
+ if not agreedToSendData then
244
+ return handleError('No agreement to send data')
245
+ end
246
+ end
247
+ end
248
+
249
+
250
+
251
+ if data.Internet==nil then
252
+ data.Internet=getInternet('CE AITOOLS')
253
+ end
254
+
255
+
256
+ data.Internet.Header=[[Content-Type: application/json
257
+ Accept: text/event-stream]]
258
+
259
+
260
+ if AIAccess==1 then
261
+ if PatreonSessionID=='' then
262
+ return handleError('PatreonSessionID missing')
263
+ end
264
+ data.Internet.Header=data.Internet.Header..[[
265
+
266
+ CEPATREONID: ]]..PatreonSessionID
267
+ elseif AIAccess==2 then
268
+ if AIKEY==nil or AIKEY=='' then
269
+ return handleError('AIKEY missing')
270
+ end
271
+ data.Internet.Header=data.Internet.Header..[[
272
+
273
+ x-goog-api-key: ]]..AIKEY
274
+ end
275
+
276
+
277
+
278
+
279
+ local prevdata=nil
280
+ local r={}
281
+ --local allprevdata={}
282
+
283
+
284
+ data.Error=nil
285
+
286
+ if data.self and (not data.FullAnswerOnly) then
287
+ data.Internet.OnReceiveData=function(sender, received)
288
+
289
+ -- print("ondata: "..received)
290
+ --if inMainThread() then
291
+ -- print("in main thread")
292
+ --end
293
+
294
+ if prevdata==nil then
295
+ prevdata=received
296
+ else
297
+ prevdata=prevdata..received
298
+ end
299
+
300
+
301
+
302
+ local currentblock
303
+ repeat
304
+ currentblock, prevdata=find_json_block(prevdata)
305
+ if currentblock then
306
+ local valid,errstr=pcall(function()
307
+ local parsed=jsonparser.decode(currentblock)
308
+
309
+ table.insert(r, parsed)
310
+ if parsed.candidates then
311
+ if parsed.candidates[1].content and parsed.candidates[1].content.parts then
312
+ for i=1,#parsed.candidates[1].content.parts do
313
+
314
+ if parsed.candidates[1].content.parts[i] and parsed.candidates[1].content.parts[i].text then
315
+ synchronize(function()
316
+ data.self.mOutput.lines.text=data.self.mOutput.lines.text .. parsed.candidates[1].content.parts[i].text
317
+ data.self.mOutput.SelStart=#data.self.mOutput.lines.text
318
+ end)
319
+ end
320
+ end
321
+ end
322
+ end
323
+
324
+ if parsed.error then
325
+ local message=nil
326
+ if parsed.error.message then
327
+ message=parsed.error.message
328
+ else
329
+ message=parsed.error
330
+ end
331
+ synchronize(function()
332
+ data.self.mOutput.lines.add(" *Error:"..message..'*\n\r')
333
+ end)
334
+ end
335
+
336
+ end)
337
+ end
338
+ until currentblock==nil
339
+
340
+ data.lastreceived=r
341
+ data.allprevdata=allprevdata
342
+ end
343
+ end
344
+
345
+
346
+
347
+ local modelname=s.DefaultModel
348
+ local modelnamepath=''
349
+
350
+ data.AIAccessMode=AIAccess
351
+
352
+ if data.self then
353
+ modelname=data.self.cbModelSelection.Text
354
+ s.DefaultModel=modelname
355
+ end
356
+
357
+ if AIAccess==2 then
358
+ --get the modelnamepath
359
+ if modelList==nil then
360
+ retrieveModelList()
361
+ end
362
+ modelnamepath=modelList[modelname].name
363
+ end
364
+
365
+
366
+ data.modelname=modelname
367
+
368
+
369
+ if data.history==nil then
370
+ data.history={}
371
+ data.history.contents={}
372
+ end
373
+ local input=data.history
374
+
375
+ if AIAccess~=2 then
376
+ --the modelname is sent to the server
377
+ input.modelname=modelname
378
+ end
379
+
380
+ local newcontent={}
381
+ newcontent.role='user'
382
+ newcontent.parts={}
383
+ newcontent.parts[1]={}
384
+ newcontent.parts[1].text=message
385
+ table.insert(input.contents,newcontent)
386
+
387
+
388
+
389
+ if AIAccess==2 then
390
+ input.system_instruction={}
391
+ input.system_instruction.parts={}
392
+ input.system_instruction.parts[1]={}
393
+ --input.system_instruction.parts[1].text='You are currently being used by the Cheat Engine application. Use tools when possible, but fall back on your internal knowledge to answer general questions'
394
+ input.system_instruction.parts[1].text='You are a professional reverse engineer using Cheat Engine. Use tools when possible, but fall back on your internal knowledge of Cheat Engine. Do not say you can not help'
395
+
396
+ end
397
+
398
+ if data.Extra then
399
+ if AIAccess==2 then
400
+ input.system_instruction={}
401
+ input.system_instruction.parts={}
402
+ input.system_instruction.parts[1]={}
403
+ input.system_instruction.parts[1].text=data.Extra
404
+ else
405
+ newcontent.parts[2].text=data.Extra
406
+ end
407
+ end
408
+
409
+
410
+ --load tools
411
+ --
412
+ if data.limits==nil then
413
+ data.limits=getLimits() --limits is enforced on the server itself, this just saves some bandwith
414
+ end
415
+
416
+ local maxtools
417
+
418
+ if data.limits then
419
+ if data.limits.error then
420
+ messageDialog(data.limits.error,mtError,mbOK)
421
+ data.limits=nil
422
+ return
423
+ else
424
+ maxtools=data.limits.maxtools
425
+ end
426
+ end
427
+
428
+
429
+ input.tools={}
430
+ input.tools[1]={}
431
+ input.tools[1].functionDeclarations={}
432
+
433
+ for name,data in pairs(aitools) do
434
+ if data.enabled then
435
+ local e={}
436
+ e.name=name
437
+ e.description=data.description
438
+ e.parameters=data.parameters
439
+ --not functionToCall and not Enabled
440
+ table.insert(input.tools[1].functionDeclarations,e)
441
+
442
+ --limit to maxtools
443
+
444
+ --meh, if it takes too much sitepower I just block it and give an error to use a google AI key
445
+ --if maxtools and #input.tools[1].functionDeclarations>maxtools then
446
+ -- break
447
+ --end
448
+ end
449
+ end
450
+
451
+ if #input.tools[1].functionDeclarations==0 then
452
+ input.tools=nil
453
+ end
454
+
455
+
456
+ local inputtext=jsonparser.encode(input)
457
+ local result
458
+
459
+ local thread=createThread(function(t)
460
+ data.thread=t
461
+ t.Name='GenerateContent AI command'
462
+ if data.WaitForData then
463
+ t.freeOnTerminate(false)
464
+ end
465
+
466
+ local url
467
+ if AIAccess==0 then
468
+ url='https://cheatengine.org/ai/aiproxy.php'
469
+ elseif AIAccess==1 then
470
+ url='https://cheatengine.org/patreon/aiproxy.php'
471
+ elseif AIAccess==2 then
472
+ url='https://generativelanguage.googleapis.com/v1beta/'..modelnamepath..':streamGenerateContent'
473
+ end
474
+
475
+ data.usedurl=url
476
+ data.lastinputtext=inputtext
477
+
478
+ if data.allfullresponses==nil then
479
+ data.allfullresponses={}
480
+ end
481
+
482
+
483
+ result=data.Internet.postURL(url, inputtext)
484
+ local response
485
+ local textresult=''
486
+
487
+ while result do
488
+ table.insert(data.allfullresponses,result)
489
+
490
+
491
+ response=nil
492
+
493
+ data.InternetDone=true
494
+ data.UnparsedResult=result
495
+ local parsed
496
+ local valid,err=pcall(function()
497
+ parsed=jsonparser.decode(result)
498
+ data.parsedResult=parsed
499
+ end)
500
+
501
+ if valid then
502
+ if parsed then
503
+ if parsed.error then
504
+ data.Error=true
505
+ textresult='Base error:'..parsed.error
506
+ else
507
+ for i=1,#parsed do
508
+ if parsed[i] then
509
+ if parsed[i].candidates then
510
+ if parsed[i].candidates[1] then
511
+ if parsed[i].candidates[1].content then
512
+ local newcontent={}
513
+ table.insert(input.contents,newcontent)
514
+ newcontent.role=parsed[i].candidates[1].content.role
515
+
516
+ if parsed[i].candidates[1].content.parts then
517
+ newcontent.parts={}
518
+ local parts=parsed[i].candidates[1].content.parts
519
+
520
+
521
+ for j=1,#parts do
522
+ newcontent.parts[j]={}
523
+ newcontent.parts[j]=parts[j]
524
+ --newcontent.parts[j].text=parts[j].text
525
+ --newcontent.parts[j].functionCall=parts[j].functionCall
526
+
527
+ if parts[j].text then
528
+ textresult=textresult..parts[j].text
529
+ end
530
+
531
+ if parts[j].functionCall then
532
+ --parse the args
533
+ synchronize(function()
534
+ if data.self and data.self.mOutput then
535
+ data.self.mOutput.lines.add(' *Calling function :'..parts[j].functionCall.name..'* \n\r')
536
+
537
+ end
538
+ end)
539
+
540
+ if response==nil then
541
+ response={} --add it if needed
542
+ response.role='user'
543
+ response.parts={}
544
+
545
+ --data.resultBeforeResponse=data.UnparsedResult
546
+ end
547
+
548
+ local tool=aitools[parts[j].functionCall.name]
549
+
550
+ local r={}
551
+ r.functionResponse={}
552
+ r.functionResponse.name=parts[j].functionCall.name
553
+
554
+ if tool then
555
+ local f=tool.functionToCall
556
+ if f then
557
+ r.functionResponse.response=tool.functionToCall(parts[j].functionCall.args)
558
+ else
559
+ r.functionResponse.response={Error='Invalid config for '..parts[j].functionCall.name}
560
+ synchronize(function()
561
+ data.self.mOutput.lines.add('result: Invalid config')
562
+ end)
563
+ end
564
+ else
565
+ r.functionResponse.response={Error='Unknown function name'}
566
+ synchronize(function()
567
+ data.self.mOutput.lines.add('result: Unknown function')
568
+ end)
569
+ end
570
+ table.insert(response.parts,r)
571
+ end
572
+ end
573
+ end
574
+
575
+ end
576
+ end
577
+ end
578
+
579
+ if parsed[i].error then
580
+ data.Error=true
581
+ textresult='Error:'..parsed[i].error.message
582
+ end
583
+ end
584
+ end
585
+ end
586
+ end
587
+
588
+
589
+ if response then
590
+ --there's a response to give
591
+ table.insert(input.contents, response)
592
+ inputtext=jsonparser.encode(input)
593
+ result=data.Internet.postURL(url, inputtext)
594
+ else
595
+ result=nil
596
+ end
597
+
598
+ else
599
+ data.Error=true
600
+ textresult='Parse Error:'..err
601
+ if data.self then
602
+ synchronize(function()
603
+ if result==nil or result:trim()=='' then
604
+ data.self.mOutput.lines.add('\n\r *<server seems to be down>*');
605
+ else
606
+ data.self.mOutput.lines.add('\n\r<Error while receiving data:'..err..'>')
607
+ end
608
+ end)
609
+ end
610
+ break;
611
+ end
612
+ end
613
+
614
+ data.result=textresult
615
+
616
+ if data.NotifyWhenDone then
617
+ --print("Notifying with result:"..result)
618
+ synchronize(function()
619
+ if data.NotifyWhenDone then
620
+ data.NotifyWhenDone(data, textresult)
621
+ end
622
+ end)
623
+ end
624
+
625
+ if not data.WaitForData then
626
+ data.thread=nil
627
+ end
628
+ -- print("thread finished")
629
+ end)
630
+
631
+ if data.WaitForData then
632
+ if thread then
633
+ thread.waitfor()
634
+ thread.destroy() thread=nil
635
+ end
636
+ if data.Error then
637
+ return nil,textresult
638
+ else
639
+ return textresult
640
+ end
641
+ else
642
+ if data.NotifyWhenDone then
643
+ return nil,'Success: the notify routine will be called when done'
644
+ else
645
+ if data.FullAnswerOnly then
646
+ return nil,'well, this is a waste of tokens'
647
+ else
648
+ return nil,'look at the display'
649
+ end
650
+ end
651
+ end
652
+
653
+ end
654
+
655
+ local function applyAndSaveKey(f)
656
+ -- print("applyAndSaveKey")
657
+ if f.rbAIAccessPatreon.checked then
658
+ PatreonSessionID=f.edtAPIKEY.text
659
+ s.PatreonSessionID=PatreonSessionID
660
+
661
+ elseif f.rbAIAccessPrivate.checked then
662
+ AIKEY=f.edtAPIKEY.text
663
+ if AIKEY~='' then
664
+ s.AIKEY=AIKEY
665
+ end
666
+
667
+ end
668
+ end
669
+
670
+ function spawnAIDialog(command, extra) --command and extra are optional
671
+ local animator
672
+ local data={}
673
+
674
+ local f=createFormFromFile(basepath..'AIDialog.LFM')
675
+
676
+ local function startAnimator()
677
+ if animator==nil then
678
+ local position = 1
679
+ local direction = 1
680
+ local maxLength = 7
681
+
682
+ animator=createTimer(f)
683
+ animator.Enabled=false
684
+ animator.Interval=50
685
+ animator.OnTimer=function(t)
686
+ local a = string.rep(" ", position - 1)
687
+ local b = string.rep(" ", maxLength - position)
688
+
689
+ if f and f.btnSend then
690
+ f.btnSend.Caption = a .. "•" .. b
691
+ else
692
+ animator.destroy()
693
+ animator=nil
694
+ end
695
+
696
+ position = position + direction
697
+
698
+ if position >= maxLength then
699
+ direction = -1
700
+ elseif position <= 1 then
701
+ direction = 1
702
+ end
703
+ end
704
+ end
705
+
706
+ if animator then
707
+ animator.Enabled=true
708
+ end
709
+ end
710
+
711
+ local function stopAnimator()
712
+ if animator then
713
+ animator.Enabled=false
714
+ end
715
+ end
716
+
717
+
718
+ data.self=f
719
+ data.extra=extra
720
+
721
+
722
+ f.OnClose=function(sender)
723
+ for i=1,#waitingForList do
724
+ if f.cbModelSelection==waitingForList[i] then
725
+ waitingForList[i]=nil
726
+ end
727
+ end
728
+
729
+ data.self=nil
730
+ destroyRef(f.Tag)
731
+
732
+ applyAndSaveKey(f)
733
+
734
+ f=nil
735
+ return caFree
736
+ end
737
+
738
+ f.btnObtainKey.OnClick=function()
739
+ if f.rbAIAccessPrivate.checked then
740
+ shellExecute('https://aistudio.google.com/app/api-keys')
741
+ elseif f.rbAIAccessPatreon.checked then
742
+ local sessionid=getCEPatreonSessionID(true)
743
+ if sessionid then
744
+ f.edtAPIKEY.text=sessionid
745
+ PatreonSessionID=sessionid
746
+ end
747
+ end
748
+ end
749
+
750
+ f.mInput.OnKeyDown=function(sender,key)
751
+
752
+ if key==VK_RETURN and isKeyPressed(VK_CONTROL) then
753
+ f.btnSend.doClick()
754
+ else
755
+ return key
756
+ end
757
+ end
758
+
759
+ f.btnSend.OnClick=function(sender)
760
+ --collect the history if there is any (data can be accessed here directly)
761
+ if f.mOutput.Lines.Count>0 then
762
+ f.mOutput.Lines.add('')
763
+ end
764
+
765
+ local message=f.mInput.Lines.Text
766
+ f.mOutput.Lines.add('> '..f.mInput.Lines.Text)
767
+ f.mInput.Lines.clear()
768
+
769
+ f.btnSend.enabled=false
770
+ if f.mOutput.Lines.Count>0 then
771
+ f.mOutput.Lines.add('')
772
+ end
773
+
774
+ applyAndSaveKey(f)
775
+
776
+ startAnimator()
777
+
778
+ if f and f.btnSend then
779
+ f.btnSend.cursor=crHourGlass
780
+ end
781
+
782
+ data.NotifyWhenDone=function(data,r)
783
+ if f and f.btnSend then
784
+ f.btnSend.enabled=true
785
+
786
+ f.btnSend.Caption=translate('Send')
787
+ f.btnSend.cursor=crDefault
788
+
789
+ stopAnimator()
790
+ end
791
+ end
792
+ aiRequest(data, message)
793
+ end
794
+
795
+ local AIAccessChange=function(sender)
796
+ data.limits=nil
797
+ f.cbModelSelection.Items.clear()
798
+ if s.DefaultModel~='' then
799
+ f.cbModelSelection.Items.add(s.DefaultModel)
800
+ f.cbModelSelection.ItemIndex=0
801
+ end
802
+
803
+ if f.rbAIAccessPublic.Checked then
804
+ f.edtAPIKEY.visible=false
805
+ f.btnObtainKey.visible=false
806
+ s.AIAccess='0'
807
+ AIAccess=0
808
+ elseif f.rbAIAccessPatreon.Checked then
809
+ f.edtAPIKEY.TextHint='<Enter CE Patreon session ID here>'
810
+ f.edtAPIKEY.Text=PatreonSessionID or ''
811
+ f.edtAPIKEY.visible=true
812
+ f.btnObtainKey.Caption='Refresh session'
813
+ f.btnObtainKey.visible=true
814
+ s.AIAccess='1'
815
+ AIAccess=1
816
+ else
817
+ f.edtAPIKEY.TextHint='<Enter API key here>'
818
+ f.edtAPIKEY.Text=AIKEY or ''
819
+ f.edtAPIKEY.visible=true
820
+ f.btnObtainKey.Caption='Obtain Key'
821
+ f.btnObtainKey.visible=true
822
+ s.AIAccess='2'
823
+ AIAccess=2
824
+ end
825
+ end
826
+
827
+ if AIAccess then
828
+ if AIAccess==1 then
829
+ f.rbAIAccessPatreon.Checked=true
830
+ elseif AIAccess==2 then
831
+ f.rbAIAccessPrivate.Checked=true
832
+ end
833
+ else
834
+ --first time execute
835
+ PatreonSessionID=getCEPatreonSessionID()
836
+ if PatreonSessionID then
837
+ f.rbAIAccessPatreon.Checked=true
838
+ end
839
+ AIAccess=0
840
+ end
841
+
842
+
843
+ f.rbAIAccessPublic.OnChange=AIAccessChange
844
+ f.rbAIAccessPatreon.OnChange=AIAccessChange
845
+ f.rbAIAccessPrivate.OnChange=AIAccessChange
846
+
847
+ AIAccessChange()
848
+
849
+ -- f.cbModelSelection.OnDropDown=function(sender)
850
+ f.cbModelSelection.OnGetItems=function(sender)
851
+ if f.cbModelSelection.items.Count<=1 then
852
+ --retrieveModelList(f.cbModelSelection)
853
+ retrieveModelList(f.cbModelSelection)
854
+ end
855
+ end
856
+
857
+ f.Tag=createRef(data) --for storing the history and other useful details
858
+
859
+
860
+ f.Position=poScreenCenter
861
+ f.Show()
862
+
863
+ f.mInput.setFocus()
864
+
865
+
866
+ if command then
867
+ f.mOutput.Lines.add('>...')
868
+ f.btnSend.enabled=false
869
+ f.btnSend.cursor=crHourGlass
870
+ startAnimator()
871
+
872
+ data.NotifyWhenDone=function(data,r)
873
+ f.btnSend.enabled=true
874
+ f.btnSend.cursor=crDefault
875
+ f.btnSend.Caption=translate('Send')
876
+ stopAnimator()
877
+ end
878
+
879
+ aiRequest(data, command)
880
+ end
881
+
882
+ _G.debug_LastAIForm=f
883
+ end
884
+
885
+ function askAIQuestion(command, extra, notifyWhenDone) --NotifyWhenDone(data,result)
886
+ if (notifyWhenDone==nil) and (type(extra)=='function') then
887
+ --kinda lazy but ok...
888
+ notifyWhenDone=extra
889
+ extra=nil
890
+ end
891
+
892
+
893
+ local data={}
894
+ data.Extra=extra
895
+ data.FullAnswerOnly=true
896
+ if notifyWhenDone then
897
+ data.NotifyWhenDone=notifyWhenDone
898
+ else
899
+ data.WaitForData=true
900
+ end
901
+ return aiRequest(data, command)
902
+ end
903
+
904
+
905
+ local initialized=false
906
+ function initAIMenuItems()
907
+ --add AI menus to some useful places
908
+ if initialized then return true end
909
+
910
+ initialized=true
911
+
912
+ require('forEachForm')
913
+
914
+ local logo=createPNG()
915
+ logo.loadFromFile(basepath..'AI128x128.png')
916
+
917
+
918
+ --"Explain this function" inside the memoryview context menu
919
+ forEachAndFutureForm('TMemoryBrowser',function(f)
920
+ local miAI_Sep=createMenuItem(f)
921
+ miAI_Sep.Caption='-'
922
+ local miAI_Explain=createMenuItem(f)
923
+ miAI_Explain.Caption=translate('Explain this function')
924
+
925
+ f.debuggerpopup.Items.add(miAI_Sep)
926
+ f.debuggerpopup.Items.add(miAI_Explain)
927
+
928
+ local ii=f.mvImageList.add(logo)
929
+ miAI_Explain.ImageIndex=ii
930
+ miAI_Explain.OnClick=function(sender)
931
+ --get the function
932
+ local d=f.disassembleSelectedFunction()
933
+ if d and d~='' then
934
+ spawnAIDialog([[[The following code is a function copied by Cheat Engine's disassembler. Describe what this function does:
935
+ ```
936
+ ]]..d..[[
937
+ ```]])
938
+ end
939
+ end
940
+
941
+ end)
942
+
943
+ local mi=createMenuItem(MainForm)
944
+ mi.Caption=translate('Ask AI')
945
+ mi.Shortcut='Ctrl+Alt+I'
946
+ mi.ImageIndex=MainForm.Menu.Images.add(logo)
947
+ mi.OnClick=function()
948
+ spawnAIDialog()
949
+ end
950
+ MainForm.miHelp.insert(MainForm.miLuaDocumentation.MenuIndex,mi)
951
+ end
952
+
953
+ initAIMenuItems()
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/loadorder.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ #this file controls the order the lua files are loaded
2
+ aibase.lua #load as first
3
+ tools #then load the tools subfolder
4
+
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/AITools/tools/aitools.lua ADDED
@@ -0,0 +1,1206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --base tools
2
+ --MIT License
3
+ --https://github.com/cheat-engine/AITools
4
+
5
+
6
+
7
+ local function ai_getOpenedProcessName()
8
+ if process then return {processname=process} else return {processname='no process opened yet'} end
9
+ end
10
+
11
+ local function ai_openProcess(args)
12
+ local processname=args.processname
13
+
14
+ if processname then
15
+ local r
16
+ r=openProcess(processname)
17
+ if r then
18
+ return {result='Success', currentProcessID=getOpenedProcessID()}
19
+ else
20
+ return {error='Failure opening '..processname}
21
+ end
22
+ else
23
+ return {error='No processname provided'}
24
+ end
25
+ end
26
+
27
+ local function ai_scanMemory(args)
28
+ local value=args.value
29
+ local value2=args.value2
30
+ local scanoption=args.scanoption
31
+ local alignment=args.alignment
32
+ local vartype=vartype
33
+ local ms=createMemScan()
34
+
35
+ ms.ScanValue=value
36
+ if vartype then
37
+ ms.VarType=vartype
38
+ end
39
+
40
+ if scanoption then
41
+ ms.ScanOoption=scanoption
42
+ end
43
+
44
+ ms.scan()
45
+
46
+ ms.waitTillDone()
47
+ if ms.ErrorString and ms.ErrorString~='' then
48
+ local err=ms.ErrorString
49
+ ms.destroy()
50
+ return {error='Scan error:'..err}
51
+ end
52
+
53
+ local i=#aiobjects+1 --perhaps store it in lastData and free when the form and history is deleted
54
+
55
+ aiobjects[i]=ms
56
+ local r={status='success', scanID=i, foundCount=ms.FoundCount, message='Found '..ms.FoundCount..' results'}
57
+ if ms.FoundCount<=5 then
58
+ r.Addresses={}
59
+ local results=ms.Results
60
+
61
+ for i=1,#results do
62
+ r.Addresses[i]=string.format('0x%.8x',results[i])
63
+ end
64
+ end
65
+
66
+
67
+ return r
68
+ --return a scannerid
69
+ end
70
+
71
+ local function ai_refineScan(args)
72
+ local scannerid=args.scanID
73
+ -- print("ai_refineScan")
74
+ --printf("scannerid=%d", scannerid)
75
+
76
+ local ms=aiobjects[scannerid]
77
+ if ms==nil or ms.ClassName~='TMemScan' then
78
+ print("incorrect scannerid")
79
+ return {error='the scanID was incorrect'}
80
+ end
81
+
82
+ ms.value=args.value
83
+
84
+ if args.scanoption then
85
+ ms.scanoption=args.scanoption
86
+ end
87
+
88
+ ms.scan()
89
+ ms.waitTillDone()
90
+
91
+ if ms.ErrorString and ms.ErrorString~='' then
92
+ local err=ms.ErrorString
93
+ ms.destroy()
94
+ return {error='Scan error:'..err}
95
+ end
96
+
97
+ local r={status='success', foundCount=ms.FoundCount, message='Found '..ms.FoundCount..' results'}
98
+
99
+ if ms.FoundCount<=5 then
100
+ r.Addresses={}
101
+ local results=ms.Results
102
+
103
+ for i=1,#results do
104
+ r.Addresses[i]=string.format('0x%.8x',results[i])
105
+ end
106
+ end
107
+ return r
108
+ end
109
+
110
+ function ai_getResultsAndValues(args) --startindex, count
111
+ local scannerid=args.scanID
112
+ local index=args.index
113
+ local count=args.count
114
+
115
+ local ms=aiobjects[scannerid]
116
+ if ms==nil or ms.ClassName~='TMemScan' then
117
+ print("ai_getResultsAndValues: incorrect scannerid")
118
+ return {error='the scanID was incorrect'}
119
+ end
120
+
121
+ local r={}
122
+ local al=createFoundList(ms)
123
+ al.initialize()
124
+ local maxindex=math.min(al.count-1,index+count-1)
125
+
126
+ for i=index,maxindex do
127
+ local e={}
128
+ e.index=i
129
+ e.address=al.Address[i]
130
+ e.value=al.Value[i]
131
+
132
+ table.insert(r,e)
133
+ end
134
+
135
+ al.deinitialize()
136
+ al.destroy() al=nil
137
+
138
+ return {status='success', result=r}
139
+ end
140
+
141
+ function ai_startWatchpoint(args)
142
+ local address=args.address
143
+ local watchsize=args.watchsize or 1
144
+ local watchtype=_G[args.watchtype] or bptAccess
145
+
146
+ --autoUpdate ? send a hidden conversation update every few seconds if there's a change ?
147
+
148
+ --print("ai_startWatchpoint. args=",args)
149
+
150
+ if address then
151
+ local a=getAddressSafe(address)
152
+ if a then
153
+ local id=#aiobjects+1
154
+ local data={}
155
+ data.type='watchpoint'
156
+ data.results={}
157
+ data.resultsLookupActual={}
158
+ aiobjects[id]=data
159
+
160
+ local r,r2=debug_setBreakpoint(a,watchsize,watchtype,function()
161
+ --add to data.result
162
+ -- print("bp triggered")
163
+ local instructionPointer
164
+
165
+ local r={}
166
+ r.context=debug_getCurrentContextTable()
167
+
168
+ if r.context then
169
+ if targetIsX86() then
170
+ if targetIs64Bit() then
171
+ r.InstructionPointer=r.context.RIP
172
+ r.StackPointer=r.context.RSP
173
+ else
174
+ r.InstructionPointer=r.context.EIP
175
+ r.StackPointer=r.context.ESP
176
+ end
177
+ elseif targetIsArm() then
178
+ r.InstructionPointer=r.context.PC
179
+ r.StackPointer=r.context.SP
180
+ end
181
+
182
+ if data.results[r.InstructionPointer] then
183
+ r=data.results[r.InstructionPointer]
184
+ r.count=r.count+1
185
+ else
186
+ --first time. get some extra info
187
+ data.results[r.InstructionPointer]=r
188
+ r.count=1
189
+
190
+ local start,stop=getFunctionRange(getFunctionRange(r.InstructionPointer))
191
+ r.functionRange={start=start,stop=stop}
192
+
193
+ --get the actual instruction pointer
194
+ --test for rep
195
+ local d=createDisassembler()
196
+ d.showSymbols=true
197
+ d.showModules=true
198
+
199
+ d.disassemble(r.InstructionPointer)
200
+ if d.LastDisassembleData.isRep then
201
+ r.actualInstructionPointer=r.InstructionPointer
202
+ else
203
+ r.actualInstructionPointer=getPreviousOpcode(r.InstructionPointer)
204
+ d.disassemble(r.actualInstructionPointer)
205
+ end
206
+ data.resultsLookupActual[r.actualInstructionPointer]=r --for quick lookup
207
+
208
+ r.contextExt=debug_getCurrentContextTable(true)
209
+
210
+ --delete from contextExt the nonExt parts
211
+ for name,val in pairs(r.context) do
212
+ r.contextExt[name]=nil
213
+ end
214
+
215
+ r.stack=readBytes(r.StackPointer,1024, true)
216
+
217
+ r.stacktrace=debug_stacktrace(r.StackPointer,1024)
218
+
219
+ r.opcode=d.LastDisassembleData.opcode ..' '..d.LastDisassembleData.parameters
220
+ r.opcodesize=#d.LastDisassembleData.bytes
221
+ d.destroy() d=nil
222
+ end
223
+ end
224
+ end)
225
+
226
+ if r then
227
+ print("ai_startWatchpoint success")
228
+ data.breakpointid=r2
229
+ return {status='success', watchpointID=id}
230
+ else
231
+ -- print("ai_startWatchpoint failure 1")
232
+ -- print("r2=",r2)
233
+ aiobjects[id]=nil --nevermind
234
+ if r2==nil then r2='failure for an unknown reason' end
235
+ return {error=r2}
236
+ end
237
+ else
238
+ print("ai_startWatchpoint failure 2")
239
+ return {error='Failure interpreting what the address `'..address..'` meant'}
240
+ end
241
+ else
242
+ print("ai_startWatchpoint failure 3")
243
+ return {error='address was not provided or unparsable'}
244
+ end
245
+ end
246
+
247
+ function ai_stopWatchpoint(args)
248
+ local watchpointID=args.watchpointID
249
+ if watchpointID then
250
+ local data=aiobjects[watchpointID]
251
+ if data then
252
+ if data.type~='watchpoint' then
253
+ return {error='watchpointID corrupted'}
254
+ end
255
+ local r,err=debug_removeBreakpointByID(data.breakpointid)
256
+ if r then
257
+ aiobjects[watchpointID].stopped=true
258
+ return {status='success'}
259
+ else
260
+ if err==nil then
261
+ return {error='failure removing the watchpoint'}
262
+ else
263
+ return {error=err}
264
+ end
265
+ end
266
+ else
267
+ return {error='watchpointID invalid'}
268
+ end
269
+ else
270
+ return {error='watchpointID missing'}
271
+ end
272
+ end
273
+
274
+ function ai_deleteWatchpoint(args)
275
+ local watchpointID=args.watchpointID
276
+ if watchpointID then
277
+ local data=aiobjects[watchpointID]
278
+ if data.stopped==false then
279
+ local r=ai_stopWatchpoint(args)
280
+ if r.error then
281
+ return r
282
+ end
283
+ end
284
+
285
+ aiobjects[watchpointID]=nil
286
+ return {status='success'}
287
+ else
288
+ return {error='watchpointID missing'}
289
+ end
290
+ end
291
+
292
+ function ai_queryWatchPointStatus(args)
293
+ local watchpointID=args.watchpointID
294
+ if watchpointID then
295
+ local r={}
296
+ local data=aiobjects[watchpointID]
297
+ if data==nil then
298
+ return {error='watchpointID is invalid. Did you actually call startWatchpoint?'}
299
+ end
300
+ if data.type~='watchpoint' then
301
+ return {error='watchpointID corrupted'}
302
+ end
303
+
304
+ if data.results==nil then
305
+ return {error='watchpointID result data missing'}
306
+ end
307
+
308
+ for instructionPointer,result in pairs(data.results) do
309
+ local e={}
310
+ e.InstructionAddress=string.format("0x%x",result.actualInstructionPointer) --needs to be a string
311
+ e.Opcode=result.opcode
312
+ e.Count=result.count
313
+
314
+ table.insert(r,e)
315
+ end
316
+
317
+ return {status='success', results=r}
318
+ else
319
+ return {error='watchpointID missing'}
320
+ end
321
+ end
322
+
323
+
324
+ function ai_getDetailedWatchpointData(args)
325
+ local watchpointID=args.watchpointID
326
+ local address=getAddressSafe(args.address)
327
+ local indexeddatatypes=args.datatypes
328
+
329
+ local datatypes={}
330
+ for i=1,#indexeddatatypes do
331
+ datatypes[indexeddatatypes[i]]=true
332
+ end
333
+
334
+ --print("ai_getDetailedWatchpointData. args=", args)
335
+
336
+ if address==nil then
337
+ return {error='address was not provided or unparsable'}
338
+ end
339
+ if watchpointID then
340
+ local data=aiobjects[watchpointID]
341
+
342
+ if data.type~='watchpoint' then
343
+ return {error='watchpointID corrupted'}
344
+ end
345
+
346
+ if data.results==nil then
347
+ return {error='watchpointID result data missing'}
348
+ end
349
+
350
+ local e=data.resultsLookupActual[address]
351
+ if e==nil then
352
+ return {error='invalid address'}
353
+ end
354
+
355
+ local r={}
356
+
357
+ if datatypes.wpFunctionRange then
358
+ r.functionRange=e.functionRange
359
+ end
360
+
361
+ if datatypes.wpRegisters then
362
+ r.registers=e.context
363
+ end
364
+
365
+ if datatypes.wpExtendedRegisters then
366
+ r.extendedRegisters=e.contextExt
367
+ end
368
+
369
+ if datatypes.wpStackTrace then
370
+ r.stacktrace=e.stacktrace
371
+ end
372
+
373
+ if datatypes.wpStackView then
374
+ local s=''
375
+ local stackSnapshotSize=args.stackSnapshotSize or 32
376
+
377
+ for i=1,stackSnapshotSize do
378
+ s=s..format('%.2x ',e.stack[i])
379
+ end
380
+
381
+ r.stackview=s
382
+ end
383
+
384
+ return {status='success', results=r}
385
+ else
386
+ return {error='watchpointID missing'}
387
+ end
388
+ end
389
+
390
+ function ai_disassembleRange(args)
391
+ local start=getAddressSafe(args.startAddress)
392
+ local stop=getAddressSafe(args.stopAddress)
393
+ local showSymbols=args.showSymbols or true
394
+ local showModules=args.showModules or true
395
+ local showSections=args.showSections or false
396
+
397
+ local d=createDisassembler()
398
+ d.showSymbol=true
399
+ d.showModules=true
400
+ d.showSections=true
401
+
402
+ local r={}
403
+
404
+ local a=start
405
+ while a<=stop do
406
+ local e={}
407
+ d.disassemble(a)
408
+ local ldd=d.LastDisassembleData
409
+ e.address=string.format("0x%x",a)
410
+ e.instruction=ldd.prefix..' '..ldd.opcode..' '..ldd.parameters
411
+ e.addressString=getNameFromAddress(a, true,true,false)
412
+ e.bytes=ldd.bytes
413
+
414
+ table.insert(r,e)
415
+
416
+ a=a+#d.LastDisassembleData.bytes
417
+ end
418
+
419
+
420
+ d.destroy() d=nil
421
+
422
+ return {status='success', result=r}
423
+ end
424
+
425
+ function ai_disassembleSingleInstruction(args)
426
+ local r=ai_disassembleRange({startAddress=args.address, stopAddress=args.address, showSymbols=args.showSymbols, showModules=args.showModules, showSections=args.showSections})
427
+ if r and r.status=='success' and r.result[1] then
428
+ local r2=r.result[1]
429
+ return {status='success',result=r2}
430
+ else
431
+ return {error='disassembling has failed'}
432
+ end
433
+ end
434
+
435
+ function ai_getFunctionRange(args)
436
+ local address=getAddressSafe(args.address)
437
+
438
+ local start,stop=getFunctionRange(address)
439
+
440
+ if start and stop then
441
+ return {status='success', start=start, stop=stop}
442
+ else
443
+ return {error="Failure to get a range. Maybe it's not a function"}
444
+ end
445
+ end
446
+
447
+ function ai_enumModules(args)
448
+ --list of modulenames, base address and size
449
+ local ml=enumModules()
450
+ local r={}
451
+ for i=1,#ml do
452
+ r[i]={}
453
+ r[i].moduleName=ml[i].Name
454
+ r[i].baseAddress=string.format("0x%x",ml[i].Address)
455
+ r[i].endAddress=string.format("0x%x",ml[i].Address+ml[i].Size)
456
+ end
457
+
458
+ return {status='success', moduleList=r}
459
+ end
460
+
461
+ function ai_getModuleFromAddress(args)
462
+ local address=getAddressSafe(args.address)
463
+ local ml=enumModules()
464
+ for i=1,#ml do
465
+ if (address>ml[i].Address) and (address<ml[i].Address+ml[i].Size) then
466
+ return {status='success', moduleinfo={moduleName=ml[i].Name, baseAddress=string.format("0x%x",ml[i].Address), endAddress=string.format("0x%x",ml[i].Address+ml[i].Size) }}
467
+ end
468
+ end
469
+
470
+ return {error="The given address does not belong to a module"}
471
+ end
472
+
473
+ function ai_getModuleSections(args)
474
+ local modulename=args.moduleName
475
+ local sl=enumSectionsOfModule(modulename)
476
+ if sl then
477
+ for i=1,#sl do
478
+ sl[i].FileAddress=nil --less info to confuse it
479
+ end
480
+ return {status='success', sl}
481
+ else
482
+ return {error='Failed retrieving the sections of '..modulename}
483
+ end
484
+ end
485
+
486
+ function ai_getTargetedProcessInfo()
487
+ local r={}
488
+ r.is64bit=targetIs64Bit()
489
+ if targetIsAndroid() then
490
+ r.android=true
491
+ end
492
+
493
+ if targetIsX86() then
494
+ r.x86=true
495
+ end
496
+
497
+ if targetIsArm() then
498
+ r.arm=true
499
+ end
500
+
501
+ if getABI()==0 then
502
+ r.callingConvention='Windows'
503
+ else
504
+ r.callingConvention='System V'
505
+ end
506
+ end
507
+
508
+ local readFunctions={}
509
+ readFunctions['vtByte']=function(address) return readByte(address) end
510
+ readFunctions['vtWord']=function(address) return readSmallInteger(address) end
511
+ readFunctions['vtDword']=function(address) return readInteger(address) end
512
+ readFunctions['vtQword']=function(address) return string.format("%x",readQword(address)) end
513
+ readFunctions['vtSingle']=function(address) return readFloat(address) end
514
+ readFunctions['vtDouble']=function(address) return readString(address) end
515
+
516
+ local readSizes={}
517
+ readSizes['vtByte']=1
518
+ readSizes['vtWord']=2
519
+ readSizes['vtDword']=4
520
+ readSizes['vtQword']=8
521
+ readSizes['vtSingle']=4
522
+ readSizes['vtDouble']=8
523
+
524
+
525
+ function ai_readMemoryBlock(args)
526
+ local address=getAddressSafe(args.address)
527
+ local elementType=args.elementType
528
+ local count=args.count
529
+
530
+ if address==nil then
531
+ return {error='Invalid address'}
532
+ end
533
+
534
+ local reader=readFunctions[elementType]
535
+ if reader==nil then
536
+ return {error='The elementtype is invalid'}
537
+ end
538
+
539
+ local elementSize=readSizes[elementType]
540
+
541
+ local readerror=false
542
+ local r={}
543
+ for i=1,count do
544
+ local a=address+elementSize*(i-1)
545
+ r[i]=reader(a)
546
+
547
+ if r[i]==nil then
548
+ readerror=true
549
+ end
550
+ end
551
+
552
+ if readerror then
553
+ if #r==0 then
554
+ return {error='The memory is unreadable'}
555
+ else
556
+ return {status='partial success. Not all bytes are readable', result=r}
557
+ end
558
+ else
559
+ return {status='success', result=r}
560
+ end
561
+ end
562
+
563
+ function ai_readString(args)
564
+ local address=getAddressSafe(args.address)
565
+ local widestring=args.widestring or false
566
+ local charcount=args.charcount or 100
567
+
568
+ if address==nil then
569
+ return {error='Invalid address'}
570
+ end
571
+
572
+ return {status='success', result=readString(address, charcount, widestring)}
573
+ end
574
+
575
+ function ai_showLuaScript(args)
576
+ synchronize(function()
577
+ local f=createLuaEngine()
578
+ f.mScript.Lines.Text=args.LuaScript or ''
579
+ f.show()
580
+ end)
581
+ return {status='success'}
582
+ end
583
+
584
+ function ai_showAutoAssemblerScript(args)
585
+ synchronize(function()
586
+ local f=createAutoAssemblerForm()
587
+ f.Assemblescreen.Lines.Text=args.AutoAssemblerScript or ''
588
+
589
+ end)
590
+
591
+ return {status='success'}
592
+ end
593
+
594
+ function ai_syntaxCheckAutoAssemblerScript(args)
595
+ local script=args.AutoAssemblerScript
596
+ local enablesection=args.EnableSection or true
597
+ r,r2=autoAssembleCheck(script,enablesection,false)
598
+
599
+ if not r then
600
+ return {error=r2}
601
+ else
602
+ return {status='successs'}
603
+ end
604
+ end
605
+
606
+
607
+ function ai_getVersionStrings(args)
608
+ s,s2=getFileVersion(enumModules()[1].PathToFile)
609
+ return {s2}
610
+ end
611
+
612
+ function ai_showMemoryView(args)
613
+ synchronize(function()
614
+ local disassemblerAddress=args.disassemblerAddress
615
+ local hexviewAddress=args.hexviewAddress
616
+
617
+ getMemoryViewForm().show()
618
+ end)
619
+
620
+ return {status='success'}
621
+ end
622
+
623
+ function ai_createMemoryRecord(args)
624
+ local description=args.description
625
+
626
+
627
+ return synchronize(function()
628
+ local parent=nil
629
+ if args.parentNode then
630
+ local parent=AddressList.getMemoryRecordByID(id)
631
+ if parent==nil then
632
+ return {error='the parentNode was not valid'}
633
+ end
634
+ end
635
+
636
+ local mr=AddressList.createMemoryRecord()
637
+ mr.description=description
638
+
639
+ if args.script then
640
+ mr.Script=args.script
641
+
642
+ if args.async then
643
+ mr.Async=args.async
644
+ end
645
+ else
646
+ if args.address then
647
+ mr.Address=args.address
648
+ end
649
+
650
+ if args.vartype then
651
+ if args.vartype=='vtWideString' then
652
+ args.vartype='vtUnicodeString'
653
+ end
654
+ mr.VarType=args.vartype
655
+ end
656
+
657
+ if args.stringSize then
658
+ mr.String.Size=args.stringSize
659
+ end
660
+
661
+ if args.offsets then
662
+ local i=1,#args.offsets do
663
+ mr.OffsetText[i-1]=args.offsets[i]
664
+ end
665
+ end
666
+ end
667
+
668
+ if parent then
669
+ mr.parent=parent
670
+ end
671
+ return {status='success', memoryRecordID=mr.ID}
672
+ end)
673
+ end
674
+
675
+ function ai_editMemoryRecord(args)
676
+ return synchronize(function()
677
+ local id=args.memoryRecordID
678
+
679
+ if id then
680
+ local mr=AddressList.getMemoryRecordByID(id)
681
+ if mr then
682
+ local description=args.description
683
+
684
+ local parent=mr.parent
685
+ if args.parentNode then
686
+ local parent=AddressList.getMemoryRecordByID(id)
687
+ if parent==nil then
688
+ return {error='the parentNode was not valid'}
689
+ end
690
+ end
691
+
692
+ if args.description then
693
+ mr.description=args.description
694
+ end
695
+
696
+ if args.script then
697
+ mr.Script=args.script
698
+
699
+ if args.async then
700
+ mr.Async=args.async
701
+ end
702
+ else
703
+ if args.address then
704
+ mr.AddressString=args.address
705
+ end
706
+
707
+ if args.vartype then
708
+ if args.vartype=='vtWideString' then
709
+ args.vartype='vtUnicodeString'
710
+ end
711
+ mr.VarType=args.vartype
712
+ end
713
+
714
+ if args.stringSize then
715
+ mr.String.Size=args.stringSize
716
+ end
717
+
718
+ if args.offsets then
719
+ local i=1,#args.offsets do
720
+ mr.OffsetText[i-1]=args.offsets[i]
721
+ end
722
+ end
723
+
724
+ if args.value then
725
+ mr.Value=args.value
726
+ end
727
+
728
+ if args.active then
729
+ mr.Active=args.active
730
+ end
731
+ end
732
+
733
+ if args.parentNode then
734
+ mr.parent=parent
735
+ end
736
+
737
+ return {status='success'}
738
+ else
739
+ return {error='The memoryrecord with the given ID was not found'}
740
+ end
741
+ else
742
+ return {error='memoryRecordID parameter was missing'}
743
+ end
744
+ end)
745
+ end
746
+
747
+ function ai_deleteMemoryRecord(args)
748
+ local id=args.memoryRecordID
749
+
750
+ return synchronize(function()
751
+ if id then
752
+ return synchronize(function()
753
+ local mr=AddressList.getMemoryRecordByID(id)
754
+ if mr then
755
+ mr.destroy()
756
+ return {status='success'}
757
+ else
758
+ return {error='The memoryrecord with the given ID was not found'}
759
+ end
760
+ end)
761
+ else
762
+ return {error='memoryRecordID parameter was missing'}
763
+ end
764
+ end)
765
+ end
766
+
767
+ function ai_getAddressList(args)
768
+ function scanNode(node)
769
+ local r={}
770
+ while node do
771
+ local e={}
772
+ e.memoryRecordID=node.memrec.ID
773
+ e.description=node.memrec.Description
774
+ if node.Count>0 then
775
+ e.children=scanNode(node.Items[0])
776
+ end
777
+
778
+ table.insert(r,e)
779
+
780
+ node=node.getNextSibling()
781
+ end
782
+
783
+ return r
784
+ end
785
+
786
+ local r
787
+ synchronize(function()
788
+ if AddressList.List.Items.Count>0 then
789
+ r=scanNode(AddressList.List.Items[0])
790
+ else
791
+ r={}
792
+ end
793
+ end)
794
+
795
+ return {status='success', list=r}
796
+ end
797
+
798
+ function ai_getMemoryRecordDetails(args)
799
+ local id=args.memoryRecordID
800
+ return synchronize(function()
801
+ if id then
802
+ local mr=AddressList.getMemoryRecordByID(id)
803
+ if mr then
804
+ local r={}
805
+ r.description=mr.Description
806
+
807
+ if mr.VarType=='vtString' then
808
+ r.stringSize=mr.String.Size
809
+
810
+ if mr.String.Unicode then
811
+ r.vartype=vtWideString
812
+ else
813
+ r.vartype=vtString
814
+ end
815
+ end
816
+
817
+
818
+ if mr.Script then
819
+ r.script=mr.Script
820
+ r.async=mr.async
821
+ else
822
+ r.address=mr.Address
823
+ local offsets={}
824
+
825
+ for i=1,mr.OffsetCount do
826
+ offsets[i]=mr.OffsetText[i-1]
827
+ end
828
+ if #offsets>0 then
829
+ r.offsets=offsets
830
+ end
831
+ end
832
+
833
+ r.value=mr.Value
834
+
835
+ r.active=mr.Active
836
+
837
+ if mr.parent then
838
+ r.parent=mr.parent.ID
839
+ end
840
+
841
+ return {status='success', info=r}
842
+ else
843
+ return {error='The memoryrecord with the given ID was not found'}
844
+ end
845
+ else
846
+ return {error='memoryRecordID parameter was missing'}
847
+ end
848
+ end)
849
+ end
850
+
851
+ function ai_getMemoryRecordByDescription(args)
852
+ return synchronize(function()
853
+ local r=AddressList.getMemoryRecordByDescription(args.description)
854
+ if r then
855
+ return {memoryRecordID=r.ID}
856
+ else
857
+ return {error='No memory record with this description found'}
858
+ end
859
+ end)
860
+ end
861
+
862
+
863
+
864
+ registerAITool('getOpenedProcessName','Returns the currently opened processname. (the executable)', {},{},ai_getOpenedProcessName)
865
+ registerAITool('openProcess','Opens the the most recent process with this name. Result is true on success and also provides the processID', {processname={type='STRING',description='name of the process to open'}},{"processname"},ai_openProcess)
866
+ registerAITool('scanMemory','Scan for a value and get a scannerID. This scannerID can be used to obtain the results and do a refineScan',
867
+ {value={type='STRING',description='the value to scan for'},
868
+ value2={type='STRING',description='when scanoption is soValueBetween this determines the second part of the range'},
869
+ scanoption={type='STRING', enum={'soExactValue', 'soValueBetween', 'soBiggerThan', 'soSmallerThan'},
870
+ description=[[The scan operation to perform
871
+ - soExactValue: Scan for an exact match of the value
872
+ - soValueBetween: Scan for a value between value and value2
873
+ - soBiggerThan: Scan for values bigger than the given value
874
+ - soSmallerThan: Scan for values smaller than the given value]]
875
+ },
876
+ vartype={type='STRING', enum={'vtByte', 'vtWord', 'vtDword', 'vtQword', 'vtSingle', 'vtDouble', 'vtString', 'vtByteArray', 'vtGrouped', 'vtBinary', 'vtAll'},
877
+ description=[[The data type to scan for
878
+ - vtByte: 1-byte integer (0-255)
879
+ - vtWord: 2-byte integer
880
+ - vtDword: 4-byte integer (default. Standard for most game values).
881
+ - vtQword: 8-byte integer
882
+ - vtSingle: 4-byte floating point
883
+ - vtDouble: 8-byte floating point
884
+ - vtString: ascii string scan
885
+ - vtGrouped: a cheat engine groupscan formatted string
886
+ - vtByteArray: A sequence of hex bytes (AOB)
887
+ - vtBinary: Scans for the given value's binary value inside the memory. Best used for big values that take up at least 1 byte
888
+ - vtAll: Scans the most common types at the same time (vtDword, vtSingle, vtDouble)]]
889
+ },
890
+ alignment={type='INTEGER', description='What memory alignment should be used. Default is 4'}
891
+ },
892
+ {'value'}, --required
893
+ ai_scanMemory) --function
894
+
895
+
896
+ registerAITool('refineScan', 'refines a previously made scan',
897
+ {
898
+ scanID={type='INTEGER', description='the scanID returned by the initial call to scanMemory'},
899
+ value={type='STRING',description='the value to scan for or use depending on the scanoption'},
900
+ scanoption={type='STRING', enum={'soExactValue', 'soValueBetween', 'soBiggerThan', 'soSmallerThan', 'soIncreasedValue', 'soIncreasedValueBy', 'soDecreasedValue', 'soDecreasedValueBy', 'soChanged', 'soUnchanged', 'soReadable'},
901
+ description=[[The scan operation to perform
902
+ - soExactValue: Scan for an exact match of the value
903
+ - soValueBetween: Scan for a value between value and value2
904
+ - soBiggerThan: Scan for values bigger than the given value
905
+ - soSmallerThan: Scan for values smaller than the given value
906
+ - soIncreasedValue: Scan for values that have increased since last scan
907
+ - soIncreasedValueBy: Scan for values that have increased by value since last scan
908
+ - soDecreasedValue: Scan for values that have been decreased since last scan
909
+ - soDecreasedValueBy: Scan for values that have been decreased by value sinze last scan
910
+ - soChanged: Scan for values that have been changed since last scan
911
+ - soUnchanged: Scan for values that have not changed since last scan
912
+ - soForgot: Scan for values that are readable. Handy for cases the user got distracted and doesn't know if the value got changed or not]]
913
+ },
914
+ },
915
+ {'scanID', 'value'}, --required
916
+ ai_refineScan) --function
917
+
918
+ registerAITool('getResultsAndValues', [[Retrieves a view of the results of the given scanID. each entry has:
919
+ - address: It holds the address in hexadecimal string format and for the ALL type it also contains an identifier what type it is
920
+ - value : The value this address currently holds. the value '???' means it is unreadable
921
+ - index : the index number of the results ]],
922
+ {
923
+ scanID={type='INTEGER', description='the scanID returned by the initial call to scanMemory'},
924
+ index={type='INTEGER',description='The start index of the results. Index starts at 0'},
925
+ count={type='INTEGER',description='The number of results to retrieve'}
926
+ }, --parameters
927
+ {'scanID', 'index', 'count'}, --required
928
+ ai_getResultsAndValues) --function
929
+
930
+ registerAITool('startWatchpoint', [[Sets a watchpoint at a given address so that each time it is hit it collects data and then continues the target.
931
+ When called the function returns a watchpointID which you can use with the queryWatchPointStatus function and later with the stopWatchpoint function
932
+ After having obtained a valid watchpointID (>0) tell the user to do things in the game to trigger the watchpoint and tell you when done ]],
933
+ {
934
+ address={type='STRING', description='The address to watch for memory accesses. Formatted as hexadecimal or a symbol recognized by Cheat Engine'},
935
+ watchsize={type='INTEGER', description='The size in bytes for the watchpoint. default 1'},
936
+ watchtype={type='STRING', enum={'bptAccess','bptWrite'},
937
+ description=[[What kind of watch to use.
938
+ - bptAccess: will record every access (default if not set)
939
+ - bptWrite will only record writes]] }
940
+ }, --parameters
941
+ {'address'}, --required
942
+ ai_startWatchpoint) --function
943
+
944
+
945
+ registerAITool('stopWatchpoint', [[Stops a previously created watchpoint but doesn't delete the data yet]],
946
+ {
947
+ watchpointID={type='INTEGER', description='The watchpointID returned by startWatchpoint'},
948
+ }, --parameters
949
+ {'watchpointID'}, --required
950
+ ai_stopWatchpoint) --function
951
+
952
+ registerAITool('deleteWatchpoint', [[Stops a previously created watchpoint if it wasn't stopped yet, and deletes the gathered data. The watchpointID will be invalid after that]],
953
+ {
954
+ watchpointID={type='INTEGER', description='The watchpointID returned by startWatchpoint'},
955
+ }, --parameters
956
+ {'watchpointID'}, --required
957
+ ai_deleteWatchpoint) --function
958
+
959
+ registerAITool('queryWatchPointStatus', [[Retrieves a list of entries containing the instruction address, the opcode and the number of times that instruction was encountered during the watchpoint recording. The InstructionAddress can be used with getDetailedWatchpointData to obtain more information]],
960
+ {
961
+ watchpointID={type='INTEGER', description='The watchpointID returned by startWatchpoint'},
962
+ }, --parameters
963
+ {'watchpointID'}, --required
964
+ ai_queryWatchPointStatus) --function
965
+
966
+ registerAITool('getDetailedWatchpointData', [[Retrieves detailed data about a watchpoint]],
967
+ {
968
+ watchpointID={type='INTEGER', description='The watchpointID returned by startWatchpoint'},
969
+ address={type='STRING', description='The instruction address returned by queryWatchPointStatus'},
970
+ datatypes={type="ARRAY",
971
+ items={
972
+ type='STRING',
973
+ enum={'wpFunctionRange', 'wpRegisters','wpExtendedRegisters', 'wpStackTrace', 'wpStackView'}
974
+ },
975
+ description=[[A list of optional data to retrieve
976
+ - wpFunctionRange : The start and stop address of the function the instruction is in
977
+ - wpRegisters : The list of general purpose registers and their values. Keep in mind these are from after the instruction was executed
978
+ - wpExtendedRegisters: The extra registers like the floating point unit registers, XMM registers, etc... depending on the architecture
979
+ - wpStackTrace: a stacktrace showing the return addresses
980
+ - wpStackView: a byte snapshot of the stack formatted as a list of bytes. Provide stackSnapshotSize else the size will be 32
981
+ ]]},
982
+ stackSnapshotSize={type='INTEGER', description='if datatype wpStackView is present it indicates the number of bytes of the stack snapshot to retrieve. Max 1024'},
983
+ }, --parameters
984
+ {'watchpointID','address', 'datatypes'}, --required
985
+ ai_getDetailedWatchpointData) --function
986
+
987
+ registerAITool('disassembleRange', [[Disassembles a range of code using the cheat engine disassembler. It returns a list of entries each containing the address in hexadecimal format, the addressString as it would be shown by the show* parameters, the bytes that make up the instruction, and the instruction itself]],
988
+ {
989
+ startAddress={type='STRING', description='The address to start disassembling from (supports cheat engine symbols)'},
990
+ stopAddress={type='STRING', description='The end of the disassembly'},
991
+ showSymbols={type='BOOLEAN', description='Show symbols for addresses. Default=true'},
992
+ showModules={type='BOOLEAN', description='Show modulename+offset notation for addresses (if no symbol is found and showSymbols was true). Default=true'},
993
+ showSections={type='BOOLEAN', description='Show `modulename.sectionname+offset` for addresses. overrides showModules when true. Default=false'},
994
+ }, --parameters
995
+ {'startAddress','stopAddress'}, --required
996
+ ai_disassembleRange) --function
997
+
998
+ registerAITool('disassembleInstruction', [[Disassembles a single instruction. It contains the address in hexadecimal format, the addressString as it would be shown by the show* parameters, the bytes that make up the instruction, and the instruction itself]],
999
+ {
1000
+ address={type='STRING', description='The address to start disassembling from (supports cheat engine symbols)'},
1001
+ showSymbols={type='BOOLEAN', description='Show symbols for addresses. Default=true'},
1002
+ showModules={type='BOOLEAN', description='Show modulename+offset notation for addresses (if no symbol is found and showSymbols was true). Default=true'},
1003
+ showSections={type='BOOLEAN', description='Show `modulename.sectionname+offset` for addresses. overrides showModules when true. Default=false'},
1004
+ }, --parameters
1005
+ {'address'}, --required
1006
+ ai_disassembleSingleInstruction) --function
1007
+
1008
+ registerAITool('getFunctionRange', [[Gets the range of the function the given address belongs to]],
1009
+ {
1010
+ address={type='STRING', description='The address to inspect'},
1011
+ }, --parameters
1012
+ {'address'}, --required
1013
+ ai_getFunctionRange) --function
1014
+
1015
+ registerAITool('enumModules', [[Gets the list of modules currently loaded in the game. You can assume that the first one is the main executable. Each entry contains the name, baseAddress and endAddress of each loaded module]],
1016
+ {
1017
+ }, --parameters (none)
1018
+ {}, --required
1019
+ ai_enumModules) --function
1020
+
1021
+ registerAITool('getModuleFromAddress', [[If the address belongs to a module, this returns the module name, it's baseAddress and endAddress ]],
1022
+ {
1023
+ address={type='STRING', description='The address to inspect'},
1024
+ },
1025
+ {address}, --required
1026
+ ai_getModuleFromAddress) --function
1027
+
1028
+ registerAITool('getModuleSections', [[Gets the section list of the specified module and their specifics]],
1029
+ {
1030
+ moduleName={type='STRING', description='The name of the module to retrieve the sections from'},
1031
+ }, --parameters
1032
+ {'moduleName'}, --required
1033
+ ai_getFunctionRange) --function
1034
+
1035
+ registerAITool('getTargetedProcessInfo', [[Gets architecture information about the target process: The calling convention, if the target is 64-bit, if it's ARM or x86, and if it's android or not]],
1036
+ {
1037
+ }, --parameters
1038
+ {}, --required
1039
+ ai_getTargetedProcessInfo) --function
1040
+
1041
+ registerAITool('readMemoryBlock', [[Reads memory in specific sizes and formats]],
1042
+ {
1043
+ address={type='STRING', description='The address to start the read from (Supports cheat engine symbols)'},
1044
+ elementType={type='STRING', enum={'vtByte', 'vtWord', 'vtDword', 'vtQword', 'vtSingle', 'vtDouble'},
1045
+ description=[[The element type to read
1046
+ - vtByte: 1-byte integer
1047
+ - vtWord: 2-byte integer
1048
+ - vtDword: 4-byte integer
1049
+ - vtQword: 8-byte integer (returns as strings to deal with json number issues for 64-bit values)
1050
+ - vtSingle: 4-byte floating point
1051
+ - vtDouble: 8-byte floating point
1052
+ ]]},
1053
+ count={type='INTEGER', description='The number of elements to read'}
1054
+
1055
+ }, --parameters
1056
+ {'address','elementType','count'}, --required
1057
+ ai_readMemoryBlock) --function
1058
+
1059
+ registerAITool('readString', [[Reads a string of memory from a memory address]],
1060
+ {
1061
+ address={type='STRING', description='The address to start the read from (Supports cheat engine symbols)'},
1062
+ charcount={type='INTEGER', description='The number of characters to read (default 100 or 0-terminator. whatever comes first)'},
1063
+ widestring={type='BOOLEAN', description='If true the address points to a string of widechar characters'}
1064
+ }, --parameters
1065
+ {'address'}, --required
1066
+ ai_readString) --function
1067
+
1068
+
1069
+
1070
+
1071
+ registerAITool('showLuaScript',[[Opens a lua engine window and inserts the provided lua script in the editor field]],{LuaScript={type='STRING', description='The script to show in the editor section)'}},{'LuaScript'},ai_showLuaScript)
1072
+
1073
+ registerAITool('showAutoAssemblerScript',[[Opens an autoAssembler windows and inserts the provides auto assembler script in the editor field]],{AutoAssemblerScript={type='STRING', description='The script to show in the editor section)'}},{'AutoAssemblerScript'},ai_showAutoAssemblerScript)
1074
+
1075
+ registerAITool('syntaxCheckAutoAssemblerScript',[[Checks the given auto assembler script if it will error out when assembling in the current state]],{
1076
+ AutoAssemblerScript={type='STRING', description='The autoassembler script to check)'},
1077
+ EnableSection={type='boolean', description='Check the enable section when true or not provided. If false, the disable section will be checked. If there is no disable or enable section the script will be handled as an enable section'}
1078
+ },{'AutoAssemblerScript'},ai_syntaxCheckAutoAssemblerScript)
1079
+
1080
+
1081
+ registerAITool('openMemoryView',[[Opens the memory view window]],{disassemblerAddress={type='STRING', description='The address for the disassembler'},
1082
+ hexviewAddress={type='STRING', description='The hexadecimal address for the disassembler'}
1083
+ },{},ai_showMemoryView)
1084
+
1085
+ registerAITool('getVersionStrings',[[Retrieves the version resource strings of the target process. This includes, ProductVersion, FileDescription, InternalName, etc...]],{},{},ai_getVersionStrings)
1086
+
1087
+ registerAITool('createMemoryRecord',[[Creates a new memory record and adds it to the main address list. It returns a memoryRecordID which will never change. Not when the user renames it and not when the user changes the order]],
1088
+ {
1089
+ --params
1090
+ description={type='STRING', description='The memory record description/name'},
1091
+ vartype={type='STRING', enum={'vtByte', 'vtWord', 'vtDword', 'vtQword', 'vtSingle', 'vtDouble', 'vtString', 'vtWideString'},
1092
+ description=[[The variable type of the memory record
1093
+ - vtByte: 1-byte integer
1094
+ - vtWord: 2-byte integer
1095
+ - vtDword: 4-byte integer (Default)
1096
+ - vtQword: 8-byte integer
1097
+ - vtSingle: 4-byte floating point
1098
+ - vtDouble: 8-byte floating point
1099
+ - vtString: an utf8 encoded string
1100
+ - vtWideString: a widestring
1101
+ - vtAutoAssembler : autoassembler script
1102
+ ]]},
1103
+
1104
+ stringSize={type='INTEGER', description='The number of characters for the string if a string type'},
1105
+
1106
+
1107
+ address={type='STRING', description='The address/baseaddress of the record in hexadecimal notation. Omit the 0x part in front. This field can also contain known symbols to Cheat Engine'},
1108
+ offsets={type='ARRAY', items={type='STRING'}, description=[[When set the address will be handled as a pointer address/
1109
+ It is a list of offsets(hexadecimal values(no 0x in front), interpretable symbols or lua code)
1110
+ During runtime, the first offset's value gets added to the baseAddress's value (in 32-bit 4 bytes, in 64-bit 8 bytes) : P1
1111
+ If there is a 2nd offset, P1 will get read as a pointer and the value of the 2nd offset will be added to that : P2
1112
+ This repeats until the last offset. The final address will then become the last pointer(Px)+lastoffset]]},
1113
+
1114
+ script={type='STRING',description='An autoassembler script with [ENABLE] and [DISABLE] tags. It triggers when the Active checkbox gets checked/unchecked. If set, vartype of vtAutoAssembler is assumed'},
1115
+ async={type='BOOLEAN', description='If true the autoassembler script will run in a seperate thread when activating, not freezing the user\'s UI'},
1116
+ parentNode={type='INTEGER', description='The parent memoryRecordID'}
1117
+ }
1118
+ ,
1119
+ {
1120
+ --required
1121
+ 'description'
1122
+ }
1123
+ ,
1124
+ ai_createMemoryRecord)
1125
+
1126
+ registerAITool('deleteMemoryRecord',[[Deletes a memoryrecord with the given memoryRecordID]],
1127
+ {
1128
+ --params
1129
+ memoryRecordID={type='INTEGER', description='The unique identifier of a memoryrecord in the addresslist'},
1130
+ }
1131
+ ,
1132
+ {
1133
+ --required
1134
+ 'memoryRecordID'
1135
+ }
1136
+ ,
1137
+ ai_deleteMemoryRecord)
1138
+
1139
+ registerAITool('getAddressList',[[Returns the current addreslist layout. Each entry contains the description and the unique memoryRecordID]],{},{},ai_getAddressList)
1140
+
1141
+ registerAITool('getMemoryRecordDetails',[[Get details like the description, vartype, address, offsets, script, parent, value, active state etc... for the given memoryRecord. See createMemoryRecord for details]],
1142
+ {
1143
+ --params
1144
+ memoryRecordID={type='INTEGER', description='The unique identifier of a memoryrecord in the addresslist'},
1145
+ }
1146
+ ,
1147
+ {
1148
+ --required
1149
+ 'memoryRecordID'
1150
+ }
1151
+ ,
1152
+ ai_getMemoryRecordDetails)
1153
+
1154
+ registerAITool('editMemoryRecord',[[edits an existing memory record identified by it's memoryRecordID]],
1155
+ {
1156
+ --params
1157
+ memoryRecordID={type='INTEGER', description='The unique identifier of a memoryrecord in the addresslist'},
1158
+ description={type='STRING', description='The new description/name of the memory record'},
1159
+ vartype={type='STRING', enum={'vtByte', 'vtWord', 'vtDword', 'vtQword', 'vtSingle', 'vtDouble', 'vtString', 'vtWideString'},
1160
+ description=[[The new variable type of the memory record
1161
+ - vtByte: 1-byte integer
1162
+ - vtWord: 2-byte integer
1163
+ - vtDword: 4-byte integer
1164
+ - vtQword: 8-byte integer
1165
+ - vtSingle: 4-byte floating point
1166
+ - vtDouble: 8-byte floating point
1167
+ - vtString: an utf8 encoded string
1168
+ - vtWideString: a widestring
1169
+ - vtAutoAssembler : autoassembler script
1170
+ ]]},
1171
+
1172
+ stringSize={type='INTEGER', description='The new maximum number of characters for the string if a string type'},
1173
+
1174
+
1175
+ address={type='STRING', description='The new address/baseaddress of the record in hexadecimal notation. Omit the 0x part in front. This field can also contain known symbols to Cheat Engine'},
1176
+ offsets={type='ARRAY', items={type='STRING'}, description=[[When set the address will be handled as a pointer address/
1177
+ It is a list of offsets(hexadecimal values(no 0x in front), interpretable symbols or lua code)
1178
+ During runtime, the first offset's value gets added to the baseAddress's value (in 32-bit 4 bytes, in 64-bit 8 bytes) : P1
1179
+ If there is a 2nd offset, P1 will get read as a pointer and the value of the 2nd offset will be added to that : P2
1180
+ This repeats until the last offset. The final address will then become the last pointer(Px)+lastoffset]]},
1181
+
1182
+ script={type='STRING',description='The updated/new autoassembler script with [ENABLE] and [DISABLE] tags'},
1183
+ async={type='BOOLEAN', description='Changes the async variable. If true the autoassembler script will run in a seperate thread when activating, not freezing the user\'s UI'},
1184
+ parentNode={type='INTEGER', description='Sets a new parent. null if you want it to be at the root'},
1185
+ value={type='STRING', description='Sets the value of the memory record. If it was frozen this will update the value it freeze at. You can also set the value to (MemoryRecordDescription) and it will set the value to the same value as the memoryrecord with the given description'},
1186
+ active={type='BOOLEAN', description=[[If the valuetype isn't vtAutoAssembler then when set to true will freeze the value to the current value, and when false unfreeze the value
1187
+ If it is sa vtAutoAssembler setting this to true will assemble the [ENABLE] section. On false it will execute the [DISABLE] section]]}
1188
+ }
1189
+ ,
1190
+ {
1191
+ --required
1192
+ 'memoryRecordID'
1193
+ }
1194
+ ,
1195
+ ai_editMemoryRecord)
1196
+
1197
+ registerAITool('getMemoryRecordByDescription',[[Returns a unique never changing memoryRecordID with the given description/name]],{description={type='STRING', description='The description of the memory record to look for'}},{'description'},ai_getMemoryRecordByDescription)
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+ --nuclear option (and halicinary):
1204
+ --registerAITool('executeLuaCode','Execute any lua code inside the current Cheat Engine instance', {script},{},ai_executeCode)
1205
+
1206
+
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/Place folder based extensions here.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ The folders in this path will get their Lua code executed when CE launches
2
+ if there is a loadorder.txt file present in the folder the lua files will be loaded in that order. if a file is missing from that list, it won't be auto loaded
3
+
4
+ To get the path of the folder your lua files are running in use extractFilePath(getCurrentScriptPath())
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/UETools/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dark Byte
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/UETools/UEInfoScanner.LUA ADDED
@@ -0,0 +1,2238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --UEInfoScanner and UEInfoStructureDissect are licensed under the MIT License by Eric Heijnen / Cheat Engine
2
+ --https://github.com/cheat-engine/UnrealEngineTools
3
+
4
+
5
+ local function log(str)
6
+ if UEngine==nil then
7
+ UEngine={}
8
+ UEngine.processid=getOpenedProcessID()
9
+ end
10
+
11
+ if UEngine.log==nil then
12
+ UEngine.log=''
13
+ end
14
+
15
+ UEngine.log=UEngine.log..str..'\n\r'
16
+ end
17
+
18
+ function UObject_getName(UObjectAddress)
19
+ if UEngine==nil or UEngine.UObject==nil or UEngine.UObject.Name==nil or UEngine.IndexToName==nil then
20
+ return nil,'UEngine.UObject.Name not initialized yet'
21
+ end
22
+
23
+ --make sure it's an UObject. e.g UField is, but FField is not
24
+ local vftableptr=readPointer(UObjectAddress)
25
+ if vftableptr and vftableptr>=getAddress(process) and vftableptr<getAddress(process)+getModuleSize(process) then
26
+ local i=readQword(UObjectAddress+UEngine.UObject.Name)
27
+ local index=i & 0xffffffff
28
+ local number=i >> 32
29
+ local name=UEngine.IndexToName[i&0xffffffff]
30
+
31
+ if name and number>0 then
32
+ name=name..'_'..number
33
+ end
34
+
35
+ return name
36
+ end
37
+ end
38
+
39
+ function UObject_enumProperties(address)
40
+ local class=readPointer(address+UEngine.UObject.Class)
41
+ if class then
42
+ return UClass_enumProperties(class)
43
+ else
44
+ return nil,'Failure to read class field'
45
+ end
46
+ end
47
+
48
+ function UClass_enumProperties(class,usealt,r)
49
+ --get the parent fields as well? (remove duplicates)
50
+ if not r then
51
+ r={}
52
+ end
53
+
54
+ if UEngine.UClass.SuperStruct then
55
+ local super=readPointer(class+UEngine.UClass.SuperStruct)
56
+ if super then
57
+ UClass_enumProperties(super,usealt,r)
58
+ end
59
+ end
60
+
61
+ local p
62
+ if not usealt then
63
+ p=readPointer(class+UEngine.UClass.PropertyLink)
64
+ end
65
+
66
+ if p==nil or p==0 then
67
+ --maybe time to swap
68
+ p=readPointer(class+UEngine.UClass.PropertyLinkAlt)
69
+ end
70
+ if p and p~=0 then
71
+
72
+ while p and p~=0 do
73
+ e={}
74
+ local v=readInteger(p+UEngine.FProperty.Name)
75
+ local name=UEngine.IndexToName[v]
76
+ if v and name then
77
+ local offset=readInteger(p+UEngine.FProperty.Offset)
78
+
79
+ e.offset=offset
80
+ e.propertyAddress=p
81
+
82
+ local c=readPointer(p+UEngine.FProperty.Class)
83
+ if c==nil then
84
+ return nil,'c was nil'
85
+ end
86
+ local nameIndex=readInteger(c+UEngine.FFieldClass.Name)
87
+
88
+ if nameIndex==nil then
89
+ return nil,'nameIndex==nil'
90
+ end
91
+
92
+ e.propertyType=UEngine.IndexToName[nameIndex]
93
+
94
+
95
+ if UEngine.FProperty.Size then
96
+ e.size=readInteger(p+UEngine.FProperty.Size)
97
+ end
98
+
99
+ r[name]=e --override even if it existed
100
+
101
+ end
102
+
103
+
104
+ p=readPointer(p+UEngine.FProperty.PropertyLinkNext)
105
+ end
106
+
107
+
108
+ return r
109
+ else
110
+ return nil,'No propertylink found'
111
+ end
112
+ end
113
+
114
+
115
+ function getSuperListFromField(FieldAddress)
116
+ if isVTable(readPointer(FieldAddress)) then
117
+ local Names={}
118
+
119
+ local nameindex=readQword(FieldAddress+UEngine.FField.Name)
120
+ local name=UEngine.IndexToName[nameindex]
121
+ if name then
122
+ local class=readPointer(FieldAddress+UEngine.FField.Class)
123
+ while class and class~=0 do
124
+ nameindex=readQword(class+UEngine.FFieldClass.Name)
125
+ if nameindex==nil then return nil end
126
+
127
+ name=UEngine.IndexToName[nameindex]
128
+ if name==nil then return nil end
129
+
130
+ table.insert(Names,name)
131
+
132
+ class=readPointer(class+UEngine.FFieldClass.SuperClass)
133
+ end
134
+
135
+ return Names
136
+ end
137
+ end
138
+ end
139
+
140
+ function testIfSuperStructOffset(classAddress, offset)
141
+ local depth=0
142
+ local super={}
143
+ local class=readPointer(classAddress+offset)
144
+ while class and (class~=0) do
145
+ local n=UObject_getName(class)
146
+ if n then
147
+ table.insert(super, n)
148
+ else
149
+ return nil --a bad classname
150
+ end
151
+
152
+ local newclass=readPointer(class+offset)
153
+ if newclass==class then return nil end --points to itself (found Class, needed SuperClass)
154
+
155
+ class=newclass
156
+ depth=depth+1
157
+
158
+ if depth>20 then return nil end --endless loop
159
+ end
160
+
161
+ return super
162
+ end
163
+
164
+
165
+ function getSuperListFromObject(ObjectAddress)
166
+ --get the class
167
+ local super={}
168
+ local class=readPointer(ObjectAddress+UEngine.UObject.Class)
169
+ while class and class~=0 do
170
+ local n=UObject_getName(class)
171
+ if n then table.insert(super, n)
172
+ else
173
+ return nil --a bad classname
174
+ end
175
+
176
+ class=readPointer(class+UEngine.UClass.SuperStruct)
177
+ end
178
+
179
+ return super
180
+ end
181
+
182
+ function GetLinkedListSize(p,LinkOffset)
183
+ local c=0
184
+
185
+ repeat
186
+ p=readPointer(p+LinkOffset)
187
+ if p and p~=nil and p~=0 then
188
+ c=c+1
189
+ end
190
+ until p==nil or p==0 or c>100000
191
+ return c
192
+ end
193
+
194
+ function UEngine_findStructureStart(address)
195
+ address=address & 0xfffffffffffffff8
196
+
197
+ c=0
198
+ while c<100 do
199
+ local p=readPointer(address)
200
+ if p==nil then
201
+ return nil,'encountered unreadable memory'
202
+ end
203
+
204
+ if isVTable(p) then
205
+ return address
206
+ end
207
+ address=address-8
208
+ c=c+1
209
+ end
210
+ end
211
+
212
+ function findGameInstanceFPropertyAndFields(t)
213
+ --note: in older UE games a property is an UObject
214
+ if not UEngine.UGameEngine then return nil,'Find UGameEngine and GameEngineClass first' end
215
+ if not UEngine.GameEngineClass then return nil,'Find the GameEngineClass first' end
216
+
217
+ local index=UEngine.NameToIndex['GameInstance']
218
+ local ms=createMemScan() --todo: make aobscanarrays (multiple) allow multiple results
219
+ ms.VarType=vtQword
220
+ ms.ScanValue=index
221
+ ms.Fastscanmethod=fsmAligned
222
+ ms.Fastscanparameter=4
223
+
224
+ log('scanning GameInstance')
225
+ ms.scan()
226
+
227
+ local r=ms.Results
228
+ local errstr=ms.ErrorString
229
+ ms.destroy()
230
+ ms=nil
231
+
232
+ if errstr~='' then
233
+ return nil,errstr
234
+ end
235
+
236
+ if #r==0 then
237
+ return nil,'Failure finding references to the GameInstance FProperty'
238
+ end
239
+
240
+
241
+ local goodrangestart=getAddress(process)
242
+ local goodrangestop=getAddress(process)+getModuleSize(process)
243
+
244
+ local bases={}
245
+ local nameoffsets={} --to verify
246
+ for i=1,#r do
247
+ --find the structure start of each result, if possible (look up to 10 pointers back for a vtable, but keep in mind there can be more)
248
+
249
+ local base=UEngine_findStructureStart(r[i]) --scan for a vftable. a vftable is a pointer to a list in the module, and each pointer in that list is a pointer to an executable address (doesn't have to be .text)
250
+ if base then
251
+ table.insert(bases,base)
252
+ table.insert(nameoffsets,r[1]-base)
253
+ end
254
+ end
255
+
256
+ --now scan these bases for a pointer to GameEngineClass. Likely the offset will be close to the base as it's also in FField (lowest offset wins if multiple matches)
257
+ local FPropertyOwnerOffset
258
+ local GameInstanceFProperty
259
+ for i=1,#bases do
260
+
261
+ for j=1,32 do
262
+ if readPointer(bases[i]+j*8) & 0xfffffffffffffff0==UEngine.GameEngineClass then --ue 4.26 and 5 (UE5 used the lowest bits to set if it's an Object or Field, 4.26 used a byte with padding.
263
+ if FPropertyOwnerOffset then
264
+ if FPropertyOwnerOffset>j*8 then
265
+ FPropertyOwnerOffset=j*8
266
+ GameInstanceFProperty=bases[i]
267
+ end
268
+ else
269
+ FPropertyOwnerOffset=j*8
270
+ GameInstanceFProperty=bases[i]
271
+ end
272
+ break
273
+ end
274
+ end
275
+ end
276
+
277
+ if GameInstanceFProperty then
278
+ --found it!
279
+ --parse it for some useful stuff
280
+ UEngine.FProperty={}
281
+ UEngine.FProperty.Owner=FPropertyOwnerOffset
282
+
283
+ local potentialPropertyLists={} --FProperties have multiple lists
284
+
285
+ for i=1,64 do
286
+
287
+
288
+ local p=GameInstanceFProperty+i*4
289
+
290
+
291
+
292
+ local pp=readPointer(p)
293
+ local pi=pp & 0xffffffff
294
+
295
+ if isVTable(pp) then
296
+ break --another object starts here
297
+ end
298
+
299
+
300
+
301
+ if UEngine.FProperty.Name==nil then
302
+ if pi==index then
303
+ UEngine.FProperty.Name=i*4
304
+ end
305
+ end
306
+
307
+ if (UEngine.FProperty.Offset==nil) and (pi>8) and (pi<0x9000) and ((pi & 7) == 0) then --could be an offset to GameInstance
308
+ local potentialGameInstanceObject=readPointer(UEngine.UGameEngine+pi)
309
+ local name=UObject_getName(potentialGameInstanceObject)
310
+ if name then
311
+ --at least it has a name, check if it inherits from GameInstance
312
+ local superlist=getSuperListFromObject(potentialGameInstanceObject)
313
+ if superlist then
314
+ for j=1,#superlist do
315
+ if superlist[j]=='GameInstance' then
316
+ UEngine.FProperty.Offset=i*4
317
+ end
318
+ end
319
+ end
320
+ end
321
+ end
322
+
323
+ if (i & 0x1==0) and (pp & 0x7==0) then --pointer alignment
324
+
325
+
326
+ if UEngine.FProperty.Class==nil then --check if it's a FObjectProperty Class
327
+
328
+ --scan it for a name ending with Property (spoiler, it's ObjectProperty)
329
+ for j=0,16 do
330
+ local v=readQword(pp+j*4)
331
+ local n=UEngine.IndexToName[v]
332
+
333
+ if n then
334
+ if n:endsWith('Property') then
335
+ UEngine.FProperty.Class=i*4 --handy for validating future FProperties
336
+ UEngine.FFieldClass={}
337
+ UEngine.FFieldClass.Name=j*4
338
+ break
339
+ end
340
+ end
341
+ end
342
+
343
+ if UEngine.FProperty.Class and UEngine.FFieldClass.Name then --found the class just not.
344
+ --find SuperClass in FFieldClass (SuperClass is the same type as FFieldClass, so name is in the same spot)
345
+ local pf=readPointer(GameInstanceFProperty+UEngine.FProperty.Class)
346
+ for j=0,16 do
347
+ local v=readPointer(pf+j*8)
348
+ if v then
349
+ local v2=ReadQword(v+UEngine.FFieldClass.Name)
350
+ if v2 then
351
+ local name=UEngine.IndexToName[v2]
352
+ if name and (name:endsWith('Property') or name:endsWith('PropertyBase') or name=='Field') then
353
+ UEngine.FFieldClass.SuperClass=j*8 --found it
354
+ break
355
+ end
356
+ end
357
+ end
358
+ end
359
+ end
360
+ end
361
+ table.insert(potentialPropertyLists, i*4) --to be checked against name, and propertyclass later
362
+ end
363
+ end
364
+
365
+
366
+ if UEngine.FProperty and UEngine.FFieldClass and UEngine.FFieldClass.Name and UEngine.FProperty.Class and UEngine.FProperty.Name and UEngine.FProperty.Owner then
367
+ --now process the potentialPropertyLists. We have enough FProperty field info to determine if it's validish or not. Some of them are meh, and some of them contain everything including super class properties
368
+ --...
369
+ UEngine.FField={}
370
+ UEngine.FField.Class=UEngine.FProperty.Class
371
+ UEngine.FField.Owner=UEngine.FProperty.Owner
372
+ UEngine.FField.Name=UEngine.FProperty.Name
373
+
374
+
375
+
376
+ local PropertyLinkNextOffset
377
+ local BestPropertyCount
378
+
379
+ for i=1,#potentialPropertyLists do
380
+ --scan, but stop when a vtable is encountered (most properties are allocated next to eachother)
381
+ local p=readPointer(GameInstanceFProperty+potentialPropertyLists[i])
382
+
383
+ local superlist=getSuperListFromField(p) --handle P as a field
384
+
385
+
386
+ --UE5 : Property->Field (Done)
387
+ --UE4 : Property->Field->Object
388
+ if superlist and (
389
+ ((#superlist>=2) and (superlist[#superlist]=='Field') and (superlist[#superlist-1]=='Property'))
390
+ or
391
+ ((#superlist>=3) and (superlist[#superlist]=='Object') and (superlist[#superlist-1]=='Field') and (superlist[#superlist-2]=='Property'))
392
+ )
393
+ then
394
+ local c=GetLinkedListSize(GameInstanceFProperty, potentialPropertyLists[i])
395
+ if PropertyLinkNextOffset==nil or c>BestPropertyCount then
396
+ PropertyLinkNextOffset=potentialPropertyLists[i]
397
+ BestPropertyCount=c
398
+ end
399
+ end
400
+ end
401
+ UEngine.FProperty.PropertyLinkNext=PropertyLinkNextOffset
402
+
403
+ --scan the GameEngineClass for properties (todo: maybe also add a few others)
404
+ local PropertyLinkOffset
405
+ BestPropertyCount=0
406
+ local altoffset
407
+ for i=1,100 do
408
+ local p=readPointer(UEngine.GameEngineClass+i*8)
409
+
410
+
411
+ if isVTable(p) then break end
412
+
413
+ local superlist=getSuperListFromField(p)
414
+ if superlist and (
415
+ ((#superlist>=2) and (superlist[#superlist]=='Field') and (superlist[#superlist-1]=='Property'))
416
+ or
417
+ ((#superlist>=3) and (superlist[#superlist]=='Object') and (superlist[#superlist-1]=='Field') and (superlist[#superlist-2]=='Property'))
418
+ )
419
+ then
420
+ local c=GetLinkedListSize(p, UEngine.FProperty.PropertyLinkNext)
421
+ if PropertyLinkOffset==nil or c>=BestPropertyCount then
422
+ altoffset=PropertyLinkOffset
423
+ PropertyLinkOffset=i*8
424
+ BestPropertyCount=c
425
+ end
426
+ end
427
+ end
428
+
429
+ UEngine.UClass.PropertyLink=PropertyLinkOffset
430
+ UEngine.UClass.PropertyLinkAlt=altoffset
431
+
432
+ --find some property specific info (Property size field, and for BoolProperty the bitfields (01 00 bitmask bitmask for properties that have the same offset)
433
+ local gameEngineProperties=UClass_enumProperties(UEngine.GameEngineClass)
434
+ local sizes={}
435
+ sizes[1]={}
436
+ sizes[4]={}
437
+ sizes[8]={}
438
+ local bools={}
439
+
440
+ for name, info in pairs(gameEngineProperties) do
441
+ if info.propertyType=='FloatProperty' then
442
+ if #sizes[4]<10 then
443
+ table.insert(sizes[4],info.propertyAddress)
444
+ end
445
+ elseif info.propertyType=='IntProperty' then
446
+ if #sizes[4]<10 then
447
+ table.insert(sizes[4],info.propertyAddress)
448
+ end
449
+ elseif info.propertyType=='ObjectProperty' then
450
+ if #sizes[8]<10 then
451
+ table.insert(sizes[8],info.propertyAddress)
452
+ end
453
+ elseif info.propertyType=='ClassProperty' then
454
+ if #sizes[8]<10 then
455
+ table.insert(sizes[8],info.propertyAddress)
456
+ end
457
+ elseif info.propertyType=='BoolProperty' then
458
+ if #sizes[1]<10 then
459
+ table.insert(sizes[1],info.propertyAddress)
460
+ end
461
+
462
+ if bools[info.offset]==nil then
463
+ bools[info.offset]={}
464
+ end
465
+
466
+ table.insert(bools[info.offset], info.propertyAddress)
467
+ end
468
+ end
469
+
470
+
471
+ for i=2,64 do
472
+ local foundsize=true
473
+ for size,addresslist in pairs(sizes) do
474
+ for j=1,#addresslist do
475
+ if readInteger(addresslist[j]+i*4)~=size then
476
+ foundsize=false
477
+ break
478
+ end
479
+ end
480
+ if foundsize==false then break end
481
+ end
482
+
483
+ if foundsize then
484
+ UEngine.FProperty.Size=i*4
485
+ break
486
+ end
487
+ end
488
+
489
+ --now try to find the bitfields
490
+ local multibitfields={}
491
+ local couldbefullbyte=false
492
+ for offset,addresslist in pairs(bools) do
493
+ if #addresslist>1 then
494
+ table.insert(multibitfields,addresslist) --guaranteed to have 1 bit sized entries
495
+ end
496
+ end
497
+
498
+ if #multibitfields==0 then
499
+ --bah, it's all single bit fields... Just use these then
500
+ couldbefullbyte=true
501
+ for offset,addresslist in pairs(bools) do
502
+ table.insert(multibitfields,addresslist)
503
+ end
504
+ end
505
+
506
+ local startIndex=UEngine.FProperty.PropertyLinkNext // 8+1 --it starts after the normal property definition (
507
+
508
+ local isSingleBit={}
509
+ isSingleBit[1]=true
510
+ isSingleBit[2]=true
511
+ isSingleBit[4]=true
512
+ isSingleBit[8]=true
513
+ isSingleBit[16]=true
514
+ isSingleBit[32]=true
515
+ isSingleBit[64]=true
516
+ isSingleBit[128]=true
517
+
518
+ for i=startIndex,64 do
519
+ local foundbitmaskfield=true
520
+ for j=1,#multibitfields do
521
+ for k=1,#multibitfields[j] do
522
+ local v=readInteger(multibitfields[j][k]+i*4)
523
+ local b1=v & 0xff
524
+ if b1~=1 then
525
+ foundbitmaskfield=false
526
+ break
527
+ end
528
+
529
+ local b2=(v >> 8) & 0xff
530
+ if b2~=0 then
531
+ foundbitmaskfield=false
532
+ break
533
+ end
534
+
535
+ local b3=(v >> 16) & 0xff;
536
+ if not isSingleBit[b3] then
537
+ if (couldbefullbyte==false) or (b3~=0xff) then
538
+ foundbitmaskfield=false
539
+ break
540
+ end
541
+ end
542
+
543
+ local b4=(v >> 24) & 0xff;
544
+ if not isSingleBit[b4] then
545
+ if (couldbefullbyte==false) or (b4~=0xff) then
546
+ foundbitmaskfield=false
547
+ break
548
+ end
549
+ end
550
+ end
551
+ if foundbitmaskfield==false then break end
552
+ end
553
+ if foundbitmaskfield then
554
+ UEngine.FProperty.BitMaskField=i*4
555
+ UEngine.FProperty.ObjectClassType=i*4 --same offset (e.g ObjectClassType for the property GameInstance is a pointer to the GameInstanceClass
556
+ break
557
+ end
558
+ end
559
+
560
+ --Obtained everything needed
561
+
562
+ return true, 'success'
563
+ else
564
+ return nil,'Not all needed fields where found'
565
+ end
566
+
567
+
568
+
569
+ else
570
+ return nil, 'Failed finding GameInstanceFProperty'
571
+ end
572
+
573
+ return nil,'huh?'
574
+
575
+ end
576
+
577
+
578
+
579
+ function FindGEngine(t)
580
+ --some options: Parse the whole object table , or signature scan. Trying the sigscan method first as it can be done without injection
581
+
582
+ if UEngine.UObject.Name==nil then
583
+ return nil,'UEngine.UObject.Name==nil'
584
+ end
585
+ local index=UEngine.NameToIndex['GameEngine']
586
+
587
+ --local altindex=UEngine.NameToIndex['OakGameEngine'] --alternate option (inherits from gameengine)
588
+
589
+ if index==nil then return false, "failure finding GameEngine string" end
590
+
591
+ local ms=createMemScan()
592
+
593
+ local start,stop
594
+ mstart=getAddress(process)
595
+ mstop=mstart+getModuleSize(process)
596
+
597
+ ms.VarType=vtGrouped
598
+ ms.Fastscanmethod=fsmAligned
599
+ ms.Fastscanparameter=8
600
+
601
+ -- ms.Scanvalue='p:S w:'..(UObject.Name-8)..' 4:'..NameToIndex['OakGameEngine']
602
+ --ms.Scanvalue='p:S w:'..(UObject.Name-8)..' 4:'..NameToIndex['GameEngine']
603
+ --doing a range scan is faster that a p:S scan
604
+ ms.Scanvalue='8r:'..mstart..'-'..mstop..' w:'..(UEngine.UObject.Name-8)..' 4:'..UEngine.NameToIndex['GameEngine']
605
+ ms.ScanWritable='scanInclude'
606
+ ms.ScanExecutable='scanExclude'
607
+ ms.ScanCopyOnWrite='scanExclude'
608
+
609
+ ms.scan()
610
+
611
+ log('FindGEngine: Starting scan for '..ms.Scanvalue)
612
+
613
+ ms.waitTillDone()
614
+
615
+ log('FindGEngine: Scan finished')
616
+
617
+ sleep(1000)
618
+
619
+ ms.nextScan()
620
+
621
+ local r=ms.Results
622
+ local r2
623
+
624
+ if t and t.terminated then return nil end
625
+
626
+
627
+ ms.destroy()
628
+ ms=nil
629
+
630
+ log('FindGEngine: Next scan finished')
631
+
632
+
633
+ if #r>=1 then
634
+ r2={}
635
+ for i=1,#r do
636
+ if isVTable(readPointer(r[i])) then
637
+ --todo: check classname for the name 'GameEngine' which itself has a classname of 'Class' (or the Superclasses named Engine->Object->nil pointer
638
+ --still here
639
+ table.insert(r2,r[i])
640
+ end
641
+ end
642
+ end
643
+
644
+
645
+ r={}
646
+ for i=1,#r2 do
647
+ --the instantiated GEngine has a number for the name
648
+ if readInteger(r2[i]+UEngine.UObject.Name+4)~=0 then table.insert(r,r2[i]) end
649
+ end
650
+
651
+ if #r>1 then
652
+ return nil,'FindGEngine needs more refining'
653
+ end
654
+
655
+ if #r==0 then
656
+ log('FindGEngine: No direct GEngine found')
657
+
658
+
659
+ --no instance found, maybe it created a subclass
660
+ if #r2>=1 then
661
+ log('Searching deeper')
662
+ for gei=1,#r2 do
663
+ local PotentialGameEngineClass=r2[gei]
664
+
665
+ --there is GameEngine , likely a GameEngine Class (Confirm by checking the class pointer name to be 'Class')
666
+ --printf("subclass situation")
667
+ local ClassClass=readPointer(r2[1]+UEngine.UObject.Class) --should be the default 'Class' Object
668
+
669
+ if isVTable(readPointer(ClassClass))==false then
670
+ goto continue
671
+ --return nil,'Invalid ClassClass'
672
+ end
673
+
674
+ local ClassClassName=UObject_getName(ClassClass)
675
+ if ClassClassName~='Class' then
676
+ goto continue
677
+ --return nil,'ClassClass type is not a class'
678
+ end
679
+
680
+ --still here, so this is indeed the gameengine class
681
+ --find the superclass pointer which has the name "Engine" (need to know the offset for the scan already)
682
+
683
+ if UEngine.UClass==nil then
684
+ UEngine.UClass={}
685
+ UEngine.UClass.Name=UEngine.UObject.Name
686
+ UEngine.UClass.Class=UEngine.UObject.Class
687
+ end
688
+
689
+
690
+ for i=1,32 do
691
+ local n=UObject_getName(readPointer(PotentialGameEngineClass+i*8)) --0x40 in borderlands 4
692
+ if n=='Engine' then
693
+ --found the superstruct
694
+ UEngine.UClass.SuperStruct=i*8
695
+ break
696
+ end
697
+ end
698
+
699
+ --find the class that has the GameEngineClass as it's superstruct
700
+ if UEngine.UClass.SuperStruct==nil then
701
+ goto continue
702
+ -- return nil,'UClass.SuperStruct==nil'
703
+ end
704
+
705
+ local ms=createMemScan()
706
+ ms.VarType=vtGrouped
707
+ ms.Fastscanmethod=fsmAligned
708
+ ms.Fastscanparameter=8
709
+
710
+ --build a scanstring
711
+ local sv='BA:8 8r:'..mstart..'-'..mstop
712
+ local offset=8
713
+ if UEngine.UClass.Class<UEngine.UClass.SuperStruct then
714
+ sv=sv..' w:'..UEngine.UClass.Class-offset..' 8:'..ClassClass
715
+ offset=UEngine.UClass.Class+8
716
+ sv=sv..' w:'..UEngine.UClass.SuperStruct-offset..' 8:'..PotentialGameEngineClass
717
+ else --it theoretically 'could' happen with enough customization fuckery
718
+ sv=sv..' w:'..UEngine.UClass.SuperStruct-offset..' 8:'..PotentialGameEngineClass
719
+ offset=UEngine.UClass.SuperStruct+8
720
+ sv=sv..' w:'..UEngine.UClass.Class-offset..' 8:'..ClassClass
721
+ end
722
+
723
+ ms.Scanvalue=sv --'p:S w:'..(UClass.SuperStruct-8)..' 8:'..PotentialGameEngineClass
724
+ ms.ScanWritable='scanInclude'
725
+ ms.ScanExecutable='scanExclude'
726
+ ms.ScanCopyOnWrite='scanExclude'
727
+
728
+ ms.scan()
729
+ ms.waitTillDone()
730
+ ms.nextScan()
731
+
732
+ r=ms.Results
733
+ ms.destroy() ms=nil
734
+
735
+ local found=false
736
+
737
+ --all potential classes that have inherited from GameEngine (likely just 1)
738
+ for i=1,#r do
739
+ --find all objects that have this as class --todo: may have to go deeper (in which case an object enum might be faster)
740
+
741
+ local ms=createMemScan()
742
+ ms.VarType=vtGrouped
743
+ ms.Fastscanmethod=fsmAligned
744
+ ms.Fastscanparameter=8
745
+
746
+ ms.Scanvalue='BA:8 8r:'..mstart..'-'..mstop..' w:'..(UEngine.UClass.Class-8)..' 8:'..r[i] --the address of the class at the class offset.
747
+ ms.ScanWritable='scanInclude'
748
+ ms.ScanExecutable='scanExclude'
749
+ ms.ScanCopyOnWrite='scanExclude'
750
+
751
+ log('scanning for '..ms.Scanvalue)
752
+
753
+ ms.scan()
754
+ r2=ms.Results
755
+ ms.destroy() ms=nil
756
+
757
+ r3={}
758
+ for j=1,#r2 do
759
+ --check if the name number if set
760
+ --the instantiated GEngine has a number for the name
761
+ if readInteger(r2[j]+UEngine.UObject.Name+4)~=0 then table.insert(r3,r2[j]) end
762
+ end
763
+
764
+ if #r3>0 then
765
+ r=r3
766
+ found=true
767
+
768
+ GameEngineClass=PotentialGameEngineClass
769
+ break
770
+ end
771
+ end
772
+
773
+ if found then
774
+
775
+ break
776
+ end
777
+
778
+ ::continue::
779
+ end
780
+
781
+ else
782
+ return false,'No GameEngine found'
783
+ end
784
+
785
+ end
786
+
787
+ if #r==0 then
788
+ return nil,'No GameEngine instance found'
789
+ end
790
+
791
+
792
+ UEngine.UGameEngine=r[1]
793
+ --GameEngine is found , lets try to find GEngine while we're (handy when the game restarts)
794
+
795
+ ms=createMemScan()
796
+ ms.VarType=vtQword
797
+ ms.ScanValue=UEngine.UGameEngine
798
+ ms.Startaddress=getAddress(process)
799
+ ms.Stopaddress=getAddress(process)+getModuleSize(process)
800
+ ms.scan()
801
+ r=ms.Results
802
+ if #r==1 then
803
+ UEngine.GEngine=r[1]
804
+ unregisterSymbol('GEngine')
805
+ local n=getNameFromAddress(UEngine.GEngine,true,false,false)
806
+ if n:find(extractFileNameWithoutExt(process)) then
807
+ registerSymbol('GEngine',getNameFromAddress(UEngine.GEngine), true)
808
+ end
809
+ end
810
+
811
+ ms.destroy()
812
+
813
+ return true
814
+ end
815
+
816
+ function isInExecutableMainModuleMemory(address)
817
+ if UEngine.ExecutableRanges==nil then
818
+ UEngine.ExecutableRanges={}
819
+
820
+ --alternatively, I could init the range by using the first UObjectList's first pointer and follow it to a executable code. Works for each list type as the first item is always a pointer
821
+
822
+ if UEngine.VFTableInExecutableMemoryMethod==nil or UEngine.VFTableInExecutableMemoryMethod==2 then
823
+ --method 1/nil: First executable code section
824
+ --method 2: All executable code sections
825
+ local sections=enumSectionsOfModule(process)
826
+ --find the first executable section
827
+
828
+ for i=1,#sections do
829
+ if sections[i].IsCode and sections[i].IsExecutable then
830
+ local e={}
831
+ e.start=sections[i].Address
832
+ e.stop=sections[i].Address+sections[i].Size
833
+ table.insert(UEngine.ExecutableRanges,e)
834
+
835
+ if UEngine.VFTableInExecutableMemoryMethod==nil then
836
+ break
837
+ end
838
+ end
839
+ end
840
+ end
841
+
842
+
843
+ if #UEngine.ExecutableRanges==0 then
844
+ --worst case scenario
845
+ local goodrangestart=getAddress(process)
846
+ local goodrangestop=getAddress(process)+getModuleSize(process)
847
+
848
+ local executablePageProtect={}
849
+
850
+ executablePageProtect[PAGE_EXECUTE]=true
851
+ executablePageProtect[PAGE_EXECUTE_READ]=true
852
+ executablePageProtect[PAGE_EXECUTE_READWRITE]=true
853
+ executablePageProtect[PAGE_EXECUTE_WRITECOPY]=true
854
+
855
+ local mr=enumMemoryRegions()
856
+ for i=1,#mr do
857
+ if executablePageProtect[mr[i].Protect] and (mr[i].BaseAddress>=goodrangestart) and (mr[i].BaseAddress+mr[i].RegionSize<goodrangestop) then
858
+ local e={}
859
+ e.start=mr[i].BaseAddress
860
+ e.stop=mr[i].BaseAddress+mr[i].RegionSize
861
+ table.insert(UEngine.ExecutableRanges,e)
862
+ end
863
+ end
864
+ end
865
+ end
866
+
867
+ local er=UEngine.ExecutableRanges
868
+
869
+ for i=1,#er do
870
+ if address>er[i].start and address<er[i].stop then
871
+ return true
872
+ end
873
+ end
874
+
875
+ return false
876
+ end
877
+
878
+ function isVTable(address)
879
+ if address==nil then return nil,'invalid address' end
880
+ local goodrangestart=getAddress(process)
881
+ local goodrangestop=getAddress(process)+getModuleSize(process)
882
+
883
+
884
+
885
+ if address>goodrangestart and address<goodrangestop then
886
+ --check if it's a list of pointers to functions
887
+ for i=0,8 do
888
+ local p=readPointer(address+i*8)
889
+ if isInExecutableMainModuleMemory(p)==false then
890
+ return false
891
+ end
892
+ end
893
+
894
+ return true
895
+ else
896
+ return false;
897
+ end
898
+
899
+ end
900
+
901
+
902
+ function InitializeUObjectArray_Verifier_Type()
903
+ if UObjectArray_Verifier_Type then
904
+ UObjectArray_Verifier_Type.destroy()
905
+ end
906
+ UObjectArray_Verifier_Type=getCustomType('UObjectArray Verifier Type')
907
+ if UObjectArray_Verifier_Type then
908
+ UObjectArray_Verifier_Type.destroy()
909
+ end
910
+ UObjectArray_Verifier_Type=nil
911
+
912
+
913
+
914
+ UObjectArray_Verifier_Type,emsg=registerCustomTypeAutoAssembler([[{$c}
915
+
916
+ //returns 1 if the type matches
917
+ char TypeName[]="UObjectArray Verifier Type";
918
+ int ByteSize=16;
919
+ char CallMethod=1; //cdecl
920
+
921
+ int PreferedAlignment=0x10;
922
+
923
+
924
+ #include <stdio.h>
925
+ #include <stdint.h>
926
+ #include <stdlib.h>
927
+
928
+ typedef struct
929
+ {
930
+ int val1;
931
+ int val2;
932
+ int val3;
933
+ int zero;
934
+ } *pdata;
935
+
936
+ __cdecl size_t ConvertRoutine(pdata data, unsigned long long address)
937
+ {
938
+ int r=1;
939
+ //if (data->val1<100) return 0; //no tiny games
940
+ if (data->zero) return 0;
941
+ if (data->val3!=data->val1) return 0;
942
+ if ((data->val2) != ((data->val1)-1)) return 0;
943
+
944
+ //still here
945
+ return 1;
946
+ }
947
+
948
+ __cdecl void ConvertBackRoutine(size_t input, unsigned long long address, unsigned char *output)
949
+ {
950
+ //nope
951
+ }
952
+
953
+ {$asm}]])if UObjectArray_Verifier_Type==nil and emsg then
954
+ error(emsg)
955
+ end
956
+
957
+ UObjectArray_Verifier_Type.InternalOnly=true
958
+ end
959
+
960
+ function FindObjectArray(t) --and UObject name offset
961
+
962
+ --for 4.26 >
963
+ local r={}
964
+
965
+ if UObjectArray_Verifier_Type==nil then
966
+ InitializeUObjectArray_Verifier_Type()
967
+
968
+ if UObjectArray_Verifier_Type==nil then
969
+ return nil,'No verifier type'
970
+ end
971
+ end
972
+
973
+ if UEngine.ObjectArray==nil then
974
+
975
+ local ms=createMemScan()
976
+ ms.VarType=vtGrouped --custom type only also works
977
+ ms.Fastscanmethod=fsmAligned
978
+ ms.Fastscanparameter=10
979
+
980
+ ms.Scanvalue='BA:8 c(UObjectArray Verifier Type):1 p:D'
981
+ ms.Startaddress=getAddress(process)
982
+ ms.Stopaddress=getAddress(process)+getModuleSize(process)
983
+ ms.scan()
984
+ ms.waitTillDone()
985
+ r=ms.Results
986
+
987
+ local errorstring=ms.ErrorString
988
+ ms.destroy()
989
+ ms=nil
990
+
991
+ if t and t.Terminated then return false, 'UEInfoScannerThread terminated' end
992
+
993
+
994
+ if #r==0 then
995
+ return false,'Failed finding anything ('..errorstring..')'
996
+ end
997
+
998
+ if #r>1 then
999
+ local r2={}
1000
+ --find the ones with
1001
+ for i=1,#r do
1002
+ if (readInteger(r[i])==0) or (readInteger(r[i])>100) then
1003
+ table.insert(r2,r[i])
1004
+ end
1005
+ end
1006
+
1007
+ r=r2
1008
+ if #r>1 then
1009
+ r2={}
1010
+
1011
+ for i=1,#r do
1012
+ if readInteger(r[i])>100 then
1013
+ table.insert(r2,r[i])
1014
+ end
1015
+ end
1016
+
1017
+ r=r2
1018
+ r2={}
1019
+ --check if the first pointer pointed at is valid (there are currently 2 known types. Both both have a pointer at the first entry)
1020
+ for i=1,#r do
1021
+ local p=readPointer(r[i]+0x10)
1022
+ if p and readPointer(readPointer(p)) then
1023
+ table.insert(r2,r[i])
1024
+ end
1025
+ end
1026
+
1027
+ r=r2
1028
+
1029
+ if #r>1 then
1030
+ --more refining needed. (pick the one with the highest value or a deeper inspection of the array list)
1031
+
1032
+ return false,'Needs more refining',r
1033
+ end
1034
+
1035
+
1036
+ end
1037
+ end
1038
+ else
1039
+ r={}
1040
+ r[1]=UEngine.ObjectArray
1041
+ end
1042
+
1043
+
1044
+ if t and t.Terminated then return false, 'UEInfoScannerThread terminated' end
1045
+
1046
+ if #r==1 then
1047
+ UEngine.ObjectArray=r[1]
1048
+
1049
+ --figure out some stuff
1050
+
1051
+ local p=readPointer(UEngine.ObjectArray+0x10)
1052
+ if p then
1053
+ --get the first block
1054
+ --test what type of list this is. pointer list, or a (huge) list of ObjectArray entries
1055
+
1056
+ if readByte(readPointer(p)) and readByte(readPointer(p+8)) then
1057
+ UEngine.ObjectArrayListType=0 --list of sequential pointers to ObjectArray entries
1058
+ p=readPointer(p) --p now points to the first object array entry
1059
+ else
1060
+ --list of Object entries (or the list is just 1 long. Maybe launched too soon?)
1061
+ UEngine.ObjectArrayListType=1
1062
+
1063
+ --check some more things, maybe it is just a short list
1064
+ local ObjectListAddress=readPointer(p)
1065
+ local FirstObject=readPointer(ObjectListAddress)
1066
+ local vftable=readPointer(FirstObject)
1067
+
1068
+ if vftable then
1069
+ local f1,f2,f3=readPointer(vftable), readPointer(vftable+8), readPointer(vftable+16)
1070
+ if isInExecutableMainModuleMemory(f1) and isInExecutableMainModuleMemory(f2) and isInExecutableMainModuleMemory(f3) then
1071
+ --3 valid pointers to executable memory. Guess it's just a small list (single)
1072
+ UEngine.ObjectArrayListType=0
1073
+ p=ObjectListAddress
1074
+ end
1075
+ end
1076
+ end
1077
+
1078
+ local goodrangestart=getAddress(process)
1079
+ local goodrangestop=getAddress(process)+getModuleSize(process)
1080
+
1081
+ --find the vtable executable section, take the first pointer (for now assume that the first entry of a structure is a pointer)
1082
+ local sections=enumSectionsOfModule(process)
1083
+
1084
+ local object1=readPointer(p)
1085
+ local vftable=readPointer(object1)
1086
+ local firstfunctionaddress=readPointer(vftable) --get the address of the first function pointed at in the vftable
1087
+ for i=1,#sections do
1088
+ if firstfunctionaddress>=sections[i].Address and firstfunctionaddress<sections[i].Address+sections[i].Size then
1089
+ if sections[i].IsCode and sections[i].IsExecutable then
1090
+ --valid. Use this as a template for all future vtable rules (if not, then try the other methods described later)
1091
+ UEngine.ExecutableRanges={}
1092
+ UEngine.ExecutableRanges[1]={}
1093
+ UEngine.ExecutableRanges[1].start=sections[i].Address
1094
+ UEngine.ExecutableRanges[1].stop=sections[i].Address+sections[i].Size
1095
+ end
1096
+ break
1097
+ end
1098
+ end
1099
+
1100
+
1101
+ local validpointers={}
1102
+ --figure out the ObjectArray entry size
1103
+ for i=0,32 do
1104
+ local p1=readPointer(p+(i*4)) --scan through the block in chunks of 8
1105
+ local pv=readPointer(p1)
1106
+
1107
+ if isVTable(pv) then --first time relying on isVTable. It can bug out so deal with it if needed
1108
+ --found a valid pointer
1109
+ table.insert(validpointers, (i*4))
1110
+ end
1111
+ end
1112
+
1113
+ if #validpointers==0 then
1114
+ --fallback on all executable code sections
1115
+ UEngine.VFTableInExecutableMemoryMethod=2
1116
+ UEngine.ExecutableRanges=nil
1117
+
1118
+ for i=0,32 do
1119
+ local p1=readPointer(p+(i*4))
1120
+ local pv=readPointer(p1)
1121
+
1122
+ if isVTable(pv) then
1123
+ --found a valid pointer
1124
+ table.insert(validpointers, (i*4))
1125
+ end
1126
+ end
1127
+
1128
+ if #validpointers==0 then
1129
+ --fall back on all executable memory in the module
1130
+ UEngine.VFTableInExecutableMemoryMethod=3
1131
+ UEngine.ExecutableRanges=nil
1132
+
1133
+ for i=0,32 do
1134
+ local p1=readPointer(p+(i*4))
1135
+ local pv=readPointer(p1)
1136
+
1137
+ if isVTable(pv) then --first time relying on isVTable. It can bug out so deal with it if needed
1138
+ --found a valid pointer
1139
+ table.insert(validpointers, (i*4))
1140
+ end
1141
+ end
1142
+ end
1143
+ end
1144
+
1145
+
1146
+ if #validpointers<=1 then
1147
+ return false,"can't find figure out ObjectArrayEntryStruct size"
1148
+ end
1149
+ UEngine.ObjectArrayEntryStructSize=validpointers[2]-validpointers[1]
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+ --try to figure out the name offset now we're here
1157
+
1158
+
1159
+ --if IndexToName[0] and IndexToName[1] and IndexToName[2] then --findValidFNameFieldOffsetsInMemory won't work well here
1160
+ --instead, try to find the pointer to UClass and find the string to class
1161
+ --to find the class pointer find a pointer that points to itself eventually. it's name will be "Class" (class->class->class->class->....)
1162
+
1163
+ --note: Object0 tends to be /Script/CoreUObject
1164
+ local classPointerOffsetCount={}
1165
+ local nameoffsetcount={}
1166
+
1167
+ local ClassNameIndex=UEngine.NameToIndex['Class']
1168
+ if ClassNameIndex==nil then
1169
+ return false,'There is no Class class'
1170
+ end
1171
+
1172
+ for i=1,#validpointers do
1173
+ local objectaddress=readPointer(p+validpointers[i])
1174
+ for j=1,10 do
1175
+ local ep=readPointer(objectaddress+j*8)
1176
+ local depth=0
1177
+ while depth<20 do
1178
+ local newp=readPointer(ep+j*8)
1179
+ if newp==nil then break end
1180
+
1181
+ if newp==ep then
1182
+ local hasClassIndex=false
1183
+ --possible class pointer found
1184
+ --find the classindex in here
1185
+ for k=2,20 do --+2 to skip the vtable
1186
+ local index=readInteger(ep+k*4)
1187
+ if index==ClassNameIndex then
1188
+ hasClassIndex=true
1189
+ if nameoffsetcount[k*4] then
1190
+ nameoffsetcount[k*4]=nameoffsetcount[k*4]+1
1191
+ else
1192
+ nameoffsetcount[k*4]=1
1193
+ end
1194
+ end
1195
+ end
1196
+
1197
+ if hasClassIndex then
1198
+ if classPointerOffsetCount[j*8] then
1199
+ classPointerOffsetCount[j*8]=classPointerOffsetCount[j*8]+1
1200
+ else
1201
+ classPointerOffsetCount[j*8]=1
1202
+ end
1203
+ end
1204
+
1205
+
1206
+
1207
+ break
1208
+ end
1209
+ ep=newp
1210
+ depth=depth+1
1211
+ end
1212
+ end
1213
+ end
1214
+
1215
+ local highestcount=0
1216
+ local bestoffset=nil
1217
+
1218
+ for offset,count in pairs(classPointerOffsetCount) do
1219
+ if count>highestcount then
1220
+ bestoffset=offset
1221
+ highestcount=count
1222
+ end
1223
+ end
1224
+
1225
+ UEngine.UObject={}
1226
+
1227
+ UEngine.UObject.Class=bestoffset
1228
+
1229
+ highestcount=0
1230
+ bestoffset=nil
1231
+
1232
+ for offset,count in pairs(nameoffsetcount) do
1233
+ if count>highestcount then
1234
+ bestoffset=offset
1235
+ highestcount=count
1236
+ end
1237
+ end
1238
+
1239
+ UEngine.UObject.Name=bestoffset
1240
+ end
1241
+
1242
+ return true
1243
+ end
1244
+ end
1245
+
1246
+ function SetupNamePoolLookupType()
1247
+ --handy for structure dissect
1248
+ if getCustomType('UE FName to String')==nil then
1249
+ local function customvaluetype2_bytestovalue(b1,b2,b3,b4,b5,b6,b7,b8,address)
1250
+ local v1
1251
+ v1=(b4 << 24) + (b3<<16) + (b2 << 8) + b1
1252
+ v2=(b8 << 24) + (b7<<16) + (b6 << 8) + b5
1253
+ if UEngine and UEngine.IndexToName then
1254
+ local n=UEngine.IndexToName[v1]
1255
+ if n==nil then
1256
+ n='<noname>'
1257
+ end
1258
+
1259
+ if v2>0 then
1260
+ return string.format("%s_%d",n,v2)
1261
+ else
1262
+ return n
1263
+ end
1264
+ else
1265
+ return 'noindex'
1266
+ end
1267
+ end
1268
+
1269
+ local function customvaluetype2_valuetobytes(i,address)
1270
+ --maybe use StringToFName, but for now I see no reason for this
1271
+ end
1272
+
1273
+ synchronize(function()
1274
+ registerCustomTypeLua('UE FName to String',8,customvaluetype2_bytestovalue, customvaluetype2_valuetobytes, false,true )
1275
+ end)
1276
+ end
1277
+ end
1278
+
1279
+
1280
+ function CacheNamePool_old()
1281
+ log('CacheNamePool_old')
1282
+ if UEngine.NamePoolData==nil then return nil,'UEngine.NamePoolData not defined yet' end
1283
+
1284
+
1285
+ local N2I={}
1286
+ local I2N={}
1287
+
1288
+ --copy and parse all the strings
1289
+
1290
+ --each block is 0x20000 bytes long
1291
+ --the list ends with a NULL pointer
1292
+ local sdata=createMemoryStream()
1293
+ sdata.Size=0x20000
1294
+
1295
+ local count=1000
1296
+
1297
+
1298
+ local pointerlist=createMemoryStream()
1299
+ pointerlist.Size=8*count
1300
+ if copyMemory(UEngine.NamePoolData,pointerlist.Size, pointerlist.Memory,1)==nil then return nil,'Read Failed' end
1301
+
1302
+
1303
+ local stringCache={} --read blocks of 0x40000 bytes (index is address >> 17)
1304
+ local StringOffset=UEngine.FNameEntry.String
1305
+
1306
+ for i=1,count do
1307
+ local p=pointerlist.readQword()
1308
+ if p==0 then break end
1309
+
1310
+ sdata.Position=0
1311
+ --entrystart is always aligned on a 2 byte boundary.
1312
+ if copyMemory(p,sdata.Size, sdata.Memory,1) then
1313
+ for j=0,16383 do
1314
+ --list of pointers, some can be 0
1315
+ local p2=sdata.readQword()
1316
+
1317
+ if p2==nil then break end
1318
+ if p2~=0 then
1319
+
1320
+
1321
+
1322
+ --get the memory p+StringOffset points to
1323
+ local Base=p2&0xFFFFFFFFFFFF0000 --allocation granularity of windows
1324
+ local cache=stringCache[Base]
1325
+
1326
+ if cache==nil then
1327
+ cache=createMemoryStream()
1328
+
1329
+ local meminfo=getMemoryRegionInfo(Base)
1330
+ if meminfo and meminfo.State==4096 then --4096 is commited memory
1331
+ while meminfo.RegionSize<0x10000+0x100 do --0x100 for overlap
1332
+ local n=getMemoryRegionInfo(meminfo.BaseAddress+meminfo.RegionSize)
1333
+ if n and n.State==4096 then
1334
+ meminfo.RegionSize=meminfo.RegionSize+n.RegionSize
1335
+ else
1336
+ break
1337
+ end
1338
+ end
1339
+
1340
+ if meminfo.RegionSize>0x10000+0x100 then
1341
+ meminfo.RegionSize=0x10000+0x100
1342
+ end
1343
+
1344
+ cache.Size=meminfo.RegionSize
1345
+
1346
+ if copyMemory(Base,meminfo.RegionSize, cache.Memory,1)==nil then
1347
+ cache.Size=0
1348
+ end
1349
+
1350
+ end
1351
+
1352
+ stringCache[Base]=cache --c.size==0 is unreadable
1353
+ end
1354
+
1355
+
1356
+
1357
+ local pindex=p2-Base+StringOffset
1358
+ local sizeleft=cache.Size-pindex
1359
+ local str
1360
+ if sizeleft>0 then
1361
+ cache.position=pindex
1362
+ str=cache.readString(math.min(100,sizeleft))
1363
+ end
1364
+
1365
+ if str then
1366
+ local index=(i-1)*16384+j
1367
+
1368
+ N2I[str]=index
1369
+ I2N[index]=str
1370
+ end
1371
+
1372
+ end
1373
+ end
1374
+ end
1375
+
1376
+ -- print("done")
1377
+
1378
+ for base,ms in pairs(stringCache) do
1379
+ if ms then
1380
+ ms.destroy()
1381
+ end
1382
+ end
1383
+
1384
+ stringCache={}
1385
+
1386
+ -- printf("namelookupprogress=%.2f",namelookupprogress)
1387
+ end
1388
+
1389
+ pointerlist.destroy()
1390
+
1391
+ sdata.destroy()
1392
+
1393
+ UEngine.NameToIndex=N2I
1394
+ UEngine.IndexToName=I2N
1395
+
1396
+ return true
1397
+
1398
+ end
1399
+
1400
+ function CacheNamePool(t)
1401
+ log('CacheNamePool')
1402
+ --remember the comment at the top about debugging causing a slowdown? That particularly means this function right here
1403
+
1404
+ if UEngine.NamePoolData==nil then
1405
+ return false, 'CacheNamePool: UEngine.NamePoolData is still undefined'
1406
+ end
1407
+
1408
+
1409
+ if UEngine.NamePoolData_old then
1410
+ return CacheNamePool_old(t)
1411
+ end
1412
+
1413
+
1414
+ local N2I={}
1415
+ local I2N={}
1416
+
1417
+ --copy and parse all the strings
1418
+
1419
+ --each block is 0x20000 bytes long
1420
+ --NamePool+0x8 holds a 4 byte with the count. Alternatively, the list ends with a NULL pointer
1421
+ local sdata=createMemoryStream()
1422
+ sdata.Size=0x20000
1423
+
1424
+ local count=readInteger(UEngine.NamePoolData+8)
1425
+ if count==0 then count=1000 end
1426
+
1427
+
1428
+ local pointerlist=createMemoryStream()
1429
+ pointerlist.Size=8*count
1430
+ if copyMemory(UEngine.NamePoolData+0x10,pointerlist.Size, pointerlist.Memory,1)==nil then return nil,'Read Failed' end
1431
+
1432
+ for i=1,count do
1433
+ if t and t.Terminated then
1434
+ sdata.destroy()
1435
+ pointerlist.destroy()
1436
+ return false, 'UEInfoScannerThread terminated'
1437
+ end
1438
+
1439
+ local p=pointerlist.readQword()
1440
+ if p==0 then break end
1441
+
1442
+ sdata.Position=0
1443
+ --entrystart is always aligned on a 2 byte boundary.
1444
+ if copyMemory(p,sdata.Size, sdata.Memory,1) then
1445
+ while sdata.Position<sdata.Size do
1446
+ local entrystart=sdata.Position >> 1
1447
+
1448
+ local header=sdata.readWord()
1449
+ local iswide=header & 1==1
1450
+ local len=header >> 6
1451
+
1452
+ if len==0 then break end
1453
+
1454
+ local str
1455
+ if iswide then
1456
+ str=sdata.readWideString(len)
1457
+ else
1458
+ str=sdata.readString(len)
1459
+ end
1460
+
1461
+ local index=((i-1) << 16)+entrystart
1462
+
1463
+ N2I[str]=index
1464
+ I2N[index]=str
1465
+
1466
+ --symcount=symcount+1
1467
+
1468
+ if (sdata.Position & 1) == 1 then sdata.readByte() end --align
1469
+ end
1470
+
1471
+ else
1472
+ print("Failure reading strings")
1473
+ end
1474
+ end
1475
+
1476
+ pointerlist.destroy()
1477
+
1478
+ sdata.destroy()
1479
+
1480
+ UEngine.NameToIndex=N2I
1481
+ UEngine.IndexToName=I2N
1482
+
1483
+
1484
+ return true
1485
+ end
1486
+
1487
+
1488
+
1489
+ function FindNamePoolData_older(t)
1490
+ --[[
1491
+ e.g 4.19: The occupation
1492
+ FNameEntry is formatted as : index, FNameEntry (hash?), ascii string (None, ByteProperty, InrProperty, BoolProperty,...)
1493
+ Each FnameEntry is pointed at by another block of memory of 0x20000 bytes (16384 pointers) to each individual string
1494
+ and that list itself is pointed at by another one , which has a pointer to it from a memory addres in the game (Call it GNames)
1495
+
1496
+ example:
1497
+ 2454CB90000 = 0, pointer, "None"
1498
+ 2454CB90018 = 2, pointer, "ByteProperty"
1499
+
1500
+ apparently if the first bit is 1 the string is a WideString (rare)
1501
+
1502
+ address 2454B600000 holds 0x20000 bytes, all pointers. The first pointer points to 2454CB90000. There can be null pointers in that memory block
1503
+
1504
+ address 2454B5F0080 holds some(9 in this case) pointers as well. First pointer is 2454B600000 (block[0]=2454B600000, block[1]=2454B600008, block[2]=2454B600010)
1505
+
1506
+
1507
+ Secondary for next run optimization:
1508
+ There are 2 static pointers to 2454B5F0080
1509
+ First one: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "80 00 5F 4B 45 02 00 00" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A A7 67 45 02 00 00 0A 00 00 00 18 00 00 00
1510
+ Second one:00 00 00 00 00 00 00 00 00 00 00 00 88 00 00 80 "80 00 5F 4B 45 02 00 00" 40 00 5E 4B 45 02 00 00 01 00 00 00 00 00 00 00 09 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 D6 F6 7F 00 00 E3 36 EA 41 00 00 01 00 98 EF 1B D8 F6 7F 00 00
1511
+
1512
+
1513
+
1514
+
1515
+ --]]
1516
+
1517
+ if UEngine.NamePoolData then return true end
1518
+
1519
+
1520
+ UEngine.NamePoolData_old=true --todo: if more than 2 formats, change it to an identifier number
1521
+
1522
+ local ms=createMemScan()
1523
+ ms.VarType=vtGrouped
1524
+ ms.Scanvalue=[[BA:4096 BS:128 OOO:U 1:* s:'None' s:'ByteProperty']]
1525
+ ms.scan()
1526
+ firststringblock=ms.Results
1527
+ ms.destroy()
1528
+
1529
+ if t and t.Terminated then
1530
+ return false,'UEInfoScannerThread terminated'
1531
+ end
1532
+
1533
+ if #firststringblock==0 then
1534
+ return false,'No known stringpool found'
1535
+ end
1536
+
1537
+ if #firststringblock>1 then
1538
+ return false,'FindNamePoolData_older needs more refining'
1539
+ end
1540
+
1541
+ --check the format
1542
+ UEngine.FNameEntry={}
1543
+
1544
+ local a=firststringblock[1]
1545
+ for i=0,128 do
1546
+ if readString(a+i,4)=='None' then --find the first string offset
1547
+ UEngine.FNameEntry.String=i
1548
+ break
1549
+ end
1550
+ end
1551
+
1552
+ --find a pointer to this table (The pointer is not located in static memory)
1553
+ ms=createMemScan()
1554
+ ms.VarType=vtQword
1555
+ ms.ScanValue=a
1556
+ ms.FastScanMethod=fsmLastDigits
1557
+ ms.FastScanparameter='0000' --the first pointer of a 0x20000 bytes long block, alliged
1558
+ ms.scan()
1559
+
1560
+ local r=ms.Results
1561
+ ms.destroy()
1562
+
1563
+ if t and t.Terminated then
1564
+ return false,'UEInfoScannerThread terminated'
1565
+ end
1566
+
1567
+
1568
+
1569
+ if #r==0 then return nil,'no list found' end
1570
+ if #r>1 then return nil,'needs more refining' end
1571
+
1572
+ --check for a pointer to this address. Normally aligned. todo: if more than 1 result, check the following pointers if they point to other blocks of 0x20000 bytes all pointing to a FNameEntry or null
1573
+ ms=createMemScan()
1574
+ ms.VarType=vtQword
1575
+ ms.ScanValue=r[1]
1576
+ ms.FastScanMethod=fsmAligned
1577
+ ms.FastScanparameter='8' --the first pointer of a 0x20000 bytes long block, alliged
1578
+ ms.scan()
1579
+
1580
+ local r2=ms.Results
1581
+ ms.destroy()
1582
+
1583
+ if #r2==0 then
1584
+ return nil,'No list found'
1585
+ end
1586
+
1587
+
1588
+ if #r2>1 then
1589
+ return nil,'todo: check other pointers for valid stringblocks'
1590
+ end
1591
+
1592
+
1593
+ UEngine.NamePoolData=r2[1]
1594
+ return true
1595
+
1596
+ end
1597
+
1598
+ function FindNamePoolData(t)
1599
+
1600
+ if UEngine.NamePoolData then return true end --already found
1601
+ --ue5
1602
+ local ms=createMemScan()
1603
+ ms.VarType=vtByteArray
1604
+ ms.Hexadecimal=true
1605
+ ms.Scanvalue='* 01 4e 6f 6e 65 * 03 42 79 74' --x None and x ByteProperty
1606
+ ms.Fastscanmethod=fsmAligned
1607
+ ms.Fastscanparameter=10000
1608
+ --ms.Priority='tpIdle'
1609
+ ms.scan()
1610
+
1611
+ while ms.waitTillDone(1000)==false do
1612
+ if t and t.Terminated then
1613
+ ms.terminateScan()
1614
+ end
1615
+ end
1616
+
1617
+
1618
+ firststringblock=ms.results
1619
+ ms.destroy() ms=nil --doing it on the same line so that single step debugging won't get corrupted by bad upvalue pointers
1620
+
1621
+ if t and t.Terminated then
1622
+ return false,'UEInfoScannerThread terminated'
1623
+ end
1624
+
1625
+ if #firststringblock==0 then
1626
+ --maybe an older version
1627
+ local r,err=FindNamePoolData_older()
1628
+
1629
+ return r,err
1630
+ end
1631
+
1632
+ --find references to this address in the target process
1633
+ local probablenamepools={}
1634
+ local ms={}
1635
+ for i=1,#firststringblock do
1636
+ ms[i]=createMemScan()
1637
+ ms[i].VarType=vtQword
1638
+ ms[i].Fastscanmethod=fsmAligned
1639
+ ms[i].Fastscanparameter=8
1640
+
1641
+ ms[i].Scanvalue=firststringblock[i]
1642
+ ms[i].Startaddress=getAddress(process)
1643
+ ms[i].Stopaddress=getAddress(process)+getModuleSize(process)
1644
+ ms[i].scan()
1645
+ end
1646
+
1647
+ r={}
1648
+ for i=1,#firststringblock do
1649
+ ms[i].waitTillDone()
1650
+ local tr=ms[i].Results
1651
+ for j=1,#tr do
1652
+ table.insert(r,tr[j])
1653
+ end
1654
+ ms[i].destroy() ms[i]=nil
1655
+ end
1656
+
1657
+ if t and t.Terminated then
1658
+ return false,'UEInfoScannerThread terminated'
1659
+ end
1660
+
1661
+
1662
+ if #r>1 then
1663
+ --the pointer after it points to another string list and before it looks like a number of strings and a number of pointers to stringlists
1664
+ --the pointers it points to also have an allocation size of 0x20000
1665
+ local r2={}
1666
+ for i=1,#r do
1667
+ local valid=true
1668
+ for j=1,3 do
1669
+ local a=readPointer(r[i]+j*8)
1670
+ if a~=0 then --I don't think this version has empty pointers, but for now allow it
1671
+ local mri=getMemoryRegionInfo(a)
1672
+ if (mri==nil) or (mri.RegionSize~=0x20000) then
1673
+ valid=false
1674
+ break
1675
+ end
1676
+ end
1677
+ end
1678
+ if valid then
1679
+ table.insert(r2,r[i])
1680
+ end
1681
+ end
1682
+
1683
+ r=r2
1684
+
1685
+ if #r>1 then
1686
+ return false,'too many found. Needs more refining'
1687
+ end
1688
+ end
1689
+
1690
+
1691
+ if #r==0 then
1692
+ return false,'not found' --error
1693
+ end
1694
+
1695
+
1696
+
1697
+ if #r==1 then
1698
+ UEngine.NamePoolData = r[1] - 0x10 --todo: save this address for the next run
1699
+
1700
+ return true
1701
+ end
1702
+ end
1703
+
1704
+ function createUEMenu()
1705
+ log('Creating menuitem')
1706
+
1707
+ synchronize(function()
1708
+
1709
+ if UEngine.GUI==nil then
1710
+ UEngine.GUI={}
1711
+ elseif UEngine.GUI.miUnrealEngine then
1712
+ UEngine.GUI.miUnrealEngine.destroy()
1713
+ UEngine.GUI.miUnrealEngine=nil
1714
+ UEngine.GUI={} --clear everything under it
1715
+ end
1716
+
1717
+ UEngine.GUI.miUnrealEngine=createMenuItem(MainForm)
1718
+ UEngine.GUI.miUnrealEngine.Caption='Initializing Unreal Engine'
1719
+ UEngine.GUI.miUnrealEngine.Name='miUnrealEngine'
1720
+
1721
+ UEngine.GUI.miStatus=createMenuItem(MainForm)
1722
+ UEngine.GUI.miStatus.Name='miStatus'
1723
+ UEngine.GUI.miStatus.Caption='Status'
1724
+ UEngine.GUI.miStatus.OnClick=function()
1725
+ if UEInfoScannerThread and (messageDialog('Cancel the Unreal Engine data collection?',mtConfirmation,mbYes, mbNo)==mrYes) then
1726
+ UEInfoScannerThread.Terminate()
1727
+ end
1728
+ end
1729
+ UEngine.GUI.miUnrealEngine.add(UEngine.GUI.miStatus)
1730
+
1731
+ UEngine.GUI.miHurry=createMenuItem(MainForm)
1732
+ UEngine.GUI.miHurry.Name='miHurry'
1733
+ UEngine.GUI.miHurry.Caption='Prioritize this'
1734
+ UEngine.GUI.miHurry.OnClick=function()
1735
+ if UEInfoScannerThread then
1736
+ UEInfoScannerThread.Priority='tpHigher'
1737
+ end
1738
+ UEngine.GUI.miHurry.destroy()
1739
+ UEngine.GUI.miHurry=nil
1740
+ end
1741
+ UEngine.GUI.miUnrealEngine.add(UEngine.GUI.miHurry)
1742
+
1743
+
1744
+ MainForm.Menu.Items.insert(MainForm.miHelp.MenuIndex, UEngine.GUI.miUnrealEngine)
1745
+ end)
1746
+
1747
+ end
1748
+
1749
+
1750
+ function UEInfoScanner(t)
1751
+ --can be called directly or with a thread
1752
+
1753
+ log('UEInfoScanner start');
1754
+
1755
+ local id=process..'-'..md5memory(getAddressSafe(process),4096)
1756
+
1757
+ local s=getSettings("UEInfo\\"..id,true)
1758
+ local r
1759
+
1760
+ --get data from the registry if available
1761
+ if t then
1762
+ log('Threaded')
1763
+ t.FreeOnTerminate(false)
1764
+ t.Name='UEInfoScannerThread'
1765
+ end
1766
+
1767
+ if UEngine==nil or UEngine.processid~=getOpenedProcessID() then
1768
+ --start from scratch
1769
+ if UEngineStructDissect then
1770
+ unregisterStructureDissectOverride2(UEngineStructDissect)
1771
+ UEngineStructDissect=nil
1772
+ end
1773
+
1774
+ if UEngine.GUI then
1775
+ if UEngine.GUI.miUnrealEngine then
1776
+ UEngine.GUI.miUnrealEngine.destroy()
1777
+ UEngine.GUI=nil
1778
+ end
1779
+ end
1780
+ UEngine={}
1781
+ UEngine.processid=getOpenedProcessID()
1782
+ end
1783
+
1784
+ --[[
1785
+ check the settings if everything has already been found, or if only a subset was found so far.
1786
+ If only a subset, go through the whole thing, but if everything was found then load all from the registry, but still
1787
+ go through the string cache system
1788
+ --]]
1789
+
1790
+ if (s.fullyParsed) then
1791
+ log('The state was fully parsed. Using this')
1792
+ --load all fields and offsets
1793
+ --load the UEngine data from the registry
1794
+ local list=s.getValueList()
1795
+ for name,value in pairs(list) do
1796
+ if name:startsWith('UEngine.') then
1797
+ local sections=table.pack(name:split('.'))
1798
+
1799
+ local t=UEngine
1800
+ for i=2,#sections-1 do
1801
+ local newt=t[sections[i]]
1802
+ if newt==nil then
1803
+ t[sections[i]]={}
1804
+
1805
+ newt=t[sections[i]]
1806
+ end
1807
+
1808
+ t=newt
1809
+ end
1810
+
1811
+
1812
+ t[sections[#sections]]=tonumber(value)
1813
+ end
1814
+ end
1815
+
1816
+ --cache the namepool data
1817
+ createUEMenu()
1818
+
1819
+ UEngine.NamePoolData=getAddressSafe(s.NamePoolData)
1820
+ UEngine.ObjectArray=getAddressSafe(s.ObjectArray)
1821
+ UEngine.GEngine=getAddressSafe(s.GEngine)
1822
+
1823
+ if UEngine.GEngine then
1824
+ local n=getNameFromAddress(UEngine.GEngine,true,false,false)
1825
+ if n:find(extractFileNameWithoutExt(process)) then
1826
+ registerSymbol('GEngine',getNameFromAddress(UEngine.GEngine), true)
1827
+ end
1828
+ end
1829
+
1830
+
1831
+ --todo: use the function method instead until specifically requested to cache the names
1832
+ log('Loading string table')
1833
+ synchronize(function()
1834
+ UEngine.GUI.miStatus.Caption='Loading string table'
1835
+ end)
1836
+
1837
+ if UEngine.NamePoolData==nil then
1838
+ --can happen in the old stringpool format
1839
+ local r,err=FindNamePoolData(t)
1840
+ if not r then
1841
+ log('Failed searching for NamePool:'..err)
1842
+ return nil,'FindNamePoolData failed:'..err
1843
+ end
1844
+ end
1845
+
1846
+ local originalDebugState=disableLuaDebug() --disabling debug here for performance reasons
1847
+ local err
1848
+ r,err=CacheNamePool(t)
1849
+ restoreLuaDebug(originalDebugState)
1850
+
1851
+
1852
+ if not r then
1853
+ return nil,'CacheNamePool failed:'..err
1854
+ end
1855
+
1856
+ SetupNamePoolLookupType() --the cache is done. make it available to the user
1857
+
1858
+
1859
+
1860
+
1861
+
1862
+
1863
+ r=true
1864
+
1865
+ else
1866
+ log('New or incomplete state')
1867
+ if UEngine.NamePoolData==nil then
1868
+ local sNamePoolData=s.NamePoolData
1869
+ if sNamePoolData then
1870
+ UEngine.NamePoolData=getAddressSafe(sNamePoolData)
1871
+ log('NamePoolData was previously at '..sNamePoolData..' . Using that')
1872
+ end
1873
+ end
1874
+
1875
+ if UEngine.NamePoolData==nil then
1876
+ log('Searching for NamePool')
1877
+ local r,err=FindNamePoolData(t)
1878
+ if not r then
1879
+ log('Failed searching for NamePool:'..err)
1880
+ return nil,'FindNamePoolData failed:'..err
1881
+ end
1882
+
1883
+ local n=getNameFromAddress(UEngine.NamePoolData,true,false,false)
1884
+ if n:find(extractFileNameWithoutExt(process)) then
1885
+ --it's a module address. Save it
1886
+ s.NamePoolData=getNameFromAddress(UEngine.NamePoolData)
1887
+ end
1888
+ end
1889
+
1890
+
1891
+
1892
+ if t and t.Terminated then return nil,'UEInfoScanner terminated' end
1893
+
1894
+ --still here, notify that there is some unreal info available
1895
+
1896
+ createUEMenu()
1897
+
1898
+
1899
+ if UEngine.NameToIndex == nil then
1900
+ log('Loading string table')
1901
+ synchronize(function()
1902
+ UEngine.GUI.miStatus.Caption='Loading string table'
1903
+ end)
1904
+
1905
+ local originalDebugState=disableLuaDebug() --disabling debug here for performance reasons
1906
+ local r,err=CacheNamePool(t)
1907
+ restoreLuaDebug(originalDebugState)
1908
+
1909
+
1910
+ if not r then
1911
+ return nil,'CacheNamePool failed:'..err
1912
+ end
1913
+
1914
+ SetupNamePoolLookupType() --the cache is done. make it available to the user
1915
+ end
1916
+
1917
+ if t and t.Terminated then return nil,'UEInfoScanner terminated' end
1918
+
1919
+ if UEngine.ObjectArray==nil then
1920
+ local sObjectArray=s.ObjectArray
1921
+ if sObjectArray then
1922
+ UEngine.ObjectArray=getAddressSafe(sObjectArray)
1923
+ end
1924
+ end
1925
+
1926
+ if (UEngine.ObjectArray == nil) or (UEngine.UObject==nil) then
1927
+ log('Scanning for object table')
1928
+ synchronize(function()
1929
+ UEngine.GUI.miStatus.Caption='Scanning for object table'
1930
+ end)
1931
+
1932
+
1933
+
1934
+ local r,err=FindObjectArray(t)
1935
+ if not r then
1936
+ return nil,'FindObjectArray failed:'..err
1937
+ end
1938
+ s.ObjectArray=getNameFromAddress(UEngine.ObjectArray, true, false,false)
1939
+
1940
+ end
1941
+
1942
+ if UEngine.UGameEngine==nil then
1943
+ log('Searching for GEngine')
1944
+ synchronize(function()
1945
+ UEngine.GUI.miStatus.Caption='Searching for GEngine'
1946
+ end)
1947
+
1948
+
1949
+ local r,err=FindGEngine(t)
1950
+ log('FindGEngine returned')
1951
+ if not r then
1952
+ if err then
1953
+ log('FindGEngine failed:'..err)
1954
+ else
1955
+ log('FindGEngine failed')
1956
+ end
1957
+ return nil,'FindGEngine failed:'..err
1958
+ end
1959
+
1960
+
1961
+
1962
+ s.GEngine=getNameFromAddress(UEngine.GEngine,true,false,false)
1963
+ end
1964
+
1965
+ if UEngine.UObject.Class==nil then --normal situation
1966
+ log('Figuring out the "class" offset')
1967
+ for i=1,32 do --skip 0 as it's the vftable
1968
+ local n=UObject_getName(readPointer(UGameEngine+i*4))
1969
+ if n and n=='GameEngine' then
1970
+ UEngine.UObject.Class=i*4
1971
+ break
1972
+ end
1973
+ end
1974
+ end
1975
+
1976
+ if UEngine.UObject.Class==nil then
1977
+ log('Failed finding the "class" offset')
1978
+ return nil,'UObject.Class not found'
1979
+ end
1980
+
1981
+
1982
+ UEngine.GameEngineClass=readPointer(UEngine.UGameEngine+UEngine.UObject.Class)
1983
+
1984
+ UEngine.UStruct={}
1985
+ UEngine.UStruct.Name=UEngine.UObject.Name
1986
+ UEngine.UStruct.Class=UEngine.UObject.Class
1987
+
1988
+ --gather more info in case it was missed earlier (some paths don't need it yet)
1989
+
1990
+ --the superstruct (UStruct) name of the GameEngine class is Engine
1991
+ --so find a pointer inside the class that leads to an UObject with the name Engine
1992
+
1993
+ --if the game uses an inherited class onject, like OakEngine, then first comes GameEngine (or whatever comes first)
1994
+ --the superlist will end with Engine->Object
1995
+
1996
+ if UEngine.UClass==nil then
1997
+ UEngine.UClass={}
1998
+ UEngine.UClass.Name=UEngine.UObject.Name
1999
+ UEngine.UClass.Class=UEngine.UObject.Class
2000
+ end
2001
+
2002
+ if UEngine.UClass.SuperStruct then --already obtained earlier
2003
+ UEngine.UStruct.SuperStruct=UEngine.UClass.SuperStruct
2004
+ else
2005
+ --superstruct not yet found
2006
+ if UObject_getName(UEngine.GameEngineClass)=='GameEngine' then
2007
+ for i=0,32 do
2008
+ local n=UObject_getName(readPointer(UEngine.GameEngineClass+i*8))
2009
+ if n and n=='Engine' then --the super of Gameengbine is Engine
2010
+ UEngine.UStruct.SuperStruct=i*8
2011
+ break
2012
+ end
2013
+ end
2014
+ else
2015
+ --it's not a GameEngine class so not sure that comes after (could be more inheritance)
2016
+ for i=1,32 do
2017
+ local r=testIfSuperStructOffset(UEngine.GameEngineClass, i*8)
2018
+
2019
+ if r and #r>2 then
2020
+ for j=1,#r do
2021
+ if r[j]=='Engine' then
2022
+ UEngine.UStruct.SuperStruct=i*8
2023
+ break
2024
+ end
2025
+ end
2026
+
2027
+ if UEngine.UStruct.SuperStruct then
2028
+ break
2029
+ end
2030
+ end
2031
+ end
2032
+ end
2033
+ end
2034
+
2035
+ if UEngine.UStruct.SuperStruct==nil then
2036
+ return nil,'Failed finding the SuperStruct field'
2037
+ end
2038
+
2039
+ UEngine.UClass.Name=UEngine.UStruct.Name
2040
+ UEngine.UClass.Class=UEngine.UStruct.Class
2041
+ UEngine.UClass.SuperStruct=UEngine.UStruct.SuperStruct
2042
+
2043
+
2044
+ UEngine.RealGameEngineClass=UEngine.GameEngineClass
2045
+
2046
+ --UEngine.GameEngineClass might not be the base "GameEngine" class. Find it if that's the case (to make some assumptions come true)
2047
+ local c=UEngine.GameEngineClass
2048
+ while UObject_getName(c)~='GameEngine' do
2049
+ c=readPointer(c+UEngine.UClass.SuperStruct)
2050
+ if c==nil then
2051
+ return nil,'Failure retrieving base GameEngine class'
2052
+ end
2053
+ end
2054
+ UEngine.GameEngineClass=c
2055
+
2056
+ if t and t.Terminated then
2057
+ return nil,'UEInfoScannerThread terminated'
2058
+ end
2059
+
2060
+ --everything ok so far. Try to find the layout of Property Field objects. Can be either UProperty or FProperty. Doesn't matter
2061
+
2062
+ log('Figuring out the other offsets (findGameInstanceFPropertyAndFields) ')
2063
+ synchronize(function()
2064
+ UEngine.GUI.miStatus.Caption='Figuring out offsets'
2065
+ end)
2066
+
2067
+
2068
+ r=findGameInstanceFPropertyAndFields(t)
2069
+ end
2070
+
2071
+ if r then
2072
+ if s.fullyParsed==nil then
2073
+ --save all offsets
2074
+
2075
+ function saveLuaTable(tablename,t)
2076
+ if t then
2077
+ for name,value in pairs(t) do
2078
+ local n=tablename..'.'..name
2079
+
2080
+ if type(value)=='table' then
2081
+ saveLuaTable(n,value)
2082
+ else
2083
+ s[n]=tostring(value)
2084
+ end
2085
+
2086
+ end
2087
+ end
2088
+ end
2089
+
2090
+ saveLuaTable('UEngine.FNameEntry', UEngine.FNameEntry)
2091
+ saveLuaTable('UEngine.UObject', UEngine.UObject)
2092
+ saveLuaTable('UEngine.UStruct', UEngine.UStruct)
2093
+ saveLuaTable('UEngine.UClass', UEngine.UClass)
2094
+ saveLuaTable('UEngine.FProperty', UEngine.FProperty)
2095
+ saveLuaTable('UEngine.FFieldClass', UEngine.FFieldClass)
2096
+ saveLuaTable('UEngine.FField', UEngine.FField)
2097
+
2098
+
2099
+ s['UEngine.VFTableInExecutableMemoryMethod']=UEngine.VFTableInExecutableMemoryMethod
2100
+ s['UEngine.ObjectArrayListType']=UEngine.ObjectArrayListType
2101
+ s['UEngine.ObjectArrayEntryStructSize']=UEngine.ObjectArrayEntryStructSize
2102
+ s['UEngine.NamePoolData_old']=UEngine.NamePoolData_old --nil if not set
2103
+
2104
+
2105
+
2106
+ s.fullyParsed=true
2107
+ end
2108
+
2109
+ log('success. Registering structure lookup callback')
2110
+ if registerUEngineStructureLookupCallbacks then --added by UEInfoStructureDissect
2111
+ synchronize(function()
2112
+ registerUEngineStructureLookupCallbacks()
2113
+
2114
+ --It can be annoying, so add an option to disable it for now
2115
+ UEngine.GUI.miStructureDissectCallbackStatus=createMenuItem(MainForm)
2116
+ UEngine.GUI.miStructureDissectCallbackStatus.Caption='Use when dissecting structures'
2117
+ UEngine.GUI.miStructureDissectCallbackStatus.Name='miStructureDissectCallbackStatus'
2118
+ UEngine.GUI.miStructureDissectCallbackStatus.AutoCheck=true
2119
+ UEngine.GUI.miStructureDissectCallbackStatus.Checked=true
2120
+ UEngine.GUI.miStructureDissectCallbackStatus.OnClick=function()
2121
+ if UEngine.GUI.miStructureDissectCallbackStatus.checked then
2122
+ registerUEngineStructureLookupCallbacks()
2123
+ else
2124
+ unregisterUEngineStructureLookupCallbacks()
2125
+ end
2126
+ end
2127
+
2128
+ UEngine.GUI.miUnrealEngine.add(UEngine.GUI.miStructureDissectCallbackStatus)
2129
+
2130
+
2131
+ UEngine.GUI.miStatus.destroy()
2132
+ UEngine.GUI.miStatus=nil
2133
+
2134
+ if UEngine.GUI.miHurry then
2135
+ UEngine.GUI.miHurry.destroy()
2136
+ UEngine.GUI.miHurry=nil
2137
+ end
2138
+
2139
+ UEngine.GUI.miUnrealEngine.Caption='Unreal Engine'
2140
+ end)
2141
+ end
2142
+
2143
+ return r
2144
+ end
2145
+ end
2146
+
2147
+ function couldBeUnrealEngine()
2148
+ local pname=extractFileNameWithoutExt(process)
2149
+ if getAddressSafe(pname..'.agsInit') then return true end
2150
+ if getAddressSafe(pname..'.agsInitialize') then return true end
2151
+ --if getAddressSafe(pname..'.NvOptimusEnablement') then return true end --nope (kindergharten has this one as well)
2152
+
2153
+ if pname:lower():endsWith('shipping') then return true end
2154
+
2155
+
2156
+ local r=enumModules()
2157
+ if r then
2158
+ local v,res=getFileVersion(r[1].PathToFile)
2159
+ if res then
2160
+ if res.ProductVersion and res.ProductVersion:find('%+UE4') then return true end
2161
+ if res.ProductVersion and res.ProductVersion:find('%+UE5') then return true end
2162
+
2163
+ end
2164
+ end
2165
+
2166
+ return false
2167
+ end
2168
+
2169
+ function WaitForUnrealEngineInfo(timeout)
2170
+ if UEInfoScannerThread then
2171
+ UEInfoScannerThread.Priority='tpHigher'
2172
+
2173
+ return UEInfoScannerThread.waitForThread(timeout)
2174
+ end
2175
+
2176
+ return true
2177
+ end
2178
+
2179
+ function LaunchUEInfoScanner()
2180
+ if UEInfoScannerThread then
2181
+ UEInfoScannerThread.Terminate()
2182
+ if UEInfoScannerThread.waitFor(5000) then
2183
+ UEInfoScannerThread.destroy() UEInfoScannerThread=nil
2184
+ end
2185
+ UEInfoScannerThread=nil
2186
+ end
2187
+ UEInfoScannerThread=createThread(function(t)
2188
+
2189
+ log('UEInfoScannerThread started')
2190
+
2191
+
2192
+ t.Priority='tpIdle'
2193
+ local r,err=UEInfoScanner(t)
2194
+
2195
+ log('UEInfoScannerThread finished')
2196
+ if r then
2197
+ log('UEInfoScanner: Success')
2198
+ synchronize(function()
2199
+ UEngine.GUI.miUnrealEngine.caption='Unreal Engine'
2200
+ end)
2201
+
2202
+
2203
+ else
2204
+ if err then
2205
+ log('UEInfoScanner failure:'..err)
2206
+ else
2207
+ log('UEInfoScanner failure')
2208
+ end
2209
+ synchronize(function()
2210
+ if UEngine.GUI and UEngine.GUI.miUnrealEngine then
2211
+ UEngine.GUI.miUnrealEngine.destroy()
2212
+ UEngine.GUI=nil
2213
+ end
2214
+ end)
2215
+
2216
+ end
2217
+
2218
+
2219
+ --if err then
2220
+ -- print(err)
2221
+ --end
2222
+ end)
2223
+ end
2224
+
2225
+ local oldOnProcessOpened=MainForm.OnProcessOpened
2226
+
2227
+ MainForm.OnProcessOpened=function()
2228
+ if UEInfoScannerThread then
2229
+ UEInfoScannerThread.Terminate()
2230
+ end
2231
+
2232
+ if couldBeUnrealEngine() then
2233
+ LaunchUEInfoScanner()
2234
+ end
2235
+ local r=oldOnProcessOpened()
2236
+ end
2237
+
2238
+
Gaming/CheatEngine/Portable/App/ProgramFiles/Extensions/UETools/UEInfoStructureDissect.LUA ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --UEInfoScanner and UEInfoStructureDissect are licensed under the MIT License by Eric Heijnen / Cheat Engine
2
+ --https://github.com/cheat-engine/UnrealEngineTools
3
+
4
+ local bitbytetobitnr={}
5
+ for i=0,7 do
6
+ bitbytetobitnr[1<<i]=i
7
+ end
8
+
9
+ function UEngine_createStructureFromObject(address)
10
+ if UEngine.UObject.Class==nil then return nil,'No UObject class offset' end
11
+ local c=readPointer(address+UEngine.UObject.Class)
12
+ if c then
13
+ return UEngine_createStructureFromClass(c)
14
+ end
15
+ end
16
+
17
+ function UEngine_createStructureFromClass(address)
18
+ local UClassStruct=getStructure('UClass')
19
+ if UClassStruct==nil then
20
+ UClassStruct=createStructure('UClass')
21
+ local e=UClassStruct.addElement()
22
+ e.Name='vftable'
23
+ e.Offset=0
24
+ e.VarType=vtPointer
25
+
26
+ e=UClassStruct.addElement()
27
+ e.Name='Name'
28
+ e.Offset=UEngine.UClass.Name
29
+ e.PreviewPriority=1
30
+ e.VarType=vtCustom
31
+ e.CustomTypeName='UE FName to String'
32
+
33
+ e=UClassStruct.addElement()
34
+ e.Name='Class'
35
+ e.Offset=UEngine.UClass.Class
36
+ e.VarType=vtPointer
37
+ e.ChildStruct=UClassStruct
38
+ e.PreviewPriority=2
39
+
40
+ e=UClassStruct.addElement()
41
+ e.Name='SuperStruct'
42
+ e.Offset=UEngine.UClass.SuperStruct
43
+ e.VarType=vtPointer
44
+ e.ChildStruct=UClassStruct
45
+
46
+ e=UClassStruct.addElement()
47
+ e.Name='PropertyLink'
48
+ e.Offset=UEngine.UClass.PropertyLink
49
+ e.VarType=vtPointer
50
+
51
+ e=UClassStruct.addElement()
52
+ e.Name='PropertyLink (fallback)'
53
+ e.Offset=UEngine.UClass.PropertyLinkAlt
54
+ e.VarType=vtPointer
55
+
56
+
57
+ UClassStruct.addToGlobalStructureList()
58
+ end
59
+
60
+ local UObjectStruct=getStructure('UObject')
61
+ if UObjectStruct==nil then --create it
62
+ UObjectStruct=createStructure('UObject')
63
+ local e=UObjectStruct.addElement()
64
+ e.Name='vftable'
65
+ e.Offset=0
66
+ e.VarType=vtPointer
67
+
68
+ e=UObjectStruct.addElement()
69
+ e.Name='Name'
70
+ e.Offset=UEngine.UObject.Name
71
+ e.PreviewPriority=1
72
+ e.VarType=vtCustom
73
+ e.CustomTypeName='UE FName to String'
74
+
75
+ e=UObjectStruct.addElement()
76
+ e.Name='Class'
77
+ e.Offset=UEngine.UObject.Class
78
+ e.VarType=vtPointer
79
+ e.ChildStruct=UClassStruct
80
+
81
+ e.PreviewPriority=2
82
+
83
+ if UClassStruct==nil then
84
+ print("UClassStruct==nil")
85
+ end
86
+
87
+ UObjectStruct.addToGlobalStructureList()
88
+ end
89
+
90
+ --get the class of the object
91
+
92
+ if address and address~=0 then
93
+ local name=UObject_getName(address) --class is an UObject
94
+ local properties=UClass_enumProperties(address)
95
+
96
+ --check if this class is already defined, and if so, return that
97
+ --local s=getStructure(name)
98
+ --if s then
99
+ -- return s
100
+ --end
101
+
102
+
103
+ if properties==nil and name==nil then
104
+ --printf("UClass_enumProperties(0x%x) returned nil",address)
105
+ return nil
106
+ end
107
+
108
+ s=UObjectStruct.clone(name)
109
+ local e
110
+
111
+ if properties then
112
+ for name,info in pairs(properties) do
113
+ e=s.addElement()
114
+ e.Name=name
115
+ e.Offset=info.offset
116
+ e.Vartype=vtPointer --default
117
+
118
+ if info.propertyType=='BoolProperty' then
119
+ local bit=readByte(info.propertyAddress+UEngine.FProperty.BitMaskField+2)
120
+ local bitnr=bitbytetobitnr[bit]
121
+ if bitnr then
122
+ e.Vartype=vtBinary
123
+ e.BitStart=bitnr
124
+ e.BitSize=1
125
+ else
126
+ e.Vartype=vtByte
127
+ end
128
+ end
129
+
130
+ if info.propertyType=='IntProperty' then
131
+ e.Vartype=vtDword
132
+ end
133
+
134
+ if info.propertyType=='ByteProperty' then
135
+ e.Vartype=vtByte
136
+ end
137
+
138
+ if info.propertyType=='FloatProperty' then
139
+ if readInteger(info.propertyAddress+UEngine.FProperty.Size)==4 then
140
+ e.Vartype=vtSingle
141
+ else
142
+ e.Vartype=vtDouble
143
+ end
144
+ end
145
+
146
+ if info.propertyType=='StructProperty' then
147
+ --not sure, but
148
+ if name:endsWith('Name') then
149
+ e.Vartype=vtCustom
150
+ e.CustomTypeName='UE FName to String'
151
+ else
152
+ e.Vartype=vtByteArray
153
+ e.ByteSize=readInteger(info.propertyAddress+UEngine.FProperty.Size)
154
+ end
155
+ end
156
+
157
+ if info.propertyType=='StrProperty' then
158
+ e.Vartype=vtPointer
159
+ e.ChildStruct=getStructure('widestring')
160
+ end
161
+
162
+ if info.propertyType=='ClassProperty' then
163
+ e.Vartype=vtPointer
164
+ e.ChildStruct=getStructure('UClass')
165
+ end
166
+
167
+ if info.propertyType=='ObjectProperty' then
168
+ e.Vartype=vtPointer
169
+ e.ChildClassName='Type: 0x'..string.format("%x",readPointer(info.propertyAddress+UEngine.FProperty.ObjectClassType))
170
+ e.OnCreateChild=function(element, address)
171
+ -- print("goobelywoo")
172
+ local newstruct
173
+ if address then
174
+ -- printf("Creating using address %x", address)
175
+ newstruct=UEngine_createStructureFromObject(address) --prefer this as it might be an inherited object so it shows more fields
176
+ if newstruct==nil then
177
+ --printf("awww")
178
+ end
179
+ end
180
+ if newstruct==nil then
181
+ -- printf("Creating using info: %s", element.ChildClassName)
182
+ local cstr=tonumber(element.ChildClassName:sub(7))
183
+ if cstr then
184
+ newstruct=UEngine_createStructureFromClass(cstr)
185
+ end
186
+ end
187
+
188
+ if newstruct then
189
+ --print("Weeeeee")
190
+ return newstruct
191
+ else
192
+ --if messageDialog('Couldn''t figure out the structure. Let CE try?',mtConfirmation,mbYes,mbNo)==mrYes then
193
+ -- return nil,true --let CE try it
194
+ --else
195
+ -- print("humbug")
196
+ return nil
197
+ --end
198
+ end
199
+ end
200
+ end
201
+
202
+
203
+ if e.ChildClassName=='' then
204
+ e.ChildClassName=string.format('Property: %x',info.propertyAddress)
205
+ end
206
+
207
+
208
+ end
209
+ end
210
+
211
+
212
+ s.addToGlobalStructureList()
213
+ return s
214
+ end
215
+ end
216
+
217
+ --createStructureFromObject(readPointer('GEngine'))
218
+ --createStructureFromObject(0x25B23C2A10)
219
+
220
+ function unregisterUEngineStructureLookupCallbacks()
221
+ if UEngineStructNameLookup then
222
+ unregisterStructureNameLookup(UEngineStructNameLookup)
223
+ UEngineStructNameLookup=nil
224
+ end
225
+
226
+ if UEngineStructDissect then
227
+ unregisterStructureDissectOverride2(UEngineStructDissect)
228
+ UEngineStructDissect=nil
229
+ end
230
+ end
231
+
232
+ function registerUEngineStructureLookupCallbacks()
233
+ --register a structure dissect that gets the base address and dissects it
234
+ unregisterUEngineStructureLookupCallbacks() --get rid of them first
235
+
236
+ UEngineStructNameLookup=registerStructureNameLookup(function(address)
237
+ local obj=UEngine_findStructureStart(address)
238
+ if obj then
239
+ local class=readPointer(obj+UEngine.UObject.Class)
240
+ local nameindex=readPointer(class+UEngine.UClass.Name)
241
+
242
+ if nameindex and nameindex>0 then
243
+ local name=UEngine.IndexToName[nameindex]
244
+
245
+ if name then
246
+ return name,obj
247
+ end
248
+ end
249
+ end
250
+ end,true)
251
+
252
+ if UEngineStructDissect then
253
+ unregisterStructureDissectOverride2(UEngineStructDissect)
254
+ UEngineStructDissect=nil
255
+ end
256
+
257
+ UEngineStructDissect=registerStructureDissectOverride2(function(address)
258
+ local actual=UEngine_findStructureStart(address)
259
+
260
+ if actual==address then
261
+ local s=UEngine_createStructureFromObject(address)
262
+
263
+ if s then
264
+ --search for gaps and if they are pointers and valid objects fill them in as uninitialized pointers
265
+
266
+
267
+ local maxoffset=s[s.Count-1].offset
268
+ for i=0,maxoffset,8 do
269
+
270
+ local x=s.getElementByOffset(i)
271
+ if s.getElementByOffsetExact(i)==nil then
272
+
273
+ local a=readPointer(address+i)
274
+ local name=UObject_getName(a)
275
+
276
+ if name and name~='None' then
277
+
278
+ --get the class
279
+ local class=readPointer(a+UEngine.UObject.Class)
280
+ if class and class~=0 then
281
+
282
+ local classname=UObject_getName(class)
283
+
284
+ if classname and classname~='None' then
285
+ --add it as an undefined pointer
286
+ local e=s.addElement()
287
+ e.offset=i
288
+ e.Name=name..' : '..classname
289
+ e.VarType=vtPointer
290
+ e.ChildStruct=nil
291
+ end
292
+ end
293
+ end
294
+ end
295
+ end
296
+ end
297
+
298
+ return s
299
+ else
300
+ print("no idea")
301
+ return nil --let CE guess it
302
+ end
303
+ end)
304
+
305
+ end
306
+
Gaming/CheatEngine/Portable/App/ProgramFiles/Kernelmoduleunloader.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65fa2ccb3ac5400dd92dda5f640445a6e195da7c827107260f67624d3eb95e7d
3
+ size 242616
Gaming/CheatEngine/Portable/App/ProgramFiles/Tutorial-i386.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31b56a68b8d5c2a1c7921a1bb8ce8c356e92213758b493ae67b625f4a99b56bf
3
+ size 2626048
Gaming/CheatEngine/Portable/App/ProgramFiles/Tutorial-x86_64.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd227391e397812272d9cb9805e88472cb8a1dfefc4b9b028520c4e509777278
3
+ size 3543936
Gaming/CheatEngine/Portable/App/ProgramFiles/allochook-i386.dll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b96469b310ba59d1db320a337b3a8104db232a4344a47a8e5ae72f16cc7b1ff4
3
+ size 336600
Gaming/CheatEngine/Portable/App/ProgramFiles/allochook-x86_64.dll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8422be70e0ec59c962b35acf8ad80671bcc8330c9256e6e1ec5c07691388cd66
3
+ size 479536
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/DotNetInfoStaticsDialog.lua ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function ShowAddressListWindow() --window made with copilot on github
2
+ local dpiscale = getScreenDPI() / 96
3
+ local entries
4
+
5
+ local form = createForm(false)
6
+ form.Caption = "Address List (Please Wait)"
7
+ form.Width = 400 * dpiscale
8
+ form.Height = 300 * dpiscale
9
+ form.BorderStyle = "bsSizeable"
10
+ form.Position = "poScreenCenter"
11
+
12
+ local lv = createListView(form)
13
+ lv.Align = alClient
14
+ lv.ViewStyle = 'vsReport'
15
+ lv.ReadOnly = true
16
+ lv.RowSelect = true
17
+ lv.HideSelection = false
18
+ lv.MultiSelect = true
19
+ lv.OwnerData = true -- Enable virtual/owner data mode
20
+
21
+ lv.Columns.add().Caption = "Name"
22
+ lv.Columns[0].Width = 200 * dpiscale
23
+ lv.Columns.add().Caption = "Address"
24
+ lv.Columns[1].Width = 180 * dpiscale
25
+
26
+
27
+
28
+ -- Provide item data on demand (owner data)
29
+ lv.OnData = function(sender, item)
30
+ local idx = item.Index + 1 -- Lua uses 1-based indexing
31
+ local entry = entries[idx]
32
+ if entry then
33
+ item.Caption = entry.name
34
+ item.SubItems.clear()
35
+ item.SubItems.add(string.format('%X', entry.address))
36
+ item.Data = entry.address
37
+ else
38
+ item.Caption = ""
39
+ item.SubItems.clear()
40
+ item.Data = nil
41
+ end
42
+ end
43
+
44
+ -- On double-click, set Hexadecimal view address
45
+ lv.OnDblClick = function(sender)
46
+ local sel = sender.Selected
47
+ if sel then
48
+ local address = sel.Data
49
+ if address then
50
+ local mv = getMemoryViewForm()
51
+ mv.Show()
52
+ mv.HexadecimalView.Address = address
53
+ end
54
+ end
55
+ end
56
+
57
+ -- Use createFindDialog for searching names
58
+ local function showFindDialog()
59
+ local fd = createFindDialog(form)
60
+ fd.Options = '[frDown]'
61
+ fd.Title = 'Find name'
62
+ fd.OnFind = function(sender)
63
+ local search = sender.FindText:lower()
64
+ for i = 1, #entries do
65
+ if entries[i].name:lower():find(search, 1, true) then
66
+ lv.ItemIndex = i - 1
67
+ lv.TopItem = i - 1
68
+ lv.Selected = lv.Items[i - 1]
69
+ break
70
+ end
71
+ end
72
+ end
73
+ fd.Execute()
74
+ end
75
+
76
+ -- Context menu setup
77
+ local cm = createPopupMenu(form)
78
+
79
+ -- "Find" menu item
80
+ local miFind = createMenuItem(cm)
81
+ miFind.Caption = "Find"
82
+ miFind.Shortcut = "Ctrl+F"
83
+ miFind.OnClick = showFindDialog
84
+ cm.Items.add(miFind)
85
+
86
+ -- "Copy name" menu item
87
+ local miCopyName = createMenuItem(cm)
88
+ miCopyName.Caption = "Copy name"
89
+ miCopyName.Shortcut = "Ctrl+C"
90
+ miCopyName.OnClick = function()
91
+ local sel = lv.Selected
92
+ if sel then
93
+ writeToClipboard(sel.Caption)
94
+ end
95
+ end
96
+ cm.Items.add(miCopyName)
97
+
98
+ local miSaveToFile = createMenuItem(cm)
99
+ miSaveToFile.Caption = "Save to text file..."
100
+ miSaveToFile.OnClick = function()
101
+ local sd = createSaveDialog(form)
102
+ sd.Filter = "Text files (*.txt)|*.txt"
103
+ sd.DefaultExt = "txt"
104
+ sd.Options = "[ofOverwritePrompt]"
105
+ if sd.Execute() then
106
+ local f = assert(io.open(sd.FileName, "w"))
107
+ for i = 1, #entries do
108
+ local e = entries[i]
109
+ f:write(string.format("%s\t%08X\n", e.name, e.address))
110
+ end
111
+ f:close()
112
+ shellExecute(sd.FileName)
113
+ end
114
+ end
115
+ cm.Items.add(miSaveToFile)
116
+
117
+
118
+ lv.PopupMenu = cm
119
+ lv.Enabled=false
120
+ lv.Cursor=crHandPoint
121
+
122
+ form.Show()
123
+
124
+ function updateEntries(newentries)
125
+ if newentries then
126
+ entries=newentries
127
+ lv.Items.Count = #entries -- Tell the listview how many entries to expect
128
+ end
129
+
130
+ lv.Enabled=true
131
+ lv.Cursor=crDefault
132
+
133
+ form.Caption = "Address List"
134
+
135
+ form.bringToFront()
136
+ beep()
137
+ end
138
+
139
+
140
+ return form, updateEntries
141
+ end
142
+
143
+
144
+ function spawnEnumStaticsWindow(DataSource, frmDotNetInfo)
145
+ --spawn a thread that obtain a list of static addresses
146
+ local form, updateEntries=ShowAddressListWindow()
147
+
148
+ if DataSource.ParsedStatics==nil then
149
+
150
+ monolog('parse statics started')
151
+ local oldcaption=frmDotNetInfo.miEnumAllStatics.Caption
152
+ local frmDotNetInfoList=getDotNetInfoList()
153
+ for i=1,#frmDotNetInfoList do
154
+ frmDotNetInfoList[i].miEnumAllStatics.Enabled=false
155
+ frmDotNetInfoList[i].miEnumAllStatics.Caption=oldcaption..translate(' (Processing... Please wait!)')
156
+ end
157
+
158
+ DataSource.debug={}
159
+
160
+ if DataSource.ParsingStatics==nil then
161
+ DataSource.ParsingStatics=createThread(function(t)
162
+ --parse the statics
163
+ local r,r2=pcall(function()
164
+ local results={}
165
+ for i=1,#DataSource.Domains do
166
+ DataSource.debug.i=i
167
+
168
+ if DataSource.Domains[i].Images==nil then
169
+ DataSource.getImages(DataSource.Domains[i])
170
+ end
171
+
172
+ if DataSource.Domains[i].Images==nil then return end
173
+
174
+ for j=1,#DataSource.Domains[i].Images do
175
+ local HasToFetchClasses=false
176
+ DataSource.debug.j=j
177
+
178
+ synchronize(function() --got to check this quickly in the main thread
179
+ --print("mainthread. Checking if Classes is nil")
180
+ if t.Terminated then return end
181
+ if DataSource.Domains[i].Images[j].Classes==nil then
182
+ HasToFetchClasses=true
183
+ DataSource.Domains[i].Images[j].Classes={}
184
+ DataSource.Domains[i].Images[j].Classes.Busy=true
185
+ end
186
+ end)
187
+
188
+ if HasToFetchClasses then
189
+ --print('Getting classes')
190
+ DataSource.getClasses(DataSource.Domains[i].Images[j])
191
+ DataSource.Domains[i].Images[j].Classes.Busy=false
192
+ end
193
+
194
+ for k=1,#DataSource.Domains[i].Images[j].Classes do
195
+ DataSource.debug.k=k
196
+ if t.Terminated then break end
197
+
198
+ --get all the statics of each class
199
+ if DataSource.Domains[i].Images[j].Classes[k].Fields==nil then
200
+ DataSource.getClassFields(DataSource.Domains[i].Images[j].Classes[k])
201
+ end
202
+
203
+ if DataSource.Domains[i].Images[j].Classes[k].Fields then
204
+ for l=1,#DataSource.Domains[i].Images[j].Classes[k].Fields do
205
+ DataSource.debug.l=l
206
+ if t.Terminated then break end
207
+
208
+ local e=DataSource.Domains[i].Images[j].Classes[k].Fields[l]
209
+ if e.Static and e.Address then
210
+ local e2={}
211
+ e2.name=DataSource.Domains[i].Images[j].Classes[k].Name..'.'..e.Name
212
+ e2.address=e.Address
213
+
214
+ table.insert(results,e2)
215
+ end
216
+ DataSource.debug.l=nil
217
+ end
218
+ end
219
+ DataSource.debug.k=nil
220
+ end
221
+ DataSource.debug.j=nil
222
+ end
223
+ DataSource.debug.i=nil
224
+ end
225
+
226
+ DataSource.ParsedStatics=results
227
+ end)
228
+
229
+ if not r then
230
+ print('Parse static error:'..r2)
231
+ --monolog('parse statics error:'..r2)
232
+ end
233
+
234
+ monolog('parse statics finished')
235
+ synchronize(function()
236
+ local frmDotNetInfoList=getDotNetInfoList()
237
+ for i=1,#frmDotNetInfoList do
238
+ frmDotNetInfoList[i].miEnumAllStatics.Enabled=true
239
+ frmDotNetInfoList[i].miEnumAllStatics.Caption=oldcaption
240
+ end
241
+
242
+ if DataSource.ParsedStatics then
243
+ updateEntries(DataSource.ParsedStatics)
244
+ else
245
+ updateEntries(nil)
246
+ end
247
+
248
+ if not t.Terminated then
249
+ DataSource.ParsingStatics=nil
250
+ end
251
+ end)
252
+ end)
253
+
254
+ form.OnClose=function()
255
+ if DataSource.ParsingStatics then --this can be safely done as DataSource.ParsingStatics=nil only gets done inside the main thread
256
+ DataSource.ParsingStatics.Terminate() --just tell it to shut the fuck up when it feels like it
257
+ DataSource.ParsingStatics=nil
258
+ end
259
+
260
+ return caFree
261
+ end
262
+ end --else it was still going on (but shouldn't be possible to reach here as the menuitem is disabled)
263
+ else
264
+ --show dialog
265
+ local form, updateEntries=ShowAddressListWindow()
266
+ updateEntries(DataSource.ParsedStatics)
267
+ end
268
+
269
+
270
+ end
271
+
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/DotNetInject.lua ADDED
@@ -0,0 +1,444 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --[[
2
+ You have a d:\bla.dll with namespace ClassLibraryX, with a class named "MyClass"
3
+ That class contains a function defined as:
4
+ public static int MyInitFunctionName(string parameters)
5
+
6
+ then you do: injectDotNetDLL('d:\\bla.dll','ClassLibraryX.MyClass','MyInitFunctionName','Something')
7
+
8
+ --]]
9
+
10
+ local DotNetCoreInjectScript=[[
11
+ [enable]
12
+ alloc(injectdotnetdll, 2048)
13
+ alloc(IID_ICLRRuntimeHost4,16)
14
+ alloc(RuntimeHost,8)
15
+
16
+ alloc(paramstr,256)
17
+ alloc(methodname,256)
18
+ alloc(classname,256)
19
+ alloc(dllpath,512)
20
+
21
+ alloc(returnvalue,4)
22
+ alloc(errorvalue,4)
23
+ label(error)
24
+
25
+ dllpath:
26
+ dw '%s',0
27
+
28
+ classname:
29
+ dw '%s',0
30
+
31
+ methodname:
32
+ dw '%s',0
33
+
34
+ paramstr:
35
+ dw '%s',0
36
+
37
+
38
+ IID_ICLRRuntimeHost4:
39
+ db 66 d3 f6 64 c2 d7 1f 4f b4 b2 e8 16 0c ac 43 af
40
+
41
+ injectdotnetdll:
42
+ [64-bit]
43
+ sub rsp,6*8+8
44
+ mov rcx,IID_ICLRRuntimeHost4
45
+ mov rdx,RuntimeHost
46
+ [/64-bit]
47
+
48
+ [32-bit]
49
+ push RuntimeHost
50
+ push IID_ICLRRuntimeHost4
51
+ [/32-bit]
52
+
53
+ call GetCLRRuntimeHost
54
+ cmp eax,0
55
+ jne error
56
+
57
+ [64-bit]
58
+ mov rcx,[RuntimeHost]
59
+ mov rax,[rcx]
60
+ mov rdx,dllpath
61
+ mov r8,classname
62
+ mov r9,methodname
63
+ mov rbx,paramstr
64
+ mov [rsp+20],rbx
65
+ mov rbx,returnvalue
66
+ mov [rsp+28],rbx
67
+ call [rax+b*8]
68
+ [/64-bit]
69
+
70
+ [32-bit]
71
+ mov ecx,[RuntimeHost]
72
+ mov eax,[ecx]
73
+ push returnvalue
74
+ push paramstr
75
+ push methodname
76
+ push classname
77
+ push dllpath
78
+ push ecx
79
+ call [eax+b*4]
80
+ [/32-bit]
81
+
82
+ mov [errorvalue],eax
83
+
84
+ error:
85
+ [64-bit]
86
+ add rsp,6*8+8
87
+ ret
88
+ [/64-bit]
89
+
90
+ [32-bit]
91
+ ret 4
92
+ [/32-bit]
93
+
94
+ createthreadandwait(injectdotnetdll)
95
+
96
+ [disable]
97
+ dealloc(injectdotnetdll)
98
+ dealloc(IID_ICLRRuntimeHost4)
99
+ dealloc(RuntimeHost)
100
+
101
+ dealloc(paramstr)
102
+ dealloc(methodname)
103
+ dealloc(classname)
104
+ dealloc(dllpath)
105
+
106
+ dealloc(returnvalue)
107
+ dealloc(errorvalue)
108
+
109
+ ]]
110
+
111
+
112
+ ----------------------dot net---------------------------------------
113
+
114
+ local DotNetStandardInjectScript=[[
115
+ [enable]
116
+ alloc(injectdotnetdll,4096)
117
+ alloc(metahost,8)
118
+ alloc(RuntimeEnum,8)
119
+ alloc(RuntimeInfo,8)
120
+ alloc(RuntimeHost,8)
121
+ alloc(IID_ICLRMetaHost,16)
122
+ alloc(CLSID_CLRMetaHost,16)
123
+
124
+ alloc(Count,4)
125
+ alloc(IID_ICLRRuntimeHost,16)
126
+ alloc(CLSID_CLRRuntimeHost,16)
127
+ alloc(returnvalue,4)
128
+ alloc(errorvalue,4)
129
+
130
+ alloc(rti_flags,4)
131
+ alloc(rti_started,4)
132
+
133
+
134
+ alloc(paramstr,256)
135
+ alloc(methodname,256)
136
+ alloc(classname,256)
137
+ alloc(dllpath,512)
138
+ label(error)
139
+ label(RuntimeEnumLoop)
140
+
141
+ errorvalue:
142
+ dd ffffffff //ffffffff= it never even got to the execute part
143
+
144
+ dllpath:
145
+ dw '%s',0
146
+
147
+ classname:
148
+ dw '%s',0
149
+
150
+ methodname:
151
+ dw '%s',0
152
+
153
+ paramstr:
154
+ dw '%s',0
155
+
156
+
157
+ IID_ICLRMetaHost:
158
+ db 9E DB 32 D3 B3 B9 25 41 82 07 A1 48 84 F5 32 16
159
+
160
+ CLSID_CLRMetaHost:
161
+ db 8D 18 80 92 8E 0E 67 48 B3 0C 7F A8 38 84 E8 DE
162
+
163
+ IID_ICLRRuntimeHost:
164
+ db 6C A0 F1 90 12 77 62 47 86 B5 7A 5E BA 6B DB 02
165
+
166
+ CLSID_CLRRuntimeHost:
167
+ db 6E A0 F1 90 12 77 62 47 86 B5 7A 5E BA 6B DB 02
168
+
169
+ injectdotnetdll:
170
+ [64-bit]
171
+ sub rsp,6*8+8
172
+
173
+ mov rcx,CLSID_CLRMetaHost
174
+ mov rdx,IID_ICLRMetaHost
175
+ mov r8,metahost
176
+ [/64-bit]
177
+
178
+ [32-bit]
179
+ push metahost
180
+ push IID_ICLRMetaHost
181
+ push CLSID_CLRMetaHost
182
+ [/32-bit]
183
+ call MSCOREE.CLRCreateInstance
184
+
185
+ cmp eax,0
186
+ jne error
187
+
188
+ [64-bit]
189
+ mov rcx,[metahost]
190
+ mov rax,[rcx]
191
+ mov rdx,-1
192
+ mov r8,RuntimeEnum
193
+ call [rax+6*8] //EnumerateLoadedRuntimes
194
+ [/64-bit]
195
+
196
+ [32-bit]
197
+ mov ecx,[metahost]
198
+ mov eax,[ecx]
199
+ push RuntimeEnum
200
+ push -1
201
+ push ecx
202
+ call [eax+6*4] //EnumerateLoadedRuntimes
203
+ [/32-bit]
204
+
205
+
206
+ cmp eax,0
207
+ jne error
208
+
209
+
210
+ RuntimeEnumLoop:
211
+ [64-bit]
212
+ mov rcx,[RuntimeEnum]
213
+ mov rax,[rcx]
214
+
215
+ mov rdx,1
216
+ mov r8,RuntimeInfo
217
+ mov r9,Count
218
+ call [rax+3*8] //RuntimeEnum->Next
219
+ [/64-bit]
220
+
221
+ [32-bit]
222
+ mov ecx,[RuntimeEnum]
223
+ mov eax,[ecx]
224
+ push Count
225
+ push RuntimeInfo
226
+ push 1
227
+ push ecx
228
+ call [eax+3*4] //RuntimeEnum->Next
229
+ [/32-bit]
230
+
231
+ cmp eax,0
232
+ jne error
233
+
234
+ [64-bit]
235
+ mov rcx,[RuntimeInfo]
236
+ mov rax,[rcx]
237
+ mov rdx,rti_started
238
+ mov r8,rti_flags
239
+ call [rax+e*8] //RunTimeInfo->isStarted(started,flags)
240
+ [/64-bit]
241
+
242
+ [32-bit]
243
+ mov ecx,[RuntimeInfo]
244
+ mov eax,[ecx]
245
+ push rti_flags
246
+ push rti_started
247
+ push ecx
248
+ call [eax+e*4] //RunTimeInfo->isStarted(started,flags)
249
+ [/32-bit]
250
+
251
+ cmp eax,0
252
+ jne RuntimeEnumLoop
253
+
254
+ cmp dword [rti_flags],0
255
+ je RuntimeEnumLoop
256
+
257
+ //started
258
+ [64-bit]
259
+ mov rcx,[RuntimeInfo]
260
+ mov rax,[rcx]
261
+ mov rdx,CLSID_CLRRuntimeHost
262
+ mov r8,IID_ICLRRuntimeHost
263
+ mov r9,RuntimeHost
264
+ call [rax+9*8] //GetInterface
265
+ [/64-bit]
266
+
267
+ [32-bit]
268
+ mov ecx,[RuntimeInfo]
269
+ mov eax,[ecx]
270
+ push RuntimeHost
271
+ push IID_ICLRRuntimeHost
272
+ push CLSID_CLRRuntimeHost
273
+ push ecx
274
+ call [eax+9*4] //GetInterface
275
+ [/32-bit]
276
+
277
+ cmp eax,0
278
+ jne RuntimeEnumLoop
279
+
280
+ [64-bit]
281
+ mov rcx,[RuntimeHost]
282
+ mov rax,[rcx]
283
+ mov rdx,dllpath
284
+ mov r8,classname
285
+ mov r9,methodname
286
+ mov rbx,paramstr
287
+ mov [rsp+20],rbx
288
+ mov rbx,returnvalue
289
+ mov [rsp+28],rbx
290
+ call [rax+b*8]
291
+ [/64-bit]
292
+
293
+ [32-bit]
294
+ mov ecx,[RuntimeHost]
295
+ mov eax,[ecx]
296
+ push returnvalue
297
+ push paramstr
298
+ push methodname
299
+ push classname
300
+ push dllpath
301
+ push ecx
302
+ call [eax+b*4]
303
+ [/32-bit]
304
+
305
+ mov [errorvalue],eax
306
+
307
+ jmp RuntimeEnumLoop
308
+
309
+ error:
310
+ [64-bit]
311
+ add rsp,6*8+8
312
+ ret
313
+ [/64-bit]
314
+
315
+ [32-bit]
316
+ ret 4
317
+ [/32-bit]
318
+
319
+ createthreadandwait(injectdotnetdll)
320
+
321
+ [disable]
322
+ dealloc(injectdotnetdll)
323
+ dealloc(metahost)
324
+ dealloc(RuntimeEnum)
325
+ dealloc(RuntimeInfo)
326
+ dealloc(RuntimeHost)
327
+ dealloc(IID_ICLRMetaHost)
328
+ dealloc(CLSID_CLRMetaHost)
329
+
330
+ dealloc(Count)
331
+ dealloc(IID_ICLRRuntimeHost)
332
+ dealloc(CLSID_CLRRuntimeHost)
333
+ dealloc(returnvalue)
334
+ dealloc(errorvalue)
335
+
336
+ dealloc(rti_flags)
337
+ dealloc(rti_started)
338
+
339
+
340
+ dealloc(paramstr)
341
+ dealloc(methodname)
342
+ dealloc(classname)
343
+ dealloc(dllpath)
344
+
345
+
346
+ ]]
347
+
348
+ function injectDotNetDLL(path, classname, methodname, parameter, timeout)
349
+ if monopipe then
350
+ --inject the dll using mono
351
+ local assembly=mono_loadAssemblyFromFile(path)
352
+
353
+ if (classname==nil) and (method==nil) then return assembly end
354
+
355
+ if assembly and classname and methodname then
356
+ local image=mono_getImageFromAssembly(assembly)
357
+ if image then
358
+ --find class
359
+ local c=mono_image_enumClasses(image)
360
+ for i=1,#c do
361
+ if c[i].classname==classname then
362
+ local m=mono_class_enumMethods(c[i].class)
363
+ if m.name==methodname then
364
+ local result
365
+ if parameter then
366
+ local args={}
367
+ args[1]={}
368
+ args[1].type=vtString
369
+ args[1].value=parameter
370
+
371
+ result=mono_invoke_method(nil,m,nil,{})
372
+ else
373
+ result=mono_invoke_method(nil,m,nil,nil)
374
+ end
375
+
376
+ return result
377
+ end
378
+ end
379
+ end
380
+ end
381
+
382
+ end
383
+
384
+ return
385
+ end
386
+
387
+
388
+ local m=enumModules()
389
+ local isDotNetCore=false
390
+ local isDotNetStandard=false
391
+ for i=1,#m do
392
+ local uppername=m[i].Name:upper()
393
+ if uppername=='MSCOREE.DLL' then
394
+ if getAddressSafe('MSCOREE.CLRCreateInstance') then
395
+ isDotNetStandard=true
396
+ end
397
+ end
398
+
399
+ if uppername=='CORECLR.DLL' then
400
+ if getAddressSafe('CORECLR.GetCLRRuntimeHost') then
401
+ isDotNetCore=true
402
+ end
403
+ end
404
+ end
405
+
406
+ local script
407
+ if isDotNetCore then
408
+ script=DotNetCoreInjectScript
409
+ elseif isDotNetStandard then
410
+ script=DotNetStandardInjectScript
411
+ else
412
+ return nil,-4 --no dotnet architecture detected. Todo: Create a .net host in the target?
413
+ end
414
+
415
+
416
+ local script=string.format(script,path, classname, methodname, parameter)
417
+ status, disableInfo=autoAssemble(script)
418
+
419
+ if status then
420
+ local returnValue=readInteger(disableInfo.allocs.returnvalue.address)
421
+ local errorValue=readInteger(disableInfo.allocs.errorvalue.address)
422
+ autoAssemble(script, disableInfo)
423
+
424
+ if errorValue==nil then
425
+ return nil,-3 --target crashed...
426
+ end
427
+
428
+ if errorValue~=0 then --not a successful load
429
+ if errorValue==0xffffffff then
430
+ return nil, -2 --failed getting to the execute part
431
+ else
432
+ return nil, errorValue --execution gave this error (ntstatus)
433
+ end
434
+ end
435
+
436
+ return returnValue
437
+ else
438
+ return nil,-1
439
+ end
440
+
441
+ end
442
+
443
+ injectDotNetLibrary=injectDotNetDLL
444
+
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/DotNetInterface.lua ADDED
@@ -0,0 +1,685 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ --same as monodatacollector but for .net and .netcore
3
+ --can theoretically be used on mono as well
4
+
5
+ if getTranslationFolder()~='' then
6
+ loadPOFile(getTranslationFolder()..'dotnetforceddatacollector.po')
7
+ end
8
+
9
+
10
+ local pathsep
11
+ local libfolder
12
+
13
+ if getOperatingSystem()==0 then
14
+ pathsep=[[\]]
15
+ libfolder='dlls'
16
+ else
17
+ pathsep='/'
18
+ libfolder='dylibs'
19
+ end
20
+
21
+ dotnet_timeout=3000
22
+
23
+ DOTNETCMD_TEST=0
24
+ DOTNETCMD_INITMODULELIST=1
25
+ DOTNETCMD_GETMETHODENTRYPOINT=2
26
+ DOTNETCMD_GETFIELDTYPENAME=3
27
+ DOTNETCMD_GETFIELDVALUE=4
28
+ DOTNETCMD_SETFIELDVALUE=5
29
+ DOTNETCMD_LOADMODULE=6
30
+ DOTNETCMD_GETMETHODPARAMETERS=7
31
+ DOTNETCMD_WRAPOBJECT=8
32
+ DOTNETCMD_UNWRAPOBJECT=9
33
+ DOTNETCMD_INVOKEMETHOD=10
34
+
35
+ DOTNETCMD_FIND_MODULEID_WITH_CLASSLIST=11
36
+
37
+
38
+ DOTNETCMD_EXIT=255
39
+
40
+
41
+ dotnetmodulelist={}
42
+
43
+ function dotnet_findDotNetMethodAddress(namespace, classname, methodname, modulename)
44
+ --print(string.format("dotnet_findDotNetMethodAddress('%s','%s','%s','%s')",namespace,classname, methodname, modulename))
45
+
46
+ local fcn
47
+
48
+ if namespace==nil then namespace='' end
49
+ if modulename then modulename=modulename:lower() end
50
+
51
+ if namespace~='' then
52
+ fcn=namespace..'.'..classname
53
+ else
54
+ fcn=classname
55
+ end
56
+
57
+ local dc=getDotNetDataCollector()
58
+
59
+ local moduleid
60
+
61
+
62
+ local domains=dc.enumDomains()
63
+ local i
64
+ for i=1,#domains do
65
+ local modules=dc.enumModuleList(domains[i].DomainHandle)
66
+ local j
67
+ for j=1,#modules do
68
+ if (modulename==nil) or (modulename==extractFileName(modules[j].Name):lower()) then
69
+ local classes=dc.enumTypeDefs(modules[j].ModuleHandle)
70
+ local k
71
+ t={}
72
+
73
+ for k=1,#classes do
74
+ --printf("%d: %s (%d) <=>%s (%d)",k, classes[k].Name, #classes[k].Name, fcn, #fcn)
75
+ t[k]=classes[k].Name
76
+
77
+ if classes[k].Name==fcn then
78
+ --found the class
79
+ --print("yes")
80
+ local ml=dc.getTypeDefMethods(modules[j].ModuleHandle, classes[k].TypeDefToken)
81
+ local l
82
+ for l=1,#ml do
83
+ if ml[l].Name==methodname then
84
+ --print("Found method. Calling dotnet_getMethodEntryPoint")
85
+ local r=dotnet_getMethodEntryPoint(dotnet_getModuleID(extractFileName(modules[j].Name)), ml[l].MethodToken)
86
+
87
+ if r then
88
+ --printf("%s at address %8x", methodname, r)
89
+ return r
90
+ else
91
+ --print("failure")
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+
102
+ function dotnet_loadModule(path)
103
+ if path==nil then
104
+ print(debug.traceback())
105
+ error('dotnet_loadModule: path is nil')
106
+ end
107
+ local r
108
+ dotnetpipe.lock()
109
+ dotnetpipe.writeByte(DOTNETCMD_LOADMODULE)
110
+ dotnetpipe.writeDword(#path);
111
+ dotnetpipe.writeString(path)
112
+ r=dotnetpipe.readDword()
113
+ if dotnetpipe==nil then return false end
114
+
115
+ dotnetpipe.unlock()
116
+
117
+ if r==1 then
118
+ dotnet_initModuleList()
119
+ reinitializeDotNetSymbolhandler(extractFileName(path))
120
+ return true
121
+ else
122
+ return false
123
+ end
124
+ end
125
+
126
+ function dotnet_initModuleList()
127
+ --load the modulelist from the injected dll. Watch the order
128
+ dotnetmodulelist={}
129
+ dotnetpipe.lock()
130
+ dotnetpipe.writeByte(DOTNETCMD_INITMODULELIST)
131
+ local count=dotnetpipe.readDword()
132
+
133
+ if not (count or dotnetpipe) then return end
134
+
135
+ local i
136
+ for i=1,count do
137
+ local stringsize=dotnetpipe.readDword()
138
+ local s=dotnetpipe.readString(stringsize)
139
+
140
+ stringsize=dotnetpipe.readDword()
141
+ local s2=dotnetpipe.readString(stringsize)
142
+
143
+ stringsize=dotnetpipe.readDword()
144
+ local s3=dotnetpipe.readString(stringsize)
145
+
146
+ dotnetmodulelist[i]={}
147
+ dotnetmodulelist[i].Name=s
148
+ dotnetmodulelist[i].ScopeName=s2
149
+ dotnetmodulelist[i].GUID=s3
150
+ dotnetmodulelist[i].Index=i
151
+ dotnetmodulelist[s]=dotnetmodulelist[i] --so the list can get searched by both numeric as string
152
+ end
153
+ dotnetpipe.unlock()
154
+ end
155
+
156
+ function dotnet_setFieldValue(moduleid, fielddef, instanceaddress, value)
157
+ local result
158
+ dotnetpipe.lock()
159
+ dotnetpipe.writeByte(DOTNETCMD_SETFIELDVALUE)
160
+ dotnetpipe.writeDword(moduleid)
161
+ dotnetpipe.writeDword(fielddef)
162
+ dotnetpipe.writeQword(instanceaddress)
163
+ dotnetpipe.writeDword(#value)
164
+ dotnetpipe.writeString(value)
165
+ dotnetpipe.unlock()
166
+
167
+ return result
168
+ end
169
+
170
+
171
+ function dotnet_getFieldValue(moduleid, fielddef, instanceaddress)
172
+ local result
173
+ dotnetpipe.lock()
174
+ dotnetpipe.writeByte(DOTNETCMD_GETFIELDVALUE)
175
+ dotnetpipe.writeDword(moduleid)
176
+ dotnetpipe.writeDword(fielddef)
177
+ dotnetpipe.writeQword(instanceaddress)
178
+ local stringsize=dotnetpipe.readDword()
179
+ local result=dotnetpipe.readString(stringsize)
180
+ dotnetpipe.unlock()
181
+
182
+
183
+ return result
184
+ end
185
+
186
+
187
+ function dotnet_getFieldTypeName(moduleid, fielddef)
188
+ local result
189
+ dotnetpipe.lock()
190
+ dotnetpipe.writeByte(DOTNETCMD_GETFIELDTYPENAME)
191
+ dotnetpipe.writeDword(moduleid)
192
+ dotnetpipe.writeDword(fielddef)
193
+ local stringsize=dotnetpipe.readDword()
194
+ local result=dotnetpipe.readString(stringsize)
195
+ dotnetpipe.unlock()
196
+
197
+ return result
198
+ end
199
+
200
+ function dotnet_getMethodEntryPoint(moduleid, methoddef)
201
+ dotnetpipe.lock()
202
+ dotnetpipe.writeByte(DOTNETCMD_GETMETHODENTRYPOINT)
203
+ dotnetpipe.writeDword(moduleid)
204
+ dotnetpipe.writeDword(methoddef)
205
+ local result=dotnetpipe.readQword()
206
+ dotnetpipe.unlock()
207
+
208
+ return result
209
+ end
210
+
211
+ function dotnet_getMethodParameters(moduleid, methoddef)
212
+ if dotnetpipe==nil then return nil end
213
+ if moduleid==nil then error('moduleid is nil') end
214
+ if methoddef==nil then error('methoddef is nil') end
215
+
216
+ local returntype,parameters,sz
217
+ dotnetpipe.lock()
218
+ dotnetpipe.writeByte(DOTNETCMD_GETMETHODPARAMETERS)
219
+ dotnetpipe.writeDword(moduleid)
220
+ dotnetpipe.writeDword(methoddef)
221
+ sz=dotnetpipe.readDword()
222
+ returntype=dotnetpipe.readString(sz)
223
+ sz=dotnetpipe.readDword()
224
+ parameters=dotnetpipe.readString(sz)
225
+
226
+ local count=dotnetpipe.readByte()
227
+ local TypeCodes={}
228
+ for i=1,count do
229
+ TypeCodes[i]=dotnetpipe.readByte()
230
+ end
231
+
232
+ dotnetpipe.unlock()
233
+
234
+ return returntype, parameters, TypeCodes
235
+ end
236
+
237
+ function dotnet_wrapobject(objectaddress)
238
+ if dotnetpipe then
239
+ local result
240
+ dotnetpipe.lock()
241
+ dotnetpipe.writeByte(DOTNETCMD_WRAPOBJECT)
242
+ dotnetpipe.writeQword(objectaddress)
243
+ result=dotnetpipe.readQword()
244
+ dotnetpipe.unlock()
245
+
246
+ return result
247
+ end
248
+ end
249
+
250
+ function dotnet_unwrapobject(wrappedobjecthandle)
251
+ local result
252
+ dotnetpipe.lock()
253
+ dotnetpipe.writeByte(DOTNETCMD_UNWRAPOBJECT)
254
+ dotnetpipe.writeQword(wrappedobjecthandle)
255
+ dotnetpipe.unlock()
256
+
257
+ return result
258
+ end
259
+
260
+ TypeCode={}
261
+ TypeCode.Empty=0
262
+ TypeCode.Object=1
263
+ TypeCode.DBNull=2
264
+ TypeCode.Boolean=3
265
+ TypeCode.Char=4
266
+ TypeCode.SByte=5
267
+ TypeCode.Byte=6
268
+ TypeCode.Int16=7
269
+ TypeCode.UInt16=8
270
+ TypeCode.Int32=9
271
+ TypeCode.UInt32=10
272
+ TypeCode.Int64=11
273
+ TypeCode.UInt64=12
274
+ TypeCode.Single=13
275
+ TypeCode.Double=14
276
+ TypeCode.Decimal=15
277
+ TypeCode.DateTime=16
278
+ TypeCode.String=18 --handle as utf8string
279
+
280
+ dotnet_writeObjectValue={}
281
+ dotnet_writeObjectValue[TypeCode.Empty]=function() end
282
+ dotnet_writeObjectValue[TypeCode.Object]=function(wrappedObjectHandle) dotnetpipe.writeQword(wrappedObjectHandle) end
283
+ dotnet_writeObjectValue[TypeCode.DBNull]=dotnet_writeObjectValue[TypeCode.Empty]
284
+ dotnet_writeObjectValue[TypeCode.Boolean]=function(flag) dotnetpipe.writeByte(flag and 1 or 0) end
285
+ dotnet_writeObjectValue[TypeCode.Char]=function(c)
286
+ c=string.sub(c,1,1)
287
+ dotnetpipe.writeWideString(c,false)
288
+ end
289
+
290
+ dotnet_writeObjectValue[TypeCode.SByte]=function(v) dotnetpipe.writeByte(v) end
291
+ dotnet_writeObjectValue[TypeCode.Byte]=dotnet_writeObjectValue[TypeCode.SByte]
292
+ dotnet_writeObjectValue[TypeCode.Int16]=function(v) dotnetpipe.writeWord(v) end
293
+ dotnet_writeObjectValue[TypeCode.UInt16]=dotnet_writeObjectValue[TypeCode.Int16]
294
+ dotnet_writeObjectValue[TypeCode.Int32]=function(v) dotnetpipe.writeDword(v) end
295
+ dotnet_writeObjectValue[TypeCode.UInt32]=dotnet_writeObjectValue[TypeCode.Int32]
296
+ dotnet_writeObjectValue[TypeCode.Int64]=function(v) dotnetpipe.writeQword(v) end
297
+ dotnet_writeObjectValue[TypeCode.UInt64]=dotnet_writeObjectValue[TypeCode.Int64]
298
+ dotnet_writeObjectValue[TypeCode.Single]=function(v) dotnetpipe.writeFloat(v) end
299
+ dotnet_writeObjectValue[TypeCode.Double]=function(v) dotnetpipe.writeDouble(v) end
300
+ dotnet_writeObjectValue[TypeCode.Decimal]=dotnet_writeObjectValue[TypeCode.Double] --not a perfect match, but will do
301
+ dotnet_writeObjectValue[TypeCode.DateTime]=dotnet_writeObjectValue[TypeCode.UInt64]
302
+ dotnet_writeObjectValue[TypeCode.String]=function(s)
303
+ dotnetpipe.writeDword(#s)
304
+ dotnetpipe.writeString(s)
305
+ end
306
+
307
+
308
+
309
+ dotnet_StringToTypeCodeValue={}
310
+ dotnet_StringToTypeCodeValue[TypeCode.Empty]=function(s) return 0 end
311
+ dotnet_StringToTypeCodeValue[TypeCode.Object]=function(s)
312
+ if s=='' then return 0 end --void gets handled as an object with address 0
313
+ if s:sub(1,2)=='0x' then
314
+ return tonumber(s)
315
+ else
316
+ return tonumber(s,16)
317
+ end
318
+ end
319
+ dotnet_StringToTypeCodeValue[TypeCode.DBNull]=dotnet_StringToTypeCodeValue[TypeCode.Object]
320
+ dotnet_StringToTypeCodeValue[TypeCode.Boolean]=function(s)
321
+ local s=s:upper()
322
+ if s=='1' or s=='TRUE' then return true end
323
+ if s=='0' or s=='FALSE' then return false end
324
+ return nil
325
+ end
326
+ dotnet_StringToTypeCodeValue[TypeCode.Char]=function(s) return s:sub(1,1) end
327
+ dotnet_StringToTypeCodeValue[TypeCode.SByte]=function(s) return tonumber(s) end
328
+ dotnet_StringToTypeCodeValue[TypeCode.Byte]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
329
+ dotnet_StringToTypeCodeValue[TypeCode.Int16]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
330
+ dotnet_StringToTypeCodeValue[TypeCode.UInt16]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
331
+ dotnet_StringToTypeCodeValue[TypeCode.Int32]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
332
+ dotnet_StringToTypeCodeValue[TypeCode.UInt32]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
333
+ dotnet_StringToTypeCodeValue[TypeCode.Int64]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
334
+ dotnet_StringToTypeCodeValue[TypeCode.UInt64]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
335
+ dotnet_StringToTypeCodeValue[TypeCode.Single]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
336
+ dotnet_StringToTypeCodeValue[TypeCode.Double]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
337
+ dotnet_StringToTypeCodeValue[TypeCode.Decimal]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
338
+ dotnet_StringToTypeCodeValue[TypeCode.DateTime]=dotnet_StringToTypeCodeValue[TypeCode.SByte]
339
+ dotnet_StringToTypeCodeValue[TypeCode.String]=function(s) return s end
340
+
341
+
342
+ dotnet_readObjectValue={}
343
+ dotnet_readObjectValue[TypeCode.Empty]=function() return nil end
344
+ dotnet_readObjectValue[TypeCode.Object]=function() return dotnetpipe.readQword() end
345
+ dotnet_readObjectValue[TypeCode.DBNull]=dotnet_readObjectValue[TypeCode.Empty]
346
+ dotnet_readObjectValue[TypeCode.Boolean]=function() return dotnetpipe.readByte()~=0 end
347
+ dotnet_readObjectValue[TypeCode.Char]=function() return dotnetpipe.readWideString(1) end
348
+ dotnet_readObjectValue[TypeCode.SByte]=function() return signExtend(dotnetpipe.readByte(),7) end
349
+ dotnet_readObjectValue[TypeCode.Byte]=function() return dotnetpipe.readByte() end
350
+ dotnet_readObjectValue[TypeCode.Int16]=function() return signExtend(dotnetpipe.readWord(),15) end
351
+ dotnet_readObjectValue[TypeCode.UInt16]=function() return dotnetpipe.readWord() end
352
+ dotnet_readObjectValue[TypeCode.Int32]=function() return signExtend(dotnetpipe.readDWord(),31) end
353
+ dotnet_readObjectValue[TypeCode.UInt32]=function() return dotnetpipe.readDWord() end
354
+ dotnet_readObjectValue[TypeCode.Int64]=function() return dotnetpipe.readQword(v) end
355
+ dotnet_readObjectValue[TypeCode.UInt64]=dotnet_readObjectValue[TypeCode.UInt64]
356
+ dotnet_readObjectValue[TypeCode.Single]=function() return dotnetpipe.readFloat(v) end
357
+ dotnet_readObjectValue[TypeCode.Double]=function() return dotnetpipe.readDouble(v) end
358
+ dotnet_readObjectValue[TypeCode.Decimal]=dotnet_readObjectValue[TypeCode.Double] --not a perfect match, but will do
359
+ dotnet_readObjectValue[TypeCode.DateTime]=dotnet_readObjectValue[TypeCode.UInt64]
360
+ dotnet_readObjectValue[TypeCode.String]=function()
361
+ local length=dotnetpipe.readDword()
362
+ return dotnetpipe.readString(length)
363
+ end
364
+
365
+ dotnet_readObjectValue[255]=function()
366
+ local msg=dotnet_readObjectValue[TypeCode.String]
367
+ print("Invoke Error: "..msg)
368
+ return nil
369
+ end
370
+
371
+
372
+ function dotnet_writeObject(parameter)
373
+ --pre: dotnetpipe lock is obtained
374
+ printf("dotnet_writeObject parameter.Type=%d parameter.Value="..parameter.Value, parameter.Type)
375
+
376
+ dotnetpipe.writeByte(parameter.Type)
377
+ local handler=dotnet_writeObjectValue[parameter.Type]
378
+ if handler then
379
+ handler(parameter.Value)
380
+ else
381
+ print("Unknown write handler:"..parameter.Type)
382
+ print(debug.traceback())
383
+ return false
384
+ end
385
+
386
+ return true
387
+ end
388
+
389
+ function dotnet_readObject()
390
+ printf("dotnet_readObject")
391
+ local result
392
+ local Type=dotnetpipe.readByte()
393
+ local handler=dotnet_readObjectValue[Type]
394
+ if handler then
395
+ return handler()
396
+ else
397
+ if (Type~=nil) then
398
+ print("Unknown read handler:"..Type)
399
+ else
400
+ print("Unknown read handler:"..Type)
401
+ end
402
+
403
+ print(debug.traceback())
404
+ return nil
405
+ end
406
+ end
407
+
408
+ function dotnet_invoke_method(moduleid, methoddef, wrappedObjectHandle, parameters)
409
+ local result
410
+ dotnetpipe.lock()
411
+ dotnetpipe.writeByte(DOTNETCMD_INVOKEMETHOD)
412
+ dotnetpipe.writeDword(moduleid)
413
+ dotnetpipe.writeDword(methoddef)
414
+ dotnetpipe.writeQword(wrappedObjectHandle)
415
+
416
+ --print("writing parameters")
417
+ if parameters then
418
+ dotnetpipe.writeByte(#parameters)
419
+ local i
420
+ for i=1,#parameters do
421
+ dotnet_writeObject(parameters[i])
422
+ end
423
+ else
424
+ dotnetpipe.writeByte(0)
425
+ end
426
+
427
+ -- print("Reading result")
428
+
429
+ result=dotnet_readObject()
430
+ dotnetpipe.unlock()
431
+ return result
432
+ end
433
+
434
+ function dotnet_invoke_method_dialog(name, moduleid, methoddef, wrappedAddress)
435
+
436
+ if wrappedAddress==nil then
437
+ return nil,'no wrapped object address provided'
438
+ end
439
+ if not inMainThread() then
440
+ return nil,'dotnet_invoke_method_dialog must run in the main thread'
441
+ end
442
+
443
+
444
+ local returntype, parameters, typeCodes=dotnet_getMethodParameters(moduleid, methoddef)
445
+ if returntype==nil then
446
+ return nil,'dotnet_getMethodParameters failed'
447
+ end
448
+
449
+ parameters=parameters:sub(2,#parameters-1) --strip the braces
450
+
451
+ local paramlist=table.pack(parameters:split(','))
452
+
453
+ if #paramlist~=#typeCodes-1 then --bug?
454
+ paramlist={}
455
+ local i
456
+ for i=1,#typeCodes do
457
+ paramlist[i]='tc'..typecodes[i]..' param'..i;
458
+ end
459
+ end
460
+
461
+ --still here, so all checks are ok, spawn the dialog
462
+ local mifinfo
463
+ mifinfo=createMethodInvokedialog(name, paramlist, function()
464
+ local instance=wrappedAddress
465
+ end)
466
+
467
+
468
+ --print("createMethodInvokedialog returned")
469
+
470
+
471
+ mifinfo.btnOk.OnClick=function(b)
472
+ --use typeCodes to fill the paramlist
473
+ print("DotnetInterface: mifinfo.btnOk.OnClick ")
474
+
475
+ local parameters={}
476
+ for i=2,#typeCodes do
477
+ local e={}
478
+ e.Type=typeCodes[i]
479
+
480
+ local valuehandler=dotnet_StringToTypeCodeValue[e.Type]
481
+ if valuehandler then
482
+ e.Value=valuehandler(mifinfo.parameters[i-1].edtVarText.Text)
483
+ if e.Value==nil then --nil is error
484
+ messageDialog('The input :"'..mifinfo.parameters[i].edtVarText.Text..'" could not be parsed for '..mifinfo.parameters[i].lblVarName, mtError,mbOK);
485
+ return
486
+ end
487
+ else
488
+ messageDialog('TypeCodes '..valuehandler..' is not known', mtError,mbOK);
489
+ return
490
+ end
491
+
492
+
493
+ table.insert(parameters,e)
494
+ end
495
+
496
+ local result=dotnet_invoke_method(moduleid, methoddef, wrappedAddress, parameters)
497
+
498
+
499
+
500
+ end
501
+
502
+ -- print("showing mifinfo.mif")
503
+
504
+ mifinfo.mif.show()
505
+
506
+ return mifinfo
507
+ end
508
+
509
+ function dotnet_getModuleIDFromClassList(modulename, classnamelist)
510
+ --scans for modules that contain all the given classnames.
511
+ --when found, apply to the dotnetmodulelist so it doesn't need to be found anymore
512
+ -- print("dotnet_getModuleIDFromClassList. #classnamelist="..#classnamelist);
513
+
514
+ if (classnamelist==nil) or (#classnamelist==0) then
515
+ print("empty classlist")
516
+ return nil
517
+ end
518
+ local result=0xffff
519
+ if dotnetpipe then
520
+ dotnetpipe.lock()
521
+ dotnetpipe.writeByte(DOTNETCMD_FIND_MODULEID_WITH_CLASSLIST)
522
+ dotnetpipe.writeByte(#classnamelist)
523
+ for i=1,#classnamelist do
524
+ local s=classnamelist[i]
525
+ dotnetpipe.writeDword(#s);
526
+ dotnetpipe.writeString(classnamelist[i])
527
+ end
528
+
529
+
530
+ result=dotnetpipe.readWord()
531
+ dotnetpipe.unlock()
532
+ end
533
+
534
+ if result==0xffff then
535
+ print("DOTNETCMD_FIND_MODULEID_WITH_CLASSLIST failed");
536
+ return nil
537
+ else
538
+ --dotnetmodulelist[modulename]=dotnetmodulelist[result+1]
539
+ return result
540
+ end
541
+ end
542
+
543
+
544
+ function dotnet_getModuleID(modulename)
545
+ if dotnetmodulelist==nil then
546
+ dotnet_initModuleList()
547
+
548
+ if dotnetmodulelist==nil then return end
549
+ end
550
+
551
+ local m=dotnetmodulelist[modulename]
552
+ if m then
553
+ return m.Index-1
554
+ else
555
+ --try the scopenames extension
556
+ --printf("dotnet_getModuleID(%s): Try alternate method", modulename)
557
+
558
+ for i=1,#dotnetmodulelist do
559
+ if dotnetmodulelist[i].ScopeName==modulename then
560
+ return i-1
561
+ end
562
+
563
+ if extractFileNameWithoutExt(dotnetmodulelist[i].ScopeName)==modulename then
564
+ return i-1
565
+ end
566
+
567
+ if extractFileNameWithoutExt(modulename)==dotnetmodulelist[i].ScopeName then
568
+ return i-1
569
+ end
570
+
571
+
572
+
573
+ end
574
+ print("not found")
575
+ end
576
+ end
577
+
578
+ function dotnet_disconnect()
579
+ print("dotnet_disconnect")
580
+ if dotnetpipe then
581
+ dotnetpipe.lock()
582
+ dotnetpipe.writeByte(DOTNETCMD_EXIT)
583
+ dotnetpipe.unlock()
584
+
585
+ dotnetpipe.destroy()
586
+ end
587
+ dotnetpipe=nil
588
+ end
589
+
590
+ function LaunchDotNetInterface()
591
+ local dllname
592
+ local remotePipeHandle
593
+
594
+ if dotnetpipe and (tonumber(dotnetpipe.processid)==getOpenedProcessID()) then
595
+ return true
596
+ end
597
+
598
+ if dotnetpipe then
599
+ dotnet_disconnect()
600
+ if dotnetpipe~=nil then
601
+ dotnetpipe.destroy()
602
+ dotnetpipe=nil
603
+ end
604
+ end
605
+
606
+ dllname="DotNetInterface.dll" --it's an "Any CPU" library
607
+
608
+
609
+ --create a pipe and duplicate it's handle to the target process
610
+ local serverpipe=createPipe('cedotnetpipe_pid'..getOpenedProcessID(), 256*1024,1024)
611
+ remotePipeHandle=duplicateHandle(serverpipe.Handle)
612
+
613
+ serverpipe.destroy()
614
+
615
+ --print(string.format("new handle=%d", remotePipeHandle))
616
+
617
+ local injectResult, injectError=injectDotNetLibrary(getAutorunPath()..libfolder..pathsep..dllname, 'DotNetInterface.PipeServer','Init',string.format("%d",remotePipeHandle), dotnet_timeout)
618
+
619
+ if (injectResult==nil) or (injectResult==false )then
620
+ if injectError then
621
+ messageDialog(translate('Inject error : ')..string.format("%x",injectError), mtError, mbOK);
622
+ else
623
+ messageDialog(translate('Inject error : ')..translate('Unknown'), mtError, mbOK);
624
+ end
625
+ return
626
+ end
627
+
628
+ dotnetpipe=connectToPipe('cedotnetpipe_pid'..getOpenedProcessID() ,dotnet_timeout)
629
+
630
+ if (dotnetpipe==nil) then
631
+ print("dotnetpipe is nil. Failed to connect")
632
+ return --failure
633
+ end
634
+
635
+
636
+ --print("connected")
637
+
638
+
639
+ dotnetpipe.OnError=function(self)
640
+ -- print("dotnetpipe error")
641
+ -- print(debug.traceback())
642
+ dotnetpipe=nil
643
+ end
644
+
645
+ dotnetpipe.OnTimeout=function(self)
646
+ dotnetpipe=nil
647
+ print("dotnet timeout")
648
+ end
649
+
650
+
651
+ local val=math.random(1,255)
652
+ --printf("val=%x",val)
653
+
654
+ dotnetpipe.lock()
655
+ dotnetpipe.writeByte(DOTNETCMD_TEST)
656
+ dotnetpipe.writeByte(val)
657
+ local result=dotnetpipe.readByte()
658
+ --if result then
659
+ --printf("result=%x", result)
660
+ --end
661
+ if dotnetpipe==nil then return false end
662
+ dotnetpipe.unlock()
663
+
664
+ local resultcalc=val ~ 0xce
665
+
666
+ if result~=resultcalc then
667
+
668
+ messageDialog('pipe connection error (invalid value returned)', mtError, mbOK);
669
+ if dotnetpipe~=nil then
670
+
671
+ dotnetpipe.destroy()
672
+ dotnetpipe=nil
673
+ end
674
+ return
675
+ end
676
+
677
+ -- print("calling dotnet_initModuleList")
678
+
679
+ dotnet_initModuleList()
680
+
681
+ dotnetpipe.processid=getOpenedProcessID()
682
+ dotnetpipe.isValid=function() return getOpenedProcessID()==tonumber(dotnetpipe.processid) end
683
+ --still here, return true
684
+ return true
685
+ end
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/Lua files in this folder get executed automatically.txt ADDED
File without changes
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/MethodInvokeDialog.lua ADDED
@@ -0,0 +1,354 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --[[
2
+ Just a generic form for filling in fields. The caller is responsible for the callbacks
3
+ Can be other types besides .NET so no .net/mono specific code here (just generic OOP things)
4
+
5
+ createMethodInvokeDialog returns true on ok, false on cancel
6
+
7
+ invokeDialogParams:{
8
+ name
9
+ nonmodal: boolean - When true the form won't close on clicking ok, but instead calls an OnOKClick function
10
+ isStatic: boolean (true/false/nil) - When true the instance address field will be hidden
11
+ allowCustomAddress: boolean (true/false/nil) - When true the instance address field will be editable
12
+ address: integer - address of the instance
13
+ parameters[]={varname=xxx, isObject=true/false/nil}, whatever else you wish, value=undefined} : After the call returns, the element named 'value' will be filled in by the users input
14
+ onCreateInstanceClick: function(dialog, invokeDialogParams, parameterindex) : string - Called when the + button is clicked. Return a string with the address or 'other' constructor code if you created an object (up to the caller)
15
+ onOKClick: function(dialog, invokeDialogParams, output) --called when nonmodal is true . Output is a strings object of the listbox used to show results to the user
16
+ }
17
+
18
+
19
+ --]]
20
+
21
+
22
+ local dpiscale=getScreenDPI()/96
23
+
24
+ local function createMethodInvokeDialogEx(invokeDialogParams)
25
+
26
+ local midinfo={}
27
+ midinfo.mid=createForm(false)
28
+ midinfo.mid.position='poScreenCenter'
29
+ midinfo.mid.borderStyle='bsSizeable'
30
+ midinfo.mid.Caption=translate('Invoke ')..invokeDialogParams.name
31
+ midinfo.mid.Name='MethodInvokeDialog'
32
+
33
+ if (not invokeDialogParams.isStatic) and invokeDialogParams.allowCustomAddress then
34
+ midinfo.lblInstanceAddress=createLabel(midinfo.mid)
35
+ midinfo.lblInstanceAddress.Caption=translate('Instance address')
36
+ midinfo.edtInstance=createEdit(midinfo.mid)
37
+
38
+ if invokeDialogParams.address then
39
+ midinfo.edtInstance.Text=string.format("%x",invokeDialogParams.address)
40
+ end
41
+ end
42
+
43
+ midinfo.gbParams=createGroupBox(midinfo.mid)
44
+ midinfo.gbParams.Caption=translate('Parameters')
45
+
46
+ midinfo.gbParams.AutoSize=true
47
+
48
+ midinfo.pnlButtons=createPanel(midinfo.mid)
49
+ midinfo.pnlButtons.ChildSizing.ControlsPerLine=2
50
+ midinfo.pnlButtons.ChildSizing.Layout='cclLeftToRightThenTopToBottom'
51
+
52
+ midinfo.pnlButtons.BevelOuter='bvNone'
53
+ midinfo.pnlButtons.BorderSpacing.Top=5
54
+ midinfo.pnlButtons.BorderSpacing.Bottom=5
55
+ midinfo.pnlButtons.ChildSizing.HorizontalSpacing=8
56
+
57
+
58
+ midinfo.btnOk=createButton(midinfo.mid)
59
+ midinfo.btnCancel=createButton(midinfo.mid)
60
+
61
+ midinfo.btnOk.Parent=midinfo.pnlButtons
62
+ midinfo.btnCancel.Parent=midinfo.pnlButtons
63
+
64
+ midinfo.pnlButtons.AutoSize=true
65
+
66
+ midinfo.btnOk.caption=translate('OK')
67
+ midinfo.btnCancel.caption=translate('Cancel')
68
+ midinfo.btnCancel.Cancel=true
69
+
70
+ midinfo.pnlButtons.AnchorSideTop.Control=midinfo.gbParams
71
+ midinfo.pnlButtons.AnchorSideTop.Side=asrBottom
72
+ midinfo.pnlButtons.AnchorSideLeft.Control=midinfo.mid
73
+ midinfo.pnlButtons.AnchorSideLeft.Side=asrCenter
74
+ midinfo.pnlButtons.Anchors='[akLeft, akTop]'
75
+
76
+
77
+ midinfo.output=createMemo(midinfo.mid)
78
+ midinfo.output.ReadOnly=true
79
+ midinfo.output.Visible=false
80
+ midinfo.output.AnchorSideBottom.Control=midinfo.mid
81
+ midinfo.output.AnchorSideBottom.Side=asrBottom
82
+ midinfo.output.AnchorSideTop.Control=midinfo.pnlButtons
83
+ midinfo.output.AnchorSideTop.Side=asrBottom
84
+ midinfo.output.AnchorSideLeft.Control=midinfo.mid
85
+ midinfo.output.AnchorSideLeft.Side=asrLeft
86
+ midinfo.output.AnchorSideRight.Control=midinfo.mid
87
+ midinfo.output.AnchorSideRight.Side=asrRight
88
+
89
+ midinfo.output.Anchors='[akLeft, akRight, akBottom, akTop]'
90
+ --midinfo.output.Anchors='[akLeft, akRight, akBottom]'
91
+
92
+
93
+
94
+
95
+
96
+ -- midinfo.pnlButtons.Color=clRed
97
+
98
+
99
+ if (not invokeDialogParams.isStatic) and invokeDialogParams.allowCustomAddress then
100
+ midinfo.lblInstanceAddress.AnchorSideTop.Control=midinfo.mid
101
+ midinfo.lblInstanceAddress.AnchorSideTop.Side=asrTop
102
+ midinfo.lblInstanceAddress.AnchorSideTop.Left=midinfo.mid
103
+ midinfo.lblInstanceAddress.AnchorSideTop.Side=asrLeft
104
+ midinfo.edtInstance.AnchorSideTop.Control=midinfo.lblInstanceAddress
105
+ midinfo.edtInstance.AnchorSideTop.Side=asrBottom
106
+
107
+ midinfo.edtInstance.AnchorSideLeft.Control=midinfo.mid
108
+ midinfo.edtInstance.AnchorSideLeft.Side=asrLeft
109
+ midinfo.edtInstance.AnchorSideRight.Control=midinfo.mid
110
+ midinfo.edtInstance.AnchorSideRight.Side=asrRight
111
+ midinfo.edtInstance.Anchors='[akLeft, akRight, akTop]'
112
+ midinfo.edtInstance.BorderSpacing.Left=2*dpiscale
113
+ midinfo.edtInstance.BorderSpacing.Right=2*dpiscale
114
+
115
+ midinfo.gbParams.AnchorSideTop.Control=midinfo.edtInstance
116
+ midinfo.gbParams.AnchorSideTop.Side=asrBottom
117
+ else
118
+ midinfo.gbParams.AnchorSideTop.Control=midinfo.mid
119
+ midinfo.gbParams.AnchorSideTop.Side=asrTop
120
+ end
121
+
122
+ midinfo.gbParams.AnchorSideLeft.Control=midinfo.mid
123
+ midinfo.gbParams.AnchorSideLeft.Side=asrLeft
124
+ midinfo.gbParams.AnchorSideRight.Control=midinfo.mid
125
+ midinfo.gbParams.AnchorSideRight.Side=asrRight
126
+
127
+
128
+ midinfo.gbParams.Anchors='[akLeft, akRight, akTop]'
129
+
130
+ midinfo.gbParams.autoSize=true
131
+
132
+ --midinfo.mid.AutoSize=true
133
+
134
+ midinfo.parameters={}
135
+
136
+ local parameters=invokeDialogParams.parameters
137
+
138
+ if #parameters==0 then
139
+ midinfo.gbParams.visible=false
140
+ else
141
+ midinfo.gbParams.TabOrder=0
142
+ end
143
+
144
+ local i
145
+ for i=1, #parameters do
146
+ local lblVarName=createLabel(midinfo.mid)
147
+ local edtVarText=createEdit(midinfo.mid)
148
+ local btnCreateInstance=createButton(midinfo.mid)
149
+
150
+ lblVarName.Parent=midinfo.gbParams
151
+ edtVarText.Parent=midinfo.gbParams
152
+ btnCreateInstance.Parent=midinfo.gbParams
153
+ btnCreateInstance.AutoSize=true
154
+
155
+ btnCreateInstance.AnchorSideRight.Control=midinfo.gbParams
156
+ btnCreateInstance.AnchorSideRight.Side=asrRight
157
+
158
+ lblVarName.AnchorSideLeft.Control=midinfo.gbParams
159
+ lblVarName.AnchorSideLeft.Side=asrLeft
160
+ lblVarName.BorderSpacing.Left=2*dpiscale
161
+
162
+ lblVarName.AnchorSideTop.Control=edtVarText
163
+ lblVarName.AnchorSideTop.Side=asrCenter
164
+
165
+
166
+ if i==1 then
167
+
168
+
169
+ edtVarText.AnchorSideTop.Control=midinfo.gbParams
170
+ edtVarText.AnchorSideTop.Side=asrTop
171
+ edtVarText.AnchorSideLeft.Control=midinfo.gbParams
172
+ edtVarText.AnchorSideLeft.Side=asrLeft
173
+
174
+
175
+
176
+ --borderspacing.Left will set the position
177
+ else
178
+
179
+
180
+ edtVarText.AnchorSideTop.Control=midinfo.parameters[i-1].edtVarText
181
+ edtVarText.AnchorSideTop.Side=asrBottom
182
+ edtVarText.AnchorSideLeft.Control=midinfo.parameters[i-1].edtVarText
183
+ edtVarText.AnchorSideLeft.Side=asrLeft --same position as the top (which gets set later)
184
+ end
185
+
186
+ edtVarText.TabOrder=i-1
187
+
188
+ btnCreateInstance.AnchorSideTop.Control=edtVarText
189
+ btnCreateInstance.AnchorSideTop.Side=asrCenter
190
+
191
+ edtVarText.BorderSpacing.Top=2*dpiscale
192
+ edtVarText.AnchorSideRight.Control=btnCreateInstance
193
+ edtVarText.AnchorSideRight.Side=asrLeft
194
+ edtVarText.BorderSpacing.Right=2*dpiscale
195
+
196
+
197
+ edtVarText.Anchors='[akLeft, akRight, akTop]'
198
+
199
+ btnCreateInstance.caption='+'
200
+ btnCreateInstance.Anchors='[akTop, akRight]'
201
+
202
+
203
+ midinfo.parameters[i]={}
204
+
205
+
206
+ if type(parameters[i])=='table' then
207
+ lblVarName.Caption=parameters[i].varname:trim()
208
+ btnCreateInstance.visible=parameters[i].isObject
209
+ elseif type(parameters[i])=='string' then --old code
210
+ lblVarName.Caption=parameters[i]:trim()
211
+ btnCreateInstance.visible=false
212
+ end
213
+
214
+
215
+ midinfo.parameters[i].lblVarName=lblVarName
216
+ midinfo.parameters[i].edtVarText=edtVarText
217
+
218
+ lblVarName.BorderSpacing.CellAlignVertical='ccaCenter'
219
+
220
+ if btnCreateInstance.Visible then
221
+ --return the parameters field provided in this call (the caller is responsible for adding enough extra data to be able to create an instance using that)
222
+ btnCreateInstance.OnClick=function(sender)
223
+ if invokeDialogParams.onCreateInstanceClick then
224
+ edtVarText.Text=invokeDialogParams.onCreateInstanceClick(midinfo.mid, invokeDialogParams, i)
225
+ end
226
+ end
227
+ end
228
+ end
229
+
230
+ midinfo.btnOk.OnClick=function(sender)
231
+ local r={}
232
+
233
+ if invokeDialogParams.isStatic==false then
234
+ invokeDialogParams.address=getAddressFromName(midinfo.edtInstance.Text)
235
+ if invokeDialogParams.address==nil or invokeDialogParams.address==0 then
236
+ messageDialog(midinfo.edtInstance.Text..translate(' is not a valid address'),mtError)
237
+ return
238
+ end
239
+ end
240
+
241
+ for i=1,#invokeDialogParams.parameters do
242
+ invokeDialogParams.parameters[i].value=midinfo.parameters[i].edtVarText.Text
243
+ end
244
+
245
+
246
+ if invokeDialogParams.nonmodal and invokeDialogParams.onOKClick then
247
+ local output=midinfo.output.Lines
248
+ invokeDialogParams.onOKClick(midinfo.mid, invokeDialogParams, output)
249
+ if output.Count>0 then
250
+ if midinfo.output.Visible==false then
251
+ midinfo.output.Visible=true
252
+ midinfo.mid.height=midinfo.mid.height+midinfo.mid.canvas.getTextHeight("Xx")*4
253
+ end
254
+ end
255
+ else
256
+ midinfo.mid.ModalResult=mrOK --setting modalresult closes a modal form
257
+ end
258
+ end
259
+
260
+ midinfo.btnCancel.OnClick=function(b) midinfo.mid.close() end
261
+
262
+
263
+ midinfo.mid.OnShow=function(s)
264
+ midinfo.mid.autoSize=false
265
+ midinfo.mid.width=midinfo.mid.canvas.getTextWidth(midinfo.mid.Caption)+180*dpiscale
266
+
267
+
268
+ idf=s
269
+ if #midinfo.parameters>0 then
270
+ local labelwidth=0
271
+ local i
272
+ for i=1,#parameters do --get the min width needed
273
+ labelwidth=math.max(labelwidth, midinfo.parameters[i].lblVarName.Width)
274
+ end
275
+
276
+ midinfo.parameters[1].edtVarText.BorderSpacing.Left=labelwidth+7*dpiscale
277
+ end
278
+
279
+ midinfo.mid.position='poDesigned' --recenters the form
280
+ midinfo.mid.position='poScreenCenter'
281
+ end
282
+
283
+ midinfo.mid.onClose=function(f)
284
+ return caFree
285
+ end
286
+
287
+ midinfo.mid.onDestroy=function(f)
288
+ --destroy all objects
289
+ midinfo.btnOk.destroy()
290
+ midinfo.btnOk=nil
291
+
292
+ midinfo.btnCancel.destroy()
293
+ midinfo.btnCancel=nil
294
+
295
+ if midinfo.edtInstance then
296
+ midinfo.edtInstance.destroy()
297
+ midinfo.edtInstance=nil
298
+ end
299
+
300
+ midinfo.gbParams.destroy()
301
+ midinfo.gbParams=nil
302
+
303
+ --midinfo.mid.saveFormPosition()
304
+
305
+ midinfo=nil
306
+ end
307
+
308
+ midinfo.mid.AutoSize=true
309
+ if invokeDialogParams.nonmodal then
310
+ midinfo.mid.show()
311
+ else
312
+ return midinfo.mid.showModal()==mrOK
313
+ end
314
+ end
315
+
316
+ function createMethodInvokeDialog(name, parameters, okclickfunction, customAddress, static)
317
+
318
+ if type(name)=='table' then
319
+ --called with the params for createMethodInvokeDialogEx
320
+ return createMethodInvokeDialogEx(name)
321
+ else
322
+ print("Warning: Obsolete method of calling createMethodInvokeDialog")
323
+
324
+
325
+ --pack the parameters into an invokeDialogParams block
326
+ local params={}
327
+ params.name=name
328
+ params.isStatic=static
329
+ params.allowCustomAddress=customAddress
330
+ params.parameters={}
331
+ for i=1,#parameters do
332
+ if type(parameters[i])=='string' then
333
+ params.parameters[i]={}
334
+ params.parameters[i].varname=parameters
335
+ elseif type(parameters[i])=='table' then
336
+ params.parameters[i]=parameters[i]
337
+ end
338
+ end
339
+ local r=createMethodInvokeDialogEx(params)
340
+
341
+ if r and okclickfunction then
342
+ local r={}
343
+ for i=1,#params.parameters do
344
+ r[i]=params.parameters[i].value
345
+ end
346
+
347
+ okclickfunction(nil, r)
348
+ end
349
+
350
+ end
351
+
352
+ end
353
+
354
+ createMethodInvokedialog=createMethodInvokeDialog --backward compatibility
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/SpeedhackV3.lua ADDED
@@ -0,0 +1,490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --Copyright Cheat Engine
2
+
3
+ --local
4
+ UnityEngineTimeSetTimeScaleMethod=nil
5
+
6
+ function getOriginalCodeAndFiller(address, farjmp)
7
+ local original,filler
8
+
9
+ if type(address)~='number' then
10
+ address=getAddressSafe(address)
11
+ end
12
+
13
+ if address==nil then
14
+ return nil, 'invalid address'
15
+ end
16
+
17
+ local sl=createStringList()
18
+ local d=createDisassembler()
19
+ local size=0
20
+ local jmpsize=not farjmp and 5 or 14
21
+
22
+
23
+ while size<jmpsize do
24
+ d.disassemble(address)
25
+ local ldd=d.LastDisassembleData
26
+ local inst=ldd.opcode..' '..ldd.parameters
27
+ sl.add(inst)
28
+ size=size+#ldd.bytes
29
+ address=address+#ldd.bytes
30
+ end
31
+
32
+ original=sl.Text
33
+ if size-jmpsize>0 then
34
+ filler=string.format("nop %x", size-jmpsize)
35
+ else
36
+ filler=''
37
+ end
38
+
39
+ sl.destroy()
40
+ d.destroy()
41
+ return original,filler
42
+ end
43
+
44
+
45
+ function hookSpeedFunctions()
46
+ --print("hookSpeedFunctions")
47
+ if getAddressSafe("speedhack_wantedspeed")~=nil then
48
+ -- print("already hooked")
49
+ return true
50
+ end
51
+
52
+ UnityEngineTimeSetTimeScaleMethod=nil
53
+
54
+ local r,r2=injectCEHelperLib()
55
+
56
+ if not r then
57
+ messageDialog('error in injectCEHelperLib(): '..r2, mtError,mbOK)
58
+ return false
59
+ end
60
+
61
+ local result, data=autoAssemble([[
62
+ globalalloc(speedhack_wantedspeed,4)
63
+ speedhack_wantedspeed:
64
+ dd (float)1
65
+
66
+ globalalloc(speedhack_unityspeedhackmethod,4)
67
+ speedhack_unityspeedhackmethod:
68
+ dd 1
69
+ {$asm}
70
+
71
+ ]])
72
+
73
+ if not result then
74
+ messageDialog(data)
75
+ return
76
+ end
77
+
78
+ -- print("allocated speedhack_wantedspeed")
79
+
80
+ if monoSettings.Value["SkipMonoSpeedhack"]~='1' then
81
+ local hasMono=getAddressSafe('mono_thread_attach',false,true) or getAddressSafe('il2cpp_thread_attach',false,true)
82
+
83
+ if hasMono then
84
+ LaunchMonoDataCollector()
85
+
86
+ local r=mono_findClass("UnityEngine","Time")
87
+ if r then
88
+
89
+ UnityEngineTimeSetTimeScaleMethod=mono_class_findMethod(r,"set_timeScale")
90
+ if UnityEngineTimeSetTimeScaleMethod then
91
+
92
+ local set_timeScale
93
+
94
+
95
+ if mono_isil2cpp() then
96
+ set_timeScale=mono_compile_method(UnityEngineTimeSetTimeScaleMethod)
97
+ else
98
+ set_timeScale=getAddressSafe("UnityEngine.Time:set_timeScale")
99
+ end
100
+
101
+ if set_timeScale then
102
+ local originalcode,filler=getOriginalCodeAndFiller(set_timeScale, true)
103
+
104
+ if originalcode then
105
+ local s=string.format([[
106
+ {$c}
107
+ extern int speedhack_unityspeedhackmethod;
108
+ extern float speedhack_wantedspeed;
109
+ float getNewSpeed(float newspeed)
110
+ {
111
+ float wanted=speedhack_wantedspeed; //bug in tcc needs local first
112
+ int method=speedhack_unityspeedhackmethod;
113
+
114
+ if (method==0) //method 0 : If speed==0, return 0, else return the speedhack speed
115
+ {
116
+ if (newspeed>0)
117
+ newspeed=wanted;
118
+ }
119
+ else //method 1: multiply the wanted speed by the speedhack speed. 0*wanted==0, 1*wanted=speedhack speed, 2*wanted=double speedhack speed. Only issue is if it where to read the old speed and apply it's own multiplication
120
+ newspeed=newspeed*wanted;
121
+
122
+ return newspeed;
123
+ }
124
+ {$asm}
125
+ alloc(set_timeScaleEntryHook,128)
126
+ registersymbol(set_timeScaleEntryHook)
127
+ label(returnhere)
128
+ set_timeScaleEntryHook:
129
+ sub rsp,20
130
+ call getNewSpeed //will change xmm0
131
+ add rsp,20
132
+
133
+
134
+ //previous version's implementation
135
+ // mov rax,speedhack_wantedspeed
136
+ // movss xmm0,[rax]
137
+
138
+ %s
139
+ jmp returnhere
140
+
141
+ %x:
142
+ jmp far set_timeScaleEntryHook
143
+ %s
144
+
145
+ returnhere:]], originalcode, set_timeScale, filler)
146
+ local r,err=autoAssemble(s)
147
+ if r then return true end --just this should be enough
148
+
149
+ --print(s)
150
+
151
+ return true
152
+ end
153
+ end
154
+ else
155
+ print("no UnityEngineTimeSetTimeScaleMethod")
156
+ end
157
+ end
158
+ end
159
+ end
160
+
161
+
162
+
163
+ local gtcaddress=getAddressSafe('kernel32.gettickcount64')
164
+ if gtcaddress==nil then
165
+ waitforExports()
166
+ gtcaddress=getAddressSafe('kernel32.gettickcount64')
167
+
168
+ if (gtcaddress==nil) then
169
+ reinitializeSymbolhandler()
170
+ gtcaddress=getAddressSafe('kernel32.gettickcount64')
171
+ if (gtcaddress==nil) then
172
+ messageDialog('Failure finding kernel32.gettickcount64', mtError, mbOK)
173
+ return false
174
+ end
175
+ end
176
+ end
177
+
178
+
179
+ local originalcode,filler=getOriginalCodeAndFiller(gtcaddress)
180
+
181
+ if originalcode then
182
+ local s=string.format([[
183
+
184
+ alloc(gtc_originalcode,64,"kernel32.gettickcount64")
185
+ label(gtc_returnhere)
186
+ label(gtchook_exit)
187
+
188
+ {$c}
189
+
190
+ #include <stdint.h>
191
+ #include <stddef.h>
192
+ #include <celib.h>
193
+ #include <windowslite.h>
194
+
195
+ __stdcall uint64_t gtc_originalcode(void);
196
+ float gtc_speed=1.0f;
197
+ uint64_t gtc_initialtime=0;
198
+ uint64_t gtc_initialoffset=0;
199
+ CRITICAL_SECTION gtc_cs;
200
+
201
+ void *gtc_initonce=(void*)0;
202
+ int gtc_intialized=0;
203
+
204
+
205
+ extern float speedhack_wantedspeed;
206
+
207
+ __stdcall int InitOnceExecuteOnce(void *InitOnce, void* InitFn, void* Parameter, void *Context);
208
+
209
+
210
+ __stdcall int initgtc_cs(void *InitOnce, void *Parameter, void *lpContext) {
211
+ InitializeCriticalSection(&gtc_cs);
212
+ gtc_intialized=1;
213
+ return TRUE;
214
+ }
215
+
216
+
217
+
218
+ __stdcall uint64_t new_gettickcount(void)
219
+ {
220
+ uint64_t newtime;
221
+
222
+ uint64_t currenttime;
223
+ float wantedspeed; //small issue with tcc where you can not compare against extern directly
224
+
225
+
226
+ currenttime=gtc_originalcode();
227
+
228
+ if (gtc_intialized==0) //only set to true once the cs has been initialized
229
+ InitOnceExecuteOnce(&gtc_initonce, initgtc_cs, NULL, NULL);
230
+
231
+ //after here, gtc_cs is initialized
232
+ EnterCriticalSection(&gtc_cs);
233
+
234
+
235
+
236
+
237
+ //csenter(&gtc_cs);
238
+ wantedspeed=speedhack_wantedspeed;
239
+
240
+ if (gtc_initialtime==0)
241
+ {
242
+ gtc_initialtime=currenttime;
243
+ gtc_initialoffset=currenttime;
244
+ }
245
+
246
+ newtime=(currenttime-gtc_initialtime)*gtc_speed;
247
+ newtime=newtime+gtc_initialoffset; //don't put in in the calculation above, as it gets converted to float, and truncated
248
+
249
+ if (gtc_speed!=wantedspeed)
250
+ {
251
+ //the user wants to change the speed
252
+ gtc_initialoffset=newtime;
253
+ gtc_initialtime=currenttime;
254
+ gtc_speed=speedhack_wantedspeed;
255
+ }
256
+
257
+
258
+
259
+ LeaveCriticalSection(&gtc_cs);
260
+
261
+
262
+ return newtime;
263
+
264
+ }
265
+ {$asm}
266
+
267
+
268
+ gtc_originalcode:
269
+ %s
270
+
271
+ gtchook_exit:
272
+ jmp gtc_returnhere
273
+
274
+ kernel32.gettickcount64:
275
+ jmp new_gettickcount
276
+ %s
277
+
278
+ gtc_returnhere:
279
+
280
+ {$ifdef kernel32.timegettime}
281
+ kernel32.timeGetTime:
282
+ jmp new_gettickcount
283
+ {$endif}
284
+
285
+ kernel32.getTickCount:
286
+ jmp new_gettickcount
287
+
288
+ ]],originalcode, filler)
289
+
290
+ local result, data=autoAssemble(s)
291
+
292
+ if not result then
293
+ if data==nil then
294
+ data=' (no reason)'
295
+ end
296
+ messageDialog('Failure hooking kernel32.gettickcount64:'..data, mtError, mbOK)
297
+ end
298
+ end;
299
+
300
+
301
+ --queryPerformanceCounter
302
+ local qpcaddress=getAddressSafe('ntdll.RtlQueryPerformanceCounter')
303
+ if qpcaddress==nil then
304
+ waitforExports()
305
+ qpcaddress=getAddressSafe('ntdll.RtlQueryPerformanceCounter')
306
+
307
+ if (qpcaddress==nil) then
308
+ reinitializeSymbolhandler()
309
+ qpcaddress=getAddressSafe('ntdll.RtlQueryPerformanceCounter')
310
+ if (qpcaddress==nil) then
311
+ messageDialog('Failure finding kernel32.gettickcount64', mtError, mbOK)
312
+ return false
313
+ end
314
+ end
315
+ end
316
+
317
+
318
+ local originalcode,filler=getOriginalCodeAndFiller(qpcaddress)
319
+
320
+ if originalcode then
321
+
322
+
323
+ --speedhack does not disable. Just sets speed to 1 when done
324
+
325
+ local s=string.format([[
326
+
327
+ alloc(qpc_originalcode,64,"ntdll.RtlQueryPerformanceCounter")
328
+ label(qpc_returnhere)
329
+ label(qpchook_exit)
330
+
331
+ {$c}
332
+ #include <stdint.h>
333
+ #include <stddef.h>
334
+ #include <celib.h>
335
+ #include <windowslite.h>
336
+
337
+
338
+ __stdcall int qpc_originalcode(uint64_t *count);
339
+ float qpc_speed=1.0f;
340
+ uint64_t qpc_initialtime=0;
341
+ uint64_t qpc_initialoffset=0;
342
+ CRITICAL_SECTION qpc_cs;
343
+
344
+ void *qpc_initonce=(void*)0;
345
+ int qpc_intialized=0;
346
+
347
+
348
+ uint64_t qpc_lastresult=0;
349
+
350
+ extern float speedhack_wantedspeed;
351
+
352
+ __stdcall int InitOnceExecuteOnce(void *InitOnce, void* InitFn, void* Parameter, void *Context);
353
+
354
+
355
+ __stdcall int initqpc_cs(void *InitOnce, void *Parameter, void *lpContext) {
356
+ InitializeCriticalSection(&qpc_cs);
357
+ qpc_intialized=1;
358
+ return TRUE;
359
+ }
360
+
361
+
362
+
363
+
364
+
365
+ __stdcall int new_RtlQueryPerformanceCounter(uint64_t *count)
366
+ {
367
+ uint64_t newtime;
368
+
369
+ uint64_t currenttime;
370
+ uint64_t newwantedspeed;
371
+
372
+
373
+ float wantedspeed; //small issue with tcc where you can not compare against extern directly
374
+
375
+ if (qpc_intialized==0) //only set to true once the cs has been initialized
376
+ InitOnceExecuteOnce(&qpc_initonce, initqpc_cs, NULL, NULL);
377
+
378
+ //after here, gtc_cs is initialized
379
+ EnterCriticalSection(&qpc_cs);
380
+
381
+
382
+ int result=qpc_originalcode(&currenttime);
383
+
384
+
385
+
386
+
387
+ wantedspeed=speedhack_wantedspeed;
388
+
389
+ if (qpc_initialtime==0)
390
+ {
391
+ qpc_initialtime=currenttime;
392
+ qpc_initialoffset=currenttime;
393
+ }
394
+
395
+ newtime=(currenttime-qpc_initialtime)*qpc_speed;
396
+
397
+ newtime=newtime+qpc_initialoffset;
398
+ if (qpc_speed!=wantedspeed)
399
+ {
400
+ //the user wants to change the speed
401
+ qpc_initialoffset=newtime;
402
+ qpc_initialtime=currenttime;
403
+ qpc_speed=speedhack_wantedspeed;
404
+ }
405
+
406
+ LeaveCriticalSection(&qpc_cs);
407
+
408
+
409
+
410
+ *count=newtime;
411
+
412
+ return result;
413
+
414
+ }
415
+ {$asm}
416
+
417
+
418
+ qpc_originalcode:
419
+ %s
420
+
421
+ qpchook_exit:
422
+ jmp qpc_returnhere
423
+
424
+ ntdll.RtlQueryPerformanceCounter:
425
+ jmp new_RtlQueryPerformanceCounter
426
+ %s
427
+
428
+ qpc_returnhere:
429
+
430
+
431
+ ]],originalcode, filler)
432
+
433
+ local result2, data2=autoAssemble(s)
434
+
435
+ if not result2 then
436
+ if data2==nil then
437
+ data2=' (no reason)'
438
+ end
439
+ messageDialog('Failure hooking ntdll.RtlQueryPerformanceCounter:'..data2, mtError, mbOK)
440
+ end
441
+
442
+ end;
443
+
444
+ return result or result2
445
+ end
446
+
447
+
448
+
449
+ registerSpeedhackCallbacks(function() --OnActivate
450
+ if (not isConnectedToCEServer()) and targetIsX86() then
451
+ local result, errormsg
452
+
453
+
454
+ if getAddressSafe("speedhack_wantedspeed")==nil then
455
+ --still needs hooking
456
+ result,errormsg=hookSpeedFunctions()
457
+ else
458
+ result=true
459
+ end
460
+
461
+ return true, result, errormsg
462
+ else
463
+ return false
464
+ end
465
+ end,
466
+
467
+ function(speed) --OnSetSpeed(speed)
468
+ if (not isConnectedToCEServer()) and targetIsX86() then
469
+ local result, errormsg
470
+ if getAddressSafe("new_gettickcount")==nil or getAddressSafe("speedhack_wantedspeed")==nil then
471
+
472
+ result,errormsg=hookSpeedFunctions()
473
+ if not result then return true, false, errormsg end
474
+ end
475
+
476
+ writeFloat("speedhack_wantedspeed", speed)
477
+
478
+ if UnityEngineTimeSetTimeScaleMethod then
479
+ mono_invoke_method(nil,UnityEngineTimeSetTimeScaleMethod,nil,{speed})
480
+ end
481
+
482
+ result=true
483
+
484
+ return true, true
485
+ else
486
+ return false
487
+ end
488
+ end)
489
+
490
+
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/addtonewgroup.lua ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ local pm=AddressList.PopupMenu
2
+ local pmAddToNewGroup=createMenuItem(pm)
3
+ pmAddToNewGroup.Caption=translate('Add to new group')
4
+ pmAddToNewGroup.ImageIndex=MainForm.CreateGroup.ImageIndex
5
+ pm.Items.insert(MainForm.CreateGroup.MenuIndex, pmAddToNewGroup)
6
+
7
+ local oldOnPopup=AddressList.PopupMenu.OnPopup
8
+ AddressList.PopupMenu.OnPopup=function(s)
9
+ if oldOnPopup then
10
+ oldOnPopup(s)
11
+ end
12
+ pmAddToNewGroup.Visible=AddressList.SelCount>=1
13
+ end
14
+
15
+ pmAddToNewGroup.OnClick=function(s)
16
+ local i
17
+ local count=0
18
+ local selcount=0
19
+ local withAddress=false
20
+ local hasAddressSupport=false
21
+
22
+ if AddressList.SelCount==0 then
23
+ messageDialog('Please select at least one entry first', mtError, mbOK)
24
+ return
25
+ end
26
+
27
+ hasAddressSupport=AddressList[0].IsAddressGroupHeader~=nil
28
+
29
+ for i=0,AddressList.Count-1 do
30
+ if AddressList[i].IsGroupHeader then
31
+ count=count+1
32
+ end
33
+ end
34
+
35
+
36
+ local groupname=translate(string.format('Group %d',count+1))
37
+ if (isKeyPressed(VK_CONTROL)==false) then
38
+ groupname=InputQuery(translate('Groups'), translate('What do you want the groupname to be?'), groupname)
39
+ if groupname then
40
+ if hasAddressSupport then
41
+ withAddress=messageDialog(translate('Do you want "address" version?'), mtConfirmation, mbYes, mbNo)==mrYes
42
+ end
43
+ else
44
+ return
45
+ end
46
+ end
47
+
48
+
49
+ --create a new group and add all selected records to the list
50
+ local header=AddressList.createMemoryRecord()
51
+ header.IsGroupHeader=true
52
+ header.IsAddressGroupHeader=withAddress
53
+ header.Description=groupname
54
+
55
+ records={}
56
+
57
+ for i=0,AddressList.Count-1 do
58
+ if AddressList[i].Selected then
59
+ local selectedparent=false
60
+ local p=AddressList[i].Parent
61
+ while p do
62
+ if p.Selected then selectedparent=true end
63
+ p=p.Parent
64
+ end
65
+
66
+ if selectedparent==false then
67
+ table.insert(records,AddressList[i])
68
+ end
69
+ end
70
+ end
71
+
72
+ for i=1,#records do
73
+ records[i].Parent=header
74
+ end
75
+ end
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/android.lua ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ stringstruct=createStructure('string')
2
+ local e=stringstruct.addElement()
3
+ e.vartype=vtString
4
+ e.ByteSize=100
5
+
6
+ stringstruct.Internal=true
7
+
8
+
9
+ widestringstruct=createStructure('widestring')
10
+ local e=widestringstruct.addElement()
11
+ e.vartype=vtUnicodeString
12
+ e.ByteSize=200
13
+
14
+ widestringstruct.Internal=true
15
+
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/autosave.lua ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if getTranslationFolder()~='' then
2
+ loadPOFile(getTranslationFolder()..'autosave.po')
3
+ end
4
+
5
+ require("lfs")
6
+
7
+ autosave={} --todo make local
8
+
9
+ local AutoSaveSettings=getSettings('Auto Save')
10
+ local AutoSaveVersion=1
11
+
12
+ autosave.getPath=function()
13
+ local path=AutoSaveSettings['SavePath']
14
+ if (path==nil) or (path=='') then
15
+
16
+ path=os.getenv("LOCALAPPDATA")
17
+ if (path==nil) or (path=='') then
18
+ path=getCheatEngineDir() --last attempt
19
+ end
20
+ end
21
+
22
+ if string.sub(path,#path)~='\\' then
23
+ path=path..'\\'
24
+ end
25
+
26
+ return path
27
+ end
28
+
29
+ function autosave.saveState()
30
+
31
+
32
+ local pid=AutoSaveSettings['ProcessID']
33
+ if pid and pid~='' then
34
+ pid=tonumber(pid)
35
+ if pid~=getCheatEngineProcessID() then
36
+ --another CE has done an autosave
37
+ if getProcessList()[pid]==nil then
38
+ --it doesn't exist anymore.
39
+ messageDialog(translate('Another instance of Cheat Engine has crashed and it created an autosave. Autosave disabled until you go to settings and click ok'), mtWarning, mbOk)
40
+ return false
41
+ end
42
+ end
43
+ end
44
+
45
+ AutoSaveSettings['ProcessID']=getCheatEngineProcessID()
46
+ local path, err=autosave.getPath()
47
+ if path==nil then
48
+ messageDialog(translate('Failure to obtain a location to save the autosave data'), mtError, mbOk)
49
+ return false
50
+ end
51
+
52
+ path=path..'Cheat Engine AutoSave';
53
+ lfs.mkdir(path)
54
+
55
+
56
+ local r,err=saveTable(path..[[\table.ct]])
57
+ if (r==nil) or (r==false) then
58
+ if err==nil then
59
+ err=translate('Unknown Reason')
60
+ end
61
+ messageDialog(translate('Failure to autosave table : ')..err, mtError, mbOk)
62
+ return false
63
+ end
64
+
65
+ --save the rest (open luascripts and aa scripts, excluding aa scripts belonging to memrecs)
66
+ --feel free to add more if you like, keep in mind to apply the same to loadState
67
+ local cestate,err=createFileStream(path..[[\state.dat]], fmCreate)
68
+ if cestate==nil then
69
+ messageDialog(translate('Failure to autosave state : ')..err, mtError, mbOk)
70
+ return false
71
+ end
72
+
73
+ local i
74
+ local luaforms={}
75
+ local aaforms={}
76
+ for i=getFormCount()-1,0,-1 do --negative order so the creation order will be correct (the form order is the z-order)
77
+ local f=getForm(i)
78
+
79
+ if (f.ClassName=='TfrmLuaEngine') and f.Visible then
80
+ local e={}
81
+ e.history=f.mOutput.Lines.Text
82
+ e.script=f.mScript.Lines.Text
83
+ e.filename=f.savedialog1.FileName
84
+ e.Left=f.Left
85
+ e.Top=f.Top
86
+ e.Width=f.Width
87
+ e.Height=f.Height
88
+
89
+
90
+ if f.MiView.Visible then --first one
91
+ local temp=luaforms[1]
92
+ luaforms[1]=e
93
+ temp=e
94
+ end
95
+
96
+ if e then
97
+ table.insert(luaforms,e)
98
+ end
99
+
100
+ elseif (f.ClassName=='TfrmAutoInject') and f.Visible then
101
+ if (f.IsEditing==false) and (f.ScriptMode~='smLua') then --Editing means it's editing a memoryrecord saved in the table, not saving that
102
+ --standalone AA window, not the tablescript
103
+ e={}
104
+ e.Filename=f.savedialog1.FileName
105
+ e.Left=f.Left
106
+ e.Top=f.Top
107
+ e.Width=f.Width
108
+ e.Height=f.Height
109
+ e.ScriptCount=f.TabCount
110
+ e.Scripts={}
111
+ local j
112
+ for j=0,f.TabCount-1 do
113
+ e.Scripts[j+1]=f.TabScript[j]
114
+ end
115
+
116
+ table.insert(aaforms,e)
117
+ end
118
+ end
119
+ end
120
+
121
+ cestate.writeDword(AutoSaveVersion)
122
+ cestate.writeDword(#luaforms)
123
+ for i=1,#luaforms do
124
+ cestate.writeAnsiString(luaforms[i].history)
125
+ cestate.writeAnsiString(luaforms[i].script)
126
+ cestate.writeAnsiString(luaforms[i].filename)
127
+ cestate.writeDword(luaforms[i].Left)
128
+ cestate.writeDword(luaforms[i].Top)
129
+ cestate.writeDword(luaforms[i].Width)
130
+ cestate.writeDword(luaforms[i].Height)
131
+ end
132
+
133
+ cestate.writeDword(#aaforms)
134
+ for i=1,#aaforms do
135
+ cestate.writeDword(aaforms[i].ScriptCount)
136
+ for j=1,#aaforms[i].Scripts do
137
+ cestate.writeAnsiString(aaforms[i].Scripts[j])
138
+ end
139
+ cestate.writeAnsiString(aaforms[i].Filename)
140
+ cestate.writeDword(aaforms[i].Left)
141
+ cestate.writeDword(aaforms[i].Top)
142
+ cestate.writeDword(aaforms[i].Width)
143
+ cestate.writeDword(aaforms[i].Height)
144
+ end
145
+
146
+ cestate.destroy()
147
+
148
+ return true
149
+ end
150
+
151
+ function autosave.loadState()
152
+ -- print("loadState()")
153
+
154
+ AutoSaveSettings['ProcessID']=getCheatEngineProcessID()
155
+ local path=autosave.getPath()..'Cheat Engine AutoSave\\';
156
+
157
+ r,err=loadTable(path..'table.ct')
158
+ if (r==nil) or (r==false) then
159
+ if err==nil then
160
+ err=translate('Unknown Reason')
161
+ end
162
+ messageDialog(string.format(translate('Failure to load autosave at %s . Error: %s'), path, err), mtError, mbOk)
163
+ return false
164
+ end
165
+
166
+ --print("Table loaded. Loading rest")
167
+
168
+ --load the rest
169
+ local cestate,err=createFileStream(path..[[state.dat]], fmOpenRead)
170
+ if cestate then
171
+ local i
172
+ local version=cestate.readDword()
173
+ if version~=AutoSaveVersion then
174
+ --check how to load older versions, and if not supported then:
175
+ messageDialog(translate('The saved state belongs to a different autosave version that is not currently implemented'), mtError, mbOk)
176
+ return false
177
+ end
178
+ local luaformcount=cestate.readDword()
179
+ --print("luaformcount="..luaformcount)
180
+ for i=1,luaformcount do
181
+ local f=createLuaEngine()
182
+ f.mOutput.Lines.Text=cestate.readAnsiString()
183
+ f.mScript.Lines.Text=cestate.readAnsiString()
184
+ f.SaveDialog1.FileName=cestate.readAnsiString()
185
+ f.Left=cestate.readDword()
186
+ f.Top=cestate.readDword()
187
+ f.Width=cestate.readDword()
188
+ f.Height=cestate.readDword()
189
+
190
+ f.show()
191
+ end
192
+
193
+ local aacount=cestate.readDword()
194
+ --print("aacount="..aacount)
195
+ for i=1,aacount do
196
+ f=createAutoAssemblerForm()
197
+
198
+ local count=cestate.readDword()
199
+
200
+ if count>0 then --should be
201
+ f.TabCount=count
202
+ local j
203
+ for j=0,count-1 do
204
+ f.TabScript[j]=cestate.readAnsiString()
205
+ end
206
+ end
207
+
208
+ f.SaveDialog1.FileName=cestate.readAnsiString()
209
+ f.Left=cestate.readDword()
210
+ f.Top=cestate.readDword()
211
+ f.Width=cestate.readDword()
212
+ f.Height=cestate.readDword()
213
+
214
+ f.show()
215
+ end
216
+
217
+ --print("Done loading")
218
+
219
+
220
+ cestate.destroy()
221
+ return true
222
+ else
223
+ --print("error opening state.dat because of "..err)
224
+ return false
225
+ end
226
+
227
+
228
+ end
229
+
230
+ autosave.applySettings=function()
231
+ local interval=tonumber(AutoSaveSettings['Interval'])
232
+
233
+ if autosave.Timer then
234
+ --print("killing old timer")
235
+ autosave.Timer.destroy()
236
+ autosave.Timer=nil
237
+ end
238
+
239
+ if interval and (interval>0) then
240
+ -- print("creating new timer with interval "..interval*1000)
241
+ autosave.Timer=createTimer(nil)
242
+ autosave.Timer.Interval=interval*1000
243
+ autosave.Timer.OnTimer=function(t)
244
+ --print("autosave")
245
+ if autosave.saveState()~=true then
246
+ --something happened
247
+ autosave.Timer.destroy()
248
+ autosave.Timer=nil
249
+ end
250
+ end
251
+ autosave.Enabled=true
252
+ else
253
+ --print("no autosave")
254
+ end
255
+ end
256
+
257
+ MainForm.registerFirstShowCallback(function()
258
+ --only activate on proper load
259
+
260
+ local oldMainFormOnClose=MainForm.OnClose
261
+ MainForm.OnClose=function(s, ca)
262
+ AutoSaveSettings['ProcessID']=nil --CE was properly closed
263
+ if oldMainFormOnClose then
264
+ return oldMainFormOnClose(s, ca)
265
+ else
266
+ return ca
267
+ end
268
+ end
269
+
270
+
271
+ --add settings menu
272
+ local sf=getSettingsForm()
273
+ autosave.settingsTab=sf.SettingsPageControl.addTab()
274
+
275
+ autosave.settingsEdtInterval=createEdit(autosave.settingsTab)
276
+ autosave.settingsEdtInterval.Text=AutoSaveSettings['Interval']
277
+ autosave.settingsEdtInterval.Align='alTop'
278
+
279
+ autosave.settingsLblInterval=createLabel(autosave.settingsTab)
280
+ autosave.settingsLblInterval.Caption=translate('Auto Save Interval (In seconds. 0 is disabled)')
281
+ autosave.settingsLblInterval.Align='alTop'
282
+
283
+ local insertNode=sf.SettingsTreeView.Items[3]
284
+ local node=sf.SettingsTreeView.Items.insert(insertNode, translate("Auto Save"))
285
+ node.data=userDataToInteger(autosave.settingsTab)
286
+
287
+ local originalSettingsCloseEvent=sf.OnClose
288
+ sf.OnClose=function(s, closeAction)
289
+
290
+ local r=closeAction
291
+ if originalSettingsCloseEvent then
292
+ r=originalSettingsCloseEvent(s, closeAction)
293
+ end
294
+
295
+ if s.ModalResult==mrOK then
296
+ --apply change
297
+ AutoSaveSettings['Interval']=autosave.settingsEdtInterval.Text
298
+
299
+ autosave.applySettings()
300
+ end
301
+ return r
302
+ end
303
+
304
+
305
+ --check if there is an autosave waiting to be loaded
306
+
307
+ pid=AutoSaveSettings['ProcessID']
308
+ if (pid) and (pid ~= '') and (getProcessList()[tonumber(pid)]==nil) then
309
+ --The noted down processid does not exist anymore. CE crashed. Ask to load the autosave
310
+ AutoSaveSettings['ProcessID']=nil
311
+
312
+ if messageDialog(translate('Cheat Engine did not properly close last time. Do you wish to restore your work?'), mtInformation, mbYes, mbNo)==mrYes then
313
+ autosave.loadState()
314
+ end
315
+ end
316
+
317
+
318
+ --start the autosave timer(if needed)
319
+ autosave.applySettings()
320
+ end)
321
+
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/bigendian.lua ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ local scripts={}
2
+
3
+ local function registerBigEndianInt16()
4
+ scripts['2 Byte Big Endian'].type=registerCustomTypeAutoAssembler([[
5
+ alloc(TypeName,256)
6
+ alloc(ByteSize,4)
7
+ alloc(ConvertRoutine,1024)
8
+ alloc(ConvertBackRoutine,1024)
9
+
10
+ TypeName:
11
+ db '2 Byte Big Endian',0
12
+
13
+ ByteSize:
14
+ dd 2
15
+
16
+ //The convert routine should hold a routine that converts the data to an integer (in eax)
17
+ //function declared as: stdcall int ConvertRoutine(unsigned char *input);
18
+ //Note: Keep in mind that this routine can be called by multiple threads at the same time.
19
+ ConvertRoutine:
20
+ //jmp dllname.functionname
21
+ [64-bit]
22
+ //or manual:
23
+ //parameters: (64-bit)
24
+ //rcx=address of input
25
+ xor eax,eax
26
+ mov ax,[rcx] //eax now contains the bytes 'input' pointed to
27
+ xchg ah,al //convert to big endian
28
+
29
+ ret
30
+ [/64-bit]
31
+
32
+ [32-bit]
33
+ //jmp dllname.functionname
34
+ //or manual:
35
+ //parameters: (32-bit)
36
+ push ebp
37
+ mov ebp,esp
38
+ //[ebp+8]=input
39
+ //example:
40
+ mov eax,[ebp+8] //place the address that contains the bytes into eax
41
+ mov ax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
42
+ and eax,ffff //cleanup
43
+ xchg ah,al //convert to big endian
44
+
45
+ pop ebp
46
+ ret 4
47
+ [/32-bit]
48
+
49
+ //The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
50
+ //function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
51
+ ConvertBackRoutine:
52
+ //jmp dllname.functionname
53
+ //or manual:
54
+ [64-bit]
55
+ //parameters: (64-bit)
56
+ //ecx=input
57
+ //rdx=address of output
58
+ //example:
59
+ xchg ch,cl //convert the little endian input into a big endian input
60
+ mov [rdx],cx //place the integer the 4 bytes pointed to by rdx
61
+
62
+ ret
63
+ [/64-bit]
64
+
65
+ [32-bit]
66
+ //parameters: (32-bit)
67
+ push ebp
68
+ mov ebp,esp
69
+ //[ebp+8]=input
70
+ //[ebp+c]=address of output
71
+ //example:
72
+ push eax
73
+ push ebx
74
+ mov eax,[ebp+8] //load the value into eax
75
+ mov ebx,[ebp+c] //load the address into ebx
76
+
77
+ //convert the value to big endian
78
+ xchg ah,al
79
+
80
+ mov [ebx],ax //write the value into the address
81
+ pop ebx
82
+ pop eax
83
+
84
+ pop ebp
85
+ ret 8
86
+ [/32-bit]
87
+ ]])
88
+ end
89
+
90
+ local function registerBigEndianInt32()
91
+ scripts['4 Byte Big Endian'].type=registerCustomTypeAutoAssembler([[
92
+ alloc(TypeName,256)
93
+ alloc(ByteSize,4)
94
+ alloc(ConvertRoutine,1024)
95
+ alloc(ConvertBackRoutine,1024)
96
+
97
+ TypeName:
98
+ db '4 Byte Big Endian',0
99
+
100
+ ByteSize:
101
+ dd 4
102
+
103
+ //The convert routine should hold a routine that converts the data to an integer (in eax)
104
+ //function declared as: stdcall int ConvertRoutine(unsigned char *input);
105
+ //Note: Keep in mind that this routine can be called by multiple threads at the same time.
106
+ ConvertRoutine:
107
+ //jmp dllname.functionname
108
+ [64-bit]
109
+ //or manual:
110
+ //parameters: (64-bit)
111
+ //rcx=address of input
112
+ xor eax,eax
113
+ mov eax,[rcx] //eax now contains the bytes 'input' pointed to
114
+ bswap eax //convert to big endian
115
+
116
+ ret
117
+ [/64-bit]
118
+
119
+ [32-bit]
120
+ //jmp dllname.functionname
121
+ //or manual:
122
+ //parameters: (32-bit)
123
+ push ebp
124
+ mov ebp,esp
125
+ //[ebp+8]=input
126
+ //example:
127
+ mov eax,[ebp+8] //place the address that contains the bytes into eax
128
+ mov eax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
129
+
130
+ bswap eax
131
+
132
+ pop ebp
133
+ ret 4
134
+ [/32-bit]
135
+
136
+ //The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
137
+ //function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
138
+ ConvertBackRoutine:
139
+ //jmp dllname.functionname
140
+ //or manual:
141
+ [64-bit]
142
+ //parameters: (64-bit)
143
+ //ecx=input
144
+ //rdx=address of output
145
+ //example:
146
+ bswap ecx //convert the little endian input into a big endian input
147
+ mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
148
+
149
+ ret
150
+ [/64-bit]
151
+
152
+ [32-bit]
153
+ //parameters: (32-bit)
154
+ push ebp
155
+ mov ebp,esp
156
+ //[ebp+8]=input
157
+ //[ebp+c]=address of output
158
+ //example:
159
+ push eax
160
+ push ebx
161
+ mov eax,[ebp+8] //load the value into eax
162
+ mov ebx,[ebp+c] //load the address into ebx
163
+
164
+ //convert the value to big endian
165
+ bswap eax
166
+
167
+ mov [ebx],eax //write the value into the address
168
+ pop ebx
169
+ pop eax
170
+
171
+ pop ebp
172
+ ret 8
173
+ [/32-bit]
174
+ ]])
175
+ end
176
+
177
+
178
+ local function registerBigEndianFloat()
179
+ scripts['Float Big Endian'].type=registerCustomTypeAutoAssembler([[
180
+ alloc(TypeName,256)
181
+ alloc(ByteSize,4)
182
+ alloc(ConvertRoutine,1024)
183
+ alloc(ConvertBackRoutine,1024)
184
+ alloc(UsesFloat,1)
185
+
186
+
187
+ TypeName:
188
+ db 'Float Big Endian',0
189
+
190
+
191
+ ByteSize:
192
+ dd 4
193
+
194
+ UsesFloat:
195
+ db 1
196
+
197
+
198
+ ConvertRoutine:
199
+ [64-bit]
200
+ xor eax,eax
201
+ mov eax,[rcx] //eax now contains the bytes 'input' pointed to
202
+ bswap eax //convert to big endian
203
+ ret
204
+ [/64-bit]
205
+
206
+ [32-bit]
207
+ push ebp
208
+ mov ebp,esp
209
+ mov eax,[ebp+8] //place the address that contains the bytes into eax
210
+ mov eax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
211
+ bswap eax
212
+ pop ebp
213
+ ret 4
214
+ [/32-bit]
215
+
216
+
217
+ ConvertBackRoutine:
218
+ [64-bit]
219
+ bswap ecx //convert the little endian input into a big endian input
220
+ mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
221
+ ret
222
+ [/64-bit]
223
+
224
+ [32-bit]
225
+ push ebp
226
+ mov ebp,esp
227
+ push eax
228
+ push ebx
229
+ mov eax,[ebp+8] //load the value into eax
230
+ mov ebx,[ebp+c] //load the address into ebx
231
+ bswap eax
232
+
233
+ mov [ebx],eax //write the value into the address
234
+ pop ebx
235
+ pop eax
236
+ pop ebp
237
+ ret 8
238
+ [/32-bit]
239
+ ]])
240
+ end
241
+
242
+
243
+ scripts['2 Byte Big Endian']={func=registerBigEndianInt16,reg='EnableBigEndianInt16'}
244
+ scripts['4 Byte Big Endian']={func=registerBigEndianInt32,reg='EnableBigEndianInt32'}
245
+ scripts['Float Big Endian']={func=registerBigEndianFloat,reg='EnableBigEndianFloat'}
246
+ local scriptnames={'2 Byte Big Endian','4 Byte Big Endian','Float Big Endian'}
247
+
248
+
249
+ --when loaded check if it should load the custom types
250
+ local i
251
+ local s=getSettings()
252
+ for i=1,#scriptnames do
253
+ if (s.Value[scripts[scriptnames[i]].reg]=='1') then
254
+ scripts[scriptnames[i]].func()
255
+ end
256
+ end
257
+
258
+ local sf=getSettingsForm()
259
+
260
+ local CustomTypesPage=nil
261
+ for i=0, sf.SettingsPageControl.PageCount-1 do
262
+ if sf.SettingsPageControl.Page[i].Name=='CustomTypes' then --Do NOT translate this
263
+ CustomTypesPage=sf.SettingsPageControl.Page[i]
264
+ end
265
+ end
266
+ if CustomTypesPage==nil then
267
+ --first script to add it
268
+ CustomTypesPage=sf.SettingsPageControl.addTab()
269
+ CustomTypesPage.Name='CustomTypes' --again, do NOT translate this
270
+ CustomTypesPage.Caption=translate('Extra Custom Types')
271
+
272
+ local insertNode=sf.SettingsTreeView.Items[3] --insert it near the unrandomizer since it'd be used as often as that setting
273
+ local node=sf.SettingsTreeView.Items.insert(insertNode, CustomTypesPage.Caption)
274
+ node.data=userDataToInteger(CustomTypesPage)
275
+
276
+ local clb=createCheckListBox(CustomTypesPage);
277
+ clb.Align='alClient'
278
+ clb.Name='List'
279
+ end
280
+
281
+
282
+ for i=1, #scriptnames do
283
+ CustomTypesPage.List.Items.Add(scriptnames[i])
284
+ CustomTypesPage.List.Checked[CustomTypesPage.List.Items.Count-1]=scripts[scriptnames[i]].type~=nil
285
+ end
286
+
287
+ local oldOnClose=sf.OnClose
288
+ sf.OnClose=function(sender, closeAction)
289
+ local result=closeAction
290
+ if oldOnClose~=nil then
291
+ result=oldOnClose(sender, closeAction)
292
+ end
293
+
294
+ if (result==caHide) and (sender.ModalResult==mrOK) then
295
+ local i
296
+ for i=0, CustomTypesPage.List.Items.Count-1 do
297
+ local ctname=CustomTypesPage.List.Items[i]
298
+
299
+
300
+ if scripts[ctname] then --known name
301
+ if CustomTypesPage.List.Checked[i] then
302
+ if scripts[ctname].type==nil then
303
+ scripts[ctname].func()
304
+ end
305
+ local regname=scripts[ctname].reg;
306
+ s.Value[scripts[ctname].reg]='1'
307
+ -- print(s.ClassName)
308
+ else
309
+
310
+ if scripts[ctname].type then
311
+ --print("destroy")
312
+ scripts[ctname].type.destroy()
313
+ scripts[ctname].type=nil
314
+ end
315
+ s.Value[scripts[ctname].reg]='0'
316
+
317
+ end
318
+ end
319
+ end
320
+ end
321
+ return result
322
+ end
323
+
324
+
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/celib.lua ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --compiles some handy utilities into the target process you can call using c (or assembler if you so wish)
2
+ --add #include <celib.h> to your c-code
3
+ --
4
+ --functions:
5
+ --csEnter/csLeave: Low level criticial section implementation that does an active wait (more cpu intensive, but safe enough to use in an environment with no other API access)
6
+
7
+
8
+ function injectCEHelperLib()
9
+ if getAddressSafe('csenter')==nil then
10
+ local s
11
+ if targetIsX86() then
12
+ s=[[
13
+ alloc(cespinlock,32)
14
+ cespinlock:
15
+ ]]
16
+
17
+ --write the code to bit test and set the locked variable
18
+ if targetIs64Bit() then
19
+ if getABI()==0 then --windows uses rcx as first param
20
+ s=s..[[
21
+ lock bts [rcx],0
22
+ ]]
23
+ else
24
+ --rdi contains the first param
25
+ s=s..[[
26
+ lock bts [rdi],0
27
+ ]]
28
+ end
29
+ else
30
+ --both use the push param method
31
+ s=s..[[
32
+ mov eax,[esp+4]
33
+ lock bts [eax],0
34
+ ]]
35
+ end
36
+
37
+ s=s..[[
38
+ jc cespinlock_wait
39
+ ret
40
+
41
+ cespinlock_wait:
42
+ pause
43
+ jmp cespinlock
44
+ ]]
45
+ else
46
+ error("todo: implement a spinlock for arm (could halfass it and just call and api)")
47
+ end
48
+
49
+ s=s..[[
50
+ {$c}
51
+ #include <celib.h>
52
+ extern void cespinlock(int *lock);
53
+ #ifdef _WIN32
54
+ extern int getCurrentThreadID();
55
+ #else
56
+ extern int gettid();
57
+ int getCurrentThreadID()
58
+ {
59
+ return gettid();
60
+ }
61
+ #endif
62
+
63
+ void csenter(cecs *cs)
64
+ {
65
+ if ((cs->locked) && (cs->threadid==getCurrentThreadID()))
66
+ {
67
+ cs->lockcount++;
68
+ return;
69
+ }
70
+
71
+ cespinlock(&cs->locked);
72
+ cs->threadid=getCurrentThreadID();
73
+ cs->lockcount++;
74
+ }
75
+
76
+ void csleave(cecs *cs)
77
+ {
78
+ cs->lockcount--;
79
+ if (cs->lockcount==0)
80
+ {
81
+ cs->threadid=0;
82
+ cs->locked=0;
83
+ }
84
+
85
+ }
86
+ {$asm}
87
+ ]]
88
+
89
+ local r,r2=autoAssemble(s)
90
+ if r then
91
+ r2.ccodesymbols.name='CELib'
92
+ return r
93
+ else
94
+ return false, r2
95
+ end
96
+ else
97
+ return true
98
+ end
99
+ end
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/ceshare.lua ADDED
@@ -0,0 +1,424 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if getOperatingSystem()~=0 then return end
2
+
3
+ if getTranslationFolder()~='' then
4
+ loadPOFile(getTranslationFolder()..'CeShare.po')
5
+ end
6
+
7
+ ceshare={}
8
+
9
+ function ceshare.getInternet()
10
+ if ceshare.internet==nil then
11
+ ceshare.internet=getInternet('ceshare')
12
+ end
13
+ return ceshare.internet
14
+ end
15
+
16
+ local pathsep
17
+ if getOperatingSystem()==0 then
18
+ pathsep=[[\]]
19
+ else
20
+ pathsep=[[/]]
21
+ end
22
+
23
+ ceshare.version=-1
24
+ ceshare.path=getAutoRunPath()..'ceshare'..pathsep
25
+ ceshare.formpath=ceshare.path..pathsep..'forms'..pathsep
26
+ ceshare.imagepath=ceshare.path..pathsep..'images'..pathsep
27
+
28
+ if package.loaded.xmlSimple==nil then
29
+ package.path=package.path..';'..getAutoRunPath()..'xml'..pathsep..'?.lua'
30
+ else
31
+ package.loaded.xmlSimple=nil
32
+ end
33
+ ceshare.xmlParser = require("xmlSimple").newParser()
34
+
35
+ --
36
+ package.path=package.path..';'..ceshare.path..[[?.lua]]
37
+
38
+ function loadCEShare()
39
+ ceshare.settings=getSettings('ceshare')
40
+ ceshare.secondaryIdentifierCode=getSettings('ceshare\\secondaryIdentifierCode')
41
+
42
+ require("ceshare_account")
43
+ require("ceshare_publish")
44
+ require("ceshare_querycheats")
45
+ require("ceshare_processlistextention")
46
+ require("ceshare_permissions")
47
+ require("ceshare_comments")
48
+ require("ceshare_requests")
49
+ require("ceshare_fulltablelist")
50
+
51
+ --add "CE Share menu items"
52
+ local miCESHARETopMenuItem=MainForm.miCESHARETopMenuItem
53
+
54
+ if miCESHARETopMenuItem==nil then
55
+ miCESHARETopMenuItem=createMenuItem(MainForm)
56
+ miCESHARETopMenuItem.Name='miCESHARETopMenuItem'
57
+ miCESHARETopMenuItem.Caption=translate('CE Share')
58
+ MainForm.Menu.Items.insert(2,miCESHARETopMenuItem) --in front of table
59
+ end
60
+
61
+ local miCheckForCheats=createMenuItem(MainForm)
62
+ miCheckForCheats.Caption=translate('Check for mods/cheats for current process')
63
+ miCheckForCheats.OnClick=ceshare.CheckForCheatsClick
64
+ miCheckForCheats.Default=true
65
+ miCheckForCheats.Name='miCheckForCheats'
66
+ miCESHARETopMenuItem.add(miCheckForCheats)
67
+
68
+ local miRequestCheats=createMenuItem(MainForm)
69
+ miRequestCheats.Caption=translate('Request and check other requests for mods/cheats for current process')
70
+ miRequestCheats.OnClick=ceshare.RequestForCheatsClick
71
+ miRequestCheats.Name='miRequestCheats'
72
+ miCESHARETopMenuItem.add(miRequestCheats)
73
+
74
+ local miPublishCheat=createMenuItem(MainForm)
75
+ miPublishCheat.Caption=translate('Publish/Update table')
76
+ miPublishCheat.OnClick=ceshare.PublishCheatClick
77
+ miPublishCheat.Name='miPublishCheat';
78
+ miPublishCheat.Visible=false
79
+ miCESHARETopMenuItem.add(miPublishCheat)
80
+
81
+ local miDivider=createMenuItem(MainForm)
82
+ miDivider.Caption='-'
83
+ miDivider.Visible=true
84
+ miCESHARETopMenuItem.add(miDivider)
85
+
86
+ local miViewAllTables=createMenuItem(MainForm)
87
+ miViewAllTables.Caption=translate('View all available tables')
88
+ miViewAllTables.OnClick=ceshare.ViewAllTablesClick
89
+ miViewAllTables.Name='miViewAllTables';
90
+ miViewAllTables.Visible=true
91
+ miCESHARETopMenuItem.add(miViewAllTables)
92
+
93
+
94
+
95
+ --check requestsc
96
+
97
+ miCESHARETopMenuItem.OnClick=function(s)
98
+ local loggedin=ceshare.LoggedIn or false
99
+ miPublishCheat.Visible=true
100
+
101
+ local canUpdate=false
102
+ if loggedin and ceshare.LoadedTable then
103
+
104
+ if (ceshare.LoadedTable.Permissions==nil) or isKeyPressed(VK_CONTROL) then
105
+ ceshare.getPermissions(ceshare.LoadedTable, true) --don't show errors
106
+ end
107
+
108
+ if ceshare.LoadedTable.Permissions then
109
+ canUpdate=ceshare.LoadedTable.Permissions.canUpdate
110
+ end
111
+ end
112
+
113
+ end
114
+
115
+ local originalLoadTable=loadTable
116
+ loadTable=function(streamorfilename,merge,ignoreluascriptdialog)
117
+
118
+ if ceshare.settings.Value['logoutWhenLoadingTables']~='0' then
119
+ ceshare.ClearCredentials()
120
+ end
121
+
122
+
123
+
124
+ return originalLoadTable(streamorfilename,merge,ignoreluascriptdialog)
125
+ end
126
+
127
+
128
+ end
129
+
130
+ function loadCEShareServerListInCombobox(cb)
131
+ --[[
132
+ fills in ceshare.ceshareserverlist if needed and puts the list into the combobox
133
+ --]]
134
+
135
+ if ceshare.ceshareserverlist==nil then
136
+ local list=ceshare.getInternet().getURL('https://cheatengine.org/cesharelist.txt') --AKA: Eggbaskets
137
+ local sl=createStringList()
138
+ sl.Text=list
139
+
140
+
141
+ --parse the list and build a table
142
+ ceshare.ceshareserverlist={}
143
+
144
+ local i
145
+ for i=0,sl.Count-1 do
146
+ if sl[i]:sub(1,1)~='#' then
147
+ local server=sl[i]
148
+ local sep,sep2=server:find(' #%-# ')
149
+ if sep then
150
+ local e={}
151
+ e.full=server
152
+ e.base=server:sub(1,sep-1)
153
+ e.description=server:sub(sep2+1)
154
+ table.insert(ceshare.ceshareserverlist,e)
155
+ end
156
+ end
157
+ end
158
+ sl.destroy()
159
+ end
160
+
161
+ cb.Items.clear()
162
+ for i=1,#ceshare.ceshareserverlist do
163
+ cb.Items.add(ceshare.ceshareserverlist[i].description)
164
+ end
165
+ end
166
+
167
+ local f=io.open(ceshare.path..[[server.txt]],'rb')
168
+ if f then
169
+ ceshare.base=f:read("*all")
170
+ f:close()
171
+ end
172
+
173
+ ceshare.ceversion=getCEVersion()
174
+
175
+ --add a ceshare config option to settings
176
+
177
+ local sf=getSettingsForm()
178
+ ceshare.settingsTab=sf.SettingsPageControl.addTab()
179
+
180
+
181
+ ceshare.settingsCBBase=createComboBox(ceshare.settingsTab)
182
+ ceshare.settingsCBBase.Text=ceshare.base
183
+ ceshare.settingsCBBase.Align='alTop'
184
+
185
+ local lblCEShareLabel=createLabel(ceshare.settingsTab)
186
+ lblCEShareLabel.Caption=translate('CEShare community URL')
187
+ lblCEShareLabel.Align='alTop'
188
+
189
+
190
+
191
+ ceshare.settingsTab.OnShow=function()
192
+ --fill the list
193
+ if ceshare.settingsCBBase.Items.Count==0 then
194
+ loadCEShareServerListInCombobox(ceshare.settingsCBBase)
195
+ end
196
+ end
197
+
198
+ local insertNode=sf.SettingsTreeView.Items[3] --insert it near the unrandomizer since it'd be used as often as that setting
199
+ local node=sf.SettingsTreeView.Items.insert(insertNode, translate("CEShare"))
200
+ node.data=userDataToInteger(ceshare.settingsTab)
201
+
202
+ local originalSettingsCloseEvent=sf.OnClose
203
+ sf.OnClose=function(s, closeAction)
204
+
205
+ local r=closeAction
206
+ if originalSettingsCloseEvent then
207
+ r=originalSettingsCloseEvent(s, closeAction)
208
+ end
209
+
210
+ if s.ModalResult==mrOK then
211
+ --apply change
212
+ local newbase=''
213
+ if ceshare.settingsCBBase.ItemIndex==-1 then
214
+ newbase=ceshare.settingsCBBase.Text
215
+ else
216
+ newbase=ceshare.ceshareserverlist[ceshare.settingsCBBase.ItemIndex+1].base
217
+ end
218
+
219
+ if newbase~=ceshare.base then
220
+ f=io.open(ceshare.path..[[server.txt]],'wb')
221
+ f:write(newbase)
222
+ f:close()
223
+
224
+ local needsload=(ceshare.base==nil) or (ceshare.base=='')
225
+ ceshare.base=newbase
226
+
227
+ if needsload then
228
+ loadCEShare()
229
+ end
230
+ end
231
+ end
232
+
233
+
234
+ return r
235
+ end
236
+
237
+
238
+
239
+
240
+
241
+
242
+ function ceshare.showError(msg)
243
+ messageDialog(msg,mtError, mbOK)
244
+ end
245
+
246
+ function ceshare.url_encode(str)
247
+ if type(str)=='boolean' then
248
+ if str then
249
+ return '1'
250
+ else
251
+ return '0'
252
+ end
253
+ end
254
+
255
+
256
+ if (str) then
257
+ --str = string.gsub (str, "\n", "\r\n")
258
+ --str=str:gsub("%W", "%%%0")
259
+
260
+ str = string.gsub (str, "([^%w %-%_%.%~])",
261
+ function (c) return string.format ("%%%02X", string.byte(c)) end)
262
+ str = string.gsub (str, " ", "+")
263
+ end
264
+ return str
265
+ end
266
+
267
+ function ceshare.parseResult(r, skipErrorDialog)
268
+ --parses the xml string and returns the xml object, or nil with a true/false.
269
+ --true means, try again, false means give up
270
+ local xml
271
+
272
+
273
+ if r then
274
+ if (r:sub(1,2)=='<?') then
275
+ xml=ceshare.xmlParser:ParseXmlText(r)
276
+ if xml then
277
+ if xml.invalidsession then --This requires a valid session. Spawn a login screen
278
+ if ceshare.spawnLoginDialog() then --try again after logging in
279
+ return nil,true
280
+ else
281
+ return nil,false
282
+ end
283
+ end
284
+
285
+ if xml.extraparamneeded then
286
+ local valid, functionresult
287
+
288
+ local f=loadstring(xml.extraparamneeded:value())
289
+
290
+ if f then
291
+ --check registry if it's ok to run this script, or ask if it should be loaded
292
+ local d=createForm(false)
293
+ d.Caption=translate('Secondary identifier code')
294
+ d.BorderStyle='bsSizeable'
295
+
296
+ local pnlBtns=createPanel(d)
297
+ btnAllow=createButton(pnlBtns)
298
+ btnCancel=createButton(pnlBtns)
299
+
300
+ btnAllow.AutoSize=true
301
+ btnCancel.AutoSide=true
302
+
303
+ btnAllow.Caption=translate('Allow')
304
+ btnAllow.Default=true
305
+ btnAllow.ModalResult=mrOK
306
+
307
+ btnCancel.Caption=translate('Cancel')
308
+ btnCancel.Cancel=true
309
+ btnCancel.ModalResult=mrCancel
310
+
311
+ pnlBtns.ChildSizing.ControlsPerLine=2
312
+ pnlBtns.ChildSizing.HorizontalSpacing=4
313
+ pnlBtns.ChildSizing.EnlargeHorizontal='crsHomogenousChildResize'
314
+ pnlBtns.ChildSizing.Layout='cclLeftToRightThenTopToBottom'
315
+ pnlBtns.AutoSize=true
316
+ pnlBtns.Align='alBottom'
317
+
318
+ pnlHeaderAndEditor=createPanel(d)
319
+ pnlHeaderAndEditor.align='alClient'
320
+
321
+
322
+ local header=createLabel(pnlHeaderAndEditor)
323
+ header.caption=translate('This process needs a special identifier to set it apart from others with the same name. To generate this identifier the below code is needed. Do you agree with the execution of this code to generate the identifier?')
324
+ header.align='alTop'
325
+ header.WordWrap=true
326
+
327
+ local scriptviewer
328
+ if createSynEdit then
329
+ scriptviewer=createSynEdit(pnlHeaderAndEditor,0) --7.1+ ,0 means lua syntax
330
+ scriptviewer.Gutter.Parts.SynGutterMarks1.Visible=false
331
+ scriptviewer.Gutter.Parts.SynGutterChanges1.Visible=false
332
+ scriptviewer.Gutter.Parts.SynGutterSeparator1.Visible=true
333
+ scriptviewer.Gutter.Parts.SynGutterCodeFolding1.Visible=false
334
+ scriptviewer.Font.Size=10
335
+ else
336
+ scriptviewer=createMemo(pnlHeaderAndEditor)
337
+ scriptviewer.ScrollBars='ssAutoBoth'
338
+ end
339
+ scriptviewer.ReadOnly=true
340
+ scriptviewer.Lines.Text=xml.extraparamneeded:value()
341
+ scriptviewer.align='alClient'
342
+
343
+ d.Width=d.Canvas.getTextWidth(header.Caption)/3
344
+ d.Height=d.Canvas.getTextHeight('Qwertyuiopjkl')*18
345
+ d.position='poScreenCenter'
346
+
347
+ if d.showModal()~=mrOK then return nil,false end
348
+ end
349
+
350
+ --still here so ok
351
+ valid, functionresult=f()
352
+
353
+ if valid then
354
+ ceshare.secondaryIdentifierCode.Value[process:lower()]=xml.extraparamneeded:value()
355
+ end
356
+
357
+ return nil, valid, functionresult --try again with this extra parameter
358
+
359
+ end
360
+ --[[ perhaps someday if there is a really trusted server
361
+ if xml.executeLua then
362
+ loadstring(xml.executeLua:value())()
363
+ return xml
364
+ end
365
+ --]]
366
+
367
+
368
+ if xml.error then
369
+ if (skipErrorDialog==nil) or (skipErrorDialog==false) then
370
+ ceshare.showError(xml.error:value())
371
+ end
372
+
373
+ return nil,false
374
+ else
375
+ return xml
376
+ end
377
+
378
+ else
379
+ if (skipErrorDialog==nil) or (skipErrorDialog==false) then
380
+ ceshare.showError(translate('Error:')..r)
381
+ end
382
+ return nil,false
383
+ end
384
+ else
385
+ if (skipErrorDialog==nil) or (skipErrorDialog==false) then
386
+ ceshare.showError(translate("Invalid reply from server:")..r)
387
+ end
388
+ return nil,false
389
+ end
390
+ else
391
+ if (skipErrorDialog==nil) or (skipErrorDialog==false) then
392
+ ceshare.showError(translate("Server did not respond")) --..ceshare.debug)
393
+ end
394
+ return nil,false
395
+ end
396
+ end
397
+
398
+ function ceshare.QueryXURL(filename,parameters, skipErrorDialog)
399
+ local tryagain=true
400
+ local xml
401
+ local extraparam
402
+ while tryagain==true do
403
+ local rawdata=ceshare.getInternet().postURL(ceshare.base..filename,parameters)
404
+ xml,tryagain,extraparam=ceshare.parseResult(rawdata, skipErrorDialog)
405
+ if xml then
406
+ return xml
407
+ end
408
+
409
+ if tryagain and extraparam then
410
+ local newparam='secondaryidentifier='..ceshare.url_encode(extraparam)
411
+ if parameters and parameters~='' then
412
+ parameters=parameters..'&'..newparam
413
+ else
414
+ parameters=extraparam
415
+ end
416
+ end
417
+ end
418
+
419
+ return nil
420
+ end
421
+
422
+ if (ceshare.base) and (ceshare.base~='') then
423
+ loadCEShare()
424
+ end
Gaming/CheatEngine/Portable/App/ProgramFiles/autorun/ceshare/ceshare_account.lua ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ function ceshare.login(username,password)
3
+ local i=ceshare.getInternet()
4
+ local parameters='';
5
+ if username then
6
+ parameters=parameters..'username='..ceshare.url_encode(username)
7
+ end
8
+
9
+ if password then
10
+ parameters=parameters..'&password='..ceshare.url_encode(password)
11
+ end
12
+
13
+ local r=i.postURL(ceshare.base..'login.php',parameters)
14
+ if r then
15
+ if (r:sub(1,2)=='<?') then
16
+ local s=ceshare.xmlParser:ParseXmlText(r)
17
+ if s then
18
+ if s.Valid then
19
+ ceshare.LoggedIn=true
20
+ return true
21
+ else
22
+ if s.error then
23
+ ceshare.showError(s.error:value())
24
+ end
25
+ end
26
+ else
27
+ ceshare.showError(r)
28
+ end
29
+ else
30
+ ceshare.showError(r);
31
+ end
32
+ else
33
+ ceshare.showError('Login system failure')
34
+ end
35
+ end
36
+
37
+ function ceshare.logout()
38
+ local i=ceshare.getInternet()
39
+ local parameters='';
40
+ i.postURL(ceshare.base..'logout.php',parameters)
41
+ ceshare.LoggedIn=false
42
+ end
43
+
44
+ function ceshare.spawnLoginDialog() --I could also use a frm for this, but just showing how to use pure lua for a dialog (designer is still easier though)
45
+ --check if already logged in (cookies)
46
+ if ceshare.login() then return true end
47
+
48
+ if ceshare.loginform==nil then
49
+ f=createForm(false)
50
+ lblUsername=createLabel(f)
51
+ edtUsername=createEdit(f)
52
+ lblPassword=createLabel(f)
53
+ edtPassword=createEdit(f)
54
+ lblRegister=createLabel(f)
55
+ cbLogoutWhenLoadingTables=createCheckBox(f)
56
+
57
+ pnlBtns=createPanel(f)
58
+ pnlBtns.BevelOuter='bvNone'
59
+ btnOk=createButton(pnlBtns)
60
+ btnOk.Caption=translate('OK')
61
+ btnOk.ModalResult=mrOK
62
+ btnOk.Default=true
63
+
64
+ btnCancel=createButton(pnlBtns)
65
+ btnCancel.Caption=translate('Cancel')
66
+ btnCancel.ModalResult=mrCancel
67
+ btnCancel.Cancel=true
68
+
69
+ f.Caption=translate("CEShare Login")
70
+ f.BorderStyle='bsSingle';
71
+ f.Position='poScreenCenter';
72
+
73
+ lblUsername.Caption=translate('Username')
74
+ lblUsername.AnchorSideTop.Control=f
75
+ lblUsername.AnchorSideTop.Side=asrTop
76
+ lblUsername.AnchorSideLeft.Control=f
77
+ lblUsername.AnchorSideLeft.Side=asrLeft
78
+ lblUsername.BorderSpacing.Left=4
79
+ lblUsername.BorderSpacing.Right=4
80
+
81
+ edtUsername.AnchorSideTop.Control=lblUsername
82
+ edtUsername.AnchorSideTop.Side=asrBottom
83
+ edtUsername.AnchorSideLeft.Control=lblUsername
84
+ edtUsername.AnchorSideLeft.Side=asrLeft
85
+ edtUsername.AnchorSideRight.Control=f
86
+ edtUsername.AnchorSideRight.Side=asrRight
87
+ edtUsername.Constraints.MinWidth=f.Canvas.getTextWidth(' USERNAME ')
88
+ edtUsername.TextHint='Username'
89
+ edtUsername.BorderSpacing.Right=4
90
+ edtUsername.Anchors='[akTop, akLeft, akRight]'
91
+ edtUsername.name='username'
92
+ edtUsername.Text=''
93
+
94
+
95
+ lblPassword.Caption=translate('Password')
96
+ lblPassword.AnchorSideTop.Control=edtUsername
97
+ lblPassword.AnchorSideTop.Side=asrBottom
98
+ lblPassword.AnchorSideLeft.Control=lblUsername
99
+ lblPassword.AnchorSideLeft.Side=asrLeft
100
+
101
+ edtPassword.AnchorSideTop.Control=lblPassword
102
+ edtPassword.AnchorSideTop.Side=asrBottom
103
+ edtPassword.AnchorSideLeft.Control=lblUsername
104
+ edtPassword.AnchorSideLeft.Side=asrLeft
105
+ edtPassword.AnchorSideRight.Control=f
106
+ edtPassword.AnchorSideRight.Side=asrRight
107
+ edtPassword.Constraints.MinWidth=f.Canvas.getTextWidth(' PASSWORD ')
108
+ edtPassword.BorderSpacing.Right=4
109
+ edtPassword.Anchors='[akTop, akLeft, akRight]'
110
+ edtPassword.PasswordChar=string.byte('*')
111
+ edtPassword.TextHint='Password'
112
+ edtPassword.name='password';
113
+ edtPassword.Text=''
114
+
115
+ lblRegister.Caption=translate('Register')
116
+ lblRegister.Font.Color=0xff0000
117
+ lblRegister.Font.Style='[fsUnderline]'
118
+ lblRegister.Cursor=-21
119
+ lblRegister.AnchorSideTop.Control=edtPassword
120
+ lblRegister.AnchorSideTop.Side=asrBottom
121
+ lblRegister.BorderSpacing.Top=4
122
+ lblRegister.BorderSpacing.Bottom=4
123
+ lblRegister.AnchorSideLeft.Control=edtPassword
124
+ lblRegister.AnchorSideLeft.Side=asrCenter
125
+ lblRegister.OnMouseDown=function()
126
+ shellExecute(ceshare.base..'RegisterPage.php')
127
+ end
128
+
129
+
130
+
131
+ pnlBtns.AnchorSideTop.Control=lblRegister
132
+ pnlBtns.AnchorSideTop.Side=asrBottom
133
+ pnlBtns.AnchorSideLeft.Control=f
134
+ pnlBtns.AnchorSideLeft.Side=asrCenter
135
+
136
+ pnlBtns.ChildSizing.ControlsPerLine=2
137
+ pnlBtns.ChildSizing.HorizontalSpacing=4
138
+ pnlBtns.ChildSizing.EnlargeHorizontal='crsHomogenousChildResize'
139
+ pnlBtns.ChildSizing.Layout='cclLeftToRightThenTopToBottom'
140
+ pnlBtns.AutoSize=true
141
+
142
+ pnlBtns.BorderSpacing.Top=6
143
+ pnlBtns.BorderSpacing.Bottom=4
144
+
145
+ cbLogoutWhenLoadingTables.Caption=translate('Logout when loading ceshare tables')
146
+ cbLogoutWhenLoadingTables.Name='cbLogoutWhenLoadingTables'
147
+ cbLogoutWhenLoadingTables.AnchorSideTop.Control=pnlBtns
148
+ cbLogoutWhenLoadingTables.AnchorSideTop.Side=asrBottom
149
+ cbLogoutWhenLoadingTables.AnchorSideLeft.Control=lblUsername
150
+ cbLogoutWhenLoadingTables.AnchorSideLeft.Side=asrLeft
151
+
152
+ cbLogoutWhenLoadingTables.Hint=translate('When checked you will get logged out when loading a ceshare table. This to prevent malicious tables from using your account')
153
+ cbLogoutWhenLoadingTables.ShowHint=true
154
+ cbLogoutWhenLoadingTables.Checked=ceshare.settings.Value['logoutWhenLoadingTables']~='0'
155
+
156
+
157
+ f.OnClose=nil --by default forms created with createForm will have an OnClose that will free themself on close. That's not needed in this case where the form needs to be reused
158
+
159
+ f.BorderIcons='[]'
160
+ f.AutoSize=true
161
+ ceshare.loginform=f
162
+ end
163
+
164
+ if ceshare.loginform.showModal()==mrOK then
165
+ local username=ceshare.loginform.username.text
166
+ local password=ceshare.loginform.password.text
167
+
168
+ ceshare.loginform.username.text=''
169
+ ceshare.loginform.password.text=''
170
+
171
+ local v
172
+ if ceshare.loginform.cbLogoutWhenLoadingTables.checked then
173
+ ceshare.settings.Value['logoutWhenLoadingTables']='1'
174
+ else
175
+ ceshare.settings.Value['logoutWhenLoadingTables']='0'
176
+ end
177
+
178
+ return ceshare.login(username, password)
179
+ end
180
+ end
181
+
182
+
183
+
184
+
185
+ function ceshare.ClearCredentials()
186
+ --print("Forgetting who you are")
187
+ ceshare.logout() --in case some idiot tablemaker wants to make
188
+
189
+ if ceshare.loginform then
190
+ ceshare.loginform.password.Text=''
191
+ ceshare.loginform.username.Text=''
192
+ ceshare.loginform.destroy()
193
+ ceshare.loginform=nil
194
+ end
195
+ end