Check out PolyLauncher, our custom launcher that automatically manages the executor and HWID spoofer!
A Modern Script Executor for Polytoria
Demo • Features • Download • Community • Architecture • Source Tree • Building • Why v3
New : Added HWID Spoofer => Copy "version.dll" from .download to your game repository or use PolyLauncher !
Polyhack is a sophisticated script executor designed for Polytoria, a user-generated content game platform similar to Roblox. Built as a DLL injection-based tool, Polyhack enables users to execute custom Lua scripts within the game environment, providing powerful capabilities for testing, debugging, and extending gameplay functionality.
The project leverages the MoonSharp Lua interpreter to execute scripts within Polytoria's scripting environment, with comprehensive bindings to the game's internal API through Unity engine reflection.
You can download directly from this repo : https://github.com/ElCapor/polytoria-executor/tree/master/.download
Or from the latest github actions : https://github.com/ElCapor/polytoria-executor/actions
You can open polyhack.exe for the normal executor, or injector.exe if you only need the internal UI.
Join our discord server to chat : https://discord.gg/NrXZmyPRvh
- NEW : MultiInstance - You can open multiple game instances at the same time
- NEW : HWID Spoofer - Your HWID is spoofed in real-time
- Custom Lua Environment - Extended Lua environment with custom functions for game manipulation
- loadstring() - Dynamic code execution from strings
- Named Pipe Server - Execute scripts from external tools via Windows named pipes
- Whitelist System - Scripts are properly whitelisted to bypass security checks
- Tool Manipulation -
activatetool(),equiptool(),unequiptool(),serverequiptool() - Chat Integration -
sendchat()function for programmatic chat messages - Click Detection -
fireclickdetector()for remote interaction - Executor Identification -
identifyexecutor()"elcapor" by default
- Real-time Hierarchy - Browse the game's instance tree in real-time
- Property Inspector - View and modify properties on any game instance
- Performance Optimized - Intelligent caching system to minimize Unity API calls
- Icon Support - Visual icons for different instance types
- Network Monitoring - Capture and inspect network packets
- Message Analysis - View incoming and outgoing game messages
- Debugging Support - Essential for understanding game protocols
- ImGui-Based Interface - Clean, professional overlay rendered via DirectX 11 hooks
- Toggleable Overlay - Press DELETE key to show/hide the UI
- Cursor Management - Automatic cursor state handling when UI is active
- Embedded Fonts - SNPro font family embedded directly in binary for portability
- Syntax Highlighting - Full-featured text editor with Lua syntax highlighting
- Memory Editor - Inspect and edit game memory
- Save Instance - Export game instances to files
- Script Source Viewer - View source code of game scripts
Polyhack v3 follows a modular architecture designed for maintainability and extensibility:
┌─────────────────────────────────────────────────────────────┐
│ Polyhack v3 │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ DLL │ │ Cheat │ │ UI │ │
│ │ Entry │──│ Core │──│ (ImGui/DX11) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Hooking Layer (Detours) │ │
│ │ • DirectX 11 Present Hook │ │
│ │ • ScriptService Hooks │ │
│ │ • Network Hooks │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Polytoria Bindings (ptoria/) │ │
│ │ • Instance, Game, Player, Tool │ │
│ │ • ScriptService, NetworkEvent │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Unity Engine Interface (unity/) │ │
│ │ • Type System • Reflection • Memory Access │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
polytoria-executor/
├── xmake.lua # Build configuration (xmake build system)
├── .editorconfig # Editor configuration
├── .gitignore # Git ignore rules
│
├── dll/ # DLL Entry Point
│ └── entry.cpp # DllMain - injection entry point
│
├── cheat/ # Core Cheat Logic
│ ├── cheat.cpp # Main thread initialization
│ ├── cheat.h # Main function declarations
│ ├── pipe.cpp # Named pipe server for external scripts
│ ├── pipe.h # Pipe server interface
│ └── ingameui.h # In-game Lua UI definition
│
├── core/ # Core Utilities
│ ├── core.cpp # Console initialization, logging setup
│ └── core.h # Core function declarations
│
├── hooking/ # Hooking Infrastructure
│ ├── dx11hook.cpp # DirectX 11 swap chain hooking
│ ├── dx11hook.h # DX11 hook interface
│ └── hookmanager.h # Detours-based hook management system
│
├── ptoria/ # Polytoria Game Bindings
│ ├── instance.cpp/h # Base Instance class binding
│ ├── game.cpp/h # Game singleton access
│ ├── player.cpp/h # Player class binding
│ ├── tool.cpp/h # Tool class binding
│ ├── scriptservice.cpp/h # Script execution hooks
│ ├── scriptinstance.h # Script instance type
│ ├── basescript.cpp/h # Base script class
│ ├── networkevent.cpp/h # Network event handling
│ ├── netmessage.cpp/h # Network message types
│ ├── chatservice.h # Chat service binding
│ └── singleton.h # Singleton pattern utilities
│
├── ui/ # User Interface (ImGui)
│ ├── ui.cpp/h # Main UI setup and rendering
│ ├── executor.cpp/h # Script executor tab
│ ├── explorer.cpp/h # Instance explorer tab
│ ├── packetlog.cpp/h # Packet logger tab
│ ├── about.cpp/h # About dialog
│ ├── settingsui.cpp/h # Settings interface
│ ├── saveinstance.cpp/h # Instance saving functionality
│ ├── scriptsource.cpp/h # Script source viewer
│ ├── texeditor.cpp/h # Text editor with syntax highlighting
│ ├── memoryeditor.h # Memory editor widget
│ ├── iconmanager.cpp/h # Icon loading and management
│ ├── premiumstyle.cpp/h # Custom ImGui styling
│ ├── languagesdefiniton.cpp # Syntax highlighting definitions
│ ├── embedded_icons.h # Embedded icon data
│ └── embeddedfonts.h/cpp # Embedded font data (SNPro family)
│
├── mirror/ # Network Mirroring/Hooks
│ ├── hooks.cpp/h # General hooks
│ ├── localconnectiontoserver.cpp/h # Server connection hooks
│ └── networkclient.cpp/h # Network client hooks
│
├── moonsharp/ # MoonSharp Lua Interpreter
│ └── ... # Lua interpreter integration
│
├── unity/ # Unity Engine Interface
│ └── ... # Unity type system, reflection
│
├── nasec/ # Security/Assertion Utilities
│ └── ... # Assertions and safety checks
│
├── network/ # Network Utilities
│ └── ... # Network helper functions
│
├── fonts/ # Font Assets (Source files for embedding)
│ └── SNPro-*.ttf # SNPro font family (various weights)
│ # Run ttf_to_header.py to embed into binary
│
├── icons/ # SVG Icons
│ └── *.svg # Instance type icons (vector)
│
├── icons_png/ # PNG Icons
│ └── *.png # Instance type icons (raster)
│
├── scripts/ # Utility Scripts
│ └── ttf_to_header.py # Convert TTF fonts to C++ embedded data
│
├── injector/ # DLL Injector
│ └── main.cpp # Standalone injector executable
│
├── WpfUI/ # WPF UI Components
│ └── ... # Windows Presentation Foundation UI
│
└── .github/ # GitHub Configuration
└── ... # Workflows, templates
- Windows 10/11 (x64)
- Visual Studio 2022 with C++23 support
- xmake build system
- Git for cloning dependencies
# Clone the repository
git clone https://github.com/ElCapor/polytoria-executor.git
cd polytoria-executor
# Generate embedded font data from TTF files
python scripts/ttf_to_header.py fonts/ ui/embeddedfonts.h ui/embeddedfonts.cpp
# Configure and build
xmake config -m release
xmake build
# Output DLL will be in build/ directoryNote: The font embedding step is optional. If skipped, placeholder font data will be used and the system will fall back to default fonts.
- Microsoft Detours - Function hooking library
- ImGui - Immediate mode GUI
- spdlog - Fast C++ logging library
- Boost - C++ utilities (regex support)
- nativefiledialog-extended - Native file dialogs
- DirectX 11 - Graphics API
Polyhack v3 represents a complete rewrite from the ground up, incorporating lessons learned from previous versions and leveraging modern C++ practices.
// Previous versions used older C++ standards
// v3 leverages C++23 features for cleaner, safer code
// Ranges and views for cleaner iteration
for (const auto key : holderMap | std::views::keys)
Disable(key);
// Template metaprogramming for type-safe Unity bindings
template<typename T>
static void RunScript(std::string source) {
BaseScript *script = BaseScript::New<T>(source);
whitelisted.push_back(script);
RunScript(script);
}Previous versions were monolithic, making maintenance difficult. v3 separates concerns:
| Module | Responsibility |
|---|---|
ptoria/ |
Game-specific bindings |
unity/ |
Engine abstraction layer |
hooking/ |
Hook infrastructure |
ui/ |
User interface |
mirror/ |
Network interception |
This separation allows:
- Easier debugging
- Independent testing of components
- Cleaner code organization
- Better collaboration
Explorer Caching System:
namespace ExplorerCache {
struct InstanceCache {
std::string name;
std::string className;
std::string fullName;
bool isPopulated = false;
};
static std::unordered_map<Instance*, InstanceCache> s_cache;
static std::mutex s_cacheMutex;
}The v3 explorer caches instance metadata to avoid repeated Unity API calls, significantly improving UI responsiveness.
The new HookManager class provides:
- Type-safe hook installation - Template-based API
- Automatic cleanup -
DetachAll()for clean unloading - Thread safety - Mutex-protected hook registry
- Multiple calling conventions - Support for
__cdecl,__stdcall,__fastcall,__vectorcall
// Clean hook installation
HookManager::Install(originalFunction, hookFunction);
// Call original safely
auto result = HookManager::Call(hookFunction, args...);
// Clean detachment
HookManager::Detach(hookFunction);v3 introduces a named pipe server for external script execution:
// External tools can send scripts to execute
HANDLE hPipe = CreateFileA(
"\\\\.\\pipe\\polyhack_pipe",
GENERIC_WRITE, 0, nullptr,
OPEN_EXISTING, 0, nullptr
);
WriteFile(hPipe, scriptCode, length, &bytesWritten, nullptr);This enables:
- Integration with external editors
- Automated testing workflows
- Remote script execution
- Custom ImGui styling with premium appearance
- Syntax-highlighted code editor with Lua support
- Memory editor for advanced debugging
- Responsive layout with proper cursor management
- Embedded fonts - No external font files required, all fonts are compiled into the binary
v3 embeds all resources directly into the binary:
// Fonts are loaded from embedded memory, not external files
FontRegular = io.Fonts->AddFontFromMemoryTTF(
const_cast<unsigned char*>(EmbeddedFonts::SNPro_Regular_Data),
static_cast<int>(EmbeddedFonts::SNPro_Regular_Size),
16.0f, &config);Benefits:
- Portability - Single DLL file, no external dependencies
- Reliability - No missing font files at runtime
- Performance - Faster loading from memory vs disk I/O
- Distribution - Simpler deployment, just copy the DLL
v3 includes complete bindings for Polytoria's type system:
Instance- Base game objectGame- Game singletonPlayer- Player entitiesTool- Equippable toolsScriptService- Script executionNetworkEvent- Network communicationChatService- Chat functionality
// Assertions with descriptive messages
nasec::Assert(gameInstance != nullptr, "Failed to get Game singleton instance");
// Proper DLL unloading
case DLL_PROCESS_DETACH:
StopPipeServer();
IconManager::Shutdown();
break;v3 provides a rich set of custom functions:
| Function | Description |
|---|---|
loadstring(source) |
Compile and execute Lua code |
activatetool(tool) |
Activate a tool |
equiptool(tool) |
Equip a tool locally |
unequiptool(tool) |
Unequip a tool |
serverequiptool(player, tool) |
Server-side tool equipping |
sendchat(message) |
Send chat message |
fireclickdetector(instance) |
Fire click detector |
identifyexecutor() |
Returns "elcapor" |
Using xmake instead of Visual Studio projects:
target("wowiezz")
set_kind("shared")
set_languages("c++23")
add_packages("spdlog", "microsoft-detours", "imgui", "boost")
add_links("user32", "dbghelp", "d3d11")Benefits:
- Cross-platform potential
- Reproducible builds
- Automatic dependency management
- Simpler configuration
- Inject the DLL into the Polytoria game process using the injector or any DLL injector
- Press DELETE to toggle the UI overlay
- Use the Executor tab to write and execute Lua scripts
- Use the Explorer tab to browse and inspect game instances
- Use the Packet Log tab to monitor network traffic
-- Print all game children
for _, child in ipairs(game:GetChildren()) do
print(child.Name)
end
-- Send a chat message
sendchat("Hello from Polyhack!")
-- Execute dynamic code
local func = loadstring("return 2 + 2")
print(func()) -- Output: 4Contributions are welcome! Please read our contributing guidelines before submitting PRs.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
CC-BY-SA 4.0 Copyright (c) 2026 @ElCapor
This tool is intended for educational purposes and legitimate game testing only. Use responsibly and in accordance with Polytoria's Terms of Service. The developers are not responsible for any consequences resulting from misuse of this software.
Made with ❤️ by the Polyhack Team

