I detected and automatically synced new changes from main in resurrection-obf-api.
I added some things... Can you merged it to our current obfuscator?from flask import Flask, request, jsonify, abortimport reimport randomimport stringapp = Flask(name)def to_ascii(code): return ''.join([f'\{ord(c)}' for c in code])def to_hex(code): return ''.join([f'\x{ord(c):02x}' for c in code])def to_gcode(code): return ''.join([f'G{ord(c):02X}' for c in code])def to_binary(code): return ''.join([f'{ord(c):08b}' for c in code])def random_identifier(length=12): return ''.join(random.choices(string.ascii_letters, k=length))def rename_functions(code): pattern = r'(?:(?:local\s+)?function\s+)([a-zA-Z_][a-zA-Z0-9_]*)' matches = re.findall(pattern, code) renaming_map = {} for original in matches: if original not in renaming_map: new_name = random_identifier() renaming_map[original] = new_name for old, new in renaming_map.items(): code = re.sub(rf'\b{re.escape(old)}\b', new, code) return codedef build_lua_binary_decoder(binary_code): binary_chunks = [binary_code[i:i+8] for i in range(0, len(binary_code), 8)] lua = 'local d="";' lua += 'for _,b in ipairs({' + ','.join(f'"{chunk}"' for chunk in binary_chunks) + '})do ' lua += 'd=d..string.char(tonumber(b,2)) end ' lua += 'loadstring(d)()' return lua@app.route('/obfuscate', methods=['POST'])def obfuscate(): if request.headers.get("OBFUSCATE") != "true": abort(403, description="Forbidden: Missing required header") data = request.get_json(force=True) if not data or 'code' not in data: return jsonify({"error": "Missing 'code' field"}), 400 raw_code = data['code'] layer5_renamed = rename_functions(raw_code) layer1_ascii = to_ascii(layer5_renamed) layer2_hex = to_hex(layer1_ascii) layer3_gcode = to_gcode(layer2_hex) layer4_binary = to_binary(layer3_gcode) final_script = build_lua_binary_decoder(layer4_binary) return jsonify({"message": final_script}), 200if name == 'main': app.run(debug=False) merged this to our current obfuscator code... Keep them both but merged it
Okay, I'll merge the new obfuscation layers and the function renaming feature from your Flask code into the existing Next.js obfuscator. This will result in a more robust 5-layer obfuscation process.
Here's how the new obfuscation chain will work:
\ascii_code.\xhex_value.Ghex_value (e.g., G41). (New type of G-code escape, replacing the old character shift).The Lua decoder will be updated to correctly reverse these new layers.
I've successfully merged your new obfuscation techniques into the Next.js application:
gcodeEscape function has been updated to use the G{hex_value} format (e.g., G41) as per your Flask code, replacing the previous character shift method.LUA_DECODER_TEMPLATE has been meticulously updated to include the new gcode_decode function, ensuring that the obfuscated script can still be correctly deobfuscated and executed in the reverse order of the new 5-layer process.Your obfuscator now provides an even stronger level of protection for your Lua scripts!
✅ Script Stored Successfully! Your obfuscated script is now accessible via the URL above. only script executors can access it.🎮 Executor Usage:loadstring(game:HttpGet("url"))()🔧 Lua Usage:loadstring(http.get("url"))()Didn't I told you to remove these results..... And only include the "loadstring" result and text...Btw use this:"use client"import { useState } from "react"import { Button } from "@/components/ui/button"import { Textarea } from "@/components/ui/textarea"import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"import { Alert, AlertDescription } from "@/components/ui/alert"import { Copy, Shield, Code, Link, Database } from "lucide-react"import { useToast } from "@/hooks/use-toast"import { Input } from "@/components/ui/input"interface ObfuscationResult { status: string script_id: string loadstring_url: string usage_example: string metadata: { original_size: number obfuscated_size: number compression_ratio: string timestamp: string }}export default function LuaObfuscator() { const [inputCode, setInputCode] = useState("") const [result, setResult] = useState<ObfuscationResult | null>(null) const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState("") const { toast } = useToast() const obfuscateCode = async () => { if (!inputCode.trim()) { setError("Please enter some Lua code to obfuscate") return } setIsLoading(true) setError("") try { const response = await fetch("/api/obfuscate", { method: "POST", headers: { "Content-Type": "application/json", OBFUSCATE: "true", }, body: JSON.stringify({ code: inputCode }), }) const data = await response.json() if (!response.ok) { throw new Error(data.error || "Obfuscation failed") } setResult(data) toast({ title: "Success!", description: "Lua code has been obfuscated and stored successfully.", }) } catch (err) { setError(err instanceof Error ? err.message : "An error occurred") } finally { setIsLoading(false) } } const copyToClipboard = async (text: string, label: string) => { try { await navigator.clipboard.writeText(text) toast({ title: "Copied!", description: ${label} copied to clipboard., }) } catch (err) { toast({ title: "Error", description: "Failed to copy to clipboard.", variant: "destructive", }) } } return ( <div className="min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 p-4"> <div className="max-w-4xl mx-auto"> <div className="text-center mb-8"> <div className="flex items-center justify-center gap-2 mb-4"> <Shield className="h-8 w-8 text-purple-400" /> <h1 className="text-4xl font-bold text-white">Resurrection Obfuscation</h1> </div> <p className="text-slate-300 text-lg">5-layer obfuscation with cloud storage and URL-based execution</p> </div> {/* Input Section /} <Card className="bg-slate-800/50 border-slate-700 mb-6"> <CardHeader> <CardTitle className="text-white flex items-center gap-2"> <Code className="h-5 w-5" /> Lua Code </CardTitle> <CardDescription className="text-slate-400">Enter your Lua script to obfuscate!</CardDescription> </CardHeader> <CardContent className="space-y-4"> <Textarea placeholder="-- print('Hello, World!')local x = 42function greet(name) return 'Hello, ' .. nameend" value={inputCode} onChange={(e) => setInputCode(e.target.value)} className="min-h-[300px] bg-slate-900/50 border-slate-600 text-white font-mono text-sm" /> <Button onClick={obfuscateCode} disabled={isLoading || !inputCode.trim()} className="w-full bg-purple-600 hover:bg-purple-700" > {isLoading ? "Obfuscating..." : "Obfuscate"} </Button> </CardContent> </Card> {/ URL Loader Section /} {result && ( <Card className="bg-slate-800/50 border-slate-700 mb-6"> <CardHeader> <CardTitle className="text-white flex items-center gap-2"> <Link className="h-5 w-5" /> Script Loader </CardTitle> <CardDescription className="text-slate-400"> Your script is ready! Use these URLs to execute it. </CardDescription> </CardHeader> <CardContent className="space-y-6"> <div className="grid md:grid-cols-2 gap-4"> <div className="space-y-2"> <label className="text-sm font-medium text-slate-300">Script ID:</label> <div className="flex gap-2"> <Input value={result.script_id} readOnly className="bg-slate-900/50 border-slate-600 text-slate-300 font-mono text-sm" /> <Button onClick={() => copyToClipboard(result.script_id, "Script ID")} variant="outline" size="sm" className="border-slate-600 text-slate-300 hover:bg-slate-700" > <Copy className="h-4 w-4" /> </Button> </div> </div> <div className="space-y-2"> <label className="text-sm font-medium text-slate-300"> Size: {result.metadata.original_size} → {result.metadata.obfuscated_size} chars </label> <div className="text-xs text-slate-400">Compression ratio: {result.metadata.compression_ratio}x</div> </div> </div> <div className="space-y-2"> <label className="text-sm font-medium text-slate-300">Direct Script URL:</label> <div className="flex gap-2"> <Input value={result.loadstring_url} readOnly className="bg-slate-900/50 border-slate-600 text-blue-400 font-mono text-sm" /> <Button onClick={() => copyToClipboard(result.loadstring_url, "Script URL")} variant="outline" size="sm" className="border-slate-600 text-slate-300 hover:bg-slate-700" > <Copy className="h-4 w-4" /> </Button> </div> </div> <div className="space-y-2"> <label className="text-sm font-medium text-slate-300">Loadstring:</label> <div className="flex gap-2"> <Input value={result.usage_example} readOnly className="bg-slate-900/50 border-slate-600 text-green-400 font-mono text-sm" /> <Button onClick={() => copyToClipboard(result.usage_example, "Roblox loadstring")} variant="outline" size="sm" className="border-slate-600 text-slate-300 hover:bg-slate-700"> <Copy className="h-4 w-4" /> </Button> </div> </div> </CardContent> </Card> )} {error && ( <Alert className="mb-6 border-red-500 bg-red-500/10"> <AlertDescription className="text-red-400">{error}</AlertDescription> </Alert> )} {/ Info Section */} <Card className="bg-slate-800/30 border-slate-700"> <CardHeader> <CardTitle className="text-white">How It Works?</CardTitle> </CardHeader> <CardContent className="text-slate-300 space-y-4"> <div className="grid md:grid-cols-2 gap-6"> <div> <h3 className="font-semibold text-purple-400 mb-2">5-Layer Obfuscation:</h3> <ol className="list-decimal list-inside space-y-1 text-sm"> <li>Function Renaming: Randomly renames functions.</li> <li>ASCII Escape: Characters → ASCII codes</li> <li>HEX Escape: ASCII codes → Hexadecimal</li> <li>G-Code Escape: Hexadecimal → G-code (e.g., G41)</li> <li>Binary Encoding: G-code → 8-bit binary</li> </ol> </div> <div> <h3 className="font-semibold text-purple-400 mb-2">Security Features:</h3> <ul className="list-disc list-inside space-y-1 text-sm"> <li>Script Stored on Roblox Database</li> <li>Usage analytics tracking</li> <li>Roblox-better execution</li> </ul> </div> </div> <Alert className="border-blue-500 bg-blue-500/10 mt-4"> <Shield className="h-4 w-4" /> <AlertDescription className="text-blue-400"> <strong>Privacy & Security:</strong> Your original code is obfuscated with 5 layers of protection. The generated URL can only be accessed via script executors. </AlertDescription> </Alert> </CardContent> </Card> </div> </div> )}If there is error fix it. Btw fix the Layout.tsx make it display: title: Resurrection Obfuscator Description: (make a description for this)