Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 18 additions & 148 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,161 +1,31 @@
name: Build Roblox Executor iOS Dynamic Library
name: Build

on:
push:
branches:
- main
branches: [ main ]
pull_request:
branches:
- main
workflow_dispatch:
branches: [ main ]

jobs:
build:
runs-on: macos-latest # Use macOS for iOS compatible builds

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/checkout@v3

- name: Install dependencies
run: |
echo "Installing dependencies..."
# Install essential build tools
brew install pkg-config

# Create required directories
mkdir -p external/dobby/include
mkdir -p external/dobby/lib
mkdir -p output/Resources/AIData
mkdir -p build

# Remove any CI_BUILD definitions from source files
echo "Removing CI_BUILD definitions from source files..."
find source -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" \) | xargs sed -i '' 's/#define CI_BUILD//g' 2>/dev/null || true

# Verify and fix VM folder structure if needed
echo "Verifying VM folder structure..."
if [ -d "VM" ] && [ -d "VM/include" ] && [ -d "VM/src" ]; then
echo "✅ VM folder structure verified"
ls -la VM/include/
ls -la VM/src/ | head -n 5

# Make sure VM files are readable
echo "Ensuring VM files have correct permissions..."
chmod -R 755 VM

# Count source files to verify
VM_SRC_COUNT=$(find VM/src -name "*.cpp" | wc -l)
VM_INCLUDE_COUNT=$(find VM/include -name "*.h" | wc -l)
echo "Found $VM_SRC_COUNT .cpp files and $VM_INCLUDE_COUNT .h files in VM directory"
else
echo "⚠️ VM folder structure has issues, creating required directories..."
mkdir -p VM/include VM/src
fi

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Install Dobby (Required)
id: install-dobby
run: |
echo "Building Dobby from source (required dependency)..."
git clone --depth=1 https://github.com/jmpews/Dobby.git
cd Dobby
mkdir -p build && cd build

# Configure and build Dobby
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DDOBBY_BUILD_SHARED_LIBRARY=OFF \
-DDOBBY_BUILD_STATIC_LIBRARY=ON

cmake --build . --config Release

# Copy Dobby files to expected location
mkdir -p $GITHUB_WORKSPACE/external/dobby/lib
mkdir -p $GITHUB_WORKSPACE/external/dobby/include

cp libdobby.a $GITHUB_WORKSPACE/external/dobby/lib/
cp -r ../include/* $GITHUB_WORKSPACE/external/dobby/include/

echo "Dobby successfully built and installed to external/dobby"
cd $GITHUB_WORKSPACE

- name: Build Dynamic Library with Makefile
sudo apt-get update
sudo apt-get install -y build-essential g++ make

- name: Build
run: |
echo "Building the iOS dynamic library using Makefile instead of CMake..."

# Make sure VM files are accessible
echo "Preparing VM files for inclusion..."
find VM -name "*.cpp" -o -name "*.h" | xargs ls -la || true

# Test VM file access
echo "Testing VM file access..."
VM_SOURCE_COUNT=$(find VM/src -name "*.cpp" | wc -l)
VM_HEADER_COUNT=$(find VM/include -name "*.h" | wc -l)
echo "Found $VM_SOURCE_COUNT C++ files in VM/src and $VM_HEADER_COUNT headers in VM/include"

# Set iOS-specific build settings for the Makefile
echo "Setting up iOS build environment..."
export SDK=$(xcrun --sdk iphoneos --show-sdk-path)
export ARCHS="arm64"
export MIN_IOS_VERSION="15.0"

# Build using Makefile with verbose output
echo "Building with Makefile instead of CMake..."
make info # Show build information
make clean # Clean any previous build artifacts
make -j4 # Build using Makefile with parallel jobs
make install # Install to output directory

# Check the build result
if [ -f "output/libmylibrary.dylib" ]; then
echo "✅ Successfully built libmylibrary.dylib with Makefile"
ls -la output/libmylibrary.dylib

# Create config if it doesn't exist
mkdir -p output/Resources/AIData
if [ ! -f "output/Resources/AIData/config.json" ]; then
echo '{"version":"1.0.0","led_effects":true,"ai_features":true,"memory_optimization":true}' > output/Resources/AIData/config.json
fi

echo "== Built files =="
ls -la output/
else
echo "❌ Failed to build libmylibrary.dylib"
echo "== Build directory contents =="
find build -name "*.dylib" -o -name "*.a"
exit 1
fi

- name: Verify Library
run: |
echo "Verifying built dylib..."

if [ -f "output/libmylibrary.dylib" ]; then
echo "✅ libmylibrary.dylib exists"

# Check for exported symbols
echo "Exported symbols:"
nm -g output/libmylibrary.dylib | grep -E "luaopen_|ExecuteScript" || echo "No key symbols found!"

# Check library type
file output/libmylibrary.dylib

# Check library dependencies
otool -L output/libmylibrary.dylib || true
else
echo "❌ libmylibrary.dylib not found in output directory"
exit 1
fi

- name: Upload Artifact
make 2>&1 | tee build.log
continue-on-error: true

- name: Upload build logs
uses: actions/upload-artifact@v4
with:
name: ios-dylib
path: |
output/libmylibrary.dylib
output/Resources/**
name: build-logs
path: build.log
retention-days: 7
52 changes: 52 additions & 0 deletions .github/workflows/save-errors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Save Build Errors

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
save-errors:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}

steps:
- name: Download build logs
uses: actions/github-script@v6
with:
script: |
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});

const buildLogs = artifacts.data.artifacts.find(artifact => artifact.name === "build-logs");

if (buildLogs) {
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: buildLogs.id,
archive_format: 'zip'
});

require('fs').writeFileSync('build-logs.zip', Buffer.from(download.data));
require('child_process').execSync('unzip build-logs.zip');
}

- name: Extract errors from logs
run: |
mkdir -p error-logs
if [ -f "build.log" ]; then
grep -n "error:" build.log > error-logs/compilation-errors.txt || true
grep -n "warning:" build.log > error-logs/compilation-warnings.txt || true
fi

- name: Upload error logs
uses: actions/upload-artifact@v4
with:
name: error-logs
path: error-logs/
retention-days: 7
70 changes: 22 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MIN_IOS_VERSION ?= 15.0
# Feature flags - disabled for now to allow clean builds
ENABLE_AI_FEATURES := 0
ENABLE_ADVANCED_BYPASS ?= 1
USE_DOBBY ?= 1
USE_DOBBY ?= 0 # Disable Dobby since we don't have it installed

# Basic flags
ifeq ($(BUILD_TYPE),Debug)
Expand All @@ -24,16 +24,16 @@ else
DEFS := -DPRODUCTION_BUILD=1
endif

CXXFLAGS := -std=c++17 -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden -ferror-limit=0 -fno-limit-debug-info
CFLAGS := -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden -ferror-limit=0 -fno-limit-debug-info
OBJCXXFLAGS := -std=c++17 -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden -ferror-limit=0 -fno-limit-debug-info
LDFLAGS := -shared -undefined dynamic_lookup -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreFoundation -framework Security -framework CoreML -framework Vision -framework Metal -framework MetalKit
CXXFLAGS := -std=c++17 -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden
CFLAGS := -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden
OBJCXXFLAGS := -std=c++17 -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden
LDFLAGS := -shared

# Include paths - add VM includes for Lua headers and source directory
INCLUDES := -I. -I/usr/local/include -I$(SDK)/usr/include -IVM/include -IVM/src -IVM/src/Luau -I$(SRC_DIR) -Iinclude
INCLUDES := -I. -I/usr/local/include -IVM/include -IVM/src -IVM/src/Luau -I$(SRC_DIR) -Iinclude

# iOS SDK flags for iOS 15+ compatibility
PLATFORM_FLAGS := -isysroot $(SDK) -arch $(ARCHS) -mios-version-min=$(MIN_IOS_VERSION) -DIOS_VERSION=$(MIN_IOS_VERSION) -DLUAU_PLATFORM_IOS=1 -DLUAU_TARGET_IOS=1
# Platform flags - simplified for non-iOS builds
PLATFORM_FLAGS := -DLUAU_PLATFORM_GENERIC=1

# Define output directories
BUILD_DIR := build
Expand All @@ -42,9 +42,9 @@ LIB_NAME := libmylibrary.dylib
INSTALL_DIR := /usr/local/lib

# Compiler commands
CXX := clang++
CXX := g++
CC := clang
OBJCXX := clang++
OBJCXX := g++
LD := $(CXX) $(PLATFORM_FLAGS)

# Add feature-specific flags
Expand Down Expand Up @@ -75,45 +75,21 @@ VM_SRC_DIR := VM/src
# Re-enable VM sources - fix the issues correctly as requested
VM_SOURCES := $(shell find $(VM_SRC_DIR) -name "*.cpp" 2>/dev/null)

CPP_SOURCES := $(shell find $(CPP_DIR) -maxdepth 1 -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/memory -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/security -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/hooks -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/naming_conventions -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/anti_detection -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/exec -name "*.cpp" 2>/dev/null)

# iOS-specific sources
iOS_CPP_SOURCES :=
iOS_MM_SOURCES :=
# Check platform - Darwin is macOS/iOS and runner.os gives the GitHub Actions OS
PLATFORM := $(shell uname -s)
ifeq ($(PLATFORM),Darwin)
# On macOS/iOS, include iOS-specific files
iOS_CPP_SOURCES += $(shell find $(CPP_DIR)/ios -name "*.cpp" 2>/dev/null)
iOS_MM_SOURCES += $(shell find $(CPP_DIR)/ios -name "*.mm" 2>/dev/null)

# Only include AI feature files if enabled
ifeq ($(ENABLE_AI_FEATURES),1)
iOS_CPP_SOURCES += $(shell find $(CPP_DIR)/ios/ai_features -name "*.cpp" 2>/dev/null)
iOS_MM_SOURCES += $(shell find $(CPP_DIR)/ios/ai_features -name "*.mm" 2>/dev/null)
endif

# Only include advanced bypass files if enabled
ifeq ($(ENABLE_ADVANCED_BYPASS),1)
iOS_CPP_SOURCES += $(shell find $(CPP_DIR)/ios/advanced_bypass -name "*.cpp" 2>/dev/null)
iOS_MM_SOURCES += $(shell find $(CPP_DIR)/ios/advanced_bypass -name "*.mm" 2>/dev/null)
endif
endif
# Only include core files to avoid multiple definition errors
CPP_SOURCES := $(CPP_DIR)/init.cpp
CPP_SOURCES += $(CPP_DIR)/library.cpp
CPP_SOURCES += $(CPP_DIR)/dobby_wrapper.cpp
CPP_SOURCES += $(CPP_DIR)/hooks/hooks.cpp
CPP_SOURCES += $(CPP_DIR)/naming_conventions/script_preprocessor.cpp
CPP_SOURCES += $(CPP_DIR)/naming_conventions/naming_conventions.cpp
CPP_SOURCES += $(CPP_DIR)/naming_conventions/function_resolver.cpp

# Convert source files to object files
VM_OBJECTS := $(VM_SOURCES:.cpp=.o)
CPP_OBJECTS := $(CPP_SOURCES:.cpp=.o)
iOS_CPP_OBJECTS := $(iOS_CPP_SOURCES:.cpp=.o)
iOS_MM_OBJECTS := $(iOS_MM_SOURCES:.mm=.o)

# Final list of object files
OBJECTS := $(VM_OBJECTS) $(CPP_OBJECTS) $(iOS_CPP_OBJECTS) $(iOS_MM_OBJECTS)
OBJECTS := $(VM_OBJECTS) $(CPP_OBJECTS)

# Set dylib install name
DYLIB_INSTALL_NAME := @executable_path/Frameworks/$(LIB_NAME)
Expand All @@ -135,9 +111,9 @@ install: all
$(OUTPUT_DIR)/$(LIB_NAME): $(OBJECTS)
@echo "Creating dummy main.cpp for linking..."
@mkdir -p $(BUILD_DIR)
@echo 'extern "C" int main(int argc, char** argv) { return 0; }' > $(BUILD_DIR)/main.cpp
@echo 'extern "C" int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }' > $(BUILD_DIR)/main.cpp
$(CXX) $(CXXFLAGS) $(PLATFORM_FLAGS) $(DEFS) $(INCLUDES) -c -o $(BUILD_DIR)/main.o $(BUILD_DIR)/main.cpp
$(LD) $(LDFLAGS) -o $@ $(BUILD_DIR)/main.o $^ -install_name $(DYLIB_INSTALL_NAME)
$(LD) $(LDFLAGS) -o $@ $(BUILD_DIR)/main.o $^
@echo "✅ Built $@"

%.o: %.cpp
Expand All @@ -152,8 +128,6 @@ info:
@echo "Platform: $(shell uname -s)"
@echo "VM Sources: $(VM_SOURCES)"
@echo "Exec Sources: $(CPP_SOURCES)"
@echo "iOS CPP Sources: $(iOS_CPP_SOURCES)"
@echo "iOS MM Sources: $(iOS_MM_SOURCES)"

# Help target
help:
Expand All @@ -165,6 +139,6 @@ help:
@echo ""
@echo "Configuration variables:"
@echo " BUILD_TYPE=Debug|Release - Set build type (default: Release)"
@echo " USE_DOBBY=0|1 - Enable Dobby hooking (default: 1)"
@echo " USE_DOBBY=0|1 - Enable Dobby hooking (default: 0)"
@echo " ENABLE_AI_FEATURES=0|1 - Enable AI features (default: 0)"
@echo " ENABLE_ADVANCED_BYPASS=0|1 - Enable advanced bypass (default: 1)"
3 changes: 3 additions & 0 deletions VM/src/Luau/Bytecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#define LUAU_INSN_A(insn) (((insn) >> 8) & 0xFF)
#define LUAU_INSN_A5(insn) (((insn) >> 8) & 0x1F)

// Define LBC_TYPE_FUNCTION constant
#define LBC_TYPE_FUNCTION 0

// Define bytecode opcodes - we need these for the VM code
enum LuauOpcode
{
Expand Down
27 changes: 27 additions & 0 deletions VM/src/Luau/BytecodeConstants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// BytecodeConstants.h - Definitions for Luau bytecode constants
#pragma once

// Bytecode version constants
#define LBC_VERSION_MIN 1
#define LBC_VERSION_MAX 4

// Type version constants
#define LBC_TYPE_VERSION_MIN 1
#define LBC_TYPE_VERSION_MAX 3

// Type constants
#define LBC_TYPE_FUNCTION 0
#define LBC_TYPE_USERDATA 7
#define LBC_TYPE_TAGGED_USERDATA_BASE 128
#define LBC_TYPE_TAGGED_USERDATA_END 192

// Constant type identifiers
#define LBC_CONSTANT_NIL 0
#define LBC_CONSTANT_BOOLEAN 1
#define LBC_CONSTANT_NUMBER 2
#define LBC_CONSTANT_STRING 3
#define LBC_CONSTANT_IMPORT 4
#define LBC_CONSTANT_TABLE 5
#define LBC_CONSTANT_CLOSURE 6
#define LBC_CONSTANT_VECTOR 7

Loading
Loading