PyProtect-v3 3.2.1__tar.gz → 3.2.3__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.
Files changed (22) hide show
  1. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PKG-INFO +1 -1
  2. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PyProtect_v3.egg-info/PKG-INFO +1 -1
  3. pyprotect_v3-3.2.3/pyprotect/_version.py +1 -0
  4. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/engine.c +13 -2
  5. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/obfuscator.py +0 -16
  6. pyprotect_v3-3.2.1/pyprotect/_version.py +0 -1
  7. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/MANIFEST.in +0 -0
  8. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PyProtect_v3.egg-info/SOURCES.txt +0 -0
  9. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PyProtect_v3.egg-info/dependency_links.txt +0 -0
  10. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PyProtect_v3.egg-info/entry_points.txt +0 -0
  11. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PyProtect_v3.egg-info/requires.txt +0 -0
  12. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/PyProtect_v3.egg-info/top_level.txt +0 -0
  13. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/README.md +0 -0
  14. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyproject.toml +0 -0
  15. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/__init__.py +0 -0
  16. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/__main__.py +0 -0
  17. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/anti_debug.py +0 -0
  18. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/crypto.py +0 -0
  19. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/engine.py +0 -0
  20. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/pyprotect/hooks.py +0 -0
  21. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/setup.cfg +0 -0
  22. {pyprotect_v3-3.2.1 → pyprotect_v3-3.2.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyProtect-v3
3
- Version: 3.2.1
3
+ Version: 3.2.3
4
4
  Summary: Python script obfuscation library with AES-256-GCM encryption and C extension acceleration
5
5
  Author-email: NguyenNgocNam <c.nam020213@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyProtect-v3
3
- Version: 3.2.1
3
+ Version: 3.2.3
4
4
  Summary: Python script obfuscation library with AES-256-GCM encryption and C extension acceleration
5
5
  Author-email: NguyenNgocNam <c.nam020213@gmail.com>
6
6
  License-Expression: MIT
@@ -0,0 +1 @@
1
+ __version__ = "3.2.3"
@@ -44,6 +44,11 @@
44
44
  #include <openssl/err.h>
45
45
  #endif
46
46
 
47
+ /* Suppress unused-parameter warnings for standard module functions */
48
+ #ifdef __GNUC__
49
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
50
+ #endif
51
+
47
52
  #include <zlib.h>
48
53
 
49
54
  /* Constants */
@@ -65,9 +70,11 @@ static const unsigned char EMBEDDED_KEY[32] = {
65
70
 
66
71
  /* ------------------------------------------------------------------ */
67
72
  /* Embedded AES-256-GCM implementation (public domain) */
68
- /* (keep the same embedded AES code from original engine.c) */
73
+ /* Only compiled when OpenSSL is not available */
69
74
  /* ------------------------------------------------------------------ */
70
75
 
76
+ #if defined(USE_EMBEDDED_AES)
77
+
71
78
  static const uint8_t aes_sbox[256] = {
72
79
  0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
73
80
  0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
@@ -252,6 +259,8 @@ static int aes_gcm_decrypt(const uint8_t *key, int key_len,
252
259
  return (int)ct_len;
253
260
  }
254
261
 
262
+ #endif /* USE_EMBEDDED_AES */
263
+
255
264
  /* ------------------------------------------------------------------ */
256
265
  /* Anti-debug */
257
266
  /* ------------------------------------------------------------------ */
@@ -623,6 +632,7 @@ static PyObject* engine_decrypt_and_exec(PyObject *self, PyObject *args) {
623
632
  if (!globals) { restore_frame_hook(); Py_DECREF(code_obj); return NULL; }
624
633
 
625
634
  PyDict_SetItemString(globals, "__builtins__", builtins);
635
+ PyDict_SetItemString(globals, "__name__", PyUnicode_FromString("__main__"));
626
636
 
627
637
  PyObject *result = PyEval_EvalCode((PyObject*)code_obj, globals, globals);
628
638
 
@@ -798,7 +808,8 @@ static PyMethodDef EngineMethods[] = {
798
808
  static struct PyModuleDef enginemodule = {
799
809
  PyModuleDef_HEAD_INIT, "engine_c",
800
810
  "pyprotect-v4 engine - frame hook, anti-tamper, anti-dump",
801
- -1, EngineMethods
811
+ -1, EngineMethods,
812
+ NULL, NULL, NULL, NULL
802
813
  };
803
814
 
804
815
  PyMODINIT_FUNC PyInit_engine_c(void) {
@@ -10,7 +10,6 @@ import marshal
10
10
  import types
11
11
  import random
12
12
  import string
13
- import shutil
14
13
  import ast
15
14
  import base64
16
15
 
@@ -392,9 +391,6 @@ class Obfuscator:
392
391
  with open(out_path, "w", encoding="utf-8") as f:
393
392
  f.write(bootstrap_source)
394
393
 
395
- # Copy engine if available
396
- self._copy_engine(output_dir)
397
-
398
394
  print(f"[+] Generated multi-module bootstrap: {out_path}")
399
395
  print(f"[!] Run: python {out_path}")
400
396
  print(f"[!] Or import it from another script")
@@ -426,15 +422,3 @@ class Obfuscator:
426
422
  os.chmod(stub_path, 0o755)
427
423
 
428
424
  return stub_path
429
-
430
- def _copy_engine(self, output_dir: str):
431
- """Copy compiled C extension next to output if available."""
432
- engine_dir = os.path.dirname(os.path.abspath(__file__))
433
- for fname in os.listdir(engine_dir):
434
- if fname.startswith("engine_c") and (
435
- fname.endswith(".so") or fname.endswith(".pyd") or fname.endswith(".dll")
436
- ):
437
- try:
438
- shutil.copy2(os.path.join(engine_dir, fname), os.path.join(output_dir, fname))
439
- except (shutil.Error, OSError):
440
- pass
@@ -1 +0,0 @@
1
- __version__ = "3.2.1"
File without changes
File without changes
File without changes
File without changes