Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Your Python - your rules
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Roman Bazhin
March 20, 2015
Research
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Your Python - your rules
Roman Bazhin
March 20, 2015
More Decks by Roman Bazhin
See All by Roman Bazhin
JETPLOW is dead. Long live the JETPLOW!
nezlooy
1
910
Oracle Database Communication Protocol
nezlooy
0
770
Other Decks in Research
See All in Research
Anthropic が提案する LLM の内部状態を自然言語で説明可能にした Natural Language Autoencoders / Natural Language Autoencoders Produce Unsupervised Explanations of LLM Activations
shunk031
0
210
[CV勉強会@関東 CVPR2026] PSDesigner: Automated Graphic Design with a Human-Like Creative Workflow / kantocv 67th CVPR 2026
shunk031
0
300
実例から見るLLMのマンガ理解:実務VQAタスクによる長期的文脈と視覚情報の定性評価
kzmssk
0
130
Language and AI
ayaniwa
0
230
[Fishers] DIVER OSINT CTF 2026 特化AIエージェントハーネスで挑戦するOSINT CTF
analokmaus
0
560
Ghost in the 7‑Zip: The Shadow of Residential Proxies Creeping into Your Life
nttcom
0
2.1k
Harness Engineering and Al Agent
kzinmr
3
2k
[ACL 2026 Demo] Fast-MIA: Efficient and Scalable Membership Inference for LLMs
upura
0
120
SOTAのさらに先へ:厳しい推論制約下での高性能モデルのPost-Training
analokmaus
0
1.5k
重要だけど測れていないもの:高齢者ケアの見えない課題
theoriatec2024
0
520
COMETAを用いたデータ民主化運動の歴史
sazimai
0
250
論文紹介:Doc-to-LoRA: Learning to Instantly Internalize Contexts
yukako_nakano
0
160
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Practical Orchestrator
shlominoach
191
12k
Facilitating Awesome Meetings
lara
57
7.1k
Music & Morning Musume
bryan
47
7.4k
Mind Mapping
helmedeiros
1
350
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
A better future with KSS
kneath
240
18k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Raft: Consensus for Rubyists
vanstee
141
7.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Transcript
–
• • • @ @ © 2002—2015, Digital Security
• • • • • • •
• • • • • • • •
None
• • • • • … • •
…
…
• • def load_module(self, fullname): code = self.get_code(fullname) // get_source
ispkg = self.is_package(fullname) nmod = imp.new_module(fullname) mod = sys.modules.setdefault(fullname, nmod) mod.__file__ = "<%s>" % self.__class__.__name__ mod.__loader__ = self if ispkg: mod.__path__ = [] mod.__package__ = fullname else: mod.__package__ = fullname.rpartition('.')[0] exec(code, mod.__dict__) return mod PyObject *load_module(PyObject *self, PyObject *args){ char *mod_code, *fullname; PyObject *new_mod, *sys_mod_dict, *mod_dict, *res, *o; PyArg_ParseTuple(args, "s", &fullname); new_mod = PyModule_New(fullname); Py_INCREF(new_mod); sys_mod_dict = PyImport_GetModuleDict(); if (sys_mod_dict != NULL){ PyDict_SetItemString(sys_mod_dict, fullname, new_mod); o = PyDict_GetItemString(sys_mod_dict, "__builtin__"); PyModule_AddObject(new_mod, "__builtins__", o); } mod_code = get_code(fullname); mod_dict = PyModule_GetDict(new_mod); res = PyRun_String(mod_code, Py_file_input, mod_dict, mod_dict);
None
None
«Об одном способе защиты исходников Python-программы»
None
None
• • •
None
• • • • • •
• • • • • • • • • •
…
• • #define STOP_CODE 0 #define POP_TOP 1 #define ROT_TWO
2 #define ROT_THREE 3 #define DUP_TOP 4 #define ROT_FOUR 5 #define NOP 9 … #define BINARY_POWER 0 #define PRINT_ITEM 1 #define INPLACE_OR 2 #define DUP_TOP 3 #define GET_ITER 4 #define BINARY_MULTIPLY 5 #define BINARY_XOR 9 …
• • typedef struct { PyObject_HEAD int co_argcount; int co_nlocals;
int co_stacksize; int co_flags; … PyObject *co_consts; PyObject *co_names; PyObject *co_varnames; PyObject *co_freevars; PyObject *co_cellvars; PyObject *co_code; … } PyCodeObject;
• • • • B3 F2 0D 0A 0D F1
5C 50 63 00 00 00 00 00 00 00 00 06 00 00 00 40 00 00 00 73 16 01 00 00 78 43 00 65 00 00 64 00 00 83 01 00 44 5D 30 00 5A 01 B3 F2 0D 0A 0D F1 5C 50 63 70 F9 79 04 8E 20 00 00 11 06 10 0C 0F 0A 0B 08 02 01 03 00 03 00 02 00 00 00 00 00 04 00 05 0A 20 01 00 00 03 00 01
• • • • •
• • • • • • • •
• • • • •
None
• • • • • •
• PyObject *codestring = PyString_FromString("MARKER"); PyObject *tuple = PyTuple_New(0); PyObject
*string = PyString_FromString(""); PyCodeObject *co_obj = PyCode_New(0, 0, 0, 0, codestring, tuple, tuple, tuple, tuple, tuple, string, string, 0, string); for (char *ptr = (char *) co_obj; ptr < (char *)co_obj + sizeof(PyCodeObject); ptr += 4) if (*((PyObject **)ptr) == co_obj) print("Gotcha"); •
• • • • 0x64 0x44 0x47 0x11 0x48 0x2E
0x61 0x41 0x53 0x23
• • •
• • • • • • • • • •
• •
• • • •
None
• • • • • • •
None
• • • • • • • • • •
• • • • • • • •
• •
None