naleraphael / bytejection Goto Github PK
View Code? Open in Web Editor NEWA tool for modifying/overwriting existing implementation by bytecode injection
License: MIT License
A tool for modifying/overwriting existing implementation by bytecode injection
License: MIT License
Steps to reproduce this issue:
print
function in demo/run_patched_module.py
at line 61.bytejection/demo/run_patch_module.py
Lines 59 to 62 in 67a9ca2
print
function in it)modified.foo()
as line 73 more than 3 times.bytejection/demo/run_patch_module.py
Lines 70 to 73 in 67a9ca2
demo/run_patched_module.py
.Result of execution:
--- modified version ---
foo
foo
foo
Fatal Python error: deletion of interned string failed
KeyError: ''eyError'
Current thread 0x00007ffff7fd7740 (most recent call first):
File "/media/nale/Data/Users/nale/project/bytejection/demo/pkg/foobarbuzz/core.py", line 8 in foo
File "run_patch_module.py", line 78 in main
File "run_patch_module.py", line 90 in <module>
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
--- modified version ---
foo
Program received signal SIGSEGV, Segmentation fault.
PyFunction_NewWithQualName ()
at /tmp/build/80754af9/python_1565725737370/work/Objects/funcobject.c:33
33 /tmp/build/80754af9/python_1565725737370/work/Objects/funcobject.c: No such file or directory.
Something related to importlib.util.MAGIC_NUMBER
makes it failed to import generated .pyc file.
File "demo/run_patch_module.py", line 77, in <module>
main()
File "demo/run_patch_module.py", line 72, in main
modified_mod = load_module_from_path('modified', osp.join(THIS_DIR, 'modified.pyc'))
File "demo/run_patch_module.py", line 42, in load_module_from_path
mod = _load_module(name, path)
File "demo/run_patch_module.py", line 31, in _load_module
spec.loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 724, in exec_module
File "<frozen importlib._bootstrap_external>", line 1005, in get_code
File "<frozen importlib._bootstrap_external>", line 467, in _classify_pyc
ImportError: invalid flags 1571323424 in 'modified'
flags
is also different on Windows 7 (local environment) and repl.it:
ImportError: invalid flags 1571323537 in 'modified'
ImportError: invalid flags 1571323424 in 'modified'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.