├── .gitattributes
├── Hax
├── Hax.rc
├── Hax.aps
├── Luau
│ ├── Luau.VM.lib
│ ├── Luau.Ast.lib
│ ├── isocline.lib
│ ├── Luau.CodeGen.lib
│ ├── Luau.Compiler.lib
│ ├── Confusables.h
│ ├── lbytecode.h
│ ├── BuiltinFolding.h
│ ├── lapi.h
│ ├── lbuiltins.h
│ ├── TableShape.h
│ ├── ParseOptions.h
│ ├── ludata.h
│ ├── ExperimentalFlags.h
│ ├── CostModel.h
│ ├── lstring.h
│ ├── Builtins.h
│ ├── lfunc.h
│ ├── ConstantFolding.h
│ ├── ValueTracking.h
│ ├── lcommon.h
│ ├── StringUtils.h
│ ├── luacode.h
│ ├── ldebug.h
│ ├── ltm.h
│ ├── ParseResult.h
│ ├── ltable.h
│ ├── lvm.h
│ ├── lmem.h
│ ├── lnumutils.h
│ ├── ldo.h
│ ├── Compiler.h
│ ├── Location.h
│ ├── Common.h
│ ├── luaconf.h
│ ├── lualib.h
│ ├── lgc.h
│ ├── TimeTrace.h
│ ├── Lexer.h
│ └── BytecodeBuilder.h
├── lib
│ ├── xxhash.lib
│ └── libzstd_static.lib
├── consolecolors.h
├── fps.h
├── rbxstring.h
├── Hax.vcxproj.user
├── fps.cpp
├── hwid.cpp
├── hwid.h
├── exceptionfilter.h
├── resource.h
├── file.h
├── rbxinstance.h
├── functions.h
├── encryption.cpp
├── rbxstring.cpp
├── encryption.h
├── AUMB_utils
│ ├── utils.hpp
│ └── utils.cpp
├── md5.h
├── rbxinstance.cpp
├── Hax.vcxproj.filters
├── exceptionfilter.cpp
├── file.cpp
├── rlapi.cpp
├── rlapi.h
└── addresses.h
├── Release
├── TaaprWare2-UI.exe
├── TaaprWare2-UI.pdb
├── ICSharpCode.AvalonEdit.dll
├── ICSharpCode.AvalonEdit.pdb
├── bin
│ └── TaaprWare2Internal.dll
├── ActiproSoftware.Text.Wpf.dll
├── ActiproSoftware.Shared.Wpf.dll
├── ActiproSoftware.SyntaxEditor.Wpf.dll
└── TaaprWare2-UI.exe.config
├── TaaprWare2-UI
├── taapr.ico
├── taapr.png
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.config
├── App.xaml
├── App.xaml.cs
├── TaaprWare2-UI.csproj.user
├── InsecureKeysystem.cs
├── NamedPipes.cs
├── MainWindow.xaml
├── Functions.cs
├── Injector.cs
├── MainWindow.xaml.cs
└── TaaprWare2-UI.csproj
├── README.md
└── TaaprWare2.sln
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.h linguist-detectable=false
2 |
--------------------------------------------------------------------------------
/Hax/Hax.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Hax.rc
--------------------------------------------------------------------------------
/Hax/Hax.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Hax.aps
--------------------------------------------------------------------------------
/Hax/Luau/Luau.VM.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Luau/Luau.VM.lib
--------------------------------------------------------------------------------
/Hax/lib/xxhash.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/lib/xxhash.lib
--------------------------------------------------------------------------------
/Hax/Luau/Luau.Ast.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Luau/Luau.Ast.lib
--------------------------------------------------------------------------------
/Hax/Luau/isocline.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Luau/isocline.lib
--------------------------------------------------------------------------------
/Hax/Luau/Luau.CodeGen.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Luau/Luau.CodeGen.lib
--------------------------------------------------------------------------------
/Hax/consolecolors.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define CONSOLE_COLOR_RED 12
4 | #define CONSOLE_COLOR_WHITE 15
--------------------------------------------------------------------------------
/Release/TaaprWare2-UI.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/TaaprWare2-UI.exe
--------------------------------------------------------------------------------
/Release/TaaprWare2-UI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/TaaprWare2-UI.pdb
--------------------------------------------------------------------------------
/TaaprWare2-UI/taapr.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/TaaprWare2-UI/taapr.ico
--------------------------------------------------------------------------------
/TaaprWare2-UI/taapr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/TaaprWare2-UI/taapr.png
--------------------------------------------------------------------------------
/Hax/Luau/Luau.Compiler.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/Luau/Luau.Compiler.lib
--------------------------------------------------------------------------------
/Hax/lib/libzstd_static.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Hax/lib/libzstd_static.lib
--------------------------------------------------------------------------------
/Hax/fps.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "addresses.h"
4 |
5 | double get_fps();
6 | void set_fps(double fps);
--------------------------------------------------------------------------------
/Hax/rbxstring.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "addresses.h"
4 |
5 | std::string rbx_string_to_string(rbx_string rbx);
--------------------------------------------------------------------------------
/Release/ICSharpCode.AvalonEdit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/ICSharpCode.AvalonEdit.dll
--------------------------------------------------------------------------------
/Release/ICSharpCode.AvalonEdit.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/ICSharpCode.AvalonEdit.pdb
--------------------------------------------------------------------------------
/Release/bin/TaaprWare2Internal.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/bin/TaaprWare2Internal.dll
--------------------------------------------------------------------------------
/Release/ActiproSoftware.Text.Wpf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/ActiproSoftware.Text.Wpf.dll
--------------------------------------------------------------------------------
/Release/ActiproSoftware.Shared.Wpf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/ActiproSoftware.Shared.Wpf.dll
--------------------------------------------------------------------------------
/Release/ActiproSoftware.SyntaxEditor.Wpf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plusgiant5/TaaprWareV2/HEAD/Release/ActiproSoftware.SyntaxEditor.Wpf.dll
--------------------------------------------------------------------------------
/Hax/Hax.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Hax/fps.cpp:
--------------------------------------------------------------------------------
1 | #include "fps.h"
2 |
3 | double get_fps() {
4 | return double(1) / functions::rbx_getscheduler()->fps;
5 | }
6 | void set_fps(double fps) {
7 | functions::rbx_getscheduler()->fps = 1 / (double)fps;
8 | }
--------------------------------------------------------------------------------
/Hax/hwid.cpp:
--------------------------------------------------------------------------------
1 | #include "hwid.h"
2 |
3 | std::string hwid;
4 |
5 | void update_hwid() {
6 | HW_PROFILE_INFOA hardware;
7 | GetCurrentHwProfileA(&hardware);
8 | hwid = hash::md5(std::string(hardware.szHwProfileGuid));
9 | }
--------------------------------------------------------------------------------
/TaaprWare2-UI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Hax/hwid.h:
--------------------------------------------------------------------------------
1 | // for user's hashed hwid
2 | // indended to create keys that roblox scripts can't create
3 |
4 | #pragma once
5 |
6 | #include
7 | #include
8 |
9 | #include "md5.h"
10 |
11 | extern std::string hwid;
12 |
13 | void update_hwid();
--------------------------------------------------------------------------------
/Hax/Luau/Confusables.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include
5 |
6 | namespace Luau
7 | {
8 | const char* findConfusable(uint32_t codepoint);
9 | }
10 |
--------------------------------------------------------------------------------
/Hax/Luau/lbytecode.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | // This is a forwarding header for Luau bytecode definition
6 | #include "Luau/Bytecode.h"
7 |
--------------------------------------------------------------------------------
/Hax/exceptionfilter.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #include "consolecolors.h"
10 | #include "functions.h"
11 | #include "addresses.h"
12 |
13 | LONG WINAPI TaaprWareExceptionFilter(EXCEPTION_POINTERS* ExceptionInfo);
14 | void unpatch_SetUnhandledExceptionFilter();
--------------------------------------------------------------------------------
/TaaprWare2-UI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Release/TaaprWare2-UI.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Hax/Luau/BuiltinFolding.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "ConstantFolding.h"
5 |
6 | namespace Luau
7 | {
8 | namespace Compile
9 | {
10 |
11 | Constant foldBuiltin(int bfid, const Constant* args, size_t count);
12 |
13 | } // namespace Compile
14 | } // namespace Luau
15 |
--------------------------------------------------------------------------------
/Hax/Luau/lapi.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 |
7 | LUAI_FUNC const TValue* luaA_toobject(lua_State* L, int idx);
8 | LUAI_FUNC void luaA_pushobject(lua_State* L, const TValue* o);
9 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TaaprWare2_UI
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Hax/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Hax.rc
4 |
5 | // Next default values for new objects
6 | //
7 | #ifdef APSTUDIO_INVOKED
8 | #ifndef APSTUDIO_READONLY_SYMBOLS
9 | #define _APS_NEXT_RESOURCE_VALUE 101
10 | #define _APS_NEXT_COMMAND_VALUE 40001
11 | #define _APS_NEXT_CONTROL_VALUE 1001
12 | #define _APS_NEXT_SYMED_VALUE 101
13 | #endif
14 | #endif
15 |
--------------------------------------------------------------------------------
/Hax/Luau/lbuiltins.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 |
7 | typedef int (*luau_FastFunction)(lua_State* L, StkId res, TValue* arg0, int nresults, StkId args, int nparams);
8 |
9 | extern luau_FastFunction luauF_table[256];
10 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/TaaprWare2-UI.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/Hax/Luau/TableShape.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Ast.h"
5 | #include "Luau/DenseHash.h"
6 |
7 | namespace Luau
8 | {
9 | namespace Compile
10 | {
11 |
12 | struct TableShape
13 | {
14 | unsigned int arraySize = 0;
15 | unsigned int hashSize = 0;
16 | };
17 |
18 | void predictTableShapes(DenseHashMap& shapes, AstNode* root);
19 |
20 | } // namespace Compile
21 | } // namespace Luau
22 |
--------------------------------------------------------------------------------
/Hax/file.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #include "xorstr.h"
12 |
13 | EXTERN_C IMAGE_DOS_HEADER __ImageBase;
14 |
15 | bool isfile(std::string path);
16 | bool isfolder(std::string path);
17 | const char* readfile(std::string path);
18 | bool delfile(std::string path);
19 | bool delfolder(std::string path);
20 | bool writefile(std::string path, const char* data);
21 | std::vector* listfiles(std::string path);
22 | std::vector* listfolders(std::string path);
--------------------------------------------------------------------------------
/Hax/Luau/ParseOptions.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | namespace Luau
5 | {
6 |
7 | enum class Mode
8 | {
9 | NoCheck, // Do not perform any inference
10 | Nonstrict, // Unannotated symbols are any
11 | Strict, // Unannotated symbols are inferred
12 | Definition, // Type definition module, has special parsing rules
13 | };
14 |
15 | struct ParseOptions
16 | {
17 | bool allowTypeAnnotations = true;
18 | bool supportContinueStatement = true;
19 | bool allowDeclarationSyntax = false;
20 | bool captureComments = false;
21 | };
22 |
23 | } // namespace Luau
24 |
--------------------------------------------------------------------------------
/Hax/Luau/ludata.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 |
7 | // special tag value is used for user data with inline dtors
8 | #define UTAG_IDTOR LUA_UTAG_LIMIT
9 |
10 | // special tag value is used for newproxy-created user data (all other user data objects are host-exposed)
11 | #define UTAG_PROXY (LUA_UTAG_LIMIT + 1)
12 |
13 | #define sizeudata(len) (offsetof(Udata, data) + len)
14 |
15 | LUAI_FUNC Udata* luaU_newudata(lua_State* L, size_t s, int tag);
16 | LUAI_FUNC void luaU_freeudata(lua_State* L, Udata* u, struct lua_Page* page);
17 |
--------------------------------------------------------------------------------
/Hax/rbxinstance.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include "addresses.h"
6 |
7 | namespace instance {
8 | objects::instance* FindFirstChild(objects::instance* parent, std::string target_child_name, bool recursive = false, std::vector ignore_list = {});
9 | objects::instance* FindFirstChildOfClass(objects::instance* parent, std::string target_class_name, bool recursive = false, std::vector ignore_list = {});
10 | std::vector GetChildren(objects::instance* parent, std::string target_class_name);
11 | std::string GetFullName(objects::instance* inst);
12 | }
13 | objects::instance* get_datamodel();
14 | objects::instance* get_scriptcontext();
15 | std::vector> get_jobs();
--------------------------------------------------------------------------------
/Hax/functions.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "Luau\Compiler.h"
6 | #include "Luau\BytecodeBuilder.h"
7 | #include "addresses.h"
8 | #include "rlapi.h"
9 | #include "file.h"
10 | #include "fps.h"
11 | #include "rbxinstance.h"
12 | #include "AUMB_utils\utils.hpp"
13 | #include "xorstr.h"
14 | #include "include\xxhash.h"
15 | #include "include\zstd.h"
16 | #include "hwid.h"
17 |
18 | #define RELEASE
19 |
20 | class roblox_encoder : public Luau::BytecodeEncoder {
21 | std::uint8_t encodeOp(const std::uint8_t opcode) {
22 | return opcode * 227;
23 | }
24 | };
25 |
26 | extern CONTEXT context_record;
27 | extern BYTE* int3_address; // int3 is the 0xCC byte and it causes an exception
28 | extern std::vector bytecode_queue;
29 |
30 | int c_function_handler(UINT rL);
31 |
--------------------------------------------------------------------------------
/Hax/Luau/ExperimentalFlags.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include
5 |
6 | namespace Luau
7 | {
8 |
9 | inline bool isFlagExperimental(const char* flag)
10 | {
11 | // Flags in this list are disabled by default in various command-line tools. They may have behavior that is not fully final,
12 | // or critical bugs that are found after the code has been submitted.
13 | static const char* kList[] = {
14 | "LuauLowerBoundsCalculation",
15 | "LuauInterpolatedStringBaseSupport",
16 | // makes sure we always have at least one entry
17 | nullptr,
18 | };
19 |
20 | for (const char* item : kList)
21 | if (item && strcmp(item, flag) == 0)
22 | return true;
23 |
24 | return false;
25 | }
26 |
27 | } // namespace Luau
28 |
--------------------------------------------------------------------------------
/Hax/Luau/CostModel.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Ast.h"
5 | #include "Luau/DenseHash.h"
6 |
7 | namespace Luau
8 | {
9 | namespace Compile
10 | {
11 |
12 | // cost model: 8 bytes, where first byte is the baseline cost, and the next 7 bytes are discounts for when variable #i is constant
13 | uint64_t modelCost(AstNode* root, AstLocal* const* vars, size_t varCount, const DenseHashMap& builtins);
14 |
15 | // cost is computed as B - sum(Di * Ci), where B is baseline cost, Di is the discount for each variable and Ci is 1 when variable #i is constant
16 | int computeCost(uint64_t model, const bool* varsConst, size_t varCount);
17 |
18 | // get loop trip count or -1 if we can't compute it precisely
19 | int getTripCount(double from, double to, double step);
20 |
21 | } // namespace Compile
22 | } // namespace Luau
23 |
--------------------------------------------------------------------------------
/Hax/encryption.cpp:
--------------------------------------------------------------------------------
1 | #include "encryption.h"
2 |
3 | UINT get_encrypted_ptr(encryption enc, UINT address_of_ptr) {
4 | switch (enc) {
5 | case ptrenc_none:
6 | return *reinterpret_cast(*reinterpret_cast(address_of_ptr));
7 | case ptrenc_add:
8 | return address_of_ptr + *reinterpret_cast(address_of_ptr);
9 | case ptrenc_xor:
10 | return address_of_ptr ^ *reinterpret_cast(address_of_ptr);
11 | default:
12 | printf(XorString("[ERROR] Invalid encryption %d when getting\n"), enc);
13 | return 0;
14 | }
15 | }
16 | void set_encrypted_ptr(encryption enc, UINT address_of_ptr, UINT value) {
17 | switch (enc) {
18 | case ptrenc_none:
19 | *reinterpret_cast(address_of_ptr) = value;
20 | break;
21 | case ptrenc_add:
22 | *reinterpret_cast(address_of_ptr) = value - address_of_ptr;
23 | break;
24 | case ptrenc_xor:
25 | *reinterpret_cast(address_of_ptr) = value ^ address_of_ptr;
26 | break;
27 | default:
28 | printf(XorString("[ERROR] Invalid encryption %d when setting\n"), enc);
29 | break;
30 | }
31 | }
--------------------------------------------------------------------------------
/TaaprWare2-UI/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TaaprWare2_UI.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Hax/Luau/lstring.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 | #include "lstate.h"
7 |
8 | // string size limit
9 | #define MAXSSIZE (1 << 30)
10 |
11 | // string atoms are not defined by default; the storage is 16-bit integer
12 | #define ATOM_UNDEF -32768
13 |
14 | #define sizestring(len) (offsetof(TString, data) + len + 1)
15 |
16 | #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
17 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, (sizeof(s) / sizeof(char)) - 1))
18 |
19 | #define luaS_fix(s) l_setbit((s)->marked, FIXEDBIT)
20 |
21 | LUAI_FUNC unsigned int luaS_hash(const char* str, size_t len);
22 |
23 | LUAI_FUNC void luaS_resize(lua_State* L, int newsize);
24 |
25 | LUAI_FUNC TString* luaS_newlstr(lua_State* L, const char* str, size_t l);
26 | LUAI_FUNC void luaS_free(lua_State* L, TString* ts, struct lua_Page* page);
27 |
28 | LUAI_FUNC TString* luaS_bufstart(lua_State* L, size_t size);
29 | LUAI_FUNC TString* luaS_buffinish(lua_State* L, TString* ts);
30 |
--------------------------------------------------------------------------------
/Hax/Luau/Builtins.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "ValueTracking.h"
5 |
6 | namespace Luau
7 | {
8 | struct CompileOptions;
9 | }
10 |
11 | namespace Luau
12 | {
13 | namespace Compile
14 | {
15 |
16 | struct Builtin
17 | {
18 | AstName object;
19 | AstName method;
20 |
21 | bool empty() const
22 | {
23 | return object == AstName() && method == AstName();
24 | }
25 |
26 | bool isGlobal(const char* name) const
27 | {
28 | return object == AstName() && method == name;
29 | }
30 |
31 | bool isMethod(const char* table, const char* name) const
32 | {
33 | return object == table && method == name;
34 | }
35 | };
36 |
37 | Builtin getBuiltin(AstExpr* node, const DenseHashMap& globals, const DenseHashMap& variables);
38 |
39 | void analyzeBuiltins(DenseHashMap& result, const DenseHashMap& globals,
40 | const DenseHashMap& variables, const CompileOptions& options, AstNode* root);
41 |
42 | } // namespace Compile
43 | } // namespace Luau
44 |
--------------------------------------------------------------------------------
/Hax/Luau/lfunc.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 |
7 | #define sizeCclosure(n) (offsetof(Closure, c.upvals) + sizeof(TValue) * (n))
8 | #define sizeLclosure(n) (offsetof(Closure, l.uprefs) + sizeof(TValue) * (n))
9 |
10 | LUAI_FUNC Proto* luaF_newproto(lua_State* L);
11 | LUAI_FUNC Closure* luaF_newLclosure(lua_State* L, int nelems, Table* e, Proto* p);
12 | LUAI_FUNC Closure* luaF_newCclosure(lua_State* L, int nelems, Table* e);
13 | LUAI_FUNC UpVal* luaF_findupval(lua_State* L, StkId level);
14 | LUAI_FUNC void luaF_close(lua_State* L, StkId level);
15 | LUAI_FUNC void luaF_closeupval(lua_State* L, UpVal* uv, bool dead);
16 | LUAI_FUNC void luaF_freeproto(lua_State* L, Proto* f, struct lua_Page* page);
17 | LUAI_FUNC void luaF_freeclosure(lua_State* L, Closure* c, struct lua_Page* page);
18 | LUAI_FUNC void luaF_unlinkupval(UpVal* uv);
19 | LUAI_FUNC void luaF_freeupval(lua_State* L, UpVal* uv, struct lua_Page* page);
20 | LUAI_FUNC const LocVar* luaF_getlocal(const Proto* func, int local_number, int pc);
21 | LUAI_FUNC const LocVar* luaF_findlocal(const Proto* func, int local_reg, int pc);
22 |
--------------------------------------------------------------------------------
/Hax/Luau/ConstantFolding.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "ValueTracking.h"
5 |
6 | namespace Luau
7 | {
8 | namespace Compile
9 | {
10 |
11 | struct Constant
12 | {
13 | enum Type
14 | {
15 | Type_Unknown,
16 | Type_Nil,
17 | Type_Boolean,
18 | Type_Number,
19 | Type_String,
20 | };
21 |
22 | Type type = Type_Unknown;
23 | unsigned int stringLength = 0;
24 |
25 | union
26 | {
27 | bool valueBoolean;
28 | double valueNumber;
29 | const char* valueString = nullptr; // length stored in stringLength
30 | };
31 |
32 | bool isTruthful() const
33 | {
34 | LUAU_ASSERT(type != Type_Unknown);
35 | return type != Type_Nil && !(type == Type_Boolean && valueBoolean == false);
36 | }
37 |
38 | AstArray getString() const
39 | {
40 | LUAU_ASSERT(type == Type_String);
41 | return {valueString, stringLength};
42 | }
43 | };
44 |
45 | void foldConstants(DenseHashMap& constants, DenseHashMap& variables,
46 | DenseHashMap& locals, const DenseHashMap* builtins, AstNode* root);
47 |
48 | } // namespace Compile
49 | } // namespace Luau
50 |
--------------------------------------------------------------------------------
/Hax/Luau/ValueTracking.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Ast.h"
5 | #include "Luau/DenseHash.h"
6 |
7 | namespace Luau
8 | {
9 | class AstNameTable;
10 | }
11 |
12 | namespace Luau
13 | {
14 | namespace Compile
15 | {
16 |
17 | enum class Global
18 | {
19 | Default = 0,
20 | Mutable, // builtin that has contents unknown at compile time, blocks GETIMPORT for chains
21 | Written, // written in the code which means we can't reason about the value
22 | };
23 |
24 | struct Variable
25 | {
26 | AstExpr* init = nullptr; // initial value of the variable; filled by trackValues
27 | bool written = false; // is the variable ever assigned to? filled by trackValues
28 | bool constant = false; // is the variable's value a compile-time constant? filled by constantFold
29 | };
30 |
31 | void assignMutable(DenseHashMap& globals, const AstNameTable& names, const char** mutableGlobals);
32 | void trackValues(DenseHashMap& globals, DenseHashMap& variables, AstNode* root);
33 |
34 | inline Global getGlobalState(const DenseHashMap& globals, AstName name)
35 | {
36 | const Global* it = globals.find(name);
37 |
38 | return it ? *it : Global::Default;
39 | }
40 |
41 | } // namespace Compile
42 | } // namespace Luau
43 |
--------------------------------------------------------------------------------
/Hax/Luau/lcommon.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include
6 | #include
7 |
8 | #include "luaconf.h"
9 |
10 | #include "Luau\Common.h"
11 |
12 | typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
13 |
14 | // internal assertions for in-house debugging
15 | #define check_exp(c, e) (LUAU_ASSERT(c), (e))
16 | #define api_check(l, e) LUAU_ASSERT(e)
17 |
18 | #ifndef cast_to
19 | #define cast_to(t, exp) ((t)(exp))
20 | #endif
21 |
22 | #define cast_byte(i) cast_to(uint8_t, (i))
23 | #define cast_num(i) cast_to(double, (i))
24 | #define cast_int(i) cast_to(int, (i))
25 |
26 | /*
27 | ** type for virtual-machine instructions
28 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
29 | */
30 | typedef uint32_t Instruction;
31 |
32 | /*
33 | ** macro to control inclusion of some hard tests on stack reallocation
34 | */
35 | #if defined(HARDSTACKTESTS) && HARDSTACKTESTS
36 | #define condhardstacktests(x) (x)
37 | #else
38 | #define condhardstacktests(x) ((void)0)
39 | #endif
40 |
41 | /*
42 | ** macro to control inclusion of some hard tests on garbage collection
43 | */
44 | #if defined(HARDMEMTESTS) && HARDMEMTESTS
45 | #define condhardmemtests(x, l) (HARDMEMTESTS >= l ? (x) : (void)0)
46 | #else
47 | #define condhardmemtests(x, l) ((void)0)
48 | #endif
49 |
--------------------------------------------------------------------------------
/Hax/Luau/StringUtils.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #if defined(__GNUC__)
10 | #define LUAU_PRINTF_ATTR(fmt, arg) __attribute__((format(printf, fmt, arg)))
11 | #else
12 | #define LUAU_PRINTF_ATTR(fmt, arg)
13 | #endif
14 |
15 | namespace Luau
16 | {
17 |
18 | std::string format(const char* fmt, ...) LUAU_PRINTF_ATTR(1, 2);
19 | std::string vformat(const char* fmt, va_list args);
20 |
21 | void formatAppend(std::string& str, const char* fmt, ...) LUAU_PRINTF_ATTR(2, 3);
22 | void vformatAppend(std::string& ret, const char* fmt, va_list args);
23 |
24 | std::string join(const std::vector& segments, std::string_view delimiter);
25 | std::string join(const std::vector& segments, std::string_view delimiter);
26 |
27 | std::vector split(std::string_view s, char delimiter);
28 |
29 | // Computes the Damerau-Levenshtein distance of A and B.
30 | // https://en.wikipedia.org/wiki/Damerau-Levenshtein_distance#Distance_with_adjacent_transpositions
31 | size_t editDistance(std::string_view a, std::string_view b);
32 |
33 | bool startsWith(std::string_view lhs, std::string_view rhs);
34 | bool equalsLower(std::string_view lhs, std::string_view rhs);
35 |
36 | size_t hashRange(const char* data, size_t size);
37 |
38 | std::string escape(std::string_view s, bool escapeForInterpString = false);
39 | bool isIdentifier(std::string_view s);
40 | } // namespace Luau
41 |
--------------------------------------------------------------------------------
/Hax/Luau/luacode.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include
5 |
6 | // Can be used to reconfigure visibility/exports for public APIs
7 | #ifndef LUACODE_API
8 | #define LUACODE_API extern
9 | #endif
10 |
11 | typedef struct lua_CompileOptions lua_CompileOptions;
12 |
13 | struct lua_CompileOptions
14 | {
15 | // 0 - no optimization
16 | // 1 - baseline optimization level that doesn't prevent debuggability
17 | // 2 - includes optimizations that harm debuggability such as inlining
18 | int optimizationLevel; // default=1
19 |
20 | // 0 - no debugging support
21 | // 1 - line info & function names only; sufficient for backtraces
22 | // 2 - full debug info with local & upvalue names; necessary for debugger
23 | int debugLevel; // default=1
24 |
25 | // 0 - no code coverage support
26 | // 1 - statement coverage
27 | // 2 - statement and expression coverage (verbose)
28 | int coverageLevel; // default=0
29 |
30 | // global builtin to construct vectors; disabled by default
31 | const char* vectorLib;
32 | const char* vectorCtor;
33 |
34 | // null-terminated array of globals that are mutable; disables the import optimization for fields accessed through these
35 | const char** mutableGlobals;
36 | };
37 |
38 | // compile source to bytecode; when source compilation fails, the resulting bytecode contains the encoded error. use free() to destroy
39 | LUACODE_API char* luau_compile(const char* source, size_t size, lua_CompileOptions* options, size_t* outsize);
40 |
--------------------------------------------------------------------------------
/Hax/Luau/ldebug.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lstate.h"
6 |
7 | #define pcRel(pc, p) ((pc) ? cast_to(int, (pc) - (p)->code) - 1 : 0)
8 |
9 | #define luaG_typeerror(L, o, opname) luaG_typeerrorL(L, o, opname)
10 | #define luaG_forerror(L, o, what) luaG_forerrorL(L, o, what)
11 | #define luaG_runerror(L, fmt, ...) luaG_runerrorL(L, fmt, ##__VA_ARGS__)
12 |
13 | #define LUA_MEMERRMSG "not enough memory"
14 | #define LUA_ERRERRMSG "error in error handling"
15 |
16 | LUAI_FUNC l_noret luaG_typeerrorL(lua_State* L, const TValue* o, const char* opname);
17 | LUAI_FUNC l_noret luaG_forerrorL(lua_State* L, const TValue* o, const char* what);
18 | LUAI_FUNC l_noret luaG_concaterror(lua_State* L, StkId p1, StkId p2);
19 | LUAI_FUNC l_noret luaG_aritherror(lua_State* L, const TValue* p1, const TValue* p2, TMS op);
20 | LUAI_FUNC l_noret luaG_ordererror(lua_State* L, const TValue* p1, const TValue* p2, TMS op);
21 | LUAI_FUNC l_noret luaG_indexerror(lua_State* L, const TValue* p1, const TValue* p2);
22 | LUAI_FUNC l_noret luaG_methoderror(lua_State* L, const TValue* p1, const TString* p2);
23 | LUAI_FUNC l_noret luaG_readonlyerror(lua_State* L);
24 |
25 | LUAI_FUNC LUA_PRINTF_ATTR(2, 3) l_noret luaG_runerrorL(lua_State* L, const char* fmt, ...);
26 | LUAI_FUNC void luaG_pusherror(lua_State* L, const char* error);
27 |
28 | LUAI_FUNC void luaG_breakpoint(lua_State* L, Proto* p, int line, bool enable);
29 | LUAI_FUNC bool luaG_onbreak(lua_State* L);
30 |
31 | LUAI_FUNC int luaG_getline(Proto* p, int pc);
32 |
--------------------------------------------------------------------------------
/Hax/Luau/ltm.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 |
7 | /*
8 | * WARNING: if you change the order of this enumeration,
9 | * grep "ORDER TM"
10 | */
11 | // clang-format off
12 | typedef enum
13 | {
14 |
15 | TM_INDEX,
16 | TM_NEWINDEX,
17 | TM_MODE,
18 | TM_NAMECALL,
19 | TM_CALL,
20 | TM_ITER,
21 | TM_LEN,
22 |
23 | TM_EQ, // last tag method with `fast' access
24 |
25 |
26 | TM_ADD,
27 | TM_SUB,
28 | TM_MUL,
29 | TM_DIV,
30 | TM_MOD,
31 | TM_POW,
32 | TM_UNM,
33 |
34 |
35 | TM_LT,
36 | TM_LE,
37 | TM_CONCAT,
38 | TM_TYPE,
39 |
40 | TM_N // number of elements in the enum
41 | } TMS;
42 | // clang-format on
43 |
44 | #define gfasttm(g, et, e) ((et) == NULL ? NULL : ((et)->tmcache & (1u << (e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
45 |
46 | #define fasttm(l, et, e) gfasttm(l->global, et, e)
47 | #define fastnotm(et, e) ((et) == NULL || ((et)->tmcache & (1u << (e))))
48 |
49 | LUAI_DATA const char* const luaT_typenames[];
50 | LUAI_DATA const char* const luaT_eventname[];
51 |
52 | LUAI_FUNC const TValue* luaT_gettm(Table* events, TMS event, TString* ename);
53 | LUAI_FUNC const TValue* luaT_gettmbyobj(lua_State* L, const TValue* o, TMS event);
54 |
55 | LUAI_FUNC const TString* luaT_objtypenamestr(lua_State* L, const TValue* o);
56 | LUAI_FUNC const char* luaT_objtypename(lua_State* L, const TValue* o);
57 |
58 | LUAI_FUNC void luaT_init(lua_State* L);
59 |
--------------------------------------------------------------------------------
/Hax/Luau/ParseResult.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Common.h"
5 | #include "Luau/Location.h"
6 | #include "Luau/Lexer.h"
7 | #include "Luau/StringUtils.h"
8 |
9 | namespace Luau
10 | {
11 |
12 | class AstStatBlock;
13 |
14 | class ParseError : public std::exception
15 | {
16 | public:
17 | ParseError(const Location& location, const std::string& message);
18 |
19 | virtual const char* what() const throw();
20 |
21 | const Location& getLocation() const;
22 | const std::string& getMessage() const;
23 |
24 | static LUAU_NORETURN void raise(const Location& location, const char* format, ...) LUAU_PRINTF_ATTR(2, 3);
25 |
26 | private:
27 | Location location;
28 | std::string message;
29 | };
30 |
31 | class ParseErrors : public std::exception
32 | {
33 | public:
34 | ParseErrors(std::vector errors);
35 |
36 | virtual const char* what() const throw();
37 |
38 | const std::vector& getErrors() const;
39 |
40 | private:
41 | std::vector errors;
42 | std::string message;
43 | };
44 |
45 | struct HotComment
46 | {
47 | bool header;
48 | Location location;
49 | std::string content;
50 | };
51 |
52 | struct Comment
53 | {
54 | Lexeme::Type type; // Comment, BlockComment, or BrokenComment
55 | Location location;
56 | };
57 |
58 | struct ParseResult
59 | {
60 | AstStatBlock* root;
61 | std::vector hotcomments;
62 | std::vector errors;
63 |
64 | std::vector commentLocations;
65 | };
66 |
67 | static constexpr const char* kParseNameError = "%error-id%";
68 |
69 | } // namespace Luau
70 |
--------------------------------------------------------------------------------
/Hax/rbxstring.cpp:
--------------------------------------------------------------------------------
1 | #include "rbxstring.h"
2 |
3 | bool constexpr inline is_typable(unsigned char character) {
4 | if (character >= 'a' && character <= 'z') {
5 | return true;
6 | }
7 | if (character >= 'A' && character <= 'Z') {
8 | return true;
9 | }
10 | if (character >= '0' && character <= '9') {
11 | return true;
12 | }
13 | if (character == ' ' || character == '_') {
14 | return true;
15 | }
16 | return false;
17 | }
18 | bool constexpr inline uint_is_typable(UINT uint_address) {
19 | bool typable = true;
20 | for (UINT8 i = 0; i < 4; i++) {
21 | UCHAR byte = *reinterpret_cast(uint_address + i);
22 | if (!is_typable(byte)) {
23 | if (typable && byte == 0x00) {
24 | return true;
25 | }
26 | typable = false;
27 | }
28 | }
29 | /*if (!typable) {
30 | volatile UINT value_at_ptr = 0;
31 | printf("Testing...");
32 | if (*reinterpret_cast(uint_address) != NULL) {
33 | value_at_ptr = ***reinterpret_cast(uint_address);
34 | printf("%X is a ptr to a valid ptr pointing to %X\n", uint_address, value_at_ptr);
35 | return false;
36 | } else {
37 | printf("%X is a ptr to an invalid ptr\n", uint_address);
38 | return true;
39 | }
40 | }*/
41 | return typable;
42 | }
43 |
44 | std::string rbx_string_to_string(rbx_string rbx) {
45 | UINT address = reinterpret_cast(&rbx);
46 | if (uint_is_typable(address)) {
47 | // string
48 | return rbx.contents;
49 | }
50 | else {
51 | if (uint_is_typable(reinterpret_cast(&((*reinterpret_cast(address))->contents)))) {
52 | // &string
53 | return std::string((*reinterpret_cast(address))->contents);
54 | }
55 | else {
56 | // &&string
57 | return std::string((**reinterpret_cast(address))->contents);
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/Hax/Luau/ltable.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 |
7 | #define gnode(t, i) (&(t)->node[i])
8 | #define gkey(n) (&(n)->key)
9 | #define gval(n) (&(n)->val)
10 | #define gnext(n) ((n)->key.next)
11 |
12 | #define gval2slot(t, v) int(cast_to(LuaNode*, static_cast(v)) - t->node)
13 |
14 | // reset cache of absent metamethods, cache is updated in luaT_gettm
15 | #define invalidateTMcache(t) t->tmcache = 0
16 |
17 | LUAI_FUNC const TValue* luaH_getnum(Table* t, int key);
18 | LUAI_FUNC TValue* luaH_setnum(lua_State* L, Table* t, int key);
19 | LUAI_FUNC const TValue* luaH_getstr(Table* t, TString* key);
20 | LUAI_FUNC TValue* luaH_setstr(lua_State* L, Table* t, TString* key);
21 | LUAI_FUNC const TValue* luaH_get(Table* t, const TValue* key);
22 | LUAI_FUNC TValue* luaH_set(lua_State* L, Table* t, const TValue* key);
23 | LUAI_FUNC TValue* luaH_newkey(lua_State* L, Table* t, const TValue* key);
24 | LUAI_FUNC Table* luaH_new(lua_State* L, int narray, int lnhash);
25 | LUAI_FUNC void luaH_resizearray(lua_State* L, Table* t, int nasize);
26 | LUAI_FUNC void luaH_resizehash(lua_State* L, Table* t, int nhsize);
27 | LUAI_FUNC void luaH_free(lua_State* L, Table* t, struct lua_Page* page);
28 | LUAI_FUNC int luaH_next(lua_State* L, Table* t, StkId key);
29 | LUAI_FUNC int luaH_getn(Table* t);
30 | LUAI_FUNC Table* luaH_clone(lua_State* L, Table* tt);
31 | LUAI_FUNC void luaH_clear(Table* tt);
32 |
33 | #define luaH_setslot(L, t, slot, key) (invalidateTMcache(t), (slot == luaO_nilobject ? luaH_newkey(L, t, key) : cast_to(TValue*, slot)))
34 |
35 | extern const LuaNode luaH_dummynode;
36 |
--------------------------------------------------------------------------------
/Hax/Luau/lvm.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 | #include "ltm.h"
7 |
8 | #define tostring(L, o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
9 |
10 | #define tonumber(o, n) (ttype(o) == LUA_TNUMBER || (((o) = luaV_tonumber(o, n)) != NULL))
11 |
12 | #define equalobj(L, o1, o2) (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
13 |
14 | LUAI_FUNC int luaV_strcmp(const TString* ls, const TString* rs);
15 | LUAI_FUNC int luaV_lessthan(lua_State* L, const TValue* l, const TValue* r);
16 | LUAI_FUNC int luaV_lessequal(lua_State* L, const TValue* l, const TValue* r);
17 | LUAI_FUNC int luaV_equalval(lua_State* L, const TValue* t1, const TValue* t2);
18 | LUAI_FUNC void luaV_doarith(lua_State* L, StkId ra, const TValue* rb, const TValue* rc, TMS op);
19 | LUAI_FUNC void luaV_dolen(lua_State* L, StkId ra, const TValue* rb);
20 | LUAI_FUNC const TValue* luaV_tonumber(const TValue* obj, TValue* n);
21 | LUAI_FUNC const float* luaV_tovector(const TValue* obj);
22 | LUAI_FUNC int luaV_tostring(lua_State* L, StkId obj);
23 | LUAI_FUNC void luaV_gettable(lua_State* L, const TValue* t, TValue* key, StkId val);
24 | LUAI_FUNC void luaV_settable(lua_State* L, const TValue* t, TValue* key, StkId val);
25 | LUAI_FUNC void luaV_concat(lua_State* L, int total, int last);
26 | LUAI_FUNC void luaV_getimport(lua_State* L, Table* env, TValue* k, uint32_t id, bool propagatenil);
27 |
28 | LUAI_FUNC void luau_execute(lua_State* L);
29 | LUAI_FUNC int luau_precall(lua_State* L, struct lua_TValue* func, int nresults);
30 | LUAI_FUNC void luau_poscall(lua_State* L, StkId first);
31 | LUAI_FUNC void luau_callhook(lua_State* L, lua_Hook hook, void* userdata);
32 |
--------------------------------------------------------------------------------
/Hax/Luau/lmem.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lua.h"
6 |
7 | struct lua_Page;
8 | union GCObject;
9 |
10 | #define luaM_newgco(L, t, size, memcat) cast_to(t*, luaM_newgco_(L, size, memcat))
11 | #define luaM_freegco(L, p, size, memcat, page) luaM_freegco_(L, obj2gco(p), size, memcat, page)
12 |
13 | #define luaM_arraysize_(L, n, e) ((cast_to(size_t, (n)) <= SIZE_MAX / (e)) ? (n) * (e) : (luaM_toobig(L), SIZE_MAX))
14 |
15 | #define luaM_newarray(L, n, t, memcat) cast_to(t*, luaM_new_(L, luaM_arraysize_(L, n, sizeof(t)), memcat))
16 | #define luaM_freearray(L, b, n, t, memcat) luaM_free_(L, (b), (n) * sizeof(t), memcat)
17 | #define luaM_reallocarray(L, v, oldn, n, t, memcat) \
18 | ((v) = cast_to(t*, luaM_realloc_(L, v, (oldn) * sizeof(t), luaM_arraysize_(L, n, sizeof(t)), memcat)))
19 |
20 | LUAI_FUNC void* luaM_new_(lua_State* L, size_t nsize, uint8_t memcat);
21 | LUAI_FUNC GCObject* luaM_newgco_(lua_State* L, size_t nsize, uint8_t memcat);
22 | LUAI_FUNC void luaM_free_(lua_State* L, void* block, size_t osize, uint8_t memcat);
23 | LUAI_FUNC void luaM_freegco_(lua_State* L, GCObject* block, size_t osize, uint8_t memcat, lua_Page* page);
24 | LUAI_FUNC void* luaM_realloc_(lua_State* L, void* block, size_t osize, size_t nsize, uint8_t memcat);
25 |
26 | LUAI_FUNC l_noret luaM_toobig(lua_State* L);
27 |
28 | LUAI_FUNC void luaM_getpagewalkinfo(lua_Page* page, char** start, char** end, int* busyBlocks, int* blockSize);
29 | LUAI_FUNC lua_Page* luaM_getnextgcopage(lua_Page* page);
30 |
31 | LUAI_FUNC void luaM_visitpage(lua_Page* page, void* context, bool (*visitor)(void* context, lua_Page* page, GCObject* gco));
32 | LUAI_FUNC void luaM_visitgco(lua_State* L, void* context, bool (*visitor)(void* context, lua_Page* page, GCObject* gco));
33 |
--------------------------------------------------------------------------------
/Hax/encryption.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include "xorstr.h"
7 |
8 | #define LUAVM_SHUFFLE_COMMA ,
9 |
10 | #define LUAVM_SHUFFLE2(sep,a0,a1) a0 sep a1
11 | #define LUAVM_SHUFFLE3(sep,a0,a1,a2) a2 sep a1 sep a0
12 | #define LUAVM_SHUFFLE4(sep,a0,a1,a2,a3) a2 sep a1 sep a3 sep a0
13 | #define LUAVM_SHUFFLE5(sep,a0,a1,a2,a3,a4) a0 sep a1 sep a2 sep a3 sep a4
14 | #define LUAVM_SHUFFLE6(sep,a0,a1,a2,a3,a4,a5) a0 sep a1 sep a2 sep a3 sep a4 sep a5
15 | #define LUAVM_SHUFFLE7(sep,a0,a1,a2,a3,a4,a5,a6) a0 sep a1 sep a2 sep a3 sep a4 sep a5 sep a6
16 | #define LUAVM_SHUFFLE8(sep,a0,a1,a2,a3,a4,a5,a6,a7) a0 sep a1 sep a2 sep a3 sep a4 sep a5 sep a6 sep a7
17 | #define LUAVM_SHUFFLE9(sep,a0,a1,a2,a3,a4,a5,a6,a7,a8) a0 sep a1 sep a2 sep a3 sep a4 sep a5 sep a6 sep a7 sep a8
18 |
19 | typedef enum {
20 | ptrenc_none,
21 | ptrenc_add,
22 | ptrenc_xor,
23 | } encryption;
24 |
25 | UINT get_encrypted_ptr(encryption enc, UINT address_of_ptr);
26 | void set_encrypted_ptr(encryption enc, UINT address_of_ptr, UINT value);
27 |
28 | template
29 | class ptr_encryption_add {
30 | public:
31 | operator const T() const {
32 | return (T)((uintptr_t)storage + reinterpret_cast(this));
33 | }
34 | void operator=(const T& value) {
35 | storage = (T)((uintptr_t)value - reinterpret_cast(this));
36 | }
37 | const T operator->() const {
38 | return operator const T();
39 | }
40 | private:
41 | T storage;
42 | };
43 |
44 | template class ptr_encryption_xor {
45 | public:
46 | operator const T() const {
47 | return (T)((uintptr_t)storage ^ reinterpret_cast(this));
48 | }
49 | void operator=(const T& value) {
50 | storage = (T)((uintptr_t)value ^ reinterpret_cast(this));
51 | }
52 | const T operator->() const {
53 | return operator const T();
54 | }
55 | private:
56 | T storage;
57 | };
--------------------------------------------------------------------------------
/Hax/Luau/lnumutils.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include
6 |
7 | #define luai_numadd(a, b) ((a) + (b))
8 | #define luai_numsub(a, b) ((a) - (b))
9 | #define luai_nummul(a, b) ((a) * (b))
10 | #define luai_numdiv(a, b) ((a) / (b))
11 | #define luai_numpow(a, b) (pow(a, b))
12 | #define luai_numunm(a) (-(a))
13 | #define luai_numisnan(a) ((a) != (a))
14 | #define luai_numeq(a, b) ((a) == (b))
15 | #define luai_numlt(a, b) ((a) < (b))
16 | #define luai_numle(a, b) ((a) <= (b))
17 |
18 | inline bool luai_veceq(const float* a, const float* b)
19 | {
20 | #if LUA_VECTOR_SIZE == 4
21 | return a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3];
22 | #else
23 | return a[0] == b[0] && a[1] == b[1] && a[2] == b[2];
24 | #endif
25 | }
26 |
27 | inline bool luai_vecisnan(const float* a)
28 | {
29 | #if LUA_VECTOR_SIZE == 4
30 | return a[0] != a[0] || a[1] != a[1] || a[2] != a[2] || a[3] != a[3];
31 | #else
32 | return a[0] != a[0] || a[1] != a[1] || a[2] != a[2];
33 | #endif
34 | }
35 |
36 | LUAU_FASTMATH_BEGIN
37 | inline double luai_nummod(double a, double b)
38 | {
39 | return a - floor(a / b) * b;
40 | }
41 | LUAU_FASTMATH_END
42 |
43 | #define luai_num2int(i, d) ((i) = (int)(d))
44 |
45 | // On MSVC in 32-bit, double to unsigned cast compiles into a call to __dtoui3, so we invoke x87->int64 conversion path manually
46 | #if defined(_MSC_VER) && defined(_M_IX86)
47 | #define luai_num2unsigned(i, n) \
48 | { \
49 | __int64 l; \
50 | __asm { __asm fld n __asm fistp l} \
51 | ; \
52 | i = (unsigned int)l; \
53 | }
54 | #else
55 | #define luai_num2unsigned(i, n) ((i) = (unsigned)(long long)(n))
56 | #endif
57 |
58 | #define LUAI_MAXNUM2STR 48
59 |
60 | LUAI_FUNC char* luai_num2str(char* buf, double n);
61 |
62 | #define luai_str2num(s, p) strtod((s), (p))
63 |
--------------------------------------------------------------------------------
/Hax/AUMB_utils/utils.hpp:
--------------------------------------------------------------------------------
1 | // most of these functions are unused and not made by me
2 |
3 | #pragma once
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #include "../xorstr.h"
12 |
13 | #pragma comment( lib, "DbgHelp.lib" )
14 |
15 | namespace utils
16 | {
17 | struct segment
18 | {
19 | std::string_view name;
20 | std::uintptr_t start_addr = 0;
21 | std::uintptr_t end_addr = 0;
22 | std::size_t size = 0;
23 |
24 | segment(std::string_view name_s, HMODULE mod = GetModuleHandle(nullptr)) : name{ name_s }
25 | {
26 | const auto nt = ImageNtHeader(mod);
27 | auto section = reinterpret_cast(nt + 1);
28 |
29 | for (auto iteration = 0u; iteration < nt->FileHeader.NumberOfSections; ++iteration, ++section)
30 | {
31 | const auto segment_name = reinterpret_cast(section->Name);
32 |
33 | if (name == segment_name)
34 | {
35 | start_addr = reinterpret_cast(mod) + section->VirtualAddress;
36 | size = section->Misc.VirtualSize;
37 | end_addr = start_addr + size;
38 |
39 | break;
40 | }
41 | }
42 | }
43 | };
44 |
45 | extern std::uintptr_t text_clone, vmp0_clone, base;
46 | extern utils::segment text_seg, vmp0_seg;
47 |
48 | void unhook_free_console();
49 | void hook_free_console();
50 | std::uintptr_t calculate_function_size(std::uintptr_t address);
51 | std::uintptr_t tramp_hook(std::uintptr_t func, std::uintptr_t new_func, std::size_t inst_size);
52 | std::vector pattern_scan(const std::string_view& pattern, const std::string_view& mask);
53 | std::uintptr_t clone_section(std::uintptr_t section_start);
54 | std::uintptr_t get_prologue(std::uintptr_t function_address);
55 | __declspec(noinline) std::uintptr_t __stdcall spoof(std::uintptr_t address);
56 | bool is_prologue(std::uintptr_t address);
57 | }
--------------------------------------------------------------------------------
/Hax/Luau/ldo.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lobject.h"
6 | #include "lstate.h"
7 | #include "luaconf.h"
8 | #include "ldebug.h"
9 |
10 | #define luaD_checkstack(L, n) \
11 | if ((char*)L->stack_last - (char*)L->top <= (n) * (int)sizeof(TValue)) \
12 | luaD_growstack(L, n); \
13 | else \
14 | condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK));
15 |
16 | #define incr_top(L) \
17 | { \
18 | luaD_checkstack(L, 1); \
19 | L->top++; \
20 | }
21 |
22 | #define savestack(L, p) ((char*)(p) - (char*)L->stack)
23 | #define restorestack(L, n) ((TValue*)((char*)L->stack + (n)))
24 |
25 | #define expandstacklimit(L, p) \
26 | { \
27 | LUAU_ASSERT((p) <= (L)->stack_last); \
28 | if ((L)->ci->top < (p)) \
29 | (L)->ci->top = (p); \
30 | }
31 |
32 | #define incr_ci(L) ((L->ci == L->end_ci) ? luaD_growCI(L) : (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci))
33 |
34 | #define saveci(L, p) ((char*)(p) - (char*)L->base_ci)
35 | #define restoreci(L, n) ((CallInfo*)((char*)L->base_ci + (n)))
36 |
37 | // results from luaD_precall
38 | #define PCRLUA 0 // initiated a call to a Lua function
39 | #define PCRC 1 // did a call to a C function
40 | #define PCRYIELD 2 // C function yielded
41 |
42 | // type of protected functions, to be ran by `runprotected'
43 | typedef void (*Pfunc)(lua_State* L, void* ud);
44 |
45 | LUAI_FUNC CallInfo* luaD_growCI(lua_State* L);
46 |
47 | LUAI_FUNC void luaD_call(lua_State* L, StkId func, int nResults);
48 | LUAI_FUNC int luaD_pcall(lua_State* L, Pfunc func, void* u, ptrdiff_t oldtop, ptrdiff_t ef);
49 | LUAI_FUNC void luaD_reallocCI(lua_State* L, int newsize);
50 | LUAI_FUNC void luaD_reallocstack(lua_State* L, int newsize);
51 | LUAI_FUNC void luaD_growstack(lua_State* L, int n);
52 | LUAI_FUNC void luaD_checkCstack(lua_State* L);
53 |
54 | LUAI_FUNC l_noret luaD_throw(lua_State* L, int errcode);
55 | LUAI_FUNC int luaD_rawrunprotected(lua_State* L, Pfunc f, void* ud);
56 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/InsecureKeysystem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Net.Http;
7 | using System.IO;
8 | using System.Security.Policy;
9 | using System.Net;
10 |
11 | namespace TaaprWare2_UI
12 | {
13 | internal class InsecureKeysystem
14 | {
15 | private static readonly string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TaaprWare2");
16 | private static readonly string FilePath = Path.Combine(AppDataPath, "key");
17 | public WebClient Client
18 | => new WebClient { Headers = new WebHeaderCollection { { HttpRequestHeader.ContentType, "application/json" } } };
19 |
20 | private static void CheckKeyStorage()
21 | {
22 | if (!Directory.Exists(AppDataPath))
23 | {
24 | Console.WriteLine("AppData folder not found!");
25 | Directory.CreateDirectory(AppDataPath);
26 | Console.WriteLine("Created AppData folder");
27 | }
28 | if (!File.Exists(FilePath))
29 | {
30 | Console.WriteLine("Key storage not found!");
31 | using (FileStream stream = File.Create(FilePath))
32 | {
33 | stream.WriteByte(0x50);
34 | }
35 | Console.WriteLine("Created key storage");
36 | }
37 | }
38 |
39 | public static void SetKeyStorage(string str)
40 | {
41 | CheckKeyStorage();
42 | File.WriteAllText(FilePath, str);
43 | }
44 |
45 | public static string GetKeyStorage()
46 | {
47 | CheckKeyStorage();
48 | try
49 | {
50 | return File.ReadAllText(FilePath);
51 | }
52 | catch
53 | {
54 | return "";
55 | }
56 | }
57 | public static bool IsKeyValid(string key)
58 | {
59 | CheckKeyStorage();
60 | try
61 | {
62 | InsecureKeysystem ik = new InsecureKeysystem();
63 | string response = ik.Client.DownloadString("https://1.kelprepl.repl.co/verify/taaprware?verify_key=" + key);
64 | ik.Client.Dispose();
65 | return !response.Contains(" ");
66 | }
67 | catch
68 | {
69 | return false;
70 | }
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/TaaprWare2-UI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("TaaprWare2-UI")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("TaaprWare2-UI")]
15 | [assembly: AssemblyCopyright("Copyright © 2022")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | NEW WORKING VERSION: https://github.com/plusgiant5/TaaprWareV3
2 |
3 | # TaaprWare V2
4 |
5 | WARNING: This code is very bad and I don't know if it still works anymore. Future exploits by me will be nothing like this. It's not updated, but it's possible to update (even following the recent compression changes).
6 |
7 | This is an open source Roblox executor with a custom DLL made in C++, and a UI made in C#.
8 | It features level 8 execution (or whatever level you want), custom functions, metamethod hooking (breaks corescripts), multi Roblox injection, an autoexec folder, and a workspace folder.
9 |
10 | It's not very secure though. With the init script, it's easily detectable because of the insecure hook that doesn't use newcclosure, but on the C++ side it's immune to simple detection methods that I though of while writing it. It doesn't trigger any 268/unexpected client behavior kicks, at least not at the time I'm writing this.
11 |
12 | Discord (better exploits soon): https://discord.gg/kj9cN9MfR4 (NEW)
13 |
14 | # How to build
15 |
16 | DLL: Set to Release x86 and turn off precompiled headers
17 |
18 | UI: Add reference to the AvalonEdit dll in the Release folder
19 |
20 | # HttpGet/GetObjects hook
21 |
22 | Because of the way custom functions work, hooking metamethods causes a bunch of errors in the output which is annoying. If you want game:HttpGet and game:GetObjects capabilities and can handle the error spam, uncomment line 1380 in InitScript.lua.
23 |
24 | # About
25 |
26 | This entire exploit started as testing grounds for me to learn more, and it definitely helped me learn. It helped me get from C++ hello world programs to real Luau function recreation for Roblox and finding offsets, so expect it to be messy.
27 | It heavily relies on the Lua init script to function properly, and it uses RuntimeScriptService::RunScript to execute. This execution method was annoying to work with as there is no lua state involved. I had to hook a terrain function and have the Lua code call that function with arguments that tell the C++ code what to do with the lua state. It was a good learning experience, but I will not be using this execution method again.
28 |
29 | With a few edits, you can get execution working with only these addresses and no offets: rbx_getscheduler, rbx_addscript, rbx_runscript, rbx_deserializer_detour and rbx_deserializer_detour2
30 | Or, for the bare minimum (localscript level, no custom bytecode) rbx_getscheduler and rbx_runscript.
31 |
32 | The framework of custom functions was also done with very few addresses, needing only rbx_writevoxels, rL->top, and rL->base.
33 |
34 | This exploit is good for beginners who want to experiment with custom functions without finding every offset in existence.
35 |
36 | If you need help with addresses or offsets, join the Discord and I will help you.
37 |
--------------------------------------------------------------------------------
/Hax/Luau/Compiler.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/ParseOptions.h"
5 | #include "Luau/Location.h"
6 | #include "Luau/StringUtils.h"
7 | #include "Luau/Common.h"
8 |
9 | namespace Luau
10 | {
11 | class AstNameTable;
12 | struct ParseResult;
13 | class BytecodeBuilder;
14 | class BytecodeEncoder;
15 |
16 | // Note: this structure is duplicated in luacode.h, don't forget to change these in sync!
17 | struct CompileOptions
18 | {
19 | // 0 - no optimization
20 | // 1 - baseline optimization level that doesn't prevent debuggability
21 | // 2 - includes optimizations that harm debuggability such as inlining
22 | int optimizationLevel = 1;
23 |
24 | // 0 - no debugging support
25 | // 1 - line info & function names only; sufficient for backtraces
26 | // 2 - full debug info with local & upvalue names; necessary for debugger
27 | int debugLevel = 1;
28 |
29 | // 0 - no code coverage support
30 | // 1 - statement coverage
31 | // 2 - statement and expression coverage (verbose)
32 | int coverageLevel = 0;
33 |
34 | // global builtin to construct vectors; disabled by default
35 | const char* vectorLib = nullptr;
36 | const char* vectorCtor = nullptr;
37 |
38 | // null-terminated array of globals that are mutable; disables the import optimization for fields accessed through these
39 | const char** mutableGlobals = nullptr;
40 | };
41 |
42 | class CompileError : public std::exception
43 | {
44 | public:
45 | CompileError(const Location& location, const std::string& message);
46 |
47 | virtual ~CompileError() throw();
48 |
49 | virtual const char* what() const throw();
50 |
51 | const Location& getLocation() const;
52 |
53 | static LUAU_NORETURN void raise(const Location& location, const char* format, ...) LUAU_PRINTF_ATTR(2, 3);
54 |
55 | private:
56 | Location location;
57 | std::string message;
58 | };
59 |
60 | // compiles bytecode into bytecode builder using either a pre-parsed AST or parsing it from source; throws on errors
61 | void compileOrThrow(BytecodeBuilder& bytecode, const ParseResult& parseResult, const AstNameTable& names, const CompileOptions& options = {});
62 | void compileOrThrow(BytecodeBuilder& bytecode, const std::string& source, const CompileOptions& options = {}, const ParseOptions& parseOptions = {});
63 |
64 | // compiles bytecode into a bytecode blob, that either contains the valid bytecode or an encoded error that luau_load can decode
65 | std::string compile(
66 | const std::string& source, const CompileOptions& options = {}, const ParseOptions& parseOptions = {}, BytecodeEncoder* encoder = nullptr);
67 |
68 | } // namespace Luau
69 |
--------------------------------------------------------------------------------
/Hax/Luau/Location.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include
5 |
6 | namespace Luau
7 | {
8 |
9 | struct Position
10 | {
11 | unsigned int line, column;
12 |
13 | Position(unsigned int line, unsigned int column)
14 | : line(line)
15 | , column(column)
16 | {
17 | }
18 |
19 | bool operator==(const Position& rhs) const
20 | {
21 | return this->column == rhs.column && this->line == rhs.line;
22 | }
23 | bool operator!=(const Position& rhs) const
24 | {
25 | return !(*this == rhs);
26 | }
27 |
28 | bool operator<(const Position& rhs) const
29 | {
30 | if (line == rhs.line)
31 | return column < rhs.column;
32 | else
33 | return line < rhs.line;
34 | }
35 |
36 | bool operator>(const Position& rhs) const
37 | {
38 | if (line == rhs.line)
39 | return column > rhs.column;
40 | else
41 | return line > rhs.line;
42 | }
43 |
44 | bool operator<=(const Position& rhs) const
45 | {
46 | return *this == rhs || *this < rhs;
47 | }
48 |
49 | bool operator>=(const Position& rhs) const
50 | {
51 | return *this == rhs || *this > rhs;
52 | }
53 | };
54 |
55 | struct Location
56 | {
57 | Position begin, end;
58 |
59 | Location()
60 | : begin(0, 0)
61 | , end(0, 0)
62 | {
63 | }
64 |
65 | Location(const Position& begin, const Position& end)
66 | : begin(begin)
67 | , end(end)
68 | {
69 | }
70 |
71 | Location(const Position& begin, unsigned int length)
72 | : begin(begin)
73 | , end(begin.line, begin.column + length)
74 | {
75 | }
76 |
77 | Location(const Location& begin, const Location& end)
78 | : begin(begin.begin)
79 | , end(end.end)
80 | {
81 | }
82 |
83 | bool operator==(const Location& rhs) const
84 | {
85 | return this->begin == rhs.begin && this->end == rhs.end;
86 | }
87 | bool operator!=(const Location& rhs) const
88 | {
89 | return !(*this == rhs);
90 | }
91 |
92 | bool encloses(const Location& l) const
93 | {
94 | return begin <= l.begin && end >= l.end;
95 | }
96 | bool contains(const Position& p) const
97 | {
98 | return begin <= p && p < end;
99 | }
100 | bool containsClosed(const Position& p) const
101 | {
102 | return begin <= p && p <= end;
103 | }
104 | };
105 |
106 | std::string toString(const Position& position);
107 | std::string toString(const Location& location);
108 |
109 | } // namespace Luau
110 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TaaprWare2_UI.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TaaprWare2_UI.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/TaaprWare2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.4.33122.133
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TaaprWare2", "Hax\Hax.vcxproj", "{E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaaprWare2-UI", "TaaprWare2-UI\TaaprWare2-UI.csproj", "{7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|x64 = Debug|x64
14 | Debug|x86 = Debug|x86
15 | Release|Any CPU = Release|Any CPU
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Debug|Any CPU.ActiveCfg = Debug|x64
21 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Debug|Any CPU.Build.0 = Debug|x64
22 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Debug|x64.ActiveCfg = Debug|x64
23 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Debug|x64.Build.0 = Debug|x64
24 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Debug|x86.ActiveCfg = Debug|Win32
25 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Debug|x86.Build.0 = Debug|Win32
26 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Release|Any CPU.ActiveCfg = Release|x64
27 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Release|Any CPU.Build.0 = Release|x64
28 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Release|x64.ActiveCfg = Release|x64
29 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Release|x64.Build.0 = Release|x64
30 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Release|x86.ActiveCfg = Release|Win32
31 | {E6DE0105-06E7-43C4-A9A8-80FB888D6ECC}.Release|x86.Build.0 = Release|Win32
32 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Debug|x64.ActiveCfg = Debug|Any CPU
35 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Debug|x64.Build.0 = Debug|Any CPU
36 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Debug|x86.ActiveCfg = Debug|Any CPU
37 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Debug|x86.Build.0 = Debug|Any CPU
38 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Release|x64.ActiveCfg = Release|Any CPU
41 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Release|x64.Build.0 = Release|Any CPU
42 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Release|x86.ActiveCfg = Release|Any CPU
43 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}.Release|x86.Build.0 = Release|Any CPU
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | GlobalSection(ExtensibilityGlobals) = postSolution
49 | SolutionGuid = {702C840B-70CC-433B-99F4-6EA33558ED6F}
50 | EndGlobalSection
51 | EndGlobal
52 |
--------------------------------------------------------------------------------
/Hax/Luau/Common.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | // Compiler codegen control macros
5 | #ifdef _MSC_VER
6 | #define LUAU_NORETURN __declspec(noreturn)
7 | #define LUAU_NOINLINE __declspec(noinline)
8 | #define LUAU_FORCEINLINE __forceinline
9 | #define LUAU_LIKELY(x) x
10 | #define LUAU_UNLIKELY(x) x
11 | #define LUAU_UNREACHABLE() __assume(false)
12 | #define LUAU_DEBUGBREAK() __debugbreak()
13 | #else
14 | #define LUAU_NORETURN __attribute__((__noreturn__))
15 | #define LUAU_NOINLINE __attribute__((noinline))
16 | #define LUAU_FORCEINLINE inline __attribute__((always_inline))
17 | #define LUAU_LIKELY(x) __builtin_expect(x, 1)
18 | #define LUAU_UNLIKELY(x) __builtin_expect(x, 0)
19 | #define LUAU_UNREACHABLE() __builtin_unreachable()
20 | #define LUAU_DEBUGBREAK() __builtin_trap()
21 | #endif
22 |
23 | namespace Luau
24 | {
25 |
26 | using AssertHandler = int (*)(const char* expression, const char* file, int line, const char* function);
27 |
28 | inline AssertHandler& assertHandler()
29 | {
30 | static AssertHandler handler = nullptr;
31 | return handler;
32 | }
33 |
34 | inline int assertCallHandler(const char* expression, const char* file, int line, const char* function)
35 | {
36 | if (AssertHandler handler = assertHandler())
37 | return handler(expression, file, line, function);
38 |
39 | return 1;
40 | }
41 |
42 | } // namespace Luau
43 |
44 | #if !defined(NDEBUG) || defined(LUAU_ENABLE_ASSERT)
45 | #define LUAU_ASSERT(expr) ((void)(!!(expr) || (Luau::assertCallHandler(#expr, __FILE__, __LINE__, __FUNCTION__) && (LUAU_DEBUGBREAK(), 0))))
46 | #define LUAU_ASSERTENABLED
47 | #else
48 | #define LUAU_ASSERT(expr) (void)sizeof(!!(expr))
49 | #endif
50 |
51 | namespace Luau
52 | {
53 |
54 | template
55 | struct FValue
56 | {
57 | static FValue* list;
58 |
59 | T value;
60 | bool dynamic;
61 | const char* name;
62 | FValue* next;
63 |
64 | FValue(const char* name, T def, bool dynamic)
65 | : value(def)
66 | , dynamic(dynamic)
67 | , name(name)
68 | , next(list)
69 | {
70 | list = this;
71 | }
72 |
73 | operator T() const
74 | {
75 | return value;
76 | }
77 | };
78 |
79 | template
80 | FValue* FValue::list = nullptr;
81 |
82 | } // namespace Luau
83 |
84 | #define LUAU_FASTFLAG(flag) \
85 | namespace FFlag \
86 | { \
87 | extern Luau::FValue flag; \
88 | }
89 | #define LUAU_FASTFLAGVARIABLE(flag, def) \
90 | namespace FFlag \
91 | { \
92 | Luau::FValue flag(#flag, def, false); \
93 | }
94 | #define LUAU_FASTINT(flag) \
95 | namespace FInt \
96 | { \
97 | extern Luau::FValue flag; \
98 | }
99 | #define LUAU_FASTINTVARIABLE(flag, def) \
100 | namespace FInt \
101 | { \
102 | Luau::FValue flag(#flag, def, false); \
103 | }
104 |
105 | #define LUAU_DYNAMIC_FASTFLAG(flag) \
106 | namespace DFFlag \
107 | { \
108 | extern Luau::FValue flag; \
109 | }
110 | #define LUAU_DYNAMIC_FASTFLAGVARIABLE(flag, def) \
111 | namespace DFFlag \
112 | { \
113 | Luau::FValue flag(#flag, def, true); \
114 | }
115 | #define LUAU_DYNAMIC_FASTINT(flag) \
116 | namespace DFInt \
117 | { \
118 | extern Luau::FValue flag; \
119 | }
120 | #define LUAU_DYNAMIC_FASTINTVARIABLE(flag, def) \
121 | namespace DFInt \
122 | { \
123 | Luau::FValue flag(#flag, def, true); \
124 | }
125 |
--------------------------------------------------------------------------------
/Hax/md5.h:
--------------------------------------------------------------------------------
1 | /* MD5
2 | converted to C++ class by Frank Thilo (thilo@unix-ag.org)
3 | for bzflag (http://www.bzflag.org)
4 |
5 | based on:
6 |
7 | md5.h and md5.c
8 | reference implementation of RFC 1321
9 |
10 | Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
11 | rights reserved.
12 |
13 | License to copy and use this software is granted provided that it
14 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest
15 | Algorithm" in all material mentioning or referencing this software
16 | or this function.
17 |
18 | License is also granted to make and use derivative works provided
19 | that such works are identified as "derived from the RSA Data
20 | Security, Inc. MD5 Message-Digest Algorithm" in all material
21 | mentioning or referencing the derived work.
22 |
23 | RSA Data Security, Inc. makes no representations concerning either
24 | the merchantability of this software or the suitability of this
25 | software for any particular purpose. It is provided "as is"
26 | without express or implied warranty of any kind.
27 |
28 | These notices must be retained in any copies of any part of this
29 | documentation and/or software.
30 |
31 | */
32 |
33 | #ifndef MD5_MD5_H
34 | #define MD5_MD5_H
35 |
36 | #include
37 | #include
38 |
39 |
40 | // a small class for calculating MD5 hashes of strings or byte arrays
41 | // it is not meant to be fast or secure
42 | //
43 | // usage: 1) feed it blocks of uchars with update()
44 | // 2) finalize()
45 | // 3) get hexdigest() string
46 | // or
47 | // MD5(std::string).hexdigest()
48 | //
49 | // assumes that char is 8 bit and int is 32 bit
50 | namespace hash {
51 | class MD5 {
52 | public:
53 | typedef unsigned int size_type; // must be 32bit
54 |
55 | MD5();
56 | MD5(const std::string& text);
57 | void update(const unsigned char *buf, size_type length);
58 | void update(const char *buf, size_type length);
59 | MD5& finalize();
60 | std::string hexdigest() const;
61 | friend std::ostream& operator<<(std::ostream&, MD5 md5);
62 |
63 | private:
64 | void init();
65 | typedef unsigned char uint1; // 8bit
66 | typedef unsigned int uint4; // 32bit
67 | enum {
68 | blocksize = 64
69 | }; // VC6 won't eat a const static int here
70 |
71 | void transform(const uint1 block[blocksize]);
72 | static void decode(uint4 output[], const uint1 input[], size_type len);
73 | static void encode(uint1 output[], const uint4 input[], size_type len);
74 |
75 | bool finalized;
76 | uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk
77 | uint4 count[2]; // 64bit counter for number of bits (lo, hi)
78 | uint4 state[4]; // digest so far
79 | uint1 digest[16]; // the result
80 |
81 | // low level logic operations
82 | static inline uint4 F(uint4 x, uint4 y, uint4 z);
83 | static inline uint4 G(uint4 x, uint4 y, uint4 z);
84 | static inline uint4 H(uint4 x, uint4 y, uint4 z);
85 | static inline uint4 I(uint4 x, uint4 y, uint4 z);
86 | static inline uint4 rotate_left(uint4 x, int n);
87 | static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
88 | static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
89 | static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
90 | static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
91 | };
92 |
93 | std::string md5(const std::string str);
94 |
95 | }
96 | #endif
--------------------------------------------------------------------------------
/Hax/rbxinstance.cpp:
--------------------------------------------------------------------------------
1 | #include "rbxstring.h"
2 | #include "rbxinstance.h"
3 |
4 | namespace instance {
5 | objects::instance* FindFirstChild(objects::instance* parent, std::string target_child_name, bool recursive, std::vector ignore_list) {
6 | std::vector children = *(parent->children);
7 | int child_num = 0;
8 | for (objects::instance* instance : children) {
9 | // child 0: right, child 1: wrong, child 2: right, child 3: wrong, etc
10 | // This is because roblox uses shared_ptr which has an extra pointer to ref_count which isnt an instance
11 | if (++child_num % 2) {
12 | std::string name = *(instance->name);
13 | if (name == target_child_name && (std::find(ignore_list.begin(), ignore_list.end(), instance) == ignore_list.end())) {
14 | return instance;
15 | } else if (recursive) {
16 | objects::instance* child = instance::FindFirstChildOfClass(instance, target_child_name, recursive);
17 | if (child && (std::find(ignore_list.begin(), ignore_list.end(), child) == ignore_list.end())) {
18 | return child;
19 | }
20 | }
21 | }
22 | }
23 | return nullptr;
24 | }
25 | objects::instance* FindFirstChildOfClass(objects::instance* parent, std::string target_class_name, bool recursive, std::vector ignore_list) {
26 | if (!parent->children) {
27 | return nullptr;
28 | }
29 | std::vector children = *(parent->children);
30 | int child_num = 0;
31 | for (objects::instance* instance : children) {
32 | if (++child_num % 2) {
33 | std::string name = *(instance->class_descriptor->class_name);
34 | if (name == target_class_name && (std::find(ignore_list.begin(), ignore_list.end(), instance) == ignore_list.end())) {
35 | return instance;
36 | } else if (recursive) {
37 | objects::instance* child = instance::FindFirstChildOfClass(instance, target_class_name, recursive);
38 | if (child && (std::find(ignore_list.begin(), ignore_list.end(), child) == ignore_list.end())) {
39 | return child;
40 | }
41 | }
42 | }
43 | }
44 | return nullptr;
45 | }
46 | std::vector GetChildren(objects::instance* parent, std::string target_class_name) {
47 | return *(parent->children);
48 | }
49 | std::string GetFullName(objects::instance* inst) {
50 | std::string output = *(inst->name);
51 | while (inst->parent) {
52 | output = std::string(".").append(output.c_str());
53 | output = std::string(inst->name->c_str()).append(output.c_str());
54 | inst = inst->parent;
55 | }
56 | return output;
57 | }
58 | }
59 |
60 | objects::instance* get_datamodel() {
61 | objects::task_scheduler* task_scheduler = functions::rbx_getscheduler();
62 | for (std::shared_ptr job : task_scheduler->jobs) {
63 | std::string name = job->name;
64 | if (name == std::string(XorString("WaitingHybridScriptsJob"))) {
65 | auto current_waiting_hybrid_script_job = reinterpret_cast(job.get());
66 | return current_waiting_hybrid_script_job->script_context->parent;
67 | }
68 | }
69 | return NULL;
70 | };
71 | objects::instance* get_scriptcontext() {
72 | objects::task_scheduler* task_scheduler = functions::rbx_getscheduler();
73 | for (std::shared_ptr job : task_scheduler->jobs) {
74 | std::string name = job->name;
75 | if (name == std::string(XorString("WaitingHybridScriptsJob"))) {
76 | auto current_waiting_hybrid_script_job = reinterpret_cast(job.get());
77 | return current_waiting_hybrid_script_job->script_context;
78 | }
79 | }
80 | return NULL;
81 | };
82 | std::vector> get_jobs() {
83 | objects::task_scheduler* task_scheduler = functions::rbx_getscheduler();
84 | return task_scheduler->jobs;
85 | };
--------------------------------------------------------------------------------
/TaaprWare2-UI/NamedPipes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.IO.Pipes;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading;
8 | using System.Windows;
9 | using TaaprWare2_UI;
10 |
11 | namespace TaaprWare2_UI
12 | {
13 | class NamedPipes
14 | {
15 | public static string luapipename = "TaaprWare2_Pipe";//Axon name of lua pipe
16 |
17 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
18 | [return: MarshalAs(UnmanagedType.Bool)]
19 | private static extern bool WaitNamedPipe(string name, int timeout);
20 | //function to check if the pipe exist
21 | public static bool NamedPipeExist(string pipeName)
22 | {
23 | try
24 | {
25 | if (!WaitNamedPipe($"\\\\.\\pipe\\{pipeName}", 0))
26 | {
27 | int lastWin32Error = Marshal.GetLastWin32Error();
28 | if (lastWin32Error == 0)
29 | {
30 | return false;
31 | }
32 | if (lastWin32Error == 2)
33 | {
34 | return false;
35 | }
36 | }
37 | return true;
38 | }
39 | catch (Exception)
40 | {
41 | return false;
42 | }
43 | }
44 |
45 | //lua pipe function
46 | public static void LuaPipe(StringBuilder script)
47 | {
48 | int UninjectedProcesses = 0;
49 | Process[] _procs = Process.GetProcesses();
50 | for (int i = 0; i < _procs.Length; i++)
51 | {
52 | if (_procs[i].ProcessName == "RobloxPlayerBeta" && _procs[i].PagedMemorySize64 > 0x10000000)
53 | {
54 | if (NamedPipeExist(luapipename + _procs[i].Id.ToString()))
55 | {
56 | try
57 | {
58 | using (NamedPipeClientStream namedPipeClientStream = new NamedPipeClientStream(".", luapipename + _procs[i].Id.ToString(), PipeDirection.Out))
59 | {
60 | namedPipeClientStream.Connect(0);
61 | using (StreamWriter streamWriter = new StreamWriter(namedPipeClientStream, System.Text.Encoding.Default, 999999))//changed buffer to max 1mb since default buffer is 1kb
62 | {
63 | streamWriter.Flush();
64 | streamWriter.Write(script);
65 | }
66 | }
67 | }
68 | catch (IOException)
69 | {
70 | MessageBox.Show("Error occured connecting to the named pipe.", "Connection Failed!", MessageBoxButton.OK, MessageBoxImage.Hand);
71 | }
72 | catch (TimeoutException)
73 | {
74 | MessageBox.Show("Named pipe doesn't exist.", "Connection Failed!", MessageBoxButton.OK, MessageBoxImage.Hand);
75 | }
76 | catch (Exception ex)
77 | {
78 | MessageBox.Show(ex.Message.ToString());
79 | }
80 | }
81 | }
82 | }
83 | if (UninjectedProcesses > 0)
84 | {
85 | MessageBox.Show("Not injected into " + UninjectedProcesses + " process" + (UninjectedProcesses == 1 ? "" : "es") + ". Please inject again so your execution will work on all processes.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
86 | }
87 | }
88 | }
89 | }
--------------------------------------------------------------------------------
/TaaprWare2-UI/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Hax/Luau/luaconf.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | // When debugging complex issues, consider enabling one of these:
6 | // This will reallocate the stack very aggressively at every opportunity; use this with asan to catch stale stack pointers
7 | // #define HARDSTACKTESTS 1
8 | // This will call GC validation very aggressively at every incremental GC step; use this with caution as it's SLOW
9 | // #define HARDMEMTESTS 1
10 | // This will call GC validation very aggressively at every GC opportunity; use this with caution as it's VERY SLOW
11 | // #define HARDMEMTESTS 2
12 |
13 | // To force MSVC2017+ to generate SSE2 code for some stdlib functions we need to locally enable /fp:fast
14 | // Note that /fp:fast changes the semantics of floating point comparisons so this is only safe to do for functions without ones
15 | #if defined(_MSC_VER) && !defined(__clang__)
16 | #define LUAU_FASTMATH_BEGIN __pragma(float_control(precise, off, push))
17 | #define LUAU_FASTMATH_END __pragma(float_control(pop))
18 | #else
19 | #define LUAU_FASTMATH_BEGIN
20 | #define LUAU_FASTMATH_END
21 | #endif
22 |
23 | // Used on functions that have a printf-like interface to validate them statically
24 | #if defined(__GNUC__)
25 | #define LUA_PRINTF_ATTR(fmt, arg) __attribute__((format(printf, fmt, arg)))
26 | #else
27 | #define LUA_PRINTF_ATTR(fmt, arg)
28 | #endif
29 |
30 | #ifdef _MSC_VER
31 | #define LUA_NORETURN __declspec(noreturn)
32 | #else
33 | #define LUA_NORETURN __attribute__((__noreturn__))
34 | #endif
35 |
36 | // Can be used to reconfigure visibility/exports for public APIs
37 | #ifndef LUA_API
38 | #define LUA_API extern
39 | #endif
40 |
41 | #define LUALIB_API LUA_API
42 |
43 | // Can be used to reconfigure visibility for internal APIs
44 | #if defined(__GNUC__)
45 | #define LUAI_FUNC __attribute__((visibility("hidden"))) extern
46 | #define LUAI_DATA LUAI_FUNC
47 | #else
48 | #define LUAI_FUNC extern
49 | #define LUAI_DATA extern
50 | #endif
51 |
52 | // Can be used to reconfigure internal error handling to use longjmp instead of C++ EH
53 | #ifndef LUA_USE_LONGJMP
54 | #define LUA_USE_LONGJMP 0
55 | #endif
56 |
57 | // LUA_IDSIZE gives the maximum size for the description of the source
58 | #ifndef LUA_IDSIZE
59 | #define LUA_IDSIZE 256
60 | #endif
61 |
62 | // LUA_MINSTACK is the guaranteed number of Lua stack slots available to a C function
63 | #ifndef LUA_MINSTACK
64 | #define LUA_MINSTACK 20
65 | #endif
66 |
67 | // LUAI_MAXCSTACK limits the number of Lua stack slots that a C function can use
68 | #ifndef LUAI_MAXCSTACK
69 | #define LUAI_MAXCSTACK 8000
70 | #endif
71 |
72 | // LUAI_MAXCALLS limits the number of nested calls
73 | #ifndef LUAI_MAXCALLS
74 | #define LUAI_MAXCALLS 20000
75 | #endif
76 |
77 | // LUAI_MAXCCALLS is the maximum depth for nested C calls; this limit depends on native stack size
78 | #ifndef LUAI_MAXCCALLS
79 | #define LUAI_MAXCCALLS 200
80 | #endif
81 |
82 | // buffer size used for on-stack string operations; this limit depends on native stack size
83 | #ifndef LUA_BUFFERSIZE
84 | #define LUA_BUFFERSIZE 512
85 | #endif
86 |
87 | // number of valid Lua userdata tags
88 | #ifndef LUA_UTAG_LIMIT
89 | #define LUA_UTAG_LIMIT 128
90 | #endif
91 |
92 | // upper bound for number of size classes used by page allocator
93 | #ifndef LUA_SIZECLASSES
94 | #define LUA_SIZECLASSES 32
95 | #endif
96 |
97 | // available number of separate memory categories
98 | #ifndef LUA_MEMORY_CATEGORIES
99 | #define LUA_MEMORY_CATEGORIES 256
100 | #endif
101 |
102 | // minimum size for the string table (must be power of 2)
103 | #ifndef LUA_MINSTRTABSIZE
104 | #define LUA_MINSTRTABSIZE 32
105 | #endif
106 |
107 | // maximum number of captures supported by pattern matching
108 | #ifndef LUA_MAXCAPTURES
109 | #define LUA_MAXCAPTURES 32
110 | #endif
111 |
112 | // }==================================================================
113 |
114 | /*
115 | @@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
116 | ** CHANGE it if your system requires alignments larger than double. (For
117 | ** instance, if your system supports long doubles and they must be
118 | ** aligned in 16-byte boundaries, then you should add long double in the
119 | ** union.) Probably you do not need to change this.
120 | */
121 | #define LUAI_USER_ALIGNMENT_T \
122 | union \
123 | { \
124 | double u; \
125 | void* s; \
126 | long l; \
127 | }
128 |
129 | #define LUA_VECTOR_SIZE 3 // must be 3 or 4
130 |
131 | #define LUA_EXTRA_SIZE LUA_VECTOR_SIZE - 2
132 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/Functions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading;
8 | using System.Windows;
9 | using TaaprWare2_UI;
10 |
11 | namespace TaaprWare2_UI
12 | {
13 | class Functions
14 | {
15 | [DllImport("kernel32.dll")]
16 | static extern IntPtr GetConsoleWindow();
17 |
18 | [DllImport("user32.dll")]
19 | static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
20 |
21 | const int SW_HIDE = 0;
22 | const int SW_SHOW = 5;
23 | public static string exploitdllname = "./bin/TaaprWare2Internal.dll";
24 | public static void Inject()
25 | {
26 | Console.Clear();
27 | ShowWindow(GetConsoleWindow(), SW_SHOW);
28 | while (true)
29 | {
30 | Console.WriteLine("Checking key...");
31 | if (!InsecureKeysystem.IsKeyValid(InsecureKeysystem.GetKeyStorage()))
32 | {
33 | Console.WriteLine("Invalid key!");
34 | Console.WriteLine("Get a key at https://1.kelprepl.repl.co/getkey/taaprware and enter it below:");
35 | Console.Write(">");
36 | InsecureKeysystem.SetKeyStorage(Console.ReadLine());
37 | continue;
38 | }
39 | break;
40 | }
41 | Console.WriteLine("Key valid! Injecting...");
42 | System.Threading.Thread.Sleep(500);
43 | Console.Clear();
44 | ShowWindow(GetConsoleWindow(), SW_HIDE);
45 | if (NamedPipes.NamedPipeExist(NamedPipes.luapipename))
46 | {
47 | MessageBox.Show("Already injected!", "Error", MessageBoxButton.OK, MessageBoxImage.Asterisk);
48 | return;
49 | }
50 | else
51 | {
52 |
53 | switch (Injector.DllInjector.GetInstance.Inject("Roblox", AppDomain.CurrentDomain.BaseDirectory + exploitdllname))
54 | {
55 | case Injector.DllInjectionResult.DllNotFound:
56 | MessageBox.Show($"Couldn't find {exploitdllname}!", "Dll not found", MessageBoxButton.OK, MessageBoxImage.Error);
57 | return;
58 | case Injector.DllInjectionResult.GameProcessNotFound:
59 | MessageBox.Show("Couldn't find Roblox!", "Target process not found", MessageBoxButton.OK, MessageBoxImage.Error);
60 | return;
61 | case Injector.DllInjectionResult.InjectionFailed:
62 | MessageBox.Show("Injection Failed!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
63 | return;
64 | case Injector.DllInjectionResult.Success:
65 | Process[] _procs = Process.GetProcesses();
66 | for (int i = 0; i < _procs.Length; i++)
67 | {
68 | if (_procs[i].MainWindowTitle == "Roblox")
69 | {
70 | while (!NamedPipes.NamedPipeExist(NamedPipes.luapipename + _procs[i].Id.ToString()))
71 | {
72 | System.Threading.Thread.Sleep(100);
73 | }
74 | }
75 | }
76 | StringBuilder script = new StringBuilder();
77 | DirectoryInfo directory = new DirectoryInfo(".\\autoexec");
78 | foreach (FileInfo file in directory.GetFiles())
79 | {
80 | script.Append("spawn(function()\nlocal success = pcall(function()\n");
81 | script.Append(File.ReadAllText(file.FullName));
82 | script.Append("\nend)\nend)\n");
83 | }
84 | if (script.Length > 0)
85 | {
86 | NamedPipes.LuaPipe(script);
87 | }
88 | return;
89 | }
90 |
91 | }
92 | }
93 |
94 | public static OpenFileDialog openfiledialog = new OpenFileDialog
95 | {
96 | Filter = "Script File|*.txt;*.lua|All files (*.*)|*.*",//add txt,lua and all files filter
97 | FilterIndex = 1,//choose what filter will be the default
98 | RestoreDirectory = true,//restore the last used directory
99 | Title = "Axon Open Script"//OpenFileDialog Tittle
100 | };//Initialize OpenFileDialog
101 | }
102 | }
--------------------------------------------------------------------------------
/TaaprWare2-UI/Injector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading;
7 |
8 | namespace TaaprWare2_UI
9 | {
10 | class Injector
11 | {
12 | public enum DllInjectionResult
13 | {
14 | DllNotFound,
15 | GameProcessNotFound,
16 | InjectionFailed,
17 | Success
18 | }
19 |
20 | public sealed class DllInjector
21 | {
22 | static readonly IntPtr INTPTR_ZERO = (IntPtr)0;
23 |
24 | [DllImport("kernel32.dll", SetLastError = true)]
25 | static extern IntPtr OpenProcess(uint dwDesiredAccess, int bInheritHandle, uint dwProcessId);
26 |
27 | [DllImport("kernel32.dll", SetLastError = true)]
28 | static extern int CloseHandle(IntPtr hObject);
29 |
30 | [DllImport("kernel32.dll", SetLastError = true)]
31 | static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
32 |
33 | [DllImport("kernel32.dll", SetLastError = true)]
34 | static extern IntPtr GetModuleHandle(string lpModuleName);
35 |
36 | [DllImport("kernel32.dll", SetLastError = true)]
37 | static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, IntPtr dwSize, uint flAllocationType, uint flProtect);
38 |
39 | [DllImport("kernel32.dll", SetLastError = true)]
40 | static extern int WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] buffer, uint size, int lpNumberOfBytesWritten);
41 |
42 | [DllImport("kernel32.dll", SetLastError = true)]
43 | static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr lpThreadAttribute, IntPtr dwStackSize, IntPtr lpStartAddress,
44 | IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
45 |
46 | static DllInjector _instance;
47 |
48 | public static DllInjector GetInstance
49 | {
50 | get
51 | {
52 | if (_instance == null)
53 | {
54 | _instance = new DllInjector();
55 | }
56 | return _instance;
57 | }
58 | }
59 |
60 | DllInjector() { }
61 |
62 | public DllInjectionResult Inject(string sProcName, string sDllPath)
63 | {
64 | if (!File.Exists(sDllPath))
65 | {
66 | return DllInjectionResult.DllNotFound;
67 | }
68 |
69 | bool FoundProcess = false;
70 | int FailCount = 0;
71 | Process[] _procs = Process.GetProcesses();
72 | for (int i = 0; i < _procs.Length; i++)
73 | {
74 | if (_procs[i].MainWindowTitle == sProcName)
75 | {
76 | FoundProcess = true;
77 | if (!BInject((uint)_procs[i].Id, sDllPath))
78 | {
79 | FailCount++;
80 | }
81 | System.Threading.Thread.Sleep(100);
82 | }
83 | }
84 | if (!FoundProcess)
85 | {
86 | return DllInjectionResult.GameProcessNotFound;
87 | }
88 | if (FailCount > 0)
89 | {
90 | return DllInjectionResult.InjectionFailed;
91 | }
92 | else
93 | {
94 | return DllInjectionResult.Success;
95 | }
96 | }
97 |
98 | bool BInject(uint pToBeInjected, string sDllPath)
99 | {
100 | IntPtr hndProc = OpenProcess((0x2 | 0x8 | 0x10 | 0x20 | 0x400), 1, pToBeInjected);
101 |
102 | if (hndProc == INTPTR_ZERO)
103 | {
104 | return false;
105 | }
106 |
107 | IntPtr lpLLAddress = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
108 |
109 | if (lpLLAddress == INTPTR_ZERO)
110 | {
111 | return false;
112 | }
113 |
114 | IntPtr lpAddress = VirtualAllocEx(hndProc, (IntPtr)null, (IntPtr)sDllPath.Length, (0x1000 | 0x2000), 0X40);
115 |
116 | if (lpAddress == INTPTR_ZERO)
117 | {
118 | return false;
119 | }
120 |
121 | byte[] bytes = Encoding.ASCII.GetBytes(sDllPath);
122 |
123 | if (WriteProcessMemory(hndProc, lpAddress, bytes, (uint)bytes.Length, 0) == 0)
124 | {
125 | return false;
126 | }
127 |
128 | if (CreateRemoteThread(hndProc, (IntPtr)null, INTPTR_ZERO, lpLLAddress, lpAddress, 0, (IntPtr)null) == INTPTR_ZERO)
129 | {
130 | return false;
131 | }
132 |
133 | CloseHandle(hndProc);
134 |
135 | return true;
136 | }
137 | }
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/Hax/AUMB_utils/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.hpp"
2 |
3 | std::uintptr_t utils::text_clone = 0, utils::vmp0_clone = 0, utils::base = reinterpret_cast(GetModuleHandleA(nullptr));
4 | utils::segment utils::text_seg = utils::segment{XorString(".text")}, utils::vmp0_seg = utils::segment{XorString(".vmp0")};
5 |
6 | std::uintptr_t utils::tramp_hook(std::uintptr_t func, std::uintptr_t new_func, std::size_t inst_size)
7 | {
8 | constexpr auto extra_size = 5;
9 |
10 | auto clone = reinterpret_cast(VirtualAlloc(nullptr, inst_size + extra_size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE));
11 |
12 | if (!clone)
13 | return 0;
14 |
15 | std::memmove(reinterpret_cast(clone), reinterpret_cast(func), inst_size);
16 |
17 | *reinterpret_cast(clone + inst_size) = 0xE9;
18 | *reinterpret_cast(clone + inst_size + 1) = (func - clone - extra_size);
19 |
20 | DWORD old_protect{ 0 };
21 |
22 | VirtualProtect(reinterpret_cast(func), inst_size, PAGE_EXECUTE_READWRITE, &old_protect);
23 |
24 | std::memset(reinterpret_cast(func), 0x90, inst_size);
25 |
26 | *reinterpret_cast(func) = 0xE9;
27 | *reinterpret_cast(func + 1) = (new_func - func - extra_size);
28 |
29 | VirtualProtect(reinterpret_cast(func), inst_size, old_protect, &old_protect);
30 |
31 | return clone;
32 | }
33 |
34 | bool free_console_hooked = false;
35 | std::uintptr_t* old_ptr_jmp_val;
36 | std::uint8_t old_ptr_0x6;
37 | void utils::unhook_free_console() {
38 | static auto ptr = reinterpret_cast(&FreeConsole);
39 | static auto ptr_jmp = ptr + 0x6;
40 |
41 | if (free_console_hooked) {
42 | free_console_hooked = false;
43 | }
44 |
45 | DWORD old{};
46 |
47 | VirtualProtect(reinterpret_cast(ptr), 0x6, PAGE_EXECUTE_READWRITE, &old);
48 |
49 | *reinterpret_cast(ptr + 0x2) = old_ptr_jmp_val;
50 | *reinterpret_cast(ptr + 0x6) = old_ptr_0x6;
51 |
52 | VirtualProtect(reinterpret_cast(ptr), 0x6, old, &old);
53 | }
54 | void utils::hook_free_console()
55 | {
56 | static auto ptr = reinterpret_cast(&FreeConsole);
57 | static auto ptr_jmp = ptr + 0x6;
58 |
59 | if (!free_console_hooked) {
60 | free_console_hooked = true;
61 | old_ptr_jmp_val = *reinterpret_cast(ptr + 0x2);
62 | old_ptr_0x6 = *reinterpret_cast(ptr + 0x6);
63 |
64 | }
65 |
66 | DWORD old{};
67 |
68 | VirtualProtect(reinterpret_cast(ptr), 0x6, PAGE_EXECUTE_READWRITE, &old);
69 |
70 | *reinterpret_cast(ptr + 0x2) = &ptr_jmp;
71 | *reinterpret_cast(ptr + 0x6) = 0xC3;
72 |
73 | VirtualProtect(reinterpret_cast(ptr), 0x6, old, &old);
74 | }
75 |
76 | std::vector utils::pattern_scan(const std::string_view& pattern, const std::string_view& mask)
77 | {
78 | std::vector results;
79 |
80 | utils::segment text{XorString(".text")};
81 |
82 | for (auto at = text.start_addr; at < text.end_addr; ++at)
83 | {
84 | const auto is_same = [&]() -> bool
85 | {
86 | for (auto i = 0u; i < mask.length(); ++i)
87 | {
88 | if (*reinterpret_cast(at + i) != static_cast(pattern[i]) && mask[i] == 'x')
89 | {
90 | return false;
91 | }
92 | }
93 |
94 | return true;
95 | };
96 |
97 | if (is_same())
98 | results.push_back(at);
99 | }
100 |
101 | return results;
102 | }
103 |
104 | std::uintptr_t utils::calculate_function_size(std::uintptr_t address)
105 | {
106 | auto bytes = reinterpret_cast(address);
107 |
108 | do
109 | bytes += 0x10;
110 | while (!(bytes[0] == 0x55 && bytes[1] == 0x8B && bytes[2] == 0xEC));
111 |
112 | return reinterpret_cast(bytes) - address;
113 | }
114 |
115 | std::uintptr_t utils::clone_section(std::uintptr_t section_start)
116 | {
117 | MEMORY_BASIC_INFORMATION mbi;
118 |
119 | VirtualQuery(reinterpret_cast(section_start), &mbi, sizeof(mbi));
120 |
121 | auto new_mem = VirtualAlloc(nullptr, mbi.RegionSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
122 |
123 | std::memmove(new_mem, reinterpret_cast(section_start), mbi.RegionSize);
124 |
125 | return reinterpret_cast(new_mem);
126 | }
127 |
128 | __declspec(noinline) std::uintptr_t __stdcall utils::spoof(std::uintptr_t address)
129 | {
130 | const auto& ref = (address >= text_seg.start_addr && address <= text_seg.end_addr) ? text_clone : vmp0_clone;
131 |
132 | if (address >= vmp0_seg.start_addr && address <= vmp0_seg.end_addr || address >= text_seg.start_addr && address <= text_seg.end_addr)
133 | address = address - base + ref - 0x1000;
134 |
135 | return address;
136 | }
137 |
138 | bool utils::is_prologue(std::uintptr_t address)
139 | {
140 | return
141 | !std::memcmp(reinterpret_cast(address), XorString("\x55\x8B\xEC"), 3) ||
142 | !std::memcmp(reinterpret_cast(address), XorString("\x53\x8B\xDC"), 3) ||
143 | !std::memcmp(reinterpret_cast(address), XorString("\x56\x8B\xF4"), 3);
144 | };
145 |
146 | std::uintptr_t utils::get_prologue(std::uintptr_t function_address)
147 | {
148 | auto address_copy = function_address;
149 |
150 | while (!is_prologue(address_copy))
151 | address_copy--;
152 |
153 | return address_copy;
154 | };
--------------------------------------------------------------------------------
/TaaprWare2-UI/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Hax/Hax.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {c04c8ad0-ce3a-4b72-9e06-d9f3791f800f}
18 |
19 |
20 | {6d80a945-e0ab-44a1-be16-d298b4666c3f}
21 |
22 |
23 | {2ae86789-f5c5-4597-9818-4638c3cb2c6b}
24 |
25 |
26 | {34af1b81-281f-4280-88c6-25f1ed5f744c}
27 |
28 |
29 | {4767268c-781f-4a77-8973-e9051bda17f2}
30 |
31 |
32 | {6130e5f6-d0fd-48d9-a76e-48f49a53e342}
33 |
34 |
35 | {0569d356-b53b-461c-a242-0c251a33c559}
36 |
37 |
38 | {6bf50a80-93b8-4347-a25f-22c5acf812f5}
39 |
40 |
41 |
42 |
43 | Source Files
44 |
45 |
46 | Source Files\roblox
47 |
48 |
49 | Source Files\roblox
50 |
51 |
52 | Source Files\roblox
53 |
54 |
55 | Source Files\roblox
56 |
57 |
58 | Source Files\security
59 |
60 |
61 | Source Files\roblox
62 |
63 |
64 | Source Files\roblox
65 |
66 |
67 | Source Files\security
68 |
69 |
70 | Source Files\misc
71 |
72 |
73 | Source Files\security
74 |
75 |
76 |
77 |
78 | Header Files\include
79 |
80 |
81 | Header Files\include
82 |
83 |
84 | Header Files\include
85 |
86 |
87 | Header Files\roblox
88 |
89 |
90 | Header Files\roblox
91 |
92 |
93 | Header Files\roblox
94 |
95 |
96 | Header Files\roblox
97 |
98 |
99 | Header Files\roblox
100 |
101 |
102 | Header Files\security
103 |
104 |
105 | Header Files\security
106 |
107 |
108 | Header Files\misc
109 |
110 |
111 | Header Files\misc
112 |
113 |
114 | Header Files\roblox
115 |
116 |
117 | Header Files\misc
118 |
119 |
120 | Header Files\roblox
121 |
122 |
123 | Header Files\security
124 |
125 |
126 |
127 |
128 | Resource Files
129 |
130 |
131 |
132 |
133 | Header Files\lib
134 |
135 |
136 | Header Files\lib
137 |
138 |
139 | Header Files\lib
140 |
141 |
142 | Header Files\lib
143 |
144 |
145 | Header Files\lib
146 |
147 |
148 | Header Files\lib
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/Hax/Luau/lualib.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "lua.h"
6 |
7 | #define luaL_error(L, fmt, ...) luaL_errorL(L, fmt, ##__VA_ARGS__)
8 | #define luaL_typeerror(L, narg, tname) luaL_typeerrorL(L, narg, tname)
9 | #define luaL_argerror(L, narg, extramsg) luaL_argerrorL(L, narg, extramsg)
10 |
11 | struct luaL_Reg
12 | {
13 | const char* name;
14 | lua_CFunction func;
15 | };
16 | typedef struct luaL_Reg luaL_Reg;
17 |
18 | LUALIB_API void luaL_register(lua_State* L, const char* libname, const luaL_Reg* l);
19 | LUALIB_API int luaL_getmetafield(lua_State* L, int obj, const char* e);
20 | LUALIB_API int luaL_callmeta(lua_State* L, int obj, const char* e);
21 | LUALIB_API l_noret luaL_typeerrorL(lua_State* L, int narg, const char* tname);
22 | LUALIB_API l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg);
23 | LUALIB_API const char* luaL_checklstring(lua_State* L, int numArg, size_t* l);
24 | LUALIB_API const char* luaL_optlstring(lua_State* L, int numArg, const char* def, size_t* l);
25 | LUALIB_API double luaL_checknumber(lua_State* L, int numArg);
26 | LUALIB_API double luaL_optnumber(lua_State* L, int nArg, double def);
27 |
28 | LUALIB_API int luaL_checkboolean(lua_State* L, int narg);
29 | LUALIB_API int luaL_optboolean(lua_State* L, int narg, int def);
30 |
31 | LUALIB_API int luaL_checkinteger(lua_State* L, int numArg);
32 | LUALIB_API int luaL_optinteger(lua_State* L, int nArg, int def);
33 | LUALIB_API unsigned luaL_checkunsigned(lua_State* L, int numArg);
34 | LUALIB_API unsigned luaL_optunsigned(lua_State* L, int numArg, unsigned def);
35 |
36 | LUALIB_API const float* luaL_checkvector(lua_State* L, int narg);
37 | LUALIB_API const float* luaL_optvector(lua_State* L, int narg, const float* def);
38 |
39 | LUALIB_API void luaL_checkstack(lua_State* L, int sz, const char* msg);
40 | LUALIB_API void luaL_checktype(lua_State* L, int narg, int t);
41 | LUALIB_API void luaL_checkany(lua_State* L, int narg);
42 |
43 | LUALIB_API int luaL_newmetatable(lua_State* L, const char* tname);
44 | LUALIB_API void* luaL_checkudata(lua_State* L, int ud, const char* tname);
45 |
46 | LUALIB_API void luaL_where(lua_State* L, int lvl);
47 | LUALIB_API LUA_PRINTF_ATTR(2, 3) l_noret luaL_errorL(lua_State* L, const char* fmt, ...);
48 |
49 | LUALIB_API int luaL_checkoption(lua_State* L, int narg, const char* def, const char* const lst[]);
50 |
51 | LUALIB_API const char* luaL_tolstring(lua_State* L, int idx, size_t* len);
52 |
53 | LUALIB_API lua_State* luaL_newstate(void);
54 |
55 | LUALIB_API const char* luaL_findtable(lua_State* L, int idx, const char* fname, int szhint);
56 |
57 | LUALIB_API const char* luaL_typename(lua_State* L, int idx);
58 |
59 | /*
60 | ** ===============================================================
61 | ** some useful macros
62 | ** ===============================================================
63 | */
64 |
65 | #define luaL_argcheck(L, cond, arg, extramsg) ((void)((cond) ? (void)0 : luaL_argerror(L, arg, extramsg)))
66 | #define luaL_argexpected(L, cond, arg, tname) ((void)((cond) ? (void)0 : luaL_typeerror(L, arg, tname)))
67 |
68 | #define luaL_checkstring(L, n) (luaL_checklstring(L, (n), NULL))
69 | #define luaL_optstring(L, n, d) (luaL_optlstring(L, (n), (d), NULL))
70 |
71 | #define luaL_getmetatable(L, n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
72 |
73 | #define luaL_opt(L, f, n, d) (lua_isnoneornil(L, (n)) ? (d) : f(L, (n)))
74 |
75 | // generic buffer manipulation
76 |
77 | struct luaL_Buffer
78 | {
79 | char* p; // current position in buffer
80 | char* end; // end of the current buffer
81 | lua_State* L;
82 | struct TString* storage;
83 | char buffer[LUA_BUFFERSIZE];
84 | };
85 | typedef struct luaL_Buffer luaL_Buffer;
86 |
87 | // when internal buffer storage is exhausted, a mutable string value 'storage' will be placed on the stack
88 | // in general, functions expect the mutable string buffer to be placed on top of the stack (top-1)
89 | // with the exception of luaL_addvalue that expects the value at the top and string buffer further away (top-2)
90 | // functions that accept a 'boxloc' support string buffer placement at any location in the stack
91 | // all the buffer users we have in Luau match this pattern, but it's something to keep in mind for new uses of buffers
92 |
93 | #define luaL_addchar(B, c) ((void)((B)->p < (B)->end || luaL_extendbuffer(B, 1, -1)), (*(B)->p++ = (char)(c)))
94 | #define luaL_addstring(B, s) luaL_addlstring(B, s, strlen(s))
95 |
96 | LUALIB_API void luaL_buffinit(lua_State* L, luaL_Buffer* B);
97 | LUALIB_API char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t size);
98 | LUALIB_API char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int boxloc);
99 | LUALIB_API void luaL_reservebuffer(luaL_Buffer* B, size_t size, int boxloc);
100 | LUALIB_API void luaL_addlstring(luaL_Buffer* B, const char* s, size_t l);
101 | LUALIB_API void luaL_addvalue(luaL_Buffer* B);
102 | LUALIB_API void luaL_pushresult(luaL_Buffer* B);
103 | LUALIB_API void luaL_pushresultsize(luaL_Buffer* B, size_t size);
104 |
105 | // builtin libraries
106 | LUALIB_API int luaopen_base(lua_State* L);
107 |
108 | #define LUA_COLIBNAME "coroutine"
109 | LUALIB_API int luaopen_coroutine(lua_State* L);
110 |
111 | #define LUA_TABLIBNAME "table"
112 | LUALIB_API int luaopen_table(lua_State* L);
113 |
114 | #define LUA_OSLIBNAME "os"
115 | LUALIB_API int luaopen_os(lua_State* L);
116 |
117 | #define LUA_STRLIBNAME "string"
118 | LUALIB_API int luaopen_string(lua_State* L);
119 |
120 | #define LUA_BITLIBNAME "bit32"
121 | LUALIB_API int luaopen_bit32(lua_State* L);
122 |
123 | #define LUA_UTF8LIBNAME "utf8"
124 | LUALIB_API int luaopen_utf8(lua_State* L);
125 |
126 | #define LUA_MATHLIBNAME "math"
127 | LUALIB_API int luaopen_math(lua_State* L);
128 |
129 | #define LUA_DBLIBNAME "debug"
130 | LUALIB_API int luaopen_debug(lua_State* L);
131 |
132 | // open all builtin libraries
133 | LUALIB_API void luaL_openlibs(lua_State* L);
134 |
135 | // sandbox libraries and globals
136 | LUALIB_API void luaL_sandbox(lua_State* L);
137 | LUALIB_API void luaL_sandboxthread(lua_State* L);
138 |
--------------------------------------------------------------------------------
/Hax/Luau/lgc.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | // This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3 | #pragma once
4 |
5 | #include "ldo.h"
6 | #include "lobject.h"
7 | #include "lstate.h"
8 |
9 | LUAU_FASTFLAG(LuauNoSleepBit)
10 |
11 | /*
12 | ** Default settings for GC tunables (settable via lua_gc)
13 | */
14 | #define LUAI_GCGOAL 200 // 200% (allow heap to double compared to live heap size)
15 | #define LUAI_GCSTEPMUL 200 // GC runs 'twice the speed' of memory allocation
16 | #define LUAI_GCSTEPSIZE 1 // GC runs every KB of memory allocation
17 |
18 | /*
19 | ** Possible states of the Garbage Collector
20 | */
21 | #define GCSpause 0
22 | #define GCSpropagate 1
23 | #define GCSpropagateagain 2
24 | #define GCSatomic 3
25 | #define GCSsweep 4
26 |
27 | /*
28 | ** macro to tell when main invariant (white objects cannot point to black
29 | ** ones) must be kept. During a collection, the sweep
30 | ** phase may break the invariant, as objects turned white may point to
31 | ** still-black objects. The invariant is restored when sweep ends and
32 | ** all objects are white again.
33 | */
34 | #define keepinvariant(g) ((g)->gcstate == GCSpropagate || (g)->gcstate == GCSpropagateagain || (g)->gcstate == GCSatomic)
35 |
36 | /*
37 | ** some useful bit tricks
38 | */
39 | #define resetbits(x, m) ((x) &= cast_to(uint8_t, ~(m)))
40 | #define setbits(x, m) ((x) |= (m))
41 | #define testbits(x, m) ((x) & (m))
42 | #define bitmask(b) (1 << (b))
43 | #define bit2mask(b1, b2) (bitmask(b1) | bitmask(b2))
44 | #define l_setbit(x, b) setbits(x, bitmask(b))
45 | #define resetbit(x, b) resetbits(x, bitmask(b))
46 | #define testbit(x, b) testbits(x, bitmask(b))
47 | #define set2bits(x, b1, b2) setbits(x, (bit2mask(b1, b2)))
48 | #define reset2bits(x, b1, b2) resetbits(x, (bit2mask(b1, b2)))
49 | #define test2bits(x, b1, b2) testbits(x, (bit2mask(b1, b2)))
50 |
51 | /*
52 | ** Layout for bit use in `marked' field:
53 | ** bit 0 - object is white (type 0)
54 | ** bit 1 - object is white (type 1)
55 | ** bit 2 - object is black
56 | ** bit 3 - object is fixed (should not be collected)
57 | */
58 |
59 | #define WHITE0BIT 0
60 | #define WHITE1BIT 1
61 | #define BLACKBIT 2
62 | #define FIXEDBIT 3
63 | #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
64 |
65 | #define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
66 | #define isblack(x) testbit((x)->gch.marked, BLACKBIT)
67 | #define isgray(x) (!testbits((x)->gch.marked, WHITEBITS | bitmask(BLACKBIT)))
68 | #define isfixed(x) testbit((x)->gch.marked, FIXEDBIT)
69 |
70 | #define otherwhite(g) (g->currentwhite ^ WHITEBITS)
71 | #define isdead(g, v) (((v)->gch.marked & (WHITEBITS | bitmask(FIXEDBIT))) == (otherwhite(g) & WHITEBITS))
72 |
73 | #define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
74 | #define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
75 |
76 | #define luaC_white(g) cast_to(uint8_t, ((g)->currentwhite) & WHITEBITS)
77 |
78 | // Thread stack states
79 | // TODO: Remove with FFlag::LuauNoSleepBit and replace with lua_State::threadactive
80 | #define THREAD_ACTIVEBIT 0 // thread is currently active
81 | #define THREAD_SLEEPINGBIT 1 // thread is not executing and stack should not be modified
82 |
83 | #define luaC_threadactive(L) (testbit((L)->stackstate, THREAD_ACTIVEBIT))
84 | #define luaC_threadsleeping(L) (testbit((L)->stackstate, THREAD_SLEEPINGBIT))
85 |
86 | #define luaC_checkGC(L) \
87 | { \
88 | condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK)); \
89 | if (L->global->totalbytes >= L->global->GCthreshold) \
90 | { \
91 | condhardmemtests(luaC_validate(L), 1); \
92 | luaC_step(L, true); \
93 | } \
94 | else \
95 | { \
96 | condhardmemtests(luaC_validate(L), 2); \
97 | } \
98 | }
99 |
100 | #define luaC_barrier(L, p, v) \
101 | { \
102 | if (iscollectable(v) && isblack(obj2gco(p)) && iswhite(gcvalue(v))) \
103 | luaC_barrierf(L, obj2gco(p), gcvalue(v)); \
104 | }
105 |
106 | #define luaC_barriert(L, t, v) \
107 | { \
108 | if (iscollectable(v) && isblack(obj2gco(t)) && iswhite(gcvalue(v))) \
109 | luaC_barriertable(L, t, gcvalue(v)); \
110 | }
111 |
112 | #define luaC_barrierfast(L, t) \
113 | { \
114 | if (isblack(obj2gco(t))) \
115 | luaC_barrierback(L, obj2gco(t), &t->gclist); \
116 | }
117 |
118 | #define luaC_objbarrier(L, p, o) \
119 | { \
120 | if (isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
121 | luaC_barrierf(L, obj2gco(p), obj2gco(o)); \
122 | }
123 |
124 | // TODO: Remove with FFlag::LuauSimplerUpval
125 | #define luaC_upvalbarrier(L, uv, tv) \
126 | { \
127 | if (iscollectable(tv) && iswhite(gcvalue(tv)) && (!(uv) || (uv)->v != &(uv)->u.value)) \
128 | luaC_barrierupval(L, gcvalue(tv)); \
129 | }
130 |
131 | #define luaC_threadbarrier(L) \
132 | { \
133 | if (FFlag::LuauNoSleepBit) \
134 | { \
135 | if (isblack(obj2gco(L))) \
136 | luaC_barrierback(L, obj2gco(L), &L->gclist); \
137 | } \
138 | else \
139 | { \
140 | if (luaC_threadsleeping(L)) \
141 | luaC_wakethread(L); \
142 | } \
143 | }
144 |
145 | #define luaC_init(L, o, tt_) \
146 | { \
147 | o->marked = luaC_white(L->global); \
148 | o->tt = tt_; \
149 | o->memcat = L->activememcat; \
150 | }
151 |
152 | LUAI_FUNC void luaC_freeall(lua_State* L);
153 | LUAI_FUNC size_t luaC_step(lua_State* L, bool assist);
154 | LUAI_FUNC void luaC_fullgc(lua_State* L);
155 | LUAI_FUNC void luaC_initobj(lua_State* L, GCObject* o, uint8_t tt);
156 | LUAI_FUNC void luaC_upvalclosed(lua_State* L, UpVal* uv);
157 | LUAI_FUNC void luaC_barrierupval(lua_State* L, GCObject* v);
158 | LUAI_FUNC void luaC_barrierf(lua_State* L, GCObject* o, GCObject* v);
159 | LUAI_FUNC void luaC_barriertable(lua_State* L, Table* t, GCObject* v);
160 | LUAI_FUNC void luaC_barrierback(lua_State* L, GCObject* o, GCObject** gclist);
161 | LUAI_FUNC void luaC_validate(lua_State* L);
162 | LUAI_FUNC void luaC_dump(lua_State* L, void* file, const char* (*categoryName)(lua_State* L, uint8_t memcat));
163 | LUAI_FUNC int64_t luaC_allocationrate(lua_State* L);
164 | LUAI_FUNC void luaC_wakethread(lua_State* L);
165 | LUAI_FUNC const char* luaC_statename(int state);
166 |
--------------------------------------------------------------------------------
/Hax/Luau/TimeTrace.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Common.h"
5 |
6 | #include
7 |
8 | #include
9 |
10 | LUAU_FASTFLAG(DebugLuauTimeTracing)
11 |
12 | namespace Luau
13 | {
14 | namespace TimeTrace
15 | {
16 | double getClock();
17 | uint32_t getClockMicroseconds();
18 | } // namespace TimeTrace
19 | } // namespace Luau
20 |
21 | #if defined(LUAU_ENABLE_TIME_TRACE)
22 |
23 | namespace Luau
24 | {
25 | namespace TimeTrace
26 | {
27 | struct Token
28 | {
29 | const char* name;
30 | const char* category;
31 | };
32 |
33 | enum class EventType : uint8_t
34 | {
35 | Enter,
36 | Leave,
37 |
38 | ArgName,
39 | ArgValue,
40 | };
41 |
42 | struct Event
43 | {
44 | EventType type;
45 | uint16_t token;
46 |
47 | union
48 | {
49 | uint32_t microsec; // 1 hour trace limit
50 | uint32_t dataPos;
51 | } data;
52 | };
53 |
54 | struct GlobalContext;
55 | struct ThreadContext;
56 |
57 | GlobalContext& getGlobalContext();
58 |
59 | uint16_t createToken(GlobalContext& context, const char* name, const char* category);
60 | uint32_t createThread(GlobalContext& context, ThreadContext* threadContext);
61 | void releaseThread(GlobalContext& context, ThreadContext* threadContext);
62 | void flushEvents(GlobalContext& context, uint32_t threadId, const std::vector& events, const std::vector& data);
63 |
64 | struct ThreadContext
65 | {
66 | ThreadContext()
67 | : globalContext(getGlobalContext())
68 | {
69 | threadId = createThread(globalContext, this);
70 | }
71 |
72 | ~ThreadContext()
73 | {
74 | if (!events.empty())
75 | flushEvents();
76 |
77 | releaseThread(globalContext, this);
78 | }
79 |
80 | void flushEvents()
81 | {
82 | static uint16_t flushToken = createToken(globalContext, "flushEvents", "TimeTrace");
83 |
84 | events.push_back({EventType::Enter, flushToken, {getClockMicroseconds()}});
85 |
86 | TimeTrace::flushEvents(globalContext, threadId, events, data);
87 |
88 | events.clear();
89 | data.clear();
90 |
91 | events.push_back({EventType::Leave, 0, {getClockMicroseconds()}});
92 | }
93 |
94 | void eventEnter(uint16_t token)
95 | {
96 | eventEnter(token, getClockMicroseconds());
97 | }
98 |
99 | void eventEnter(uint16_t token, uint32_t microsec)
100 | {
101 | events.push_back({EventType::Enter, token, {microsec}});
102 | }
103 |
104 | void eventLeave()
105 | {
106 | eventLeave(getClockMicroseconds());
107 | }
108 |
109 | void eventLeave(uint32_t microsec)
110 | {
111 | events.push_back({EventType::Leave, 0, {microsec}});
112 |
113 | if (events.size() > kEventFlushLimit)
114 | flushEvents();
115 | }
116 |
117 | void eventArgument(const char* name, const char* value)
118 | {
119 | uint32_t pos = uint32_t(data.size());
120 | data.insert(data.end(), name, name + strlen(name) + 1);
121 | events.push_back({EventType::ArgName, 0, {pos}});
122 |
123 | pos = uint32_t(data.size());
124 | data.insert(data.end(), value, value + strlen(value) + 1);
125 | events.push_back({EventType::ArgValue, 0, {pos}});
126 | }
127 |
128 | GlobalContext& globalContext;
129 | uint32_t threadId;
130 | std::vector events;
131 | std::vector data;
132 |
133 | static constexpr size_t kEventFlushLimit = 8192;
134 | };
135 |
136 | ThreadContext& getThreadContext();
137 |
138 | struct Scope
139 | {
140 | explicit Scope(uint16_t token)
141 | : context(getThreadContext())
142 | {
143 | if (!FFlag::DebugLuauTimeTracing)
144 | return;
145 |
146 | context.eventEnter(token);
147 | }
148 |
149 | ~Scope()
150 | {
151 | if (!FFlag::DebugLuauTimeTracing)
152 | return;
153 |
154 | context.eventLeave();
155 | }
156 |
157 | ThreadContext& context;
158 | };
159 |
160 | struct OptionalTailScope
161 | {
162 | explicit OptionalTailScope(uint16_t token, uint32_t threshold)
163 | : context(getThreadContext())
164 | , token(token)
165 | , threshold(threshold)
166 | {
167 | if (!FFlag::DebugLuauTimeTracing)
168 | return;
169 |
170 | pos = uint32_t(context.events.size());
171 | microsec = getClockMicroseconds();
172 | }
173 |
174 | ~OptionalTailScope()
175 | {
176 | if (!FFlag::DebugLuauTimeTracing)
177 | return;
178 |
179 | if (pos == context.events.size())
180 | {
181 | uint32_t curr = getClockMicroseconds();
182 |
183 | if (curr - microsec > threshold)
184 | {
185 | context.eventEnter(token, microsec);
186 | context.eventLeave(curr);
187 | }
188 | }
189 | }
190 |
191 | ThreadContext& context;
192 | uint16_t token;
193 | uint32_t threshold;
194 | uint32_t microsec;
195 | uint32_t pos;
196 | };
197 |
198 | LUAU_NOINLINE uint16_t createScopeData(const char* name, const char* category);
199 |
200 | } // namespace TimeTrace
201 | } // namespace Luau
202 |
203 | // Regular scope
204 | #define LUAU_TIMETRACE_SCOPE(name, category) \
205 | static uint16_t lttScopeStatic = Luau::TimeTrace::createScopeData(name, category); \
206 | Luau::TimeTrace::Scope lttScope(lttScopeStatic)
207 |
208 | // A scope without nested scopes that may be skipped if the time it took is less than the threshold
209 | #define LUAU_TIMETRACE_OPTIONAL_TAIL_SCOPE(name, category, microsec) \
210 | static uint16_t lttScopeStaticOptTail = Luau::TimeTrace::createScopeData(name, category); \
211 | Luau::TimeTrace::OptionalTailScope lttScope(lttScopeStaticOptTail, microsec)
212 |
213 | // Extra key/value data can be added to regular scopes
214 | #define LUAU_TIMETRACE_ARGUMENT(name, value) \
215 | do \
216 | { \
217 | if (FFlag::DebugLuauTimeTracing) \
218 | lttScope.context.eventArgument(name, value); \
219 | } while (false)
220 |
221 | #else
222 |
223 | #define LUAU_TIMETRACE_SCOPE(name, category)
224 | #define LUAU_TIMETRACE_OPTIONAL_TAIL_SCOPE(name, category, microsec)
225 | #define LUAU_TIMETRACE_ARGUMENT(name, value) \
226 | do \
227 | { \
228 | } while (false)
229 |
230 | #endif
231 |
--------------------------------------------------------------------------------
/TaaprWare2-UI/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using ICSharpCode.AvalonEdit.Highlighting.Xshd;
2 | using ICSharpCode.AvalonEdit.Highlighting;
3 | using System.IO;
4 | using System;
5 | using System.Xml;
6 | using System.Collections.Generic;
7 | using System.Diagnostics;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Controls;
13 | using System.Windows.Data;
14 | using System.Windows.Documents;
15 | using System.Windows.Input;
16 | using System.Windows.Media;
17 | using System.Windows.Media.Imaging;
18 | using System.Windows.Navigation;
19 | using System.Windows.Shapes;
20 | using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
21 | using System.Runtime.InteropServices;
22 |
23 | namespace TaaprWare2_UI
24 | {
25 | ///
26 | /// Interaction logic for MainWindow.xaml
27 | ///
28 |
29 | public partial class MainWindow : Window
30 | {
31 | [DllImport("kernel32.dll")]
32 | static extern IntPtr GetConsoleWindow();
33 |
34 | [DllImport("user32.dll")]
35 | static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
36 | const int SW_HIDE = 0;
37 | public MainWindow()
38 | {
39 | InitializeComponent();
40 | ShowWindow(GetConsoleWindow(), SW_HIDE);
41 | Color string_color = new Color
42 | {
43 | A = 0xFF,
44 | R = 0x15,
45 | G = 0x81,
46 | B = 0xFF
47 | };
48 | SolidColorBrush string_brush = new SolidColorBrush(string_color);
49 | CodeBox.TextArea.TextView.LinkTextForegroundBrush = string_brush;
50 | Stream stream = File.OpenRead("./bin/SyntaxHighlighting.xshd");
51 | if (stream.CanRead)
52 | {
53 | XmlTextReader reader = new XmlTextReader(stream);
54 | CodeBox.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
55 | }
56 | else
57 | {
58 | MessageBox.Show("Couldn't read bin/SyntaxHighlighting.xshd", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
59 | }
60 | }
61 |
62 | private void RichTextBox_TextChanged(object sender, TextChangedEventArgs e)
63 | {
64 |
65 | }
66 |
67 | public static string ReadFile(string filePath)
68 | {
69 | // Declare a string variable to store the file contents
70 | string fileContents;
71 |
72 | // Use a try-catch block to handle any exceptions that may occur
73 | try
74 | {
75 | // Read the file contents into the string variable
76 | fileContents = File.ReadAllText(filePath);
77 | }
78 | catch (Exception ex)
79 | {
80 | MessageBox.Show("Custom functions are disabled because an error reading the InitScript.lua file: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
81 | return "";
82 | }
83 |
84 | // Return the file contents
85 | return fileContents;
86 | }
87 |
88 | private void Button_Click(object sender, RoutedEventArgs e)
89 | {
90 | if (sender == Inject)
91 | {
92 | TaaprWare2_UI.Functions.Inject();
93 | }
94 | else if (sender == Execute)
95 | {
96 | int FoundPipes = 0;
97 |
98 | Process[] _procs = Process.GetProcesses();
99 | for (int i = 0; i < _procs.Length; i++)
100 | {
101 | if (_procs[i].ProcessName == "RobloxPlayerBeta")
102 | {
103 | if (NamedPipes.NamedPipeExist(NamedPipes.luapipename + _procs[i].Id.ToString()))
104 | {
105 | FoundPipes++;
106 | }
107 | }
108 | }
109 | if (FoundPipes > 0)
110 | {
111 | StringBuilder script = new StringBuilder("spawn(function()\n");
112 | script.Append(ReadFile("bin/InitScript.lua"));
113 | script.Append("\n");
114 | script.Append(CodeBox.Text);
115 | script.Append("\nend)");
116 | NamedPipes.LuaPipe(script);
117 | }
118 | else
119 | {
120 | MessageBox.Show("Not injected", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);//if the pipe can't be found a messagebox will appear
121 | return;
122 | }
123 | }
124 | else if (sender == CloseRoblox)
125 | {
126 | foreach (var process in Process.GetProcessesByName("RobloxPlayerBeta"))
127 | {
128 | process.Kill();
129 | }
130 | }
131 | else if (sender == Discord)
132 | {
133 | Process.Start("https://discord.gg/nAEHrW9EF9");
134 | }
135 | }
136 |
137 | private void CodeBoxHost_ChildChanged(object sender, System.Windows.Forms.Integration.ChildChangedEventArgs e)
138 | {
139 |
140 | }
141 |
142 | private void Top_MouseDown(object sender, MouseButtonEventArgs e)
143 | {
144 | if (e.ChangedButton == MouseButton.Left)
145 | this.DragMove();
146 | }
147 |
148 | private void TopButton_Click(object sender, RoutedEventArgs e)
149 | {
150 |
151 | }
152 |
153 | private void TopButton_MouseDown(object sender, MouseButtonEventArgs e)
154 | {
155 |
156 | }
157 |
158 | private void Windo_MouseDown(object sender, MouseButtonEventArgs e)
159 | {
160 | if (e.LeftButton == MouseButtonState.Pressed)
161 | this.DragMove();
162 | }
163 |
164 | private void Button_Click_1(object sender, RoutedEventArgs e)
165 | {
166 | if (sender == _Close)
167 | {
168 | GetWindow(Windo).Close();
169 | }
170 | else if (sender == Minimise)
171 | {
172 | WindowState = WindowState.Minimized;
173 | }
174 | }
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/Hax/exceptionfilter.cpp:
--------------------------------------------------------------------------------
1 | #include "exceptionfilter.h"
2 |
3 | char errstr[128];
4 | const char* exceptionCodeToString(DWORD exceptionCode) {
5 | const char* str;
6 | switch (exceptionCode) {
7 | case EXCEPTION_ACCESS_VIOLATION:
8 | str = XorString("EXCEPTION_ACCESS_VIOLATION");
9 | case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
10 | str = XorString("EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
11 | case EXCEPTION_BREAKPOINT:
12 | str = XorString("EXCEPTION_BREAKPOINT");
13 | case EXCEPTION_DATATYPE_MISALIGNMENT:
14 | str = XorString("EXCEPTION_DATATYPE_MISALIGNMENT");
15 | case EXCEPTION_FLT_DENORMAL_OPERAND:
16 | str = XorString("EXCEPTION_FLT_DENORMAL_OPERAND");
17 | case EXCEPTION_FLT_DIVIDE_BY_ZERO:
18 | str = XorString("EXCEPTION_FLT_DIVIDE_BY_ZERO");
19 | case EXCEPTION_FLT_INEXACT_RESULT:
20 | str = XorString("EXCEPTION_FLT_INEXACT_RESULT");
21 | case EXCEPTION_FLT_INVALID_OPERATION:
22 | str = XorString("EXCEPTION_FLT_INVALID_OPERATION");
23 | case EXCEPTION_FLT_OVERFLOW:
24 | str = XorString("EXCEPTION_FLT_OVERFLOW");
25 | case EXCEPTION_FLT_STACK_CHECK:
26 | str = XorString("EXCEPTION_FLT_STACK_CHECK");
27 | case EXCEPTION_FLT_UNDERFLOW:
28 | str = XorString("EXCEPTION_FLT_UNDERFLOW");
29 | case EXCEPTION_ILLEGAL_INSTRUCTION:
30 | str = XorString("EXCEPTION_ILLEGAL_INSTRUCTION");
31 | case EXCEPTION_IN_PAGE_ERROR:
32 | str = XorString("EXCEPTION_IN_PAGE_ERROR");
33 | case EXCEPTION_INT_DIVIDE_BY_ZERO:
34 | str = XorString("EXCEPTION_INT_DIVIDE_BY_ZERO");
35 | case EXCEPTION_INT_OVERFLOW:
36 | str = XorString("EXCEPTION_INT_OVERFLOW");
37 | case EXCEPTION_INVALID_DISPOSITION:
38 | str = XorString("EXCEPTION_INVALID_DISPOSITION");
39 | case EXCEPTION_NONCONTINUABLE_EXCEPTION:
40 | str = XorString("EXCEPTION_NONCONTINUABLE_EXCEPTION");
41 | case EXCEPTION_PRIV_INSTRUCTION:
42 | str = XorString("EXCEPTION_PRIV_INSTRUCTION");
43 | case EXCEPTION_SINGLE_STEP:
44 | str = XorString("EXCEPTION_SINGLE_STEP");
45 | case EXCEPTION_STACK_OVERFLOW:
46 | str = XorString("EXCEPTION_STACK_OVERFLOW");
47 | default:
48 | std::string* code = new std::string();
49 | *code = std::to_string(exceptionCode);
50 | str = code->c_str();
51 | }
52 | memcpy(errstr, new char[_countof(errstr)], _countof(errstr));
53 | memcpy(errstr, str, strlen(str));
54 | return errstr;
55 | }
56 |
57 | LONG WINAPI TaaprWareExceptionFilter(EXCEPTION_POINTERS* ExceptionInfo) {
58 | HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
59 | EXCEPTION_RECORD* ExceptionRecord = ExceptionInfo->ExceptionRecord;
60 | CONTEXT* context = ExceptionInfo->ContextRecord;
61 | if (ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT && context->Eip == addresses::rbx_writevoxels) {
62 | //printf("C func detected! (inst: %X)\n", (UINT)ExceptionRecord->ExceptionAddress);
63 | context->Eip = (UINT)(c_function_handler);
64 | return EXCEPTION_CONTINUE_EXECUTION;
65 | }
66 | SetConsoleTextAttribute(hConsole, CONSOLE_COLOR_RED);
67 | printf(XorString("Exception 0x%X occurred at 0x%p\n"), ExceptionRecord->ExceptionCode, ExceptionRecord->ExceptionAddress);
68 | printf(XorString("Error: %s ("), exceptionCodeToString(ExceptionRecord->ExceptionCode));
69 | if (ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
70 | switch (ExceptionRecord->ExceptionInformation[0]) {
71 | case 0:
72 | printf(XorString("Failed to write memory at 0x%X)\n"), ExceptionRecord->ExceptionInformation[1]);
73 | break;
74 | case 1:
75 | printf(XorString("Failed to read memory at 0x%X)\n"), ExceptionRecord->ExceptionInformation[1]);
76 | break;
77 | case 8:
78 | printf(XorString("Failed to execute memory at 0x%X)\n"), ExceptionRecord->ExceptionInformation[1]);
79 | break;
80 |
81 | }
82 | } else if (ExceptionRecord->ExceptionCode == EXCEPTION_IN_PAGE_ERROR) {
83 | switch (ExceptionRecord->ExceptionInformation[0]) {
84 | case 0:
85 | printf(XorString("Failed to write memory at 0x%X with NTSTATUS 0x%X)\n"), ExceptionRecord->ExceptionInformation[1], ExceptionRecord->ExceptionInformation[2]);
86 | break;
87 | case 1:
88 | printf(XorString("Failed to read memory at 0x%X with NTSTATUS 0x%X)\n"), ExceptionRecord->ExceptionInformation[1], ExceptionRecord->ExceptionInformation[2]);
89 | break;
90 | case 8:
91 | printf(XorString("Failed to execute memory at 0x%X with NTSTATUS 0x%X)\n"), ExceptionRecord->ExceptionInformation[1], ExceptionRecord->ExceptionInformation[2]);
92 | break;
93 | }
94 | } else {
95 | printf(XorString("Additional ExceptionInformation: 0x%X)\n"), ExceptionRecord->ExceptionInformation[0]);
96 | }
97 | printf(XorString("Number of parameters: %d\n"), ExceptionRecord->NumberParameters);
98 | printf(XorString("EAX: 0x%p\n"), reinterpret_cast(context->Eax));
99 | printf(XorString("EBX: 0x%p\n"), reinterpret_cast(context->Ebx));
100 | printf(XorString("ECX: 0x%p\n"), reinterpret_cast(context->Ecx));
101 | printf(XorString("EDX: 0x%p\n"), reinterpret_cast(context->Edx));
102 | printf(XorString("ESI: 0x%p\n"), reinterpret_cast(context->Esi));
103 | printf(XorString("EDI: 0x%p\n"), reinterpret_cast(context->Edi));
104 | printf(XorString("EBP: 0x%p\n"), reinterpret_cast(context->Ebp));
105 | printf(XorString("ESP: 0x%p\n"), reinterpret_cast(context->Esp));
106 | printf(XorString("EIP: 0x%p\n"), reinterpret_cast(context->Eip));
107 | printf(XorString("Stack trace:\n"));
108 | void** stackTrace = (void**)context->Ebp;
109 | int i = 0;
110 | while (stackTrace && *(stackTrace + 1)) {
111 | stackTrace = (void**)*stackTrace;
112 | printf(XorString("%d: 0x%p\n"), ++i, *(stackTrace + 1));
113 | }
114 | MessageBoxA(NULL, XorString("TaaprWare V2 has crashed! Screenshot the console and send it to plusgiant5! (Your crash logs have not been sent to Roblox)"), XorString("Crash"), NULL);
115 | SetConsoleTextAttribute(hConsole, CONSOLE_COLOR_WHITE);
116 | Sleep(MAXDWORD);
117 | return EXCEPTION_EXECUTE_HANDLER;
118 | }
119 |
120 | const patch_5 SetUnhandledExceptionFilter_bytes = {0x8B, 0xFF, 0x55, 0x8B, 0xEC};
121 | void unpatch_SetUnhandledExceptionFilter() {
122 | DWORD original;
123 | VirtualProtect(SetUnhandledExceptionFilter, 5, PAGE_EXECUTE_READWRITE, &original);
124 | *reinterpret_cast(SetUnhandledExceptionFilter) = SetUnhandledExceptionFilter_bytes;
125 | VirtualProtect(SetUnhandledExceptionFilter, 5, original, &original);
126 | }
--------------------------------------------------------------------------------
/Hax/Luau/Lexer.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Ast.h"
5 | #include "Luau/Location.h"
6 | #include "Luau/DenseHash.h"
7 | #include "Luau/Common.h"
8 |
9 | namespace Luau
10 | {
11 |
12 | class Allocator
13 | {
14 | public:
15 | Allocator();
16 | Allocator(Allocator&&);
17 |
18 | Allocator& operator=(Allocator&&) = delete;
19 |
20 | ~Allocator();
21 |
22 | void* allocate(size_t size);
23 |
24 | template
25 | T* alloc(Args&&... args)
26 | {
27 | static_assert(std::is_trivially_destructible::value, "Objects allocated with this allocator will never have their destructors run!");
28 |
29 | T* t = static_cast(allocate(sizeof(T)));
30 | new (t) T(std::forward(args)...);
31 | return t;
32 | }
33 |
34 | private:
35 | struct Page
36 | {
37 | Page* next;
38 |
39 | char data[8192];
40 | };
41 |
42 | Page* root;
43 | size_t offset;
44 | };
45 |
46 | struct Lexeme
47 | {
48 | enum Type
49 | {
50 | Eof = 0,
51 |
52 | // 1..255 means actual character values
53 | Char_END = 256,
54 |
55 | Equal,
56 | LessEqual,
57 | GreaterEqual,
58 | NotEqual,
59 | Dot2,
60 | Dot3,
61 | SkinnyArrow,
62 | DoubleColon,
63 |
64 | InterpStringBegin,
65 | InterpStringMid,
66 | InterpStringEnd,
67 | // An interpolated string with no expressions (like `x`)
68 | InterpStringSimple,
69 |
70 | AddAssign,
71 | SubAssign,
72 | MulAssign,
73 | DivAssign,
74 | ModAssign,
75 | PowAssign,
76 | ConcatAssign,
77 |
78 | RawString,
79 | QuotedString,
80 | Number,
81 | Name,
82 |
83 | Comment,
84 | BlockComment,
85 |
86 | BrokenString,
87 | BrokenComment,
88 | BrokenUnicode,
89 | BrokenInterpDoubleBrace,
90 |
91 | Error,
92 |
93 | Reserved_BEGIN,
94 | ReservedAnd = Reserved_BEGIN,
95 | ReservedBreak,
96 | ReservedDo,
97 | ReservedElse,
98 | ReservedElseif,
99 | ReservedEnd,
100 | ReservedFalse,
101 | ReservedFor,
102 | ReservedFunction,
103 | ReservedIf,
104 | ReservedIn,
105 | ReservedLocal,
106 | ReservedNil,
107 | ReservedNot,
108 | ReservedOr,
109 | ReservedRepeat,
110 | ReservedReturn,
111 | ReservedThen,
112 | ReservedTrue,
113 | ReservedUntil,
114 | ReservedWhile,
115 | Reserved_END
116 | };
117 |
118 | Type type;
119 | Location location;
120 | unsigned int length;
121 |
122 | union
123 | {
124 | const char* data; // String, Number, Comment
125 | const char* name; // Name
126 | unsigned int codepoint; // BrokenUnicode
127 | };
128 |
129 | Lexeme(const Location& location, Type type);
130 | Lexeme(const Location& location, char character);
131 | Lexeme(const Location& location, Type type, const char* data, size_t size);
132 | Lexeme(const Location& location, Type type, const char* name);
133 |
134 | std::string toString() const;
135 | };
136 |
137 | class AstNameTable
138 | {
139 | public:
140 | AstNameTable(Allocator& allocator);
141 |
142 | AstName addStatic(const char* name, Lexeme::Type type = Lexeme::Name);
143 |
144 | std::pair getOrAddWithType(const char* name, size_t length);
145 | std::pair getWithType(const char* name, size_t length) const;
146 |
147 | AstName getOrAdd(const char* name);
148 | AstName get(const char* name) const;
149 |
150 | private:
151 | struct Entry
152 | {
153 | AstName value;
154 | uint32_t length;
155 | Lexeme::Type type;
156 |
157 | bool operator==(const Entry& other) const;
158 | };
159 |
160 | struct EntryHash
161 | {
162 | size_t operator()(const Entry& e) const;
163 | };
164 |
165 | DenseHashSet data;
166 |
167 | Allocator& allocator;
168 | };
169 |
170 | class Lexer
171 | {
172 | public:
173 | Lexer(const char* buffer, std::size_t bufferSize, AstNameTable& names);
174 |
175 | void setSkipComments(bool skip);
176 | void setReadNames(bool read);
177 |
178 | const Location& previousLocation() const
179 | {
180 | return prevLocation;
181 | }
182 |
183 | const Lexeme& next();
184 | const Lexeme& next(bool skipComments, bool updatePrevLocation);
185 | void nextline();
186 |
187 | Lexeme lookahead();
188 |
189 | const Lexeme& current() const
190 | {
191 | return lexeme;
192 | }
193 |
194 | static bool isReserved(const std::string& word);
195 |
196 | static bool fixupQuotedString(std::string& data);
197 | static void fixupMultilineString(std::string& data);
198 |
199 | private:
200 | char peekch() const;
201 | char peekch(unsigned int lookahead) const;
202 |
203 | Position position() const;
204 |
205 | void consume();
206 |
207 | Lexeme readCommentBody();
208 |
209 | // Given a sequence [===[ or ]===], returns:
210 | // 1. number of equal signs (or 0 if none present) between the brackets
211 | // 2. -1 if this is not a long comment/string separator
212 | // 3. -N if this is a malformed separator
213 | // Does *not* consume the closing brace.
214 | int skipLongSeparator();
215 |
216 | Lexeme readLongString(const Position& start, int sep, Lexeme::Type ok, Lexeme::Type broken);
217 | Lexeme readQuotedString();
218 |
219 | Lexeme readInterpolatedStringBegin();
220 | Lexeme readInterpolatedStringSection(Position start, Lexeme::Type formatType, Lexeme::Type endType);
221 |
222 | void readBackslashInString();
223 |
224 | std::pair readName();
225 |
226 | Lexeme readNumber(const Position& start, unsigned int startOffset);
227 |
228 | Lexeme readUtf8Error();
229 | Lexeme readNext();
230 |
231 | const char* buffer;
232 | std::size_t bufferSize;
233 |
234 | unsigned int offset;
235 |
236 | unsigned int line;
237 | unsigned int lineOffset;
238 |
239 | Lexeme lexeme;
240 |
241 | Location prevLocation;
242 |
243 | AstNameTable& names;
244 |
245 | bool skipComments;
246 | bool readNames;
247 |
248 | enum class BraceType
249 | {
250 | InterpolatedString,
251 | Normal
252 | };
253 |
254 | std::vector braceStack;
255 | };
256 |
257 | inline bool isSpace(char ch)
258 | {
259 | return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\v' || ch == '\f';
260 | }
261 |
262 | } // namespace Luau
263 |
--------------------------------------------------------------------------------
/Hax/file.cpp:
--------------------------------------------------------------------------------
1 | // Thank you, ChatGPT
2 |
3 | #include "file.h"
4 |
5 | void replace_char(std::string& str, char replace_this, char replace_with) {
6 | for (std::size_t i = 0; i < str.size(); ++i) {
7 | if (str[i] == replace_this) {
8 | str[i] = replace_with;
9 | }
10 | }
11 | }
12 | std::string get_dll_path() {
13 | char DllPath[MAX_PATH] = {0};
14 | GetModuleFileNameA((HINSTANCE)&__ImageBase, DllPath, _countof(DllPath));
15 | return DllPath;
16 | }
17 | std::string get_exploit_path() {
18 | std::string dll_path = get_dll_path();
19 | std::string bin_path = dll_path.substr(0, dll_path.rfind('\\'));
20 | return bin_path.substr(0, bin_path.rfind('\\'));
21 | }
22 | bool is_within_workspace(std::string& file_path) {
23 | if (file_path.find("..") != std::string::npos) {
24 | return false;
25 | }
26 | std::string workspace_path = get_exploit_path() + XorString("\\workspace\\");
27 | std::transform(file_path.begin(), file_path.end(), file_path.begin(), ::tolower);
28 | std::transform(workspace_path.begin(), workspace_path.end(), workspace_path.begin(), ::tolower);
29 | return (file_path.find(workspace_path) == 0);
30 | }
31 | std::string fix_path(std::string& path) {
32 | replace_char(path, '/', '\\');
33 | return get_exploit_path() + XorString("\\workspace\\") + path;
34 | }
35 | const char* readfile_internal (const std::string& path) {
36 | std::ifstream file(path);
37 | if (!file.is_open()) {
38 | return nullptr;
39 | }
40 |
41 | // Determine the size of the file
42 | file.seekg(0, std::ios::end);
43 | size_t size = file.tellg();
44 | file.seekg(0, std::ios::beg);
45 |
46 | // Allocate a buffer to hold the file contents
47 | char* buffer = new char[size + 1];
48 |
49 | // Read the file into the buffer
50 | file.read(buffer, size);
51 | buffer[size] = '\0';
52 |
53 | // Close the file and return the buffer
54 | file.close();
55 | return buffer;
56 | }
57 | bool writefile_internal(const std::string& path, const char* contents, size_t size) {
58 | std::ofstream file(path, std::ios::binary);
59 | if (!file.is_open()) {
60 | return false;
61 | }
62 |
63 | file.write(contents, size);
64 | file.close();
65 | return true;
66 | }
67 |
68 | bool isfile(std::string path) {
69 | path = fix_path(path);
70 | return std::filesystem::is_regular_file(path);
71 | }
72 | bool isfolder(std::string path) {
73 | path = fix_path(path);
74 | if (is_within_workspace(path)) {
75 | return std::filesystem::is_directory(path);
76 | } else {
77 | return false;
78 | }
79 | }
80 | const char* readfile(std::string path) {
81 | path = fix_path(path);
82 | if (is_within_workspace(path)) {
83 | return readfile_internal(path);
84 | } else {
85 | return nullptr;
86 | }
87 | }
88 | bool delfile(std::string path) {
89 | path = fix_path(path);
90 | if (is_within_workspace(path) && std::filesystem::is_regular_file(path)) {
91 | std::filesystem::remove(path);
92 | return true;
93 | } else {
94 | return false;
95 | }
96 | }
97 | bool delfolder(std::string path) {
98 | path = fix_path(path);
99 | if (is_within_workspace(path) && std::filesystem::is_directory(path)) {
100 | std::filesystem::remove(path);
101 | return true;
102 | } else {
103 | return false;
104 | }
105 | }
106 | bool writefile(std::string path, const char* data) {
107 | path = fix_path(path);
108 | if (is_within_workspace(path)) {
109 | writefile_internal(path, data, strlen(data));
110 | return true;
111 | } else {
112 | return false;
113 | }
114 | }
115 | std::vector* listfiles(std::string original_path) {
116 | replace_char(original_path, '/', '\\');
117 | // Create a vector to store the file paths
118 | std::vector* file_paths = new std::vector;
119 |
120 | // Get the full path to the workspace folder
121 | std::string workspace_path = get_exploit_path() + XorString("\\workspace\\");
122 |
123 | // Concatenate the original path with the workspace path to get the full path
124 | std::string full_path = workspace_path + original_path;
125 |
126 | // Append the wildcard character to the path to search for all files
127 | full_path += "\\*";
128 |
129 | // Initialize the WIN32_FIND_DATA structure
130 | WIN32_FIND_DATAA ffd;
131 |
132 | // Find the first file in the directory
133 | HANDLE hFind = FindFirstFileA(full_path.c_str(), &ffd);
134 | if (hFind == INVALID_HANDLE_VALUE) {
135 | return nullptr;
136 | }
137 |
138 | // Iterate over the files in the directory
139 | do {
140 | // Skip the "." and ".." entries
141 | if (strcmp(ffd.cFileName, ".") == 0 || strcmp(ffd.cFileName, "..") == 0 || (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
142 | continue;
143 | }
144 | // Get the full path of the file
145 | std::string file_path = original_path + "\\" + std::string(ffd.cFileName);
146 | //file_path.erase(0, workspace_path.length());
147 | // Add the file path to the vector
148 | file_paths->push_back(file_path);
149 | } while (FindNextFileA(hFind, &ffd) != 0);
150 |
151 | // Close the directory
152 | FindClose(hFind);
153 |
154 | // Return the vector of file paths
155 | return file_paths;
156 | }
157 |
158 |
159 |
160 |
161 |
162 |
163 | std::vector* listfolders(std::string original_path) {
164 | replace_char(original_path, '/', '\\');
165 | // Create a vector to store the file paths
166 | std::vector* file_paths = new std::vector;
167 |
168 | // Get the full path to the workspace folder
169 | std::string workspace_path = get_exploit_path() + XorString("\\workspace\\");
170 |
171 | // Concatenate the original path with the workspace path to get the full path
172 | std::string full_path = workspace_path + original_path;
173 |
174 | // Append the wildcard character to the path to search for all files
175 | full_path += "\\*";
176 |
177 | // Initialize the WIN32_FIND_DATA structure
178 | WIN32_FIND_DATAA ffd;
179 |
180 | // Find the first file in the directory
181 | HANDLE hFind = FindFirstFileA(full_path.c_str(), &ffd);
182 | if (hFind == INVALID_HANDLE_VALUE) {
183 | return nullptr;
184 | }
185 |
186 | // Iterate over the files in the directory
187 | do {
188 | // Skip the "." and ".." entries
189 | if (strcmp(ffd.cFileName, ".") == 0 || strcmp(ffd.cFileName, "..") == 0 || (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
190 | continue;
191 | }
192 | // Get the full path of the file
193 | std::string file_path = original_path + "\\" + std::string(ffd.cFileName) + "\\";
194 | //file_path.erase(0, workspace_path.length());
195 | // Add the file path to the vector
196 | file_paths->push_back(file_path);
197 | } while (FindNextFileA(hFind, &ffd) != 0);
198 |
199 | // Close the directory
200 | FindClose(hFind);
201 |
202 | // Return the vector of file paths
203 | return file_paths;
204 | }
--------------------------------------------------------------------------------
/TaaprWare2-UI/TaaprWare2-UI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {7631001F-BBE2-4FD4-AB1E-8B8C6E2CBF0D}
8 | Exe
9 | TaaprWare2_UI
10 | TaaprWare2-UI
11 | v4.8
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | true
17 | false
18 |
19 | publish\
20 | true
21 | Disk
22 | false
23 | Foreground
24 | 7
25 | Days
26 | false
27 | false
28 | true
29 | 0
30 | 1.0.0.%2a
31 | false
32 | true
33 |
34 |
35 | AnyCPU
36 | false
37 | none
38 | false
39 | ..\..\TaaprWare2\Debug\
40 | DEBUG;TRACE
41 | prompt
42 | 4
43 |
44 |
45 | AnyCPU
46 | pdbonly
47 | true
48 | ..\..\RobloxLuaC\Release\
49 | TRACE
50 | prompt
51 | 4
52 |
53 |
54 | taapr.ico
55 |
56 |
57 |
58 |
59 |
60 |
61 | ..\..\..\..\..\..\Program Files (x86)\Actipro Software\WinForms-Controls\v21.1.1\Tools\LanguageDesigner\ActiproSoftware.Shared.Wpf.dll
62 |
63 |
64 | ..\..\..\..\..\..\Program Files (x86)\Actipro Software\WinForms-Controls\v21.1.1\Tools\LanguageDesigner\ActiproSoftware.SyntaxEditor.Wpf.dll
65 |
66 |
67 | ..\..\..\..\..\..\Program Files (x86)\Actipro Software\WinForms-Controls\v21.1.1\Tools\LanguageDesigner\ActiproSoftware.Text.Wpf.dll
68 |
69 |
70 | ..\..\..\..\Downloads\AvalonEdit-6.1.3\ICSharpCode.AvalonEdit.Sample\bin\Debug\net472\ICSharpCode.AvalonEdit.dll
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | 4.0
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 | MSBuild:Compile
98 | Designer
99 |
100 |
101 | MSBuild:Compile
102 | Designer
103 |
104 |
105 | App.xaml
106 | Code
107 |
108 |
109 |
110 |
111 |
112 | MainWindow.xaml
113 | Code
114 |
115 |
116 |
117 |
118 |
119 | Code
120 |
121 |
122 | True
123 | True
124 | Resources.resx
125 |
126 |
127 | True
128 | Settings.settings
129 | True
130 |
131 |
132 | ResXFileCodeGenerator
133 | Resources.Designer.cs
134 |
135 |
136 | SettingsSingleFileGenerator
137 | Settings.Designer.cs
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | False
149 | Microsoft .NET Framework 4.8 %28x86 and x64%29
150 | true
151 |
152 |
153 | False
154 | .NET Framework 3.5 SP1
155 | false
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
--------------------------------------------------------------------------------
/Hax/rlapi.cpp:
--------------------------------------------------------------------------------
1 | #include "rlapi.h"
2 |
3 | TValue* luaO_nilobject = reinterpret_cast(addresses::luaO_nilobject);
4 |
5 | const types::pseudo2addr pseudo2addr = functions::luau::pseudo2addr;
6 |
7 | int gettop(UINT rL) {
8 | return (int)(rL_get(StkId, top) - rL_get(StkId, base));
9 | }
10 |
11 | void settop(UINT rL, int idx) {
12 | if (idx >= 0) {
13 | while (rL_get(StkId, top) < rL_get(StkId, base) + idx)
14 | setnilvalue(rL_get(StkId, top));
15 | rL_get(StkId, top) = rL_get(StkId, base) + idx;
16 | } else {
17 | rL_get(StkId, top) += idx + 1; // `subtract' index (index is negative)
18 | }
19 | }
20 |
21 | TValue* index2addr(UINT rL, int idx) {
22 | if (idx > 0) {
23 | TValue* o = rL_get(StkId, base) + (idx - 1);
24 | //api_check(L, idx <= L->ci->top - L->base);
25 | if (o >= rL_get(StkId, top))
26 | return (TValue*)luaO_nilobject;
27 | else
28 | return o;
29 | } else if (idx > LUA_REGISTRYINDEX) {
30 | //api_check(L, idx != 0 && -idx <= L->top - L->base);
31 | return rL_get(StkId, top) + idx;
32 | } else {
33 | return (TValue*)functions::luau::pseudo2addr(rL, idx);
34 | }
35 | }
36 |
37 | void pushvalue(UINT rL, int idx) {
38 | StkId o = index2addr(rL, idx);
39 | setobj2s(rL, rL_get(StkId, top), o);
40 | api_incr_top(rL);
41 | }
42 |
43 | void pushnil(UINT rL) {
44 | setnilvalue(rL_get(StkId, top));
45 | api_incr_top(L);
46 | }
47 |
48 | void pushnumber(UINT rL, double n) {
49 | setnvalue(rL_get(StkId, top), n);
50 | api_incr_top(L);
51 | }
52 |
53 | void pushinteger(UINT rL, int n) {
54 | setnvalue(rL_get(StkId, top), (double)(n));
55 | api_incr_top(L);
56 | }
57 |
58 | void pushunsigned(UINT rL, unsigned u) {
59 | setnvalue(rL_get(StkId, top), (double)(u));
60 | api_incr_top(L);
61 | }
62 |
63 | void pushvector(UINT rL, float x, float y, float z) {
64 | setvvalue(rL_get(StkId, top), x, y, z, 0.0f);
65 | api_incr_top(L);
66 | }
67 |
68 | void pushboolean(UINT rL, int b) {
69 | setbvalue(rL_get(StkId, top), (b != 0)); // ensure that true is 1
70 | api_incr_top(rL);
71 | }
72 |
73 | void pushtable(UINT rL, UINT t) {
74 | sethvalue(rL, rL_get(StkId, top), t);
75 | api_incr_top(rL);
76 | }
77 |
78 | unsigned int luaS_hash(const char* str, size_t len) {
79 | // Note that this hashing algorithm is replicated in BytecodeBuilder.cpp, BytecodeBuilder::getStringHash
80 | unsigned int a = 0, b = 0;
81 | unsigned int h = unsigned(len);
82 |
83 | // hash prefix in 12b chunks (using aligned reads) with ARX based hash (LuaJIT v2.1, lookup3)
84 | // note that we stop at length<32 to maintain compatibility with Lua 5.1
85 | while (len >= 32) {
86 | #define rol(x, s) ((x >> s) | (x << (32 - s)))
87 | #define mix(u, v, w) a ^= h, a -= rol(h, u), b ^= a, b -= rol(a, v), h ^= b, h -= rol(b, w)
88 |
89 | // should compile into fast unaligned reads
90 | uint32_t block[3];
91 | memcpy(block, str, 12);
92 |
93 | a += block[0];
94 | b += block[1];
95 | h += block[2];
96 | mix(14, 11, 25);
97 | str += 12;
98 | len -= 12;
99 |
100 | #undef mix
101 | #undef rol
102 | }
103 |
104 | // original Lua 5.1 hash for compatibility (exact match when len<32)
105 | for (size_t i = len; i > 0; --i)
106 | h ^= (h << 5) + (h >> 2) + (uint8_t)str[i - 1];
107 |
108 | return h;
109 | }
110 |
111 | void pushlstring(UINT rL, const char* s, size_t len) {
112 | setsvalue(rL, rL_get(StkId, top), luaS_newlstr(rL, s, len));
113 | api_incr_top(L);
114 | }
115 |
116 | void pushstring(UINT rL, const char* s) {
117 | if (s == NULL)
118 | pushnil(rL);
119 | else
120 | pushlstring(rL, s, strlen(s));
121 | }
122 |
123 | UINT luaS_newlstr(UINT rL, const char* str, size_t l) {
124 | unsigned int h = luaS_hash(str, l);
125 | // This is not required but i believe if you dont have it your exploit strings will always fail EQ checks with roblox strings
126 | /*
127 | for (TString* el = L->global->strt.hash[lmod(h, L->global->strt.size)]; el != NULL; el = el->next)
128 | {
129 | if (el->len == l && (memcmp(str, getstr(el), l) == 0))
130 | {
131 | // string may be dead
132 | if (isdead(L->global, obj2gco(el)))
133 | changewhite(obj2gco(el));
134 | return el;
135 | }
136 | }
137 | */
138 | return newlstr(rL, str, l, h); // not found
139 | }
140 |
141 | UINT newlstr(UINT rL, const char* str, size_t l, unsigned int h) {
142 | // this is the first good function i have recreated ever
143 | // since this was hell for me to make the first time ill add comments to help someone else whos also doing it for the first time
144 | if (l > MAXSSIZE) {
145 | printf(XorString("String too big! (How did you make a string over 1 billion characters long)\n"));
146 | return 0;
147 | }
148 | const int mem_size = 24 + l + 1; // 24 is the size of a TString + length of string + 1 byte for the '\0'
149 |
150 | UINT ts = (UINT)malloc(mem_size);
151 | //printf("Allocated memory at %X\n", ts);
152 | luaC_init(rL, ts, LUA_TSTRING); // DO NOT FORGET THIS!!!!!!!!!!!!!!!!!!!! (without this the GC will completely error and die)
153 | //printf("Initialized\n");
154 | structptr_set(ts, UINT, rTString, atom, ATOM_UNDEF); // not required, looking for ATOM_UNDEF (32768) is good for identifying newlstr pseudocode in ida
155 | // atom in computer science is for stopping any other code from erroring or being unstable because it accessed an object in the middle of a calculation
156 | //printf("Set ts->atom\n");
157 | structptr_set(ts, UINT, rTString, hash, h); // not required, encrypted, not used for eq checks suprisingly
158 | //printf("Set ts->hash\n");
159 | structptr_set(ts, UINT, rTString, len, unsigned(l)); // encrypted
160 | //printf("Set ts->len\n");
161 |
162 | memcpy((char*)(struct_get(ts, UINT, rTString, data)), str, l); // structptr_get wouldnt work here because we need address not value at address
163 | // you can see from Cheat Engine how easy it is to get a const char from a TString
164 | //printf("Set ts->data\n");
165 | ((char*)(struct_get(ts, UINT, rTString, data)))[l] = '\0'; // ending 0, remove if you want random garbage in memory at the more unexpected times
166 | //printf("Added null terminator\n");
167 | // this is actually useless which is something i didnt realize when writing it
168 | // it would only do stuff if i recreated the commented code i put in luaS_newlstr
169 | /*
170 | UINT rG = structptr_get(rL, UINT, rL, global);
171 | //printf("Got rG\n");
172 | h = lmod(h, structptr_get(rG, UINT, rG, strt_size));
173 | //printf("Set h to %X\n", h);
174 | structptr_set(ts, UINT, rTString, next, (*structptr_get(rG, UINT**, rG, strt_hash))[h]);
175 | //printf("Set ts->next\n");
176 | (*structptr_get(rG, UINT**, rG, strt_hash))[h] = ts;
177 | //printf("Set tb->hash[h]\n");
178 |
179 | structptr_set(ts, UINT, rG, strt_nuse, structptr_get(rG, UINT, rG, strt_nuse) + 1);
180 | //printf("Incremented nuse\n");
181 | if (structptr_get(rG, UINT, rG, strt_nuse) > (uint32_t)(structptr_get(rG, UINT, rG, strt_size)) && structptr_get(rG, UINT, rG, strt_size) <= INT_MAX / 2) {
182 | //luaS_resize(L, strt->size * 2); // too crowded
183 | printf("oh no\n");
184 | }
185 | */
186 | //printf("Done\n");
187 | return (UINT)ts;
188 | }
189 |
190 | void insert(UINT rL, int idx) {
191 | StkId p = index2addr(rL, idx);
192 | for (StkId q = rL_get(StkId, top); q > p; q--)
193 | setobj2s(L, q, q - 1);
194 | setobj2s(L, p, rL_get(StkId, top));
195 | }
196 |
197 | void xmove(UINT from, UINT to, int n) {
198 | if (from == to) {
199 | return;
200 | }
201 | StkId ttop = *reinterpret_cast(to + offsets::rL::top);
202 | StkId ftop = *reinterpret_cast(from + offsets::rL::top) - n;
203 | for (int i = 0; i < n; i++) {
204 | setobj2s(to, ttop + i, ftop + i);
205 | }
206 | *reinterpret_cast(from + offsets::rL::top) = ftop;
207 | *reinterpret_cast(to + offsets::rL::top) = ttop + n;
208 | }
--------------------------------------------------------------------------------
/Hax/Luau/BytecodeBuilder.h:
--------------------------------------------------------------------------------
1 | // This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2 | #pragma once
3 |
4 | #include "Luau/Bytecode.h"
5 | #include "Luau/DenseHash.h"
6 | #include "Luau/StringUtils.h"
7 |
8 | #include
9 |
10 | namespace Luau
11 | {
12 |
13 | class BytecodeEncoder
14 | {
15 | public:
16 | virtual ~BytecodeEncoder() {}
17 |
18 | virtual uint8_t encodeOp(uint8_t op) = 0;
19 | };
20 |
21 | class BytecodeBuilder
22 | {
23 | public:
24 | // BytecodeBuilder does *not* copy the data passed via StringRef; instead, it keeps the ref around until finalize()
25 | // Please be careful with the lifetime of the data that's being passed because of this.
26 | // The safe and correct pattern is to only build StringRefs out of pieces of AST (AstName or AstArray<>) that are backed by AstAllocator.
27 | // Note that you must finalize() the builder before the Allocator backing the Ast is destroyed.
28 | struct StringRef
29 | {
30 | // To construct a StringRef, use sref() from Compiler.cpp.
31 | const char* data = nullptr;
32 | size_t length = 0;
33 |
34 | bool operator==(const StringRef& other) const;
35 | };
36 |
37 | struct TableShape
38 | {
39 | static const unsigned int kMaxLength = 32;
40 |
41 | int32_t keys[kMaxLength];
42 | unsigned int length = 0;
43 |
44 | bool operator==(const TableShape& other) const;
45 | };
46 |
47 | BytecodeBuilder(BytecodeEncoder* encoder = 0);
48 |
49 | uint32_t beginFunction(uint8_t numparams, bool isvararg = false);
50 | void endFunction(uint8_t maxstacksize, uint8_t numupvalues);
51 |
52 | void setMainFunction(uint32_t fid);
53 |
54 | int32_t addConstantNil();
55 | int32_t addConstantBoolean(bool value);
56 | int32_t addConstantNumber(double value);
57 | int32_t addConstantString(StringRef value);
58 | int32_t addImport(uint32_t iid);
59 | int32_t addConstantTable(const TableShape& shape);
60 | int32_t addConstantClosure(uint32_t fid);
61 |
62 | int16_t addChildFunction(uint32_t fid);
63 |
64 | void emitABC(LuauOpcode op, uint8_t a, uint8_t b, uint8_t c);
65 | void emitAD(LuauOpcode op, uint8_t a, int16_t d);
66 | void emitE(LuauOpcode op, int32_t e);
67 | void emitAux(uint32_t aux);
68 |
69 | size_t emitLabel();
70 |
71 | [[nodiscard]] bool patchJumpD(size_t jumpLabel, size_t targetLabel);
72 | [[nodiscard]] bool patchSkipC(size_t jumpLabel, size_t targetLabel);
73 |
74 | void foldJumps();
75 | void expandJumps();
76 |
77 | void setDebugFunctionName(StringRef name);
78 | void setDebugFunctionLineDefined(int line);
79 | void setDebugLine(int line);
80 | void pushDebugLocal(StringRef name, uint8_t reg, uint32_t startpc, uint32_t endpc);
81 | void pushDebugUpval(StringRef name);
82 | uint32_t getDebugPC() const;
83 |
84 | void addDebugRemark(const char* format, ...) LUAU_PRINTF_ATTR(2, 3);
85 |
86 | void finalize();
87 |
88 | enum DumpFlags
89 | {
90 | Dump_Code = 1 << 0,
91 | Dump_Lines = 1 << 1,
92 | Dump_Source = 1 << 2,
93 | Dump_Locals = 1 << 3,
94 | Dump_Remarks = 1 << 4,
95 | };
96 |
97 | void setDumpFlags(uint32_t flags)
98 | {
99 | dumpFlags = flags;
100 | dumpFunctionPtr = &BytecodeBuilder::dumpCurrentFunction;
101 | }
102 |
103 | void setDumpSource(const std::string& source);
104 |
105 | const std::string& getBytecode() const
106 | {
107 | LUAU_ASSERT(!bytecode.empty()); // did you forget to call finalize?
108 | return bytecode;
109 | }
110 |
111 | std::string dumpFunction(uint32_t id) const;
112 | std::string dumpEverything() const;
113 |
114 | static uint32_t getImportId(int32_t id0);
115 | static uint32_t getImportId(int32_t id0, int32_t id1);
116 | static uint32_t getImportId(int32_t id0, int32_t id1, int32_t id2);
117 |
118 | static uint32_t getStringHash(StringRef key);
119 |
120 | static std::string getError(const std::string& message);
121 |
122 | static uint8_t getVersion();
123 |
124 | private:
125 | struct Constant
126 | {
127 | enum Type
128 | {
129 | Type_Nil,
130 | Type_Boolean,
131 | Type_Number,
132 | Type_String,
133 | Type_Import,
134 | Type_Table,
135 | Type_Closure,
136 | };
137 |
138 | Type type;
139 | union
140 | {
141 | bool valueBoolean;
142 | double valueNumber;
143 | unsigned int valueString; // index into string table
144 | uint32_t valueImport; // 10-10-10-2 encoded import id
145 | uint32_t valueTable; // index into tableShapes[]
146 | uint32_t valueClosure; // index of function in global list
147 | };
148 | };
149 |
150 | struct ConstantKey
151 | {
152 | Constant::Type type;
153 | // Note: this stores value* from Constant; when type is Number_Double, this stores the same bits as double does but in uint64_t.
154 | uint64_t value;
155 |
156 | bool operator==(const ConstantKey& key) const
157 | {
158 | return type == key.type && value == key.value;
159 | }
160 | };
161 |
162 | struct Function
163 | {
164 | std::string data;
165 |
166 | uint8_t maxstacksize = 0;
167 | uint8_t numparams = 0;
168 | uint8_t numupvalues = 0;
169 | bool isvararg = false;
170 |
171 | unsigned int debugname = 0;
172 | int debuglinedefined = 0;
173 |
174 | std::string dump;
175 | std::string dumpname;
176 | };
177 |
178 | struct DebugLocal
179 | {
180 | unsigned int name;
181 |
182 | uint8_t reg;
183 | uint32_t startpc;
184 | uint32_t endpc;
185 | };
186 |
187 | struct DebugUpval
188 | {
189 | unsigned int name;
190 | };
191 |
192 | struct Jump
193 | {
194 | uint32_t source;
195 | uint32_t target;
196 | };
197 |
198 | struct StringRefHash
199 | {
200 | size_t operator()(const StringRef& v) const;
201 | };
202 |
203 | struct ConstantKeyHash
204 | {
205 | size_t operator()(const ConstantKey& key) const;
206 | };
207 |
208 | struct TableShapeHash
209 | {
210 | size_t operator()(const TableShape& v) const;
211 | };
212 |
213 | std::vector functions;
214 | uint32_t currentFunction = ~0u;
215 | uint32_t mainFunction = ~0u;
216 |
217 | std::vector insns;
218 | std::vector lines;
219 | std::vector constants;
220 | std::vector protos;
221 | std::vector jumps;
222 |
223 | std::vector tableShapes;
224 |
225 | bool hasLongJumps = false;
226 |
227 | DenseHashMap constantMap;
228 | DenseHashMap tableShapeMap;
229 | DenseHashMap protoMap;
230 |
231 | int debugLine = 0;
232 |
233 | std::vector debugLocals;
234 | std::vector debugUpvals;
235 |
236 | DenseHashMap stringTable;
237 |
238 | std::vector> debugRemarks;
239 | std::string debugRemarkBuffer;
240 |
241 | BytecodeEncoder* encoder = nullptr;
242 | std::string bytecode;
243 |
244 | uint32_t dumpFlags = 0;
245 | std::vector dumpSource;
246 |
247 | std::string (BytecodeBuilder::*dumpFunctionPtr)() const = nullptr;
248 |
249 | void validate() const;
250 |
251 | std::string dumpCurrentFunction() const;
252 | void dumpInstruction(const uint32_t* opcode, std::string& output, int targetLabel) const;
253 |
254 | void writeFunction(std::string& ss, uint32_t id) const;
255 | void writeLineInfo(std::string& ss) const;
256 | void writeStringTable(std::string& ss) const;
257 |
258 | int32_t addConstant(const ConstantKey& key, const Constant& value);
259 | unsigned int addStringTableEntry(StringRef value);
260 | };
261 |
262 | } // namespace Luau
263 |
--------------------------------------------------------------------------------
/Hax/rlapi.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "addresses.h"
4 |
5 | #define LUAI_MAXCSTACK 8000
6 | #define LUA_REGISTRYINDEX (-LUAI_MAXCSTACK - 2000)
7 | #define LUA_ENVIRONINDEX (-LUAI_MAXCSTACK - 2001)
8 | #define LUA_GLOBALSINDEX (-LUAI_MAXCSTACK - 2002)
9 | #define lua_upvalueindex(i) (LUA_GLOBALSINDEX - (i))
10 | #define lua_ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
11 | /*
12 | Type 0: nil
13 | Type 1: boolean
14 | Type 2: number
15 | Type 3: vector
16 | Type 4: userdata
17 | Type 5: string
18 | Type 6: thread
19 | Type 7: function
20 | Type 8: userdata
21 | Type 9: table
22 | */
23 | enum lua_Type {
24 | LUA_TNIL = 0, // must be 0 due to lua_isnoneornil
25 | LUA_TBOOLEAN = 1, // must be 1 due to l_isfalse
26 |
27 | LUA_TNUMBER,
28 | LUA_TVECTOR,
29 | LUA_TLIGHTUSERDATA,
30 |
31 | LUA_TSTRING, // all types above this must be value types, all types below this must be GC types - see iscollectable
32 |
33 | LUA_TTHREAD,
34 | LUA_TFUNCTION,
35 | LUA_TUSERDATA,
36 | LUA_TTABLE,
37 |
38 | // values below this line are used in GCObject tags but may never show up in TValue type tags
39 | LUA_TPROTO,
40 | LUA_TUPVAL,
41 | LUA_TDEADKEY,
42 |
43 | // the count of TValue type tags
44 | LUA_T_COUNT = LUA_TPROTO
45 | };
46 |
47 | #define CommonHeader \
48 | LUAVM_SHUFFLE3(;, uint8_t tt, uint8_t marked, uint8_t memcat)
49 | typedef struct GCheader {
50 | CommonHeader;
51 | } GCheader;
52 | typedef struct {
53 | char padding[88];
54 | } GCHeader_size;
55 |
56 | // its a UNION not a struct
57 | union GCObject {
58 | GCheader gch;
59 | UINT ts; // tstring
60 | UINT u; // userdata (udata)
61 | UINT cl; // closure
62 | UINT h; // table
63 | UINT p; // proto
64 | UINT uv; // upvalue (upval)
65 | UINT th; // thread
66 | GCHeader_size padding;
67 | };
68 |
69 | // its a UNION not a struct
70 | typedef union {
71 | GCObject* gc;
72 | double n;
73 | int b;
74 | void* p;
75 | float v[2]; // v[0], v[1] live here; v[2] lives in TValue::extra (USED FOR VECTORS)
76 | } Value;
77 |
78 | typedef struct lua_TValue {
79 | Value value;
80 | int extra[1]; // For when a vector is being
81 | int tt;
82 | } TValue;
83 | typedef TValue* StkId;
84 |
85 | extern TValue* luaO_nilobject;
86 |
87 | #define api_incr_top(rL) rL_get(StkId, top) += 1;
88 |
89 | #define setnilvalue(obj) ((obj)->tt = LUA_TNIL)
90 |
91 | #define setnvalue(obj, x) \
92 | { \
93 | TValue* i_o = (obj); \
94 | i_o->value.n = (x); \
95 | i_o->tt = LUA_TNUMBER; \
96 | }
97 |
98 | #define setvvalue(obj, x, y, z, w) \
99 | { \
100 | TValue* i_o = (obj); \
101 | float* i_v = i_o->value.v; \
102 | i_v[0] = (x); \
103 | i_v[1] = (y); \
104 | i_v[2] = (z); \
105 | i_o->tt = LUA_TVECTOR; \
106 | }
107 |
108 | #define setpvalue(obj, x) \
109 | { \
110 | TValue* i_o = (obj); \
111 | i_o->value.p = (x); \
112 | i_o->tt = LUA_TLIGHTUSERDATA; \
113 | }
114 |
115 | #define setbvalue(obj, x) \
116 | { \
117 | TValue* i_o = (obj); \
118 | i_o->value.b = (x); \
119 | i_o->tt = LUA_TBOOLEAN; \
120 | }
121 |
122 | #define setsvalue(L, obj, x) \
123 | { \
124 | TValue* i_o = (obj); \
125 | i_o->value.gc = (GCObject*)(x); \
126 | i_o->tt = LUA_TSTRING; \
127 | }
128 |
129 | #define setuvalue(L, obj, x) \
130 | { \
131 | TValue* i_o = (obj); \
132 | i_o->value.gc = (GCObject*)(x); \
133 | i_o->tt = LUA_TUSERDATA; \
134 | }
135 |
136 | #define setthvalue(L, obj, x) \
137 | { \
138 | TValue* i_o = (obj); \
139 | i_o->value.gc = (GCObject*)(x); \
140 | i_o->tt = LUA_TTHREAD; \
141 | }
142 |
143 | #define setclvalue(L, obj, x) \
144 | { \
145 | TValue* i_o = (obj); \
146 | i_o->value.gc = (GCObject*)(x); \
147 | i_o->tt = LUA_TFUNCTION; \
148 | }
149 |
150 | #define sethvalue(L, obj, x) \
151 | { \
152 | TValue* i_o = (obj); \
153 | i_o->value.gc = (GCObject*)(x); \
154 | i_o->tt = LUA_TTABLE; \
155 | }
156 |
157 | #define setptvalue(L, obj, x) \
158 | { \
159 | TValue* i_o = (obj); \
160 | i_o->value.gc = (GCObject*)(x); \
161 | i_o->tt = LUA_TPROTO; \
162 | }
163 |
164 | #define setupvalue(L, obj, x) \
165 | { \
166 | TValue* i_o = (obj); \
167 | i_o->value.gc = (GCObject*)(x); \
168 | i_o->tt = LUA_TUPVAL; \
169 | }
170 |
171 | #define setobj(L, obj1, obj2) \
172 | { \
173 | const TValue* o2 = (obj2); \
174 | TValue* o1 = (obj1); \
175 | *o1 = *o2; \
176 | }
177 | // to stack
178 | #define setobj2s setobj
179 | // from table to same table (no barrier)
180 | #define setobjt2t setobj
181 | // to table (needs barrier)
182 | #define setobj2t setobj
183 | // to new object (no barrier)
184 | #define setobj2n setobj
185 |
186 | #define setttype(obj, tt) (ttype(obj) = (tt))
187 |
188 | #define ttype(o) ((o)->tt)
189 | #define ttisnil(o) (ttype(o) == LUA_TNIL)
190 | #define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
191 | #define iscollectable(o) (ttype(o) >= LUA_TSTRING)
192 | #define ttisstring(o) (ttype(o) == LUA_TSTRING)
193 | #define ttistable(o) (ttype(o) == LUA_TTABLE)
194 | #define ttisfunction(o) (ttype(o) == LUA_TFUNCTION)
195 | #define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN)
196 | #define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA)
197 | #define ttisthread(o) (ttype(o) == LUA_TTHREAD)
198 | #define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA)
199 | #define ttisvector(o) (ttype(o) == LUA_TVECTOR)
200 | #define ttisupval(o) (ttype(o) == LUA_TUPVAL)
201 | #define gcvalue(o) (o)->value.gc
202 | #define pvalue(o) (o)->value.p
203 | #define nvalue(o) (o)->value.n
204 | #define vvalue(o) (o)->value.v
205 | #define tsvalue(o) &(o)->value.gc->ts
206 | #define uvalue(o) &(o)->value.gc->u
207 | #define clvalue(o) &(o)->value.gc->cl
208 | #define hvalue(o) &(o)->value.gc->h
209 | #define bvalue(o) (o)->value.b
210 | #define thvalue(o) &(o)->value.gc->th
211 | #define upvalue(o) &(o)->value.gc->uv
212 | #define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
213 | #define lmod(s, size) ((int)((s)&((size)-1)))
214 | #define MAXSSIZE (1 << 30)
215 | #define lua_pop(L, n) settop(L, -(n)-1)
216 |
217 | // Cry about it
218 | #define structptr_get(var_name, type, struct_name, member) ((offsets::struct_name::member##_get((UINT)(var_name + offsets::struct_name::member))))
219 | #define struct_get(var_name, type, struct_name, member) ((type)((UINT)(var_name) + offsets::struct_name::member))
220 | #define structptr_set(var_name, type, struct_name, member, value) (offsets::struct_name::member##_set((UINT)(var_name + offsets::struct_name::member), (UINT)(value)))
221 | #define struct_set(var_name, type, struct_name, member, value) ((type)((UINT)(var_name) + offsets::struct_name::member) = (type)(value))
222 | #define rL_get(type, member) (*reinterpret_cast(rL + offsets::rL::member))
223 | #define rLapi_func extern
224 |
225 | // For rCommonHeader->marked
226 | #define resetbits(x, m) ((x) &= cast_to(uint8_t, ~(m)))
227 | #define setbits(x, m) ((x) |= (m))
228 | #define testbits(x, m) ((x) & (m))
229 | #define bitmask(b) (1 << (b))
230 | #define bit2mask(b1, b2) (bitmask(b1) | bitmask(b2))
231 | #define l_setbit(x, b) setbits(x, bitmask(b))
232 | #define resetbit(x, b) resetbits(x, bitmask(b))
233 | #define testbit(x, b) testbits(x, bitmask(b))
234 | #define set2bits(x, b1, b2) setbits(x, (bit2mask(b1, b2)))
235 | #define reset2bits(x, b1, b2) resetbits(x, (bit2mask(b1, b2)))
236 | #define test2bits(x, b1, b2) testbits(x, (bit2mask(b1, b2)))
237 | #define WHITE0BIT 0
238 | #define WHITE1BIT 1
239 | #define BLACKBIT 2
240 | #define FIXEDBIT 3
241 | #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
242 | #define iswhite(x) test2bits(structptr_get(x, uint8_t, rCommonHeader, marked), WHITE0BIT, WHITE1BIT)
243 | #define isblack(x) testbit(structptr_get(x, uint8_t, rCommonHeader, marked), BLACKBIT)
244 | #define isgray(x) (!testbits(structptr_get(x, uint8_t, rCommonHeader, marked), WHITEBITS | bitmask(BLACKBIT)))
245 | #define isfixed(x) testbit(structptr_get(x, uint8_t, rCommonHeader, marked), FIXEDBIT)
246 | #define otherwhite(g) (structptr_get(v, uint8_t, g, currentwhite) ^ WHITEBITS)
247 | #define isdead(g, v) ((structptr_get(v, uint8_t, rCommonHeader, marked) & (WHITEBITS | bitmask(FIXEDBIT))) == (otherwhite(g) & WHITEBITS))
248 | #define changewhite(x) (structptr_get(x, uint8_t, rCommonHeader, marked) ^= WHITEBITS)
249 | #define gray2black(x) l_setbit(structptr_get(x, uint8_t, rCommonHeader, marked), BLACKBIT)
250 | #define luaC_white(g) ((uint8_t)(structptr_get(g, uint8_t, rG, currentwhite)) & WHITEBITS)
251 | #define sizestring(len) (offsets::rTString::data + len + 1)
252 | #define luaM_newgco(rL, t, size, memcat) ((t*)(functions::luau::luaM_newgco_(rL, size, memcat)))
253 | #define luaC_init(rL_, o, tt_) \
254 | { \
255 | structptr_set(o, uint8_t, rTString, tt, tt_); \
256 | structptr_set(o, uint8_t, rTString, memcat, structptr_get(rL_, uint8_t, rL, activememcat)); \
257 | structptr_set(o, uint8_t, rTString, marked, structptr_get(structptr_get(rL_, UINT, rL, global), uint8_t, rG, currentwhite)); \
258 | }
259 |
260 | #define ATOM_UNDEF -32768
261 |
262 | const extern types::pseudo2addr pseudo2addr;
263 | rLapi_func int gettop(UINT rL);
264 | rLapi_func void settop(UINT rL, int idx);
265 | rLapi_func TValue* index2addr(UINT rL, int idx);
266 | rLapi_func void pushvalue(UINT rL, int idx);
267 | rLapi_func void pushnil(UINT rL);
268 | rLapi_func void pushnumber(UINT rL, double n);
269 | rLapi_func void pushinteger(UINT rL, int n);
270 | rLapi_func void pushunsigned(UINT rL, unsigned u);
271 | rLapi_func void pushvector(UINT rL, float x, float y, float z);
272 | rLapi_func void pushboolean(UINT rL, int b);
273 | rLapi_func void pushtable(UINT rL, UINT t);
274 | rLapi_func unsigned int luaS_hash(const char* str, size_t len);
275 | rLapi_func void pushlstring(UINT rL, const char* s, size_t len);
276 | rLapi_func void pushstring(UINT rL, const char* s);
277 | rLapi_func UINT luaS_newlstr(UINT rL, const char* str, size_t l);
278 | rLapi_func UINT newlstr(UINT rL, const char* str, size_t l, unsigned int h);
279 | rLapi_func void insert(UINT rL, int idx);
280 | rLapi_func void xmove(UINT from, UINT to, int n);
281 |
--------------------------------------------------------------------------------
/Hax/addresses.h:
--------------------------------------------------------------------------------
1 | // [INFO] Roblox shuffles everything they can every update: addresses, offsets, and even offset encryptions
2 |
3 | #pragma once
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #include "encryption.h"
12 |
13 | const UINT base = reinterpret_cast(GetModuleHandleA(NULL));
14 |
15 | #define define_address(name, address) const UINT name = base + address
16 | #define define_type(return_type, calling_convention, name, ...) typedef return_type(calling_convention* rbx_newthread)(__VA_ARGS__)
17 | #define define_function(name) inline types::name name = reinterpret_cast(addresses::name)
18 | #define define_runtime_object(type, name) static type name
19 | #define define_offset(name, offset, getlamb, setlamb) \
20 | const int name = offset; \
21 | const auto name##_##get = [](T address_of_ptr) -> T {getlamb;}; \
22 | const auto name##_##set = [](T address_of_ptr, T value) -> void {setlamb;};
23 |
24 | typedef struct {
25 | BYTE bytes[5];
26 | } patch_5;
27 | typedef struct {
28 | BYTE bytes[6];
29 | } patch_6;
30 | typedef struct {
31 | BYTE bytes[16];
32 | } patch_16;
33 | typedef UINT* vftable;
34 | typedef struct {
35 | char contents[128];
36 | } rbx_string;
37 |
38 | typedef enum {
39 | _0_Anonymous,
40 | _1_LocalGUI, // Any action initiated by Roblox Studio or the mouse
41 | _2_GameScript, // Execution of a BaseScript object inside any DataModel
42 | _3_GameScriptInRobloxPlace, // Execution of a BaseScript object inside any DataModel, if the place was authored by Roblox
43 | _4_RobloxGameScript, // Execution of a BaseScript object written by Roblox inside any DataModel
44 | _5_CmdLine, // Any script executed from the Studio command line
45 | _6_COM, // Scripts executed via the COM API (usually comes from roblox.com)
46 | _7_WebService, // Scripts executed via the Web Service API (usually comes from roblox.com)
47 | _8_Replicator, // Receiving data via replication
48 | COUNT_Identities // Not a true identity. Used for enumeration
49 | } Identities;
50 | #define execution_level _8_Replicator // Feel free to edit
51 | typedef enum {
52 | Output,
53 | Info,
54 | Warn,
55 | Error
56 | } PrintType;
57 | typedef enum {
58 | StopJob,
59 | ContinueStepping,
60 | } JobStatus;
61 |
62 | namespace objects {
63 | typedef struct instance instance;
64 | typedef struct class_descriptor class_descriptor;
65 | typedef struct datamodel datamodel;
66 | typedef struct job job;
67 | typedef struct waiting_hybrid_scripts_job waiting_hybrid_scripts_job;
68 | typedef struct task_scheduler task_scheduler;
69 | typedef struct script_start script_start;
70 | struct instance {
71 | vftable vftable;
72 | std::shared_ptr self;
73 | class_descriptor* class_descriptor;
74 | char padding1[0x14];
75 | std::string* name;
76 | std::vector* children;
77 | char padding2[0x4];
78 | instance* parent;
79 | };
80 | struct class_descriptor {
81 | char padding2[0x4];
82 | std::string* class_name;
83 | };
84 | struct job {
85 | vftable vftable;
86 | job* self;
87 | char padding1[8];
88 | std::string name;
89 | };
90 | struct waiting_hybrid_scripts_job {
91 | vftable vftable;
92 | char padding1[0x12C];
93 | instance* script_context;
94 | };
95 | struct task_scheduler {
96 | char padding1[0x118];
97 | double fps;
98 | char padding2[0x14];
99 | std::vector> jobs;
100 | };
101 | struct script_start {
102 | std::shared_ptr script;
103 | Identities identity;
104 | int nullptrs[8];
105 | };
106 | }
107 | typedef JobStatus(__fastcall* job_step_func)(objects::job* self, int fakearg, int a2);
108 |
109 | // plusgiant5#7930 for address help
110 | // you can get base execution with a bit of editing with no offsets and only type_name, rbx_getscheduler, rbx_addscript, rbx_runscript, and rbx_deserializer_detour 1 and 2
111 | const UINT rbx_writevoxels_instsize = 13; // sum of length of instructions affected by placing a push ret (5 bytes) at rbx_writevoxels
112 | // instructions affected by placing a push ret (5 bytes) at rbx_writevoxels
113 | #define rbx_writevoxels_overwritten_instructions \
114 | mov[ebp - 0x44], ecx; \
115 | mov[ebp - 0x134], 0x3246AE8;
116 | namespace addresses {
117 | define_address(rbx_printf, 0xC2DCE0); // tons of ways to get this
118 | define_address(rbx_getscheduler, 0x718F60); // tons of ways to get this
119 | define_address(rbx_addscript, 0x3B04B0); // startscript's only xref (used for setting level)
120 | define_address(rbx_runscript, 0x3BC530); // xref addscript and check each one until a breakpoint hits (used for starting execution cycle)
121 | define_address(rbx_deserializer_detour, 0x340230); // after getbytecode in deserializer, right after the conditional (used for setting bytecode)
122 | define_address(rbx_deserializer_detour_2, 0x340204); // after getbytecode in deserializer, inside the conditional, after the label definition (used for hashcheck bypass)
123 | define_address(rbx_writevoxels, 0xF2BAA0); // [AFTER THE PROLOGUE] cause a Lua error in WriteVoxels to know how to find this
124 |
125 | // Look at Luau source for all of these
126 | define_address(type_name, 0x13ECB30); // easiest Luau function "no value"
127 | define_address(pseudo2addr, 0x13DE050); // literally just scroll down from type_name and you will 99% see a function that calls this lol
128 | define_address(luaO_nilobject, 0x2482770); // the only pointer inside pseudo2addr
129 |
130 | define_address(load, 0x33D0E0); // aka LuaVM::load, for loadstring only, also credit to Nezy-Exploit for the code involving this
131 | }
132 |
133 | namespace types {
134 | typedef void (__cdecl* rbx_printf)(PrintType type, const char* format, ...);
135 | typedef objects::task_scheduler* (__cdecl* rbx_getscheduler)();
136 | typedef void(__fastcall* rbx_addscript)(objects::instance* scriptcontext, int fake, objects::script_start script_start);
137 | typedef void(__fastcall* rbx_runscript)(objects::instance* runtimescriptservice, int fake, objects::instance* script);
138 |
139 | typedef const char*(__fastcall* type_name)(UINT rL, int type);
140 | typedef void*(__fastcall* pseudo2addr)(UINT rL, int idx);
141 |
142 | typedef UINT(__fastcall* load)(UINT rL, std::string* source, const char* chunkname, int env);
143 | }
144 |
145 | namespace functions {
146 | define_function(rbx_printf);
147 | define_function(rbx_getscheduler);
148 | namespace runtimescriptservice {
149 | define_function(rbx_runscript);
150 | }
151 |
152 | namespace luau {
153 | define_function(type_name);
154 | define_function(pseudo2addr);
155 | }
156 |
157 | define_function(load);
158 | }
159 |
160 | /*
161 | Offset Guide:
162 | 1. Look at pseudocode of any newlstr call (noob tip: looking around ATOM_UNDEF will help you get the right offsets)
163 | 2. Basically everywhere
164 | 3. Any checking of arguments
165 | 4. Found experimenting with Cheat Engine
166 | 5. Look at pseudocode of any newthread call
167 | 6. Look at pseudocode of luaL_getmetafield
168 | 7. Basic reversing using error messages (use Ghidra to find encrypted strings)
169 | 8. Checking of Luau source and use of Ghidra for strings
170 | */
171 | #define get_unencrypted return *(T*)(address_of_ptr)
172 | #define set_unencrypted *(T*)(address_of_ptr) = value
173 | // Don't get overwhelmed. None of these are required for base execution, and only top and base are required for __send_to_C
174 | namespace offsets {
175 | namespace rCommonHeader {
176 | // I don't know how GC works fully yet, I just know every object NEEDS this to cooperate with roblox properly
177 | define_offset(tt, 0x2, get_unencrypted, set_unencrypted); // 1
178 | define_offset(marked, 0x0, get_unencrypted, set_unencrypted); // 1
179 | define_offset(memcat, 0x1, get_unencrypted, set_unencrypted); // 1
180 | }
181 | namespace rL {
182 | define_offset(activememcat, 0x4, get_unencrypted, set_unencrypted); // 1
183 | define_offset(top, 0x8, get_unencrypted, set_unencrypted); // 3
184 | define_offset(base, 0x10, get_unencrypted, set_unencrypted); // 3
185 | define_offset(global, 0xC, // 1, 2, 3, 5, 6, 7, 8
186 | /* get */ return *(UINT*)(address_of_ptr) + address_of_ptr,
187 | /* set */ );
188 | define_offset(namecall, 0x44, get_unencrypted, set_unencrypted); // (getnamecallmethod) 8h
189 | define_offset(userdata, 0x48, get_unencrypted, set_unencrypted); // (aka extraspace) 5h
190 | }
191 | namespace rG {
192 | // rG->rstringtable isn't a pointer
193 | //define_offset(strt_size, 0x8, get_unencrypted, set_unencrypted); // (unused) 1h
194 | //define_offset(strt_nuse, 0x4, get_unencrypted, set_unencrypted); // (unused) 1h
195 | //define_offset(strt_hash, 0x0, get_unencrypted, set_unencrypted); // (unused) 1h
196 | define_offset(currentwhite, 0x14, get_unencrypted, set_unencrypted); // 1
197 | }
198 | namespace rTString {
199 | define_offset(tt, offsets::rCommonHeader::tt, get_unencrypted, set_unencrypted);
200 | define_offset(marked, offsets::rCommonHeader::marked, get_unencrypted, set_unencrypted);
201 | define_offset(memcat, offsets::rCommonHeader::memcat, get_unencrypted, set_unencrypted);
202 |
203 | define_offset(atom, 0x4, get_unencrypted, set_unencrypted); // 1
204 | //define_offset(next, 0x8, get_unencrypted, set_unencrypted); // (unused) 1
205 | define_offset(hash, 0xC, // 1
206 | /* get */ return *(T*)(address_of_ptr) + address_of_ptr,
207 | /* set */ *(T*)(address_of_ptr) = value - address_of_ptr);
208 | define_offset(len, 0x10, // 1
209 | /* get */ return *(T*)(address_of_ptr) - address_of_ptr,
210 | /* set */ *(T*)(address_of_ptr) = address_of_ptr - value);
211 | define_offset(data, 0x14, get_unencrypted, set_unencrypted); // (unchanging) 1
212 | }
213 | namespace rUdata {
214 | define_offset(metatable, 0x8, // 6h
215 | /* get */ return address_of_ptr - *(T*)(address_of_ptr),
216 | /* set */ *(T*)(address_of_ptr) = address_of_ptr - value);
217 | define_offset(data, 0x10, get_unencrypted, set_unencrypted); // (unchanging) 4h
218 | }
219 | namespace rTable {
220 | define_offset(readonly, 0x6, get_unencrypted, set_unencrypted); // (unchanging) 8h
221 | define_offset(metatable, 0x1C, // 6h
222 | /* get */ return address_of_ptr - *(T*)(address_of_ptr),
223 | /* set */ *(T*)(address_of_ptr) = address_of_ptr - value);
224 | }
225 | namespace rextraspace {
226 | define_offset(identity, 0x18, get_unencrypted, set_unencrypted);
227 | }
228 | namespace rPlayer {
229 | define_offset(simulationradius, 0x1D0, get_unencrypted, set_unencrypted); // 4h
230 | define_offset(maximumsimulationradius, 0x1D4, get_unencrypted, set_unencrypted); // 4h
231 | }
232 | }
233 | inline UINT get_rL(UINT scriptcontext) {
234 | return (scriptcontext + 0x104) ^ *(UINT*)(scriptcontext + 0x104);
235 | }
236 |
--------------------------------------------------------------------------------