{"id":336178,"date":"2022-07-25T21:00:18","date_gmt":"2022-07-25T21:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336178"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336178","title":{"rendered":"<span>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u0438 \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HASP?<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/3a3\/3ad\/58d\/3a33ad58dc982529116efdd7d5c99f17.jpg\" alt=\"\" title=\"\" width=\"1492\" height=\"783\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a3\/3ad\/58d\/3a33ad58dc982529116efdd7d5c99f17.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u044f \u0412\u044f\u0447\u0435\u0441\u043b\u0430\u0432 \u0416\u0443\u0439\u043a\u043e \u2013 Lead \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Audiogram \u0432 MTS AI.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 On-Cloud \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u041f\u041e \u043d\u0430 On-Premises \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0434 \u0432\u0430\u043c\u0438 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0449\u0438\u0442\u044b \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u2013 \u0438 \u043e\u043d\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430 \u0434\u043b\u044f \u0440\u044b\u043d\u043a\u0430 AI, \u0433\u0434\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0444\u0435\u0440\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a Python, \u041f\u041e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f On-Cloud \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 On-Premises \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u0430\u043a \u043e\u0442 \u0443\u0442\u0435\u0447\u0435\u043a \u043a\u043e\u0434\u0430, \u0442\u0430\u043a \u0438 \u0441\u0430\u043c\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0418 \u0442\u0430\u043a, \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c Audiogram \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438. \u041e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 On-Cloud, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u0435\u043b \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Audiogram On-Premises. \u041c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u2014 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u0431\u044b \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u0440\u0430\u0436\u0438 \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435.  \u0414\u0430\u043b\u0435\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u043a\u0430\u043a \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0418\u0442\u0430\u043a, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u043f\u043e \u0448\u0430\u0433\u0430\u043c.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0437 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u043a\u043e\u0434 \u043d\u0430 C++<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0445. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"python\">with open(path, 'rb') as f:     data = f.read() use_data(data)<\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u043d\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u043a\u043e\u0434 \u043e\u0431\u0444\u0443\u0441\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Cython \u2013 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u043a\u043e\u0434\u0430 \u043d\u0430 C \u0438\u043b\u0438 C++. \u0412\u043e\u043e\u0431\u0449\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438, \u0430 \u0441\u0430\u043c\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Setuptools. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0445\u043e\u0434\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u044b\u0448\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c setup.py \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043d\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0448\u0435\u043b \u043f\u0443\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Cython \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432 Cython:<\/p>\n<pre><code>cython -3 --no-docstrings --fast-fail --output-file lib.c lib.py cython -3 --no-docstrings --fast-fail --cplus --output-file lib.cpp lib.py cython -3 --no-docstrings --fast-fail --embed --output-file app.c app.py<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<br \/> <code>-3<\/code> &#8212; \u0432\u0435\u0440\u0441\u0438\u044f Python<br \/> <code>--no-docstrings<\/code> &#8212; \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 Python Docstrings \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<br \/> <code>--fast-fail<\/code> &#8212; \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435<br \/> <code>--embed<\/code> &#8212; \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>main()<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440, \u0430 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e: <code>.\/app<\/code><br \/> <code>--cplus<\/code> &#8212; \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>C++<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>C<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 C \u0438\u043b\u0438 C++ \u0444\u0430\u0439\u043b\u044b \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Makefile. \u042f \u043f\u043e\u0448\u0435\u043b \u0441\u0445\u043e\u0436\u0438\u043c \u043f\u0443\u0442\u0435\u043c, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Cython, \u0438 \u0432\u044b\u0437\u0432\u0430\u043b \u0441\u0431\u043e\u0440\u043a\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u044b <code>build-essential python-dev-is-python3<\/code>.<br \/> \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0437 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code>gcc $(python3.8-config --cflags) -fPIC -g0 -s -shared lib.c -o lib.so gcc $(python3.8-config --cflags) -fPIC -g0 -s app.c -o app $(python3.8-config --libs --embed)<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<br \/> <code>python3.8-config --cflags<\/code> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 CFLAGS<br \/> <code>-fPIC<\/code> &#8212; \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u0434<br \/> <code>-g0<\/code> &#8212; \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438<br \/> <code>-s<\/code> &#8212; \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u043b\u043e\u043a\u0430\u0446\u0438\u0438<br \/> <code>-shared<\/code> &#8212; \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<br \/> <code>python3.8-config --libs --embed<\/code> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u043b\u0438\u043d\u043a\u0435\u0440\u0430<br \/> \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>-g0<\/code> \u0438 <code>-s<\/code> \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0432\u0435 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: \u0441\u0438\u0442\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0441 \u043a\u043e\u0434\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u2013 \u043c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0438\u0445 \u043d\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 ELF \u0444\u0430\u0439\u043b\u044b \u0431\u0435\u0437 Python Docstrings \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0431\u043e\u043d\u0443\u0441 \u2013 \u0441\u0438\u0442\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 Python, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f type hinting.<\/p>\n<p>\u0412\u0441\u0435 \u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e? \u0423\u0432\u044b, \u043d\u0435\u0442. Cython \u043e\u0442\u0441\u0442\u0430\u0435\u0442 \u043f\u043e \u0444\u0438\u0447\u0430\u043c \u043e\u0442 Python, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f &#171;the walrus operator&#187;, Data Classes, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 inspect \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0435\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u2013 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0441 \u0447\u0435\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043c\u044b. \u042d\u0442\u043e \u0432\u0441\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u0436\u0438\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0433\u0434\u0435-\u0442\u043e \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Data Classes \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c annotations \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<h3>\u0428\u0438\u0444\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c SDK \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f HASP, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e Sentinel.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 SDK \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f <a href=\"https:\/\/docs.sentinel.thalesgroup.com\/ldk\/LDKdocs\/SPNL\/LDK_SLnP_Guide\/Protection\/Data_File_Protection\/0_datahasp_working_with.htm\">&#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;<\/a>. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 Python \u0438\u0445 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432:<\/p>\n<pre><code class=\"python\">with open(path, 'rb') as f:     data = f.read() data = decrypt(data) use_data(data)<\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430, \u0441\u043e\u0441\u0447\u0438\u0442\u0430\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c. \u0412 \u0441\u0430\u043c\u044b\u0445 \u043e\u0431\u0449\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u2013 \u0433\u0434\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e, \u0430 \u0441\u0430\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435: <code>f<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Sentinel SDK \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 C++ libsentinel.a \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439:<\/p>\n<pre><code>std::vector&lt;unsigned char> sentinel_decrypt(const std::string&amp; path);<\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e? \u0415\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 libsentinel.so \u0441 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 sentinel_decrypt(), \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u044e\u0431\u043e\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430 Cython \u043f\u043e\u0434\u043c\u0435\u043d\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">import os import io from typing import Union, List, AnyStr, Iterator from libcpp.vector cimport vector from libcpp.string cimport string cdef extern from \"sentinel.h\": vector[unsigned char] sentinel_decrypt(const string&amp; path) except + def sentinel_open(path: Union[str, bytes, os.PathLike], mode: str, **kwargs) -> 'SentinelFileIo': return SentinelFileIo(path, mode, **kwargs) class SentinelFileIo: def init(self, path: Union[str, bytes, os.PathLike], mode: str, **kwargs) -> None: if isinstance(path, os.PathLike): path = str(path) if isinstance(path, str): path = path.encode('utf-8') data = bytes(sentinel_decrypt(path)) encoding = kwargs.get('encoding', None) if encoding is not None: data = data.decode(encoding) self._data = data self._size = len(self._data) self._pos = 0 def close(self) -&amp;gt; None:     self._data = None  def closed(self) -&amp;gt; bool:     return self._data is None  def tell(self) -&amp;gt; int:     self._ensure_open()     return self._pos  def seek(self, offset: int, whence: int = io.SEEK_SET) -&amp;gt; int:     self._ensure_open()     if whence == io.SEEK_SET:         if offset &amp;lt; 0:             raise ValueError(f'negative seek position {offset}')         self._pos = offset     else:         raise io.UnsupportedOperation(\"can't do nonzero cur-relative seeks\")     return self._pos  def read(self, n: int = -1) -&amp;gt; AnyStr:     self._ensure_open()     data = self._data[self._pos:self._pos+n] if n &amp;gt;= 0 else self._data[self._pos:]     self._pos += len(data)     return data  def readline(self, limit: int = -1) -&amp;gt; AnyStr:     self._ensure_open()     data = self._data[self._pos:]     stream = io.BytesIO(data) if isinstance(data, bytes) else io.StringIO(data)     line = stream.readline(limit)     self._pos += len(line)     return line  def readlines(self, hint: int = -1) -&amp;gt; List[AnyStr]:     self._ensure_open()     data = self._data[self._pos:]     stream = io.BytesIO(data) if isinstance(data, bytes) else io.StringIO(data)     lines = stream.readlines(hint)     self._pos += sum([len(line) for line in lines])     return lines   def __enter__(self) -&amp;gt; 'SentinelFileIo':     return self  def __exit__(self, exc_type, exc_val, exc_tb) -&amp;gt; bool:     self.close()     return exc_type is None  def __iter__(self) -&amp;gt; Iterator[AnyStr]:     self._ensure_open()     while self._pos &amp;lt; self._size:         yield self.readline()  def _ensure_open(self) -&amp;gt; None:     if self.closed():         raise ValueError('I\/O operation on closed file.')&lt;\/code>&lt;\/pre>&lt;p>\u0412\u0441\u0435, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u2013 \u044d\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c &lt;code>open()&lt;\/code> \u043d\u0430 &lt;code>sentinel_open()&lt;\/code> \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:&lt;\/p>&lt;pre>&lt;code class=\"python\">with sentinel_open(path, 'rb') as f: data = f.read()  use_data(data)<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b .py -> .pyx<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c C++ \u043a\u043e\u0434 \u0438\u0437 \u2013 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u2013 Cython \u043a\u043e\u0434\u0430 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043f\u0440\u0438\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0432 libsentinel.a \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u0437 Sentinel SDK.<br \/>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432:<\/p>\n<pre><code>g++ $(python3.8-config --cflags) -fPIC -g0 -s -shared lib.cpp -o lib.so -lsentinel -lhasp_cpp_linux_x86_64 g++ $(python3.8-config --cflags) -fPIC -g0 -s app.cpp -o app $(python3.8-config --libs --embed) -lsentinel -lhasp_cpp_linux_x86_64<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 ELF-\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442? \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0434\u0430, \u043d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u044b\u043b \u043f\u0440\u0438\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d libsentinel.a, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 vendor code, \u0438\u043c\u0435\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 Sentinel SDK, \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 Sentinel SDK: Envelope, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043e\u0431\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u044b strings \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0438 \u0435\u0434\u0438\u043d\u043e\u0439 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<br \/>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u044b:<\/p>\n<pre><code>Sentinel-LDK\/VendorTools\/Envelope\/linuxenv --vcf:company-product.hvc --fid:1 input-file.so output-file.so<\/code><\/pre>\n<p>\u0410 \u043a\u0430\u043a \u0436\u0435 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0441\u0442\u0430\u0442\u044c\u0438? \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 Envelope, ELF-\u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u043f\u043e\u0434 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u043e\u0439  \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 On-Premises-\u0432\u0435\u0440\u0441\u0438\u0438 Audiogram. \u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0431\u044b\u043b\u0430 \u043b\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0432\u0430\u043c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0438 \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043b\u0430\u0439\u0444\u0445\u0430\u043a\u0430\u043c\u0438, \u043a\u0430\u043a \u0432\u044b \u0440\u0435\u0448\u0430\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043a\u043e\u0434\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/mts_ai\/blog\/678928\/\"> https:\/\/habr.com\/ru\/company\/mts_ai\/blog\/678928\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u044f \u0412\u044f\u0447\u0435\u0441\u043b\u0430\u0432 \u0416\u0443\u0439\u043a\u043e \u2013 Lead \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Audiogram \u0432 MTS AI.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 On-Cloud \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u041f\u041e \u043d\u0430 On-Premises \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0434 \u0432\u0430\u043c\u0438 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0449\u0438\u0442\u044b \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u2013 \u0438 \u043e\u043d\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430 \u0434\u043b\u044f \u0440\u044b\u043d\u043a\u0430 AI, \u0433\u0434\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0444\u0435\u0440\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a Python, \u041f\u041e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f On-Cloud \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 On-Premises \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u0430\u043a \u043e\u0442 \u0443\u0442\u0435\u0447\u0435\u043a \u043a\u043e\u0434\u0430, \u0442\u0430\u043a \u0438 \u0441\u0430\u043c\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0418 \u0442\u0430\u043a, \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c Audiogram \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438. \u041e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 On-Cloud, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u0435\u043b \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Audiogram On-Premises. \u041c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u2014 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u0431\u044b \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u0440\u0430\u0436\u0438 \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435.  \u0414\u0430\u043b\u0435\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u043a\u0430\u043a \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0418\u0442\u0430\u043a, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u043f\u043e \u0448\u0430\u0433\u0430\u043c.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0437 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u043a\u043e\u0434 \u043d\u0430 C++<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0445. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"python\">with open(path, 'rb') as f:     data = f.read() use_data(data)<\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u043d\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u043a\u043e\u0434 \u043e\u0431\u0444\u0443\u0441\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Cython \u2013 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u043a\u043e\u0434\u0430 \u043d\u0430 C \u0438\u043b\u0438 C++. \u0412\u043e\u043e\u0431\u0449\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438, \u0430 \u0441\u0430\u043c\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Setuptools. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0445\u043e\u0434\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u044b\u0448\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c setup.py \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043d\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0448\u0435\u043b \u043f\u0443\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Cython \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432 Cython:<\/p>\n<pre><code>cython -3 --no-docstrings --fast-fail --output-file lib.c lib.py cython -3 --no-docstrings --fast-fail --cplus --output-file lib.cpp lib.py cython -3 --no-docstrings --fast-fail --embed --output-file app.c app.py<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<br \/> <code>-3<\/code> &#8212; \u0432\u0435\u0440\u0441\u0438\u044f Python<br \/> <code>--no-docstrings<\/code> &#8212; \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 Python Docstrings \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<br \/> <code>--fast-fail<\/code> &#8212; \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435<br \/> <code>--embed<\/code> &#8212; \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>main()<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440, \u0430 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e: <code>.\/app<\/code><br \/> <code>--cplus<\/code> &#8212; \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>C++<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>C<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 C \u0438\u043b\u0438 C++ \u0444\u0430\u0439\u043b\u044b \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Makefile. \u042f \u043f\u043e\u0448\u0435\u043b \u0441\u0445\u043e\u0436\u0438\u043c \u043f\u0443\u0442\u0435\u043c, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Cython, \u0438 \u0432\u044b\u0437\u0432\u0430\u043b \u0441\u0431\u043e\u0440\u043a\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u044b <code>build-essential python-dev-is-python3<\/code>.<br \/> \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0437 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code>gcc $(python3.8-config --cflags) -fPIC -g0 -s -shared lib.c -o lib.so gcc $(python3.8-config --cflags) -fPIC -g0 -s app.c -o app $(python3.8-config --libs --embed)<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<br \/> <code>python3.8-config --cflags<\/code> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 CFLAGS<br \/> <code>-fPIC<\/code> &#8212; \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u0434<br \/> <code>-g0<\/code> &#8212; \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438<br \/> <code>-s<\/code> &#8212; \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u043b\u043e\u043a\u0430\u0446\u0438\u0438<br \/> <code>-shared<\/code> &#8212; \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<br \/> <code>python3.8-config --libs --embed<\/code> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u043b\u0438\u043d\u043a\u0435\u0440\u0430<br \/> \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>-g0<\/code> \u0438 <code>-s<\/code> \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0432\u0435 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: \u0441\u0438\u0442\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0441 \u043a\u043e\u0434\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u2013 \u043c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0438\u0445 \u043d\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 ELF \u0444\u0430\u0439\u043b\u044b \u0431\u0435\u0437 Python Docstrings \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0431\u043e\u043d\u0443\u0441 \u2013 \u0441\u0438\u0442\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 Python, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f type hinting.<\/p>\n<p>\u0412\u0441\u0435 \u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e? \u0423\u0432\u044b, \u043d\u0435\u0442. Cython \u043e\u0442\u0441\u0442\u0430\u0435\u0442 \u043f\u043e \u0444\u0438\u0447\u0430\u043c \u043e\u0442 Python, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f &#171;the walrus operator&#187;, Data Classes, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 inspect \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0435\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u2013 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0441 \u0447\u0435\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043c\u044b. \u042d\u0442\u043e \u0432\u0441\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u0436\u0438\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0433\u0434\u0435-\u0442\u043e \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Data Classes \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c annotations \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<h3>\u0428\u0438\u0444\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c SDK \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f HASP, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e Sentinel.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 SDK \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f <a href=\"https:\/\/docs.sentinel.thalesgroup.com\/ldk\/LDKdocs\/SPNL\/LDK_SLnP_Guide\/Protection\/Data_File_Protection\/0_datahasp_working_with.htm\">&#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;<\/a>. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 Python \u0438\u0445 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432:<\/p>\n<pre><code class=\"python\">with open(path, 'rb') as f:     data = f.read() data = decrypt(data) use_data(data)<\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430, \u0441\u043e\u0441\u0447\u0438\u0442\u0430\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c. \u0412 \u0441\u0430\u043c\u044b\u0445 \u043e\u0431\u0449\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u2013 \u0433\u0434\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e, \u0430 \u0441\u0430\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435: <code>f<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Sentinel SDK \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 C++ libsentinel.a \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439:<\/p>\n<pre><code>std::vector&lt;unsigned char> sentinel_decrypt(const std::string&amp; path);<\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e? \u0415\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 libsentinel.so \u0441 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 sentinel_decrypt(), \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u044e\u0431\u043e\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430 Cython \u043f\u043e\u0434\u043c\u0435\u043d\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">import os import io from typing import Union, List, AnyStr, Iterator from libcpp.vector cimport vector from libcpp.string cimport string cdef extern from \"sentinel.h\": vector[unsigned char] sentinel_decrypt(const string&amp; path) except + def sentinel_open(path: Union[str, bytes, os.PathLike], mode: str, **kwargs) -> 'SentinelFileIo': return SentinelFileIo(path, mode, **kwargs) class SentinelFileIo: def init(self, path: Union[str, bytes, os.PathLike], mode: str, **kwargs) -> None: if isinstance(path, os.PathLike): path = str(path) if isinstance(path, str): path = path.encode('utf-8') data = bytes(sentinel_decrypt(path)) encoding = kwargs.get('encoding', None) if encoding is not None: data = data.decode(encoding) self._data = data self._size = len(self._data) self._pos = 0 def close(self) -&amp;gt; None:     self._data = None  def closed(self) -&amp;gt; bool:     return self._data is None  def tell(self) -&amp;gt; int:     self._ensure_open()     return self._pos  def seek(self, offset: int, whence: int = io.SEEK_SET) -&amp;gt; int:     self._ensure_open()     if whence == io.SEEK_SET:         if offset &amp;lt; 0:             raise ValueError(f'negative seek position {offset}')         self._pos = offset     else:         raise io.UnsupportedOperation(\"can't do nonzero cur-relative seeks\")     return self._pos  def read(self, n: int = -1) -&amp;gt; AnyStr:     self._ensure_open()     data = self._data[self._pos:self._pos+n] if n &amp;gt;= 0 else self._data[self._pos:]     self._pos += len(data)     return data  def readline(self, limit: int = -1) -&amp;gt; AnyStr:     self._ensure_open()     data = self._data[self._pos:]     stream = io.BytesIO(data) if isinstance(data, bytes) else io.StringIO(data)     line = stream.readline(limit)     self._pos += len(line)     return line  def readlines(self, hint: int = -1) -&amp;gt; List[AnyStr]:     self._ensure_open()     data = self._data[self._pos:]     stream = io.BytesIO(data) if isinstance(data, bytes) else io.StringIO(data)     lines = stream.readlines(hint)     self._pos += sum([len(line) for line in lines])     return lines   def __enter__(self) -&amp;gt; 'SentinelFileIo':     return self  def __exit__(self, exc_type, exc_val, exc_tb) -&amp;gt; bool:     self.close()     return exc_type is None  def __iter__(self) -&amp;gt; Iterator[AnyStr]:     self._ensure_open()     while self._pos &amp;lt; self._size:         yield self.readline()  def _ensure_open(self) -&amp;gt; None:     if self.closed():         raise ValueError('I\/O operation on closed file.')&lt;\/code>&lt;\/pre>&lt;p>\u0412\u0441\u0435, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u2013 \u044d\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c &lt;code>open()&lt;\/code> \u043d\u0430 &lt;code>sentinel_open()&lt;\/code> \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:&lt;\/p>&lt;pre>&lt;code class=\"python\">with sentinel_open(path, 'rb') as f: data = f.read()  use_data(data)<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b .py -> .pyx<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c C++ \u043a\u043e\u0434 \u0438\u0437 \u2013 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u2013 Cython \u043a\u043e\u0434\u0430 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043f\u0440\u0438\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0432 libsentinel.a \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u0437 Sentinel SDK.<br \/>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432:<\/p>\n<pre><code>g++ $(python3.8-config --cflags) -fPIC -g0 -s -shared lib.cpp -o lib.so -lsentinel -lhasp_cpp_linux_x86_64 g++ $(python3.8-config --cflags) -fPIC -g0 -s app.cpp -o app $(python3.8-config --libs --embed) -lsentinel -lhasp_cpp_linux_x86_64<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 ELF-\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442? \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0434\u0430, \u043d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u044b\u043b \u043f\u0440\u0438\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d libsentinel.a, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 vendor code, \u0438\u043c\u0435\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 Sentinel SDK, \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 Sentinel SDK: Envelope, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043e\u0431\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u044b strings \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0438 \u0435\u0434\u0438\u043d\u043e\u0439 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<br \/>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u044b:<\/p>\n<pre><code>Sentinel-LDK\/VendorTools\/Envelope\/linuxenv --vcf:company-product.hvc --fid:1 input-file.so output-file.so<\/code><\/pre>\n<p>\u0410 \u043a\u0430\u043a \u0436\u0435 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0441\u0442\u0430\u0442\u044c\u0438? \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 Envelope, ELF-\u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-336178","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=336178"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336178\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}