-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcore.cpp
More file actions
43 lines (34 loc) · 1023 Bytes
/
core.cpp
File metadata and controls
43 lines (34 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// by CompiledCode#1234 @ https://github.com/Compiled-Code/StudioLuauCompiler
#include <Windows.h>
#include <thread>
#include <string>
inline void alloc_console()
{
AllocConsole();
FILE* v;
freopen_s(&v, "CONIN$", "r", stdin);
freopen_s(&v, "CONOUT$", "w", stdout);
freopen_s(&v, "CONOUT$", "w", stderr);
SetConsoleTitleA("Luau Studio Compiler | CompiledCode#1234");
}
struct luau_compiler_option_1
{
std::uint32_t v1, v2, v3, v4;
};
struct luau_compiler_option_2
{
std::uint8_t v1, v2;
};
using luau_compiler_t = std::string(__fastcall*)(const std::string&, const luau_compiler_option_1&, const luau_compiler_option_2&);
const auto luau_compile = reinterpret_cast<luau_compiler_t>(reinterpret_cast<std::uintptr_t>(GetModuleHandleA(nullptr)) + 0x179EF00);
void core()
{
alloc_console();
const auto bytecode = luau_compile("do end", { 1, 1, 2, 0 }, { 0, 0 });
}
bool __stdcall DllMain(HMODULE, const DWORD reason, void*)
{
if (reason == DLL_PROCESS_ATTACH)
std::thread(core).detach();
return true;
}