Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krypton-byte/lexz
Time travel for obfuscation purpose xD
https://github.com/krypton-byte/lexz
ast python tree variable
Last synced: 9 days ago
JSON representation
Time travel for obfuscation purpose xD
- Host: GitHub
- URL: https://github.com/krypton-byte/lexz
- Owner: krypton-byte
- License: apache-2.0
- Created: 2023-08-17T13:06:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-21T18:04:28.000Z (over 1 year ago)
- Last Synced: 2025-01-04T20:44:52.546Z (13 days ago)
- Topics: ast, python, tree, variable
- Language: Python
- Homepage:
- Size: 138 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lexz
Remapping Variable Using Abstract Syntax Tree [(AST)](https://docs.python.org/3/library/ast.html)
# Task
- [x] Graph
- [x] Aliasing Variable
- [x] Alias Backend
- [x] JSON
- [ ] Fully support annotation
# Tutorial
### Generate GraphViz File
```bash
python -m lexz -f test.py -g graph.dot
```
### Generate SVG Image
```bash
python -m lexz test.py -g graph.dot
dot -Tsvg output.svg graph.dot#in single line
python -m lexz -f test.py -g /dev/stdout|dot -Tsvg -o output.svg
```
# Demo
### Input```python
class HelloWorld:
def __init__(self) -> None:
try:
self.a = 3
except Exception:
self.b = 3class HelloWorld2((child:=HelloWorld)):
def __init__(selx) -> None:
selx.a = 3
for i in range(10):
self.for_ = i
@dfunc((decorator:=10))
async def xyz(self, a):
async for i in range(10):
self.tesx = i
async with open("test3.py", "r") as f:
print(f.read())
lambda ho: 123@(lambda:(call := dfunc((arg := 2))))()
def FunDec():
data = {'a': (a := (b := (c := 3)))}
print(data, a, b, c)
passdef dfunc(arg):
def func(f):
def execute(*args, **kwargs):
return f(*args, **kwargs)
return execute
return func```
### Result Graphviz( Dot Graph )
![image](assets/output.svg)