exopython 1.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of exopython might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exopython
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Programmatic level builder, decompiler, and obfuscator for Exoracer (.exolvl)
5
5
  License: MIT License
6
6
 
@@ -24,6 +24,8 @@ License: MIT License
24
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  SOFTWARE.
26
26
 
27
+ Project-URL: Homepage, https://github.com/TheNexusZen/ExoPython
28
+ Project-URL: Repository, https://github.com/TheNexusZen/ExoPython
27
29
  Requires-Python: >=3.8
28
30
  Description-Content-Type: text/markdown
29
31
  License-File: LICENSE
@@ -31,9 +33,14 @@ Dynamic: license-file
31
33
 
32
34
  # exopy
33
35
 
34
- Programmatic level builder, decompiler, and source-protection toolkit for **Exoracer** (`.exolvl`).
36
+ ​A toolkit for building, decompiling, and protecting **Exoracer** (`.exolvl`) levels with python.
35
37
 
36
38
  ## Installation
37
39
 
38
40
  ```bash
39
- pip install .
41
+ pip install exopython
42
+ ```
43
+
44
+ ## Todo
45
+ - [ ] update `README.md` to be useful (someone do that)
46
+ - [ ] improvements
@@ -0,0 +1,13 @@
1
+ # exopy
2
+
3
+ ​A toolkit for building, decompiling, and protecting **Exoracer** (`.exolvl`) levels with python.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install exopython
9
+ ```
10
+
11
+ ## Todo
12
+ - [ ] update `README.md` to be useful (someone do that)
13
+ - [ ] improvements
@@ -25,7 +25,7 @@ def _get_or_create_key(level_uuid: str) -> str:
25
25
 
26
26
 
27
27
  def _build_exopy_footer(obfuscated=False, watermark="made with exopy", decompiled=False, key_hash: bytes = b"") -> bytes:
28
- flags = 0x01 # compiled by exopy
28
+ flags = 0x01
29
29
  if decompiled:
30
30
  flags |= 0x02
31
31
  if obfuscated:
@@ -86,7 +86,6 @@ class DynamicType:
86
86
  TransitionConstant, TransitionVariable, EasingConstant, EasingVariable = 139, 140, 141, 142
87
87
  FloatLevelTime = 145
88
88
  SpriteConstant, SpriteVariable, ScriptConstant, ScriptVariable = 148, 149, 150, 151
89
- # Function Parameter References
90
89
  BoolParameter = 152
91
90
  IntParameter = 153
92
91
  FloatParameter = 154
@@ -31,7 +31,6 @@ def _check_owner_key(level_uuid: str, expected_hash_hex: str) -> bool:
31
31
 
32
32
 
33
33
  def _pack_obfuscated_py(code: str, seed: str) -> str:
34
- # Compile to Python bytecode before compressing & scrambling
35
34
  bc = marshal.dumps(compile(code, "<exopy>", "exec"))
36
35
  key = hashlib.sha256(seed.encode("utf-8")).digest()[:16]
37
36
  raw = zlib.compress(bc, 9)
@@ -47,7 +46,6 @@ def _pack_obfuscated_py(code: str, seed: str) -> str:
47
46
  )
48
47
 
49
48
  def read_exopy_meta(data: bytes):
50
- """Read hidden ExoPy trailing footer (EXPY...YPXE) if present."""
51
49
  if len(data) >= 12 and data.endswith(b"YPXE"):
52
50
  body_len = struct.unpack("<H", data[-6:-4])[0]
53
51
  start = len(data) - 6 - body_len
@@ -151,11 +149,11 @@ def _read_nova(r: BinaryReader, ver: int = 18) -> dict:
151
149
  c = r.color()
152
150
  v = r.vec2()
153
151
  if ver >= 19:
154
- r.u8() # v19+ extra byte before int_list
152
+ r.u8()
155
153
  il = r.option(lambda: r.vec(r.i32))
156
154
  sub = r.option(lambda: r.vec(lambda: _read_nova(r, ver)))
157
155
  if ver >= 19:
158
- r.raw(4) # v19+ extra 4 bytes after sub_values
156
+ r.raw(4)
159
157
  return {"dt": dt, "b": b, "i": i, "f": f, "s": s, "c": c, "v": v, "il": il, "sub": sub}
160
158
 
161
159
 
@@ -298,7 +296,6 @@ def _read_script(r: BinaryReader, ver: int = 18) -> dict:
298
296
 
299
297
 
300
298
  def decompile(filepath: str, out_py: str = None, generator_mode: bool = None, include_meta: bool = False):
301
- """Read a .exolvl file and convert objects, layers, settings, variables, and scripts into exopy code."""
302
299
  with open(filepath, "rb") as f:
303
300
  raw = f.read()
304
301
 
@@ -310,7 +307,6 @@ def decompile(filepath: str, out_py: str = None, generator_mode: bool = None, in
310
307
  if r.raw(4) != b"NYA^":
311
308
  raise ValueError("Not a valid .exolvl file (missing NYA^ magic)")
312
309
 
313
- # --- 1. LocalLevel ---
314
310
  ver = r.i32()
315
311
  uid = r.string()
316
312
  _lver = r.i32()
@@ -323,7 +319,6 @@ def decompile(filepath: str, out_py: str = None, generator_mode: bool = None, in
323
319
  private = r.bool()
324
320
  _nova = r.bool()
325
321
 
326
- # --- 2. LevelData: Objects & Layers ---
327
322
  r.string(); r.i32(); r.bool()
328
323
  for _ in range(6):
329
324
  r.vec(r.i32)
@@ -358,7 +353,6 @@ def decompile(filepath: str, out_py: str = None, generator_mode: bool = None, in
358
353
  r.bool(); r.vec(r.i32)
359
354
  layers.append((lid, lname, fg, plx))
360
355
 
361
- # --- 3. LevelData: Scripts, Variables & Settings ---
362
356
  nova_scripts, global_vars = [], []
363
357
  theme, gravity = "Mountains", (0.0, -75.0)
364
358
  lvl_settings = {"uuid": uid, "Private": private, "_ExopyDecompiled": True}
@@ -374,13 +368,13 @@ def decompile(filepath: str, out_py: str = None, generator_mode: bool = None, in
374
368
  if n_prefabs or n_brushes or n_patterns:
375
369
  raise NotImplementedError(f"non-empty prefabs({n_prefabs})/brushes({n_brushes})/patterns({n_patterns})")
376
370
  if ver >= 17:
377
- r.vec(r.color) # color_palette
371
+ r.vec(r.color)
378
372
 
379
373
  r.i64(); r.vec(r.i64); r.i64(); r.i64(); r.i32()
380
374
  lvl_settings["CenterCamera"] = r.bool()
381
- r.vec(r.i32) # legacy scripts
375
+ r.vec(r.i32)
382
376
  if ver >= 19:
383
- r.i32() # extra v19+ field before scripts
377
+ r.i32()
384
378
  nova_scripts = r.vec(lambda: _read_script(r, ver))
385
379
  global_vars = r.vec(lambda: _read_var(r, ver))
386
380
 
@@ -406,7 +400,6 @@ def decompile(filepath: str, out_py: str = None, generator_mode: bool = None, in
406
400
  except Exception as e:
407
401
  tail_note = f"Partial tail parse ({e})"
408
402
 
409
- # --- 4. Emit Runnable exopy Python Code ---
410
403
  base_name = os.path.splitext(os.path.basename(filepath))[0]
411
404
  lines = [
412
405
  f"# Decompiled from {os.path.basename(filepath)} (format v{ver})",
@@ -147,7 +147,6 @@ class _ActionBuilder:
147
147
  return self._push(action_id, lambda w: [v._write_to(w) for v in vals], wait=wait)
148
148
 
149
149
  def ret(self, value, stype=None):
150
- """Store a return value into the level's shared return register."""
151
150
  if stype is None:
152
151
  stype = resolve_static_type(None, value)
153
152
  else:
@@ -156,7 +155,6 @@ class _ActionBuilder:
156
155
  return self.set_var(reg, as_typed_nova(value, stype))
157
156
 
158
157
  def call(self, fn, *args, wait=True, **kwargs):
159
- """Invoke a NovaScript function (ActionID.RunFunction = 47)."""
160
158
  if not isinstance(fn, Script) or not fn.is_function:
161
159
  raise TypeError(f"Expected an @exoscript.func / function Script, got {fn!r}")
162
160
  if len(args) > len(fn.parameters):
@@ -239,7 +237,6 @@ def block() -> _ActionBuilder:
239
237
 
240
238
 
241
239
  def func(py_fn=None, *, name=None):
242
- """Decorator: turn a Python function into a reusable packed Exoracer NovaScript function."""
243
240
  def decorator(f):
244
241
  sig = inspect.signature(f)
245
242
  fn_script = function(name or f.__name__)
@@ -1,4 +1,3 @@
1
- """Pre-built reusable NovaScript functions that compile straight into your .exolvl."""
2
1
  from . import _state
3
2
  from . import scripts as exoscript
4
3
  from . import variables as exovar
@@ -10,7 +9,6 @@ def _cached(key: str, builder):
10
9
  return lvl._stdlib_cache[key]
11
10
 
12
11
  def flash():
13
- """flash(target: ObjectSet, hi_color: Color, base_color: Color, duration: Float)"""
14
12
  def build():
15
13
  @exoscript.func(name="std_flash")
16
14
  def _fn(target: exovar.ObjectSet, hi_color: exovar.Color = "#FFFFFF", base_color: exovar.Color = "#00F5FF", duration: exovar.Float = 0.15):
@@ -24,7 +22,6 @@ def flash():
24
22
  return _cached("flash", build)
25
23
 
26
24
  def pulse():
27
- """pulse(target: ObjectSet, big_scale: Vector, duration: Float)"""
28
25
  def build():
29
26
  @exoscript.func(name="std_pulse")
30
27
  def _fn(target: exovar.ObjectSet, big_scale: exovar.Vector = (1.35, 1.35), duration: exovar.Float = 0.15):
@@ -37,7 +34,6 @@ def pulse():
37
34
  return _cached("pulse", build)
38
35
 
39
36
  def glide_between():
40
- """glide_between(target: ObjectSet, pos_a: Vector, pos_b: Vector, duration: Float)"""
41
37
  def build():
42
38
  @exoscript.func(name="std_glide_between")
43
39
  def _fn(target: exovar.ObjectSet, pos_a: exovar.Vector = (0, 0), pos_b: exovar.Vector = (5, 0), duration: exovar.Float = 1.5):
@@ -50,7 +46,6 @@ def glide_between():
50
46
  return _cached("glide_between", build)
51
47
 
52
48
  def banner():
53
- """banner(label: ObjectSet, message: String, color: Color)"""
54
49
  def build():
55
50
  @exoscript.func(name="std_banner")
56
51
  def _fn(label: exovar.ObjectSet, message: exovar.String = "HELLO", color: exovar.Color = "#FFE66D"):
@@ -252,7 +252,6 @@ def Vector(name, value=(0.0,0.0), *, is_global=True): return _reg(name, StaticTy
252
252
  def Object(name, obj=0, *, is_global=True): return _reg(name, StaticType.Object, NovaValue.object(obj), is_global)
253
253
  def ObjectSet(name, objs=(), *, is_global=True): return _reg(name, StaticType.ObjectSet, NovaValue.object_set(objs), is_global)
254
254
 
255
- # Resolve Python type hints or exovar constructors -> StaticType
256
255
  HINT_TO_STATIC = {
257
256
  bool: StaticType.Bool, Bool: StaticType.Bool,
258
257
  int: StaticType.Int, Int: StaticType.Int,
@@ -278,7 +277,6 @@ def resolve_static_type(hint, default=None) -> int:
278
277
  if isinstance(default, (tuple, list)) and len(default) == 2: return StaticType.Vector
279
278
  raise ValueError(f"Cannot infer StaticType from annotation {hint!r} / default {default!r}")
280
279
 
281
- # Shared Return Registers (lazily registered per level, Blockvale-style)
282
280
  def return_reg(stype: int) -> Variable:
283
281
  lvl = _state.get_level()
284
282
  st = int(stype)
@@ -292,7 +290,6 @@ def return_reg(stype: int) -> Variable:
292
290
  lvl._return_regs[st] = _reg(names.get(st, f"_rv_{st}"), st, default_nova_for(st), is_global=True)
293
291
  return lvl._return_regs[st]
294
292
 
295
- # Built-in Expressions
296
293
  def player(): return NovaValue(DynamicType.ObjectPlayer)
297
294
  def players(): return NovaValue(DynamicType.ObjectSetPlayers)
298
295
  def tag(name): return NovaValue.expr(DynamicType.ObjectSetObjectsWithTag, NovaValue.string(name))
@@ -310,7 +307,6 @@ def and_(a, b): return NovaValue.expr(DynamicType.BoolAnd, a, b)
310
307
  def or_(a, b): return NovaValue.expr(DynamicType.BoolOr, a, b)
311
308
 
312
309
 
313
- # Public exovar wrappers (keeps NovaValue internal)
314
310
  def value(dynamic_type: int, **kwargs):
315
311
  return NovaValue(dynamic_type, **kwargs)
316
312
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exopython
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Programmatic level builder, decompiler, and obfuscator for Exoracer (.exolvl)
5
5
  License: MIT License
6
6
 
@@ -24,6 +24,8 @@ License: MIT License
24
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  SOFTWARE.
26
26
 
27
+ Project-URL: Homepage, https://github.com/TheNexusZen/ExoPython
28
+ Project-URL: Repository, https://github.com/TheNexusZen/ExoPython
27
29
  Requires-Python: >=3.8
28
30
  Description-Content-Type: text/markdown
29
31
  License-File: LICENSE
@@ -31,9 +33,14 @@ Dynamic: license-file
31
33
 
32
34
  # exopy
33
35
 
34
- Programmatic level builder, decompiler, and source-protection toolkit for **Exoracer** (`.exolvl`).
36
+ ​A toolkit for building, decompiling, and protecting **Exoracer** (`.exolvl`) levels with python.
35
37
 
36
38
  ## Installation
37
39
 
38
40
  ```bash
39
- pip install .
41
+ pip install exopython
42
+ ```
43
+
44
+ ## Todo
45
+ - [ ] update `README.md` to be useful (someone do that)
46
+ - [ ] improvements
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "exopython"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  description = "Programmatic level builder, decompiler, and obfuscator for Exoracer (.exolvl)"
9
9
  readme = "README.md"
10
10
  license = {file = "LICENSE"}
@@ -13,3 +13,7 @@ dependencies = []
13
13
 
14
14
  [tool.setuptools.packages.find]
15
15
  include = ["exopy*"]
16
+
17
+ [project.urls]
18
+ Homepage = "https://github.com/TheNexusZen/ExoPython"
19
+ Repository = "https://github.com/TheNexusZen/ExoPython"
exopython-1.0.0/README.md DELETED
@@ -1,8 +0,0 @@
1
- # exopy
2
-
3
- Programmatic level builder, decompiler, and source-protection toolkit for **Exoracer** (`.exolvl`).
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pip install .
File without changes
File without changes
File without changes
File without changes
File without changes