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
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
780
Other Decks in Research
See All in Research
COMETAを用いたデータ民主化運動の歴史
sazimai
0
290
VRID: View-Invariant Representation through Dual-Axis Transformation for Cross-iew Pose Estimation
satai
3
120
Être éleveur dans un monde en transition : Comprendre les changements pour mieux les accompagner
institutdelelevage
PRO
0
140
Santé et fertilité des sols : ce que nous disent les pratiques dans les systèmes de polyculture-élevage
institutdelelevage
PRO
0
130
Model Predictive Control for Uncertain Systems: Robust & Data-Driven Designs
kohlerjohannes
0
170
量子サマースクール2026「量子計算機アーキテクチャ分野の概観」
youten622
1
980
Volatilité des marchés et sécheresse historique, l’élevage bovin viande sous contraintes en 2026
institutdelelevage
PRO
0
120
某助成金プロジェクト採択に向けて企業研究所のアウトリーチ専任者がやったこと
afroscript
0
200
Détecter les vulnérabilités dans un environnement souverain
hellosct1
0
110
高性能計算機クラスタを用いた大規模点群処理による森林の単木抽出と構造解析
kentaitakura
1
150
Language and AI
ayaniwa
0
320
Développer des solutions de réduction des émissions de méthane entérique : 1ers résultats Méthane 2030
institutdelelevage
PRO
0
250
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
430
Typedesign – Prime Four
hannesfritz
42
3.2k
Designing Experiences People Love
moore
143
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
580
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
The SEO Collaboration Effect
kristinabergwall1
1
590
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