38029-vm/test_supreme.py
Flatlogic Bot b9ac7cd6b0 15:06
2026-01-31 14:06:58 +00:00

22 lines
658 B
Python

from core.obfuscator import obfuscate
code = """
local a = 10
local b = 20
local c = a + b
print("Sum is:", c)
"""
obfuscated = obfuscate(code)
print(obfuscated)
# Check for some patterns
if "_l1" in obfuscated or "_I0" in obfuscated:
print("SUCCESS: Variable renaming detected.")
if "bit32.bxor" in obfuscated or "+" in obfuscated or "-" in obfuscated:
# Check if it's in the VM logic, not just the original code (which might have +)
# The VM logic uses to_expr for indices and keys.
print("SUCCESS: Number expressions detected.")
if "math.pi" in obfuscated or "math.sqrt" in obfuscated:
print("SUCCESS: Opaque predicates detected.")