{"id":452737,"date":"2025-03-22T09:00:27","date_gmt":"2025-03-22T09:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=452737"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=452737","title":{"rendered":"<span>\u0411\u043e\u0431\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0433: \u0431\u0435\u043a\u043f\u043e\u0440\u0442 Golang \u043d\u0430 Windows 7<\/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<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/822817\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 Node.js<\/a>, \u0437\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0436\u0435\u0440\u0442\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0441\u0442\u0430\u043b <a href=\"https:\/\/go.dev\/\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u00a0Go<\/a>.<\/p>\n<p>\u041f\u043e\u043b\u0433\u043e\u0434\u0430 \u0436\u0435\u0441\u0442\u043e\u043a\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/46a\/49e\/39e\/46a49e39e7c9ee8448ac19e345897e3d.jpeg\" width=\"1280\" height=\"800\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/46a\/49e\/39e\/46a49e39e7c9ee8448ac19e345897e3d.jpeg\" data-blurred=\"true\"\/><\/figure>\n<h3>\u0412\u0432\u043e\u0434\u043d\u0430\u044f<\/h3>\n<p>\u0412\u00a0\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <a href=\"https:\/\/blog.0x08.ru\/how-to-backport-nodejs-on-windows7\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/a> \u0441\u00a0Node.js, \u0431\u0435\u043a\u043f\u043e\u0440\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Golang \u043d\u0430\u00a0Windows 7\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u0447\u0438\u0441\u0442\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\u00a0\u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0440\u0430\u0434\u0438 <s>\u0442\u0440\u0435\u0448\u0430 \u0438 \u0443\u0433\u0430\u0440\u0430<\/s> \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u0442\u0430\u043b\u0430\u043d\u0442\u043e\u0432.<\/p>\n<blockquote>\n<p>\u042f\u0437\u044b\u043a Golang \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0438 \u0434\u0430\u043b\u0435\u043a \u043e\u0442 \u043c\u0438\u0440\u0430 Windows, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/articles\/837454\/\" rel=\"noopener noreferrer nofollow\">\u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/a> \u0434\u0430\u0436\u0435 \u0442\u0430\u043c.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u043e\u043b\u044c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 Golang \u0438 \u043f\u043e\u0434 Windows, \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u0431\u0435\u043a\u043f\u043e\u0440\u0442\u0435.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041e\u0431\u044a\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Go \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439,  \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043c\u0438\u043d\u0443\u0442\u044b \u0434\u0430\u0436\u0435 \u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<blockquote>\n<p>\u042d\u0442\u043e \u043d\u0435 <a href=\"https:\/\/github.com\/dotnet\/core\" rel=\"noopener noreferrer nofollow\">.NET<\/a> \u0438 \u043d\u0435 <a href=\"https:\/\/github.com\/chromium\/chromium\" rel=\"noopener noreferrer nofollow\">Chromium<\/a> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0435 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u0443\u0442\u043a\u0430\u043c\u0438, \u0441 \u0440\u0438\u0441\u043a\u043e\u043c \u0441\u043f\u0430\u043b\u0438\u0442\u044c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<\/blockquote>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 1.5, \u0434\u043b\u044f <a href=\"https:\/\/go.dev\/doc\/install\/source\" rel=\"noopener noreferrer nofollow\">\u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/a> Go \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: <\/p>\n<pre><code> The minimum version of Go required depends on the target version of Go:     Go &lt;= 1.4: a C toolchain.     1.5 &lt;= Go &lt;= 1.19: a Go 1.4 compiler.     1.20 &lt;= Go &lt;= 1.21: a Go 1.17 compiler.     1.22 &lt;= Go &lt;= 1.23: a Go 1.20 compiler.     Going forward, Go version 1.N will require a Go 1.M compiler,      where M is N-2 rounded down to an even number.      Example: Go 1.24 and 1.25 require Go 1.22. <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430\u00a0\u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 1.24, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 1.22, \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0434\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e 1.20.<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Windows 7 \u0432\u00a0Golang \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u00a0\u0442\u0430\u043a \u0443\u0436\u00a0\u0434\u0430\u0432\u043d\u043e\u00a0\u2014 \u0441\u00a0\u0440\u0435\u043b\u0438\u0437\u043e\u043c \u0432\u0435\u0440\u0441\u0438\u0438 1.20 \u0432\u00a0\u0444\u0435\u0432\u0440\u0430\u043b\u0435 2023 \u0433\u043e\u0434\u0430:<\/p>\n<blockquote>\n<p>Go 1.20 was the last release supporting Windows 2008: <a href=\"https:\/\/go.dev\/doc\/go1.20#windows\" rel=\"noopener noreferrer nofollow\">https:\/\/go.dev\/doc\/go1.20#windows<\/a><\/p>\n<\/blockquote>\n<p>\u041d\u043e\u00a0\u0434\u0430\u0436\u0435 \u0437\u0430\u00a0\u0441\u0442\u043e\u043b\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0441\u043f\u0435\u043b\u0438 \u043d\u0430\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438), \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0432\u0448\u0438\u0445 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0446\u044b \u0441\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.20, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f Windows \u0432\u0441\u0435 \u0435\u0449\u0435 <a href=\"https:\/\/go.dev\/dl\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f<\/a>, \u043d\u043e\u00a0\u043c\u044b\u00a0\u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.4. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e, \u0442\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>\u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e\u00a0\u0441\u0431\u043e\u0440\u043a\u0430 Golang \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Microsoft <strong>\u043d\u0435\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/strong> \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 MinGW, \u043f\u0440\u0438\u0447\u0435\u043c \u0435\u0449\u0435 \u0438 \u0432\u043c\u0435\u0441\u0442\u0435\u00a0\u0441\u00a0binutils. <\/p>\n<p>\u0418 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 Windows, \u0434\u0430.<\/p>\n<blockquote>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0435\u0449\u0435 \u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0446\u0438\u0440\u043a\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0431\u0438\u043b\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/niXman\/mingw-builds-binaries\/releases\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<\/blockquote>\n<p>\u041f\u0430\u043f\u043a\u0430 <code>bin<\/code> \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 PATH:<\/p>\n<pre><code>set PATH=c:\\work\\mingw64\\bin;%PATH%<\/code><\/pre>\n<p>\u0410\u0440\u0445\u0438\u0432\u044b \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c Golang \u0431\u044b\u043b\u0438 \u0432\u0437\u044f\u0442\u044b \u0441 <a href=\"https:\/\/go.dev\/dl\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/a>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Google, \u0442\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u043b\u0438\u0437\u043d\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 1.22:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e4f\/e09\/376\/e4fe0937612f5c2866f1729d5bdc9277.png\" width=\"993\" height=\"503\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e4f\/e09\/376\/e4fe0937612f5c2866f1729d5bdc9277.png\"\/><\/figure>\n<p>\u0412\u043e \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0441\u0431\u043e\u0440\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>src<\/code>:<\/p>\n<pre><code>cd src make<\/code><\/pre>\n<h3>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.4\u00a0\u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Golang, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u043e\u0439 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0421.<\/p>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ef\/cc3\/019\/1efcc301919a75a384a4b39ccd937515.png\" width=\"677\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ef\/cc3\/019\/1efcc301919a75a384a4b39ccd937515.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0431\u0435\u0437\u00a0\u043e\u0448\u0438\u0431\u043e\u043a\u00a0\u2014 \u0432\u00a0\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>bin<\/code> \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go \u0432\u0435\u0440\u0441\u0438\u0438 1.4.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.4, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0443\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 1.19:<\/p>\n<pre><code class=\"bash\">set GOROOT_BOOTSTRAP=c:\\work\\backport-go\\1.4<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b69\/ad0\/9d6\/b69ad09d68800afec72a18dc86d74d74.png\" width=\"677\" height=\"198\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b69\/ad0\/9d6\/b69ad09d68800afec72a18dc86d74d74.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0438 \u044d\u0442\u0430 \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>bin<\/code> \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go \u0443\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 1.19:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d68\/d34\/154\/d68d34154bfb01b8572ee2113d1bd147.png\" width=\"677\" height=\"198\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d68\/d34\/154\/d68d34154bfb01b8572ee2113d1bd147.png\"\/><\/figure>\n<p>\u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 1.20:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/969\/71a\/add\/96971aaddb304a5df0b7b52a2996a903.png\" width=\"677\" height=\"198\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/969\/71a\/add\/96971aaddb304a5df0b7b52a2996a903.png\"\/><\/figure>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e Golang, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0432\u00a0Windows 7 \u00ab\u0438\u0437\u00a0\u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u0437\u00a0\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n<blockquote>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0442\u043e\u043b\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e <a href=\"https:\/\/go.dev\/dl\/go1.20.14.windows-amd64.zip\" rel=\"noopener noreferrer nofollow\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a> \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.20, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0431\u043e\u0440\u043e\u043a.<\/p>\n<\/blockquote>\n<h3>\u041f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u0430\u0434<\/h3>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 1.20 \u0441\u043a\u0430\u0437\u043a\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0436\u0435\u0441\u0442\u044c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a7d\/50f\/cd8\/a7d50fcd88f27afd0577692309053da4.png\" width=\"677\" height=\"510\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a7d\/50f\/cd8\/a7d50fcd88f27afd0577692309053da4.png\"\/><\/figure>\n<p>\u0414\u0430, \u0433\u043b\u0430\u0437\u0430 \u0432\u0430\u0441 \u043d\u0435\u00a0\u043f\u043e\u0434\u0432\u043e\u0434\u044f\u0442\u00a0\u2014 \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0440\u043e\u0434\u0435\u00a0\u0431\u044b \u0432\u00a0\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u043c \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"assembly\">.. docall: \/\/ Call stdcall function. CALLAX  ADDQ$(const_maxArgs*8), SP  \/\/ Return result. MOVQ0(SP), CX MOVQ8(SP), SP MOVQAX, libcall_r1(CX) \/\/ Floating point return values are returned in XMM0. Setting r2 to this \/\/ value in case this call returned a floating point value. For details, \/\/ see https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/x64-calling-convention MOVQ    X0, libcall_r2(CX)  \/\/ GetLastError(). MOVQ0x30(GS), DI MOVL0x68(DI), AX MOVQAX, libcall_err(CX)  RET ..<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0432\u044b\u0448\u0435 \u043d\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d, \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/strong>.<\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c Golang \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439.<\/p>\n<p>75 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 (\u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u043c \u043a\u043e\u0434\u0435!) \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 WinAPI \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"assembly\">ADDQ$(const_maxArgs*8), SP<\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439<\/strong>.<\/p>\n<blockquote>\n<p>\u041d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e WinAPI!<\/p>\n<\/blockquote>\n<p>\u0410 \u0432\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435 <s>\u0434\u0443\u0440\u043a\u0430 \u0438 \u0441\u0430\u043d\u0438\u0442\u0430\u0440\u044b<\/s> \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043d\u0430\u0441 \u0432\u0441\u0435\u0445 \u0437\u0430\u043c\u0435\u043d\u044f\u0442, \u0430\u0433\u0430.<\/p>\n<h3>\u041a\u0440\u043e\u0432\u0430\u0432\u044b\u0435 \u043f\u0430\u0442\u0447\u0438<\/h3>\n<p>\u0421\u0442\u043e\u0438\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 <a href=\"https:\/\/github.com\/golang\/go\/issues\/64602\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c<\/a> <a href=\"https:\/\/github.com\/golang\/go\/issues\/64413\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e<\/a> \u043f\u0440\u0438\u0440\u043e\u0434\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u00a0\u043d\u0430\u0439\u0442\u0438 \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043f\u0430\u0442\u0447\u0430 (<a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/545355\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a> \u0438\u00a0<a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/319310\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>), \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b Golang \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432\u00a0\u00abWindows 7 and older\u00bb \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a\u00a0\u00ab\u043a\u0440\u043e\u0432\u0430\u0432\u043e\u043c\u0443 \u043f\u0430\u0442\u0447\u0438\u043d\u0433\u0443\u00bb, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u043a\u0430\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0442\u0447\u0438 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/www.atlassian.com\/git\/tutorials\/cherry-pick\" rel=\"noopener noreferrer nofollow\">cherry pick<\/a> <strong>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/strong>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 Golang, \u0430\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445\u00a0\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439. <\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<h4>\u041f\u0430\u0442\u0447 \u043f\u0435\u0440\u0432\u044b\u0439<\/h4>\n<p>\u0418\u0437\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f <a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/545355\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0438\u0442\u0430<\/a>, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0441\u043d\u043e\u0432\u0430 \u00ab\u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435\u00bb:<\/p>\n<pre><code>RtlGenRandom is a semi-undocumented API, also known as SystemFunction036, which we use to generate random data on Windows. It's definition, in cryptbase.dll, is an opaque wrapper for the documented API ProcessPrng. Instead of using RtlGenRandom, switch to using ProcessPrng, since the former is simply a wrapper for the latter, there should be no practical change on the user side, other than a minor change in the DLLs we load.<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 Windows 7 <strong>\u043d\u0435\u0442<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/windows\/win32\/seccng\/processprng\" rel=\"noopener noreferrer nofollow\">ProcessPrng<\/a>. <\/p>\n<blockquote>\n<p>\u0410 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f SystemFunction036 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0435\u0441\u0442\u044c.<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/github.com\/tauri-apps\/tauri\/issues\/10008\" rel=\"noopener noreferrer nofollow\">\u041e\u0448\u0438\u0431\u043a\u0430<\/a> <a href=\"https:\/\/github.com\/ruffle-rs\/ruffle\/issues\/17337\" rel=\"noopener noreferrer nofollow\">\u0447\u0430\u0441\u0442\u0430\u044f<\/a> \u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0432\u0441\u0435, \u043a\u0442\u043e \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0435\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Windows.<\/p>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0434\u0432\u0435 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0440\u0430\u0432\u043a\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u0434\u0430, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0430\u0439\u043b <a href=\"http:\/\/src\/crypto\/rand\/rand_windows.go\" rel=\"noopener noreferrer nofollow\">rand_windows.go<\/a>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/33f\/719\/a6d\/33f719a6d0986a26b05826b6f5a6fc93.png\" width=\"1201\" height=\"375\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33f\/719\/a6d\/33f719a6d0986a26b05826b6f5a6fc93.png\"\/><\/figure>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b\u00a0\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u0430\u0434, \u043d\u0443\u0436\u043d\u0430\u044f \u043d\u0430\u043c \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <strong>\u0441\u043b\u0435\u0432\u0430<\/strong> \u0438\u00a0\u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u0430\u00a0\u043d\u0435\u043d\u0443\u0436\u043d\u0430\u044f (\u043e\u043d\u0430\u00a0\u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u0430\u044f)\u00a0\u2014 <strong>\u0441\u043f\u0440\u0430\u0432\u0430<\/strong>.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">\/\/ Copyright 2010 The Go Authors. All rights reserved. \/\/ Use of this source code is governed by a BSD-style \/\/ license that can be found in the LICENSE file.  \/\/ Windows cryptographically secure pseudorandom number \/\/ generator.  package rand  import ( \"internal\/syscall\/windows\" )  func init() { Reader = &amp;rngReader{} }  type rngReader struct{}  func (r *rngReader) Read(b []byte) (n int, err error) { \/\/ RtlGenRandom only returns 1&lt;&lt;32-1 bytes at a time. We only read at \/\/ most 1&lt;&lt;31-1 bytes at a time so that  this works the same on 32-bit \/\/ and 64-bit systems. if err := batched(windows.RtlGenRandom, 1&lt;&lt;31-1)(b); err != nil { return 0, err } return len(b), nil }<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/src\/internal\/syscall\/windows\/zsyscall_windows.go\" rel=\"noopener noreferrer nofollow\">zsyscall_windows.go<\/a> \u0432\u0441\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/351\/ad1\/fc4\/351ad1fc47991a892e243b4623627895.png\" width=\"1253\" height=\"523\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/351\/ad1\/fc4\/351ad1fc47991a892e243b4623627895.png\"\/><\/figure>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0437\u0430\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"go\">modbcryptprimitives = syscall.NewLazyDLL(sysdll.Add(\"bcryptprimitives.dll\"))<\/code><\/pre>\n<p>\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 procProcessPrng, \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n<pre><code class=\"go\">procProcessPrng = modbcryptprimitives.NewProc(\"ProcessPrng\")<\/code><\/pre>\n<p>\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430:<\/p>\n<pre><code class=\"go\">procSystemFunction036 = modadvapi32.NewProc(\"SystemFunction036\")<\/code><\/pre>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u043a\u043e\u043d\u0435\u0446, \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043f\u0440\u0430\u0432\u043a\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/911\/655\/6e2\/9116556e273ede685f66d734b647f3fe.png\" width=\"1247\" height=\"472\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/911\/655\/6e2\/9116556e273ede685f66d734b647f3fe.png\"\/><\/figure>\n<p>\u041d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 <code>syscall<\/code>:<\/p>\n<pre><code class=\"go\">func RtlGenRandom(buf []byte) (err error) { var _p0 *byte if len(buf) &gt; 0 { _p0 = &amp;buf[0] } r1, _, e1 := syscall.Syscall(procSystemFunction036.Addr(), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0) if r1 == 0 { err = errnoErr(e1) } return }<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e <a href=\"http:\/\/src\/runtime\/os_windows.go\" rel=\"noopener noreferrer nofollow\">os_windows.go<\/a>. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u0432\u0441\u0435 \u0442\u043e\u0433\u043e \u0436\u0435 <code>ProcessPrng<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ae2\/6ba\/f27\/ae26baf279064cb1ddf8b4394502ed4e.png\" width=\"1222\" height=\"426\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ae2\/6ba\/f27\/ae26baf279064cb1ddf8b4394502ed4e.png\"\/><\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"go\">_ProcessPrng stdFunction<\/code><\/pre>\n<p>\u043d\u0430\u0434\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c:<\/p>\n<pre><code class=\"go\">_RtlGenRandom stdFunction<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e9f\/a3d\/260\/e9fa3d260064dc903580552d794e8414.png\" width=\"1244\" height=\"467\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e9f\/a3d\/260\/e9fa3d260064dc903580552d794e8414.png\"\/><\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"go\">bcryptprimitivesdll = [...]uint16{'b', 'c', 'r', 'y', 'p', 't', 'p', 'r', 'i', 'm', 'i', 't', 'i', 'v', 'e', 's', '.', 'd', 'l', 'l', 0}<\/code><\/pre>\n<p>\u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"go\">advapi32dll = [...]uint16{'a', 'd', 'v', 'a', 'p', 'i', '3', '2', '.', 'd', 'l', 'l', 0}<\/code><\/pre>\n<p>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0430\u0432\u043a\u0430, \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>loadOptionalSyscalls<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7d0\/aad\/412\/7d0aad41272b57ffbd3068a3266bfc6d.png\" width=\"1211\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d0\/aad\/412\/7d0aad41272b57ffbd3068a3266bfc6d.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0431\u043b\u043e\u043a\u0430, \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (\u0441\u043f\u0440\u0430\u0432\u0430) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (\u0441\u043b\u0435\u0432\u0430): <\/p>\n<pre><code class=\"go\">a32 := windowsLoadSystemLib(advapi32dll[:]) if a32 == 0 { throw(\"advapi32.dll not found\") } _RtlGenRandom = windowsFindfunc(a32, []byte(\"SystemFunction036\\000\"))<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043f\u0440\u0430\u0432\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4f1\/269\/172\/4f126917282df7a398264bf945c231de.png\" width=\"1203\" height=\"486\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f1\/269\/172\/4f126917282df7a398264bf945c231de.png\"\/><\/figure>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0437\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0448\u0443\u043c\u0430 (\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445) \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getRandomData<\/code>.<\/p>\n<blockquote>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0436\u043e\u0440\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 1.22 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u0432 <code>readRandom<\/code>.<\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.24, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u0435\u0442\u043a\u0438 1.22:<\/p>\n<pre><code class=\"go\">\/\/go:nosplit func readRandom(r []byte) int { n := 0 if stdcall2(_RtlGenRandom, uintptr(unsafe.Pointer(&amp;r[0])), uintptr(len(r)))&amp;0xff != 0 { n = len(r) } return n }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u00a0\u2014 \u0441\u0431\u043e\u0440\u043a\u0430 Golang \u0432\u0435\u0440\u0441\u0438\u0438 1.22 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/06f\/7c4\/c38\/06f7c4c38d2dad4c678bc8f192456f5e.png\" width=\"677\" height=\"210\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06f\/7c4\/c38\/06f7c4c38d2dad4c678bc8f192456f5e.png\"\/><\/figure>\n<p>\u041d\u043e\u00a0\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442\u00a0\u2014 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u00a0\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c.<\/p>\n<blockquote>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u0430\u0436\u0435 \u044d\u0442\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0445\u0432\u0430\u0442\u0438\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 1.24<\/p>\n<\/blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u00a0\u043d\u0435\u00a0\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e 1.22 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0430\u00a0\u043b\u0438\u0448\u044c \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u00a0\u2014 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0442\u0447 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u0430\u0442\u0447 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p><a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/319310\" rel=\"noopener noreferrer nofollow\">\u041f\u0430\u0442\u0447<\/a> \u0441\u00a0\u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0443\u0434\u044c\u0431\u043e\u0439\u00a0\u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u00a02021 \u0433\u043e\u0434\u0443, \u043e\u043d\u00a0\u0432\u0441\u043a\u043e\u0440\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0435\u043d \u0438\u0437-\u0437\u0430 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u0430 \u043e\u0442\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Windows:<\/p>\n<pre><code>On Windows 7 (and below), console handles are not real kernel handles but are rather userspace objects, with information passed via special bits in the handle itself. That means they can't be passed in PROC_THREAD_ATTRIBUTE_HANDLE_LIST, even though they can be inherited.<\/code><\/pre>\n<p>\u0421\u0443\u0442\u044c \u0435\u0433\u043e \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0432\u00a0\u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Windows \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u044f \u0441\u00a0\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0443 \u00abconsole handle\u00bb, \u0447\u0442\u043e\u00a0\u043c\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 Go.<\/p>\n<p>\u0411\u0435\u0437 \u043f\u0430\u0442\u0447\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c Golang 1.24 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0b6\/306\/69f\/0b630669f7e86a37d95759b17e105cfe.png\" width=\"677\" height=\"186\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b6\/306\/69f\/0b630669f7e86a37d95759b17e105cfe.png\"\/><\/figure>\n<p>\u041e\u043d\u0430 \u0436\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.22:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/308\/704\/e90\/308704e90201551f205e59f7b6635480.png\" width=\"677\" height=\"186\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/308\/704\/e90\/308704e90201551f205e59f7b6635480.png\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u043e\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/src\/syscall\/exec_windows.go\" rel=\"noopener noreferrer nofollow\">exec_windows.go<\/a> \u0438 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u043d\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/678\/98d\/33e\/67898d33e54c875ccdee974bef129260.png\" width=\"1251\" height=\"653\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/678\/98d\/33e\/67898d33e54c875ccdee974bef129260.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u043b\u043e\u043a, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Windows:<\/p>\n<pre><code class=\"go\">var maj, min, build uint32 rtlGetNtVersionNumbers(&amp;maj, &amp;min, &amp;build) isWin7 := maj &lt; 6 || (maj == 6 &amp;&amp; min &lt;= 1) \/\/ NT kernel handles are divisible by 4, with the bottom 3 bits left as \/\/ a tag. The fully set tag correlates with the types of handles we're \/\/ concerned about here.  Except, the kernel will interpret some \/\/ special handle values, like -1, -2, and so forth, so kernelbase.dll \/\/ checks to see that those bottom three bits are checked, but that top \/\/ bit is not checked. isLegacyWin7ConsoleHandle := func(handle Handle) bool { return isWin7 &amp;&amp; handle&amp;0x10000003 == 3 }<\/code><\/pre>\n<p>\u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0438\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"go\">if attr.Files[i] &gt; 0 { err := DuplicateHandle(p, Handle(attr.Files[i]), parentProcess, &amp;fd[i], 0, true, DUPLICATE_SAME_ACCESS)<\/code><\/pre>\n<p>\u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"go\">if attr.Files[i] &gt; 0 { destinationProcessHandle := parentProcess \/\/ On Windows 7, console handles aren't real handles, and can only be duplicated \/\/ into the current process, not a parent one, which amounts to the same thing. if parentProcess != p &amp;&amp; isLegacyWin7ConsoleHandle(Handle(attr.Files[i])) { destinationProcessHandle = p } err := DuplicateHandle(p, Handle(attr.Files[i]), destinationProcessHandle, &amp;fd[i], 0, true, DUPLICATE_SAME_ACCESS)<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u0430\u0432\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/864\/e7d\/c6a\/864e7dc6abeaf370e804ac1f1034661b.png\" width=\"1251\" height=\"649\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/864\/e7d\/c6a\/864e7dc6abeaf370e804ac1f1034661b.png\"\/><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0438 Windows:<\/p>\n<pre><code class=\"go\">\/\/ On Windows 7, console handles aren't real handles, so don't pass them \/\/ through to PROC_THREAD_ATTRIBUTE_HANDLE_LIST. for i := range fd { if isLegacyWin7ConsoleHandle(fd[i]) { fd[i] = 0 } } \/\/ The presence of a NULL handle in the list is enough to cause  \/\/ PROC_THREAD_ATTRIBUTE_HANDLE_LIST \/\/ to treat the entire list as empty, so remove NULL handles. j := 0 for i := range fd { if fd[i] != 0 { fd[j] = fd[i] j++ } } fd = fd[:j]<\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"go\">\/\/ Do not accidentally inherit more than these handles. err = updateProcThreadAttribute(si.ProcThreadAttributeList, 0, _PROC_THREAD_ATTRIBUTE_HANDLE_LIST, unsafe.Pointer(&amp;fd[0]), uintptr(len(fd))*unsafe.Sizeof(fd[0]), nil, nil) if err != nil { return 0, 0, err<\/code><\/pre>\n<p>\u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430:<\/p>\n<pre><code class=\"go\">\/\/ Do not accidentally inherit more than these handles. if len(fd) &gt; 0 { err = updateProcThreadAttribute(si.ProcThreadAttributeList, 0, _PROC_THREAD_ATTRIBUTE_HANDLE_LIST, unsafe.Pointer(&amp;fd[0]), uintptr(len(fd))*unsafe.Sizeof(fd[0]), nil, nil) if err != nil { return 0, 0, err }<\/code><\/pre>\n<p>\u0427\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0432\u00a0\u044d\u0442\u043e\u043c\u00a0\u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u043f\u0440\u0430\u0432\u043a\u0430 \u0432\u00a0\u044d\u0442\u043e\u0442 \u0440\u0430\u0437 <strong>\u0441\u043f\u0440\u0430\u0432\u0430<\/strong>, \u0430 <strong>\u0441\u043b\u0435\u0432\u0430<\/strong>\u00a0\u2014 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aad\/16e\/9fb\/aad16e9fbea8548cc50963ac7718b84e.png\" width=\"1247\" height=\"347\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aad\/16e\/9fb\/aad16e9fbea8548cc50963ac7718b84e.png\"\/><\/figure>\n<p>\u0421\u0443\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0438\u00a0\u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0434\u043b\u044f \u0443\u0447\u0435\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Windows.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u00a0\u2014 \u0444\u0430\u0439\u043b <a href=\"http:\/\/src\/syscall\/zsyscall_windows.go\" rel=\"noopener noreferrer nofollow\">zsyscall_windows.go<\/a>, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u044d\u0442\u043e <strong>\u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0430\u0439\u043b<\/strong> \u0441\u00a0\u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c (\u0438\u0437\u00a0\u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0442\u0447\u0430), \u043d\u043e\u00a0\u0432\u00a0\u0434\u0440\u0443\u0433\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9c7\/347\/4cf\/9c73474cfd47408dbfa5a13f0eb111b4.png\" width=\"1247\" height=\"643\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c7\/347\/4cf\/9c73474cfd47408dbfa5a13f0eb111b4.png\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<\/p>\n<pre><code class=\"go\">modntdll    = NewLazyDLL(sysdll.Add(\"ntdll.dll\"))<\/code><\/pre>\n<p>\u0438 \u043d\u043e\u0432\u0443\u044e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"go\">procRtlGetNtVersionNumbers = modntdll.NewProc(\"RtlGetNtVersionNumbers\")<\/code><\/pre>\n<p>\u0427\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0435\u0440\u0442\u043a\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u0437\u0430 \u0432\u044b\u0437\u043e\u0432 syscall:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6f7\/12b\/89d\/6f712b89d68f5a2fd04fae17bdce84da.png\" width=\"1246\" height=\"453\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f7\/12b\/89d\/6f712b89d68f5a2fd04fae17bdce84da.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u0430\u0432\u043e\u043a, \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.22 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0441\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0446\u0432\u0435\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u044b: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1d1\/e32\/278\/1d1e32278710d7eb394d6c57cc989370.png\" width=\"677\" height=\"270\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d1\/e32\/278\/1d1e32278710d7eb394d6c57cc989370.png\"\/><\/figure>\n<h3>\u041a\u0440\u043e\u0432\u0430\u0432\u044b\u0439 \u043f\u0430\u0442\u0447\u0438\u043d\u0433 \u0434\u043b\u044f Golang 1.24<\/h3>\n<p>\u0412\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u0445\u043e\u0442\u044c \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e\u00a0\u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u0434\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u0434\u00a0\u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u0430. \u041d\u043e\u00a0\u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.24\u00a0\u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0447\u0430\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0438\u00a0\u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0430.<\/p>\n<blockquote>\n<p>\u0410 \u0435\u0449\u0435 \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0442\u0447\u0435\u0439 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u043d\u0435\u0441\u0435\u043d\u0430, \u043d\u043e \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e\u00a0\u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0431\u0435\u0437\u0443\u0434\u0435\u0440\u0436\u043d\u043e\u0435 \u0432\u0435\u0441\u0435\u043b\u044c\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u043b\u044f\u00a0\u043e\u0434\u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u043e\u0434\u043e\u043c \u043a\u00a0\u0443\u0432\u043e\u043b\u044c\u043d\u0435\u043d\u0438\u044e \u0438\u043b\u0438\u00a0\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043d\u0435\u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043f\u0443\u0441\u043a\u0430 \u0430\u00a0\u0434\u043b\u044f\u00a0\u0434\u0440\u0443\u0433\u0438\u0445\u00a0\u2014 \u0441\u043c\u044b\u0441\u043b\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u00a0\u0418\u0422.<\/p>\n<h4>\u041f\u0430\u0442\u0447 \u043f\u0435\u0440\u0432\u044b\u0439<\/h4>\n<p>\u0424\u0430\u0439\u043b <a href=\"http:\/\/src\/crypto\/rand\/rand_windows.go\" rel=\"noopener noreferrer nofollow\">rand_windows.go<\/a> \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u043a\u0438, \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d \u0432 <a href=\"https:\/\/go.googlesource.com\/go\/+\/refs\/tags\/go1.24.1\/src\/crypto\/internal\/sysrand\/rand_windows.go\" rel=\"noopener noreferrer nofollow\">src\/crypto\/internal\/sysrand\/rand_windows.go<\/a> \u0430 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">\/\/ Copyright 2010 The Go Authors. All rights reserved. \/\/ Use of this source code is governed by a BSD-style \/\/ license that can be found in the LICENSE file.  package sysrand  import \"internal\/syscall\/windows\"  func read(b []byte) error { return windows.ProcessPrng(b) }<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0442\u043e\u043c\u043b\u044f\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"go\">\/\/ Copyright 2010 The Go Authors. All rights reserved. \/\/ Use of this source code is governed by a BSD-style \/\/ license that can be found in the LICENSE file.  package sysrand  import \"internal\/syscall\/windows\"  \/\/ batched returns a function that calls f to populate a []byte by chunking it \/\/ into subslices of, at most, readMax bytes. func batched(f func([]byte) error, readMax int) func([]byte) error { return func(out []byte) error { for len(out) &gt; 0 { read := len(out) if read &gt; readMax { read = readMax } if err := f(out[:read]); err != nil { return err } out = out[read:] } return nil } }  func read(b []byte) error { return batched(windows.RtlGenRandom, 1&lt;&lt;31-1)(b) }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u0440\u044f\u043c\u043e \u0441\u044e\u0434\u0430 \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>batched<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.24.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/src\/internal\/syscall\/windows\/zsyscall_windows.go\" rel=\"noopener noreferrer nofollow\">zsyscall_windows.go<\/a> \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 1.22, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/src\/runtime\/os_windows.go\" rel=\"noopener noreferrer nofollow\">os_windows.go<\/a> \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u043f\u0440\u0430\u0432\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 1.22, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getRandomData<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0430\u0441\u044c \u0432 <code>readRandom<\/code> \u0438 \u0441\u0442\u0430\u043b\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>int<\/code>.<\/p>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 1.22 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u044b\u0448\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f 1.24.<\/p>\n<h4>\u041f\u0430\u0442\u0447 \u0432\u0442\u043e\u0440\u043e\u0439<\/h4>\n<p>\u0414\u043b\u044f\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.24\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0435\u0437\u00a0\u043d\u0435\u0433\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0435\u00a0\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0432\u0441\u0435\u043c. \u041a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043b\u043e\u0433\u0438\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0447\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0443\u0436\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u00a0\u043a\u043e\u0434\u0435, \u0442\u0430\u043a \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u00a0\u2014 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432\u00a0\u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/src\/syscall\/exec_windows.go\" rel=\"noopener noreferrer nofollow\">exec_windows.go<\/a>, \u043f\u0435\u0440\u0432\u0443\u044e \u0438\u0445 \u0447\u0430\u0441\u0442\u044c \u0432\u00a0\u0432\u0438\u0434\u0435 \u0431\u043b\u043e\u043a\u0430:<\/p>\n<pre><code class=\"go\">var maj, min, build uint32 rtlGetNtVersionNumbers(&amp;maj, &amp;min, &amp;build) isWin7 := maj &lt; 6 || (maj == 6 &amp;&amp; min &lt;= 1) \/\/ NT kernel handles are divisible by 4, with the bottom 3 bits left as \/\/ a tag. The fully set tag correlates with the types of handles we're \/\/ concerned about here.  Except, the kernel will interpret some \/\/ special handle values, like -1, -2, and so forth, so kernelbase.dll \/\/ checks to see that those bottom three bits are checked, but that top \/\/ bit is not checked. isLegacyWin7ConsoleHandle := func(handle Handle) bool { return isWin7 &amp;&amp; handle&amp;0x10000003 == 3 }<\/code><\/pre>\n<p>\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0441\u043b\u0435\u0434\u0443\u0449\u0438\u0439 \u0431\u043b\u043e\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0441\u0432\u0435\u0440\u044f\u044f \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0441 \u0442\u0435\u043c \u0447\u0442\u043e \u0432 \u043f\u0430\u0442\u0447\u0435.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">fd := make([]Handle, len(attr.Files)) for i := range attr.Files { if attr.Files[i] &gt; 0 {  destinationProcessHandle := parentProcess \/\/ On Windows 7, console handles aren't real handles, and can only be duplicated \/\/ into the current process, not a parent one, which amounts to the same thing. if parentProcess != p &amp;&amp; isLegacyWin7ConsoleHandle(Handle(attr.Files[i])) { destinationProcessHandle = p } err := DuplicateHandle(p, Handle(attr.Files[i]), destinationProcessHandle, &amp;fd[i], 0, true, DUPLICATE_SAME_ACCESS)  if err != nil { return 0, 0, err } defer DuplicateHandle(parentProcess, fd[i], 0, nil, 0, false, DUPLICATE_CLOSE_SOURCE) } }<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u043e\u0433\u0438\u043a\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"go\">\/\/ On Windows 7, console handles aren't real handles, so don't pass them \/\/ through to PROC_THREAD_ATTRIBUTE_HANDLE_LIST. for i := range fd { if isLegacyWin7ConsoleHandle(fd[i]) { fd[i] = 0 } } \/\/ The presence of a NULL handle in the list is enough to cause PROC_THREAD_ATTRIBUTE_HANDLE_LIST \/\/ to treat the entire list as empty, so remove NULL handles. j := 0 for i := range fd { if fd[i] != 0 { fd[j] = fd[i] j++ } } fd = fd[:j]   willInheritHandles := len(fd) &gt; 0 &amp;&amp; !sys.NoInheritHandles  \/\/ Do not accidentally inherit more than these handles. if willInheritHandles { err = updateProcThreadAttribute(si.ProcThreadAttributeList, 0, _PROC_THREAD_ATTRIBUTE_HANDLE_LIST, unsafe.Pointer(&amp;fd[0]), uintptr(len(fd))*unsafe.Sizeof(fd[0]), nil, nil) if err != nil { return 0, 0, err } }<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0431\u043b\u043e\u043a, \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <code>createEnvBlock<\/code> \u0431\u044b\u043b \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"go\">pi := new(ProcessInformation) flags := sys.CreationFlags | CREATE_UNICODE_ENVIRONMENT | _EXTENDED_STARTUPINFO_PRESENT if sys.Token != 0 { err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, willInheritHandles, flags, &amp;envBlock[0], dirp, &amp;si.StartupInfo, pi) } else { err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, willInheritHandles, flags, &amp;envBlock[0], dirp, &amp;si.StartupInfo, pi) } if err != nil { return 0, 0, err }<\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u043a\u0438 \u0434\u043b\u044f <a href=\"https:\/\/go.googlesource.com\/go\/+\/refs\/tags\/go1.24.1\/src\/syscall\/zsyscall_windows.go\" rel=\"noopener noreferrer nofollow\">zsyscall_windows.go<\/a> \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0435\u0439 1.22, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u044b\u0448\u0435\u00a0\u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0435\u0441\u0438\u0442\u0435 \u0442\u0430\u043a\u0438\u0435\u00a0\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. <\/p>\n<h3>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0430\u0442\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u00ab\u0431\u043e\u0431\u0440\u0430\u2011\u0444\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430\u00bb,\u00a0\u0431\u044b\u043b \u0432\u0437\u044f\u0442 <a href=\"https:\/\/github.com\/codoworks\/go-boilerplate\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u0436\u0438\u0440\u043d\u044b\u0445 boilerplate<\/a> (\u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0434\u043b\u044f\u00a0Golang, \u0441\u043e\u0431\u0440\u0430\u043d \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d.<\/p>\n<p>\u0415\u0433\u043e \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043d\u0430 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0417\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438:<\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/codoworks\/go-boilerplate.git<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code class=\"bash\">cd go-boilerplate go get go run . db migrate go run . db seed<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u0432\u044b\u043b\u0435\u0437\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e7c\/6ba\/911\/e7c6ba911d799f25d88f5e1180646b5a.png\" width=\"677\" height=\"342\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e7c\/6ba\/911\/e7c6ba911d799f25d88f5e1180646b5a.png\"\/><\/figure>\n<p>\u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Golang \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"bash\">CGO_ENABLED=1<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043d\u043e\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 make.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"bash\">go run . start<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/553\/47d\/c9e\/55347dc9ebbece54f64ceb1a45ac0110.png\" width=\"677\" height=\"342\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/553\/47d\/c9e\/55347dc9ebbece54f64ceb1a45ac0110.png\"\/><\/figure>\n<h3>\u042d\u043f\u0438\u043b\u043e\u0433<\/h3>\n<blockquote>\n<p>\u0413\u043e\u0442\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 Golang 1.24 \u0434\u043b\u044f Windows 7 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u043a\u0430\u043d\u0430\u043b\u0435, <a href=\"https:\/\/t.me\/alex0x09\/1217\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<\/blockquote>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432\u00a0\u0441\u0442\u0430\u0442\u044c\u0435\u00a0\u2014 \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u0440\u0443\u0442\u0430\u044f, \u043d\u043e\u00a0<strong>\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f<\/strong> \u0440\u0430\u0431\u043e\u0442\u0430, \u043e\u00a0\u0447\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0435 \u043d\u0430\u0448\u0443 \u0441\u0431\u043e\u0440\u043a\u0443.<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 Golang, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0431\u0435\u043a\u043f\u043e\u0440\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0432\u0440\u0430\u0437\u0443\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0435\u043a\u043f\u043e\u0440\u0442\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0422\u0435\u0441\u0442\u044b <strong>\u043f\u0430\u0434\u0430\u044e\u0442<\/strong>, \u043d\u0435\u00a0\u0432\u0441\u0435\u00a0\u2014 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 10%, \u043d\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430\u00a0\u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u00a0\u0431\u043e\u0435\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445. <\/p>\n<p>\u0418\u043c\u0435\u0439\u0442\u0435 \u044d\u0442\u043e \u0432\u0432\u0438\u0434\u0443 \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0432\u0435\u0441\u0435\u043b\u044b\u0439 <a href=\"https:\/\/blog.0x08.ru\/backporting-golang-to-windows7\" rel=\"noopener noreferrer nofollow\">\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/a> \u0441\u0442\u0430\u0442\u044c\u0438 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435.<\/p>\n<h3>0x08 Software<\/h3>\n<p>\u041c\u044b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0435\u0442\u0435\u0440\u0430\u043d\u043e\u0432 \u0418\u0422\u2011\u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0430\u043c\u043e\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435, \u043d\u0430\u0448 \u0441\u043e\u0444\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043d\u0430\u00a0\u0442\u0440\u0435\u0445 \u043a\u043e\u043d\u0442\u0438\u043d\u0435\u043d\u0442\u0430\u0445, \u0432\u00a0\u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0442\u0440\u0430\u0441\u043b\u044f\u0445 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445.<\/p>\n<p>\u041e\u0436\u0438\u0432\u043b\u044f\u0435\u043c\u00a0<a href=\"https:\/\/blog.0x08.ru\/xerox-alto-bcpl-hello-world\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u0432\u043d\u043e \u0443\u043c\u0435\u0440\u0448\u0435\u0435<\/a>,\u00a0<a href=\"https:\/\/blog.0x08.ru\/running-from-websphere-esb\" rel=\"noopener noreferrer nofollow\">\u0447\u0438\u043d\u0438\u043c \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0435\u0435<\/a>\u00a0\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c\u00a0<a href=\"https:\/\/blog.0x08.ru\/call-webservice-from-dos\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435<\/a>\u00a0\u2014 \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u00a0\u044d\u0442\u043e\u043c \u0432\u00a0\u0441\u0432\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/893302\/\"> https:\/\/habr.com\/ru\/articles\/893302\/<\/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<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/822817\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 Node.js<\/a>, \u0437\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0436\u0435\u0440\u0442\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0441\u0442\u0430\u043b <a href=\"https:\/\/go.dev\/\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u00a0Go<\/a>.<\/p>\n<p>\u041f\u043e\u043b\u0433\u043e\u0434\u0430 \u0436\u0435\u0441\u0442\u043e\u043a\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0412\u0432\u043e\u0434\u043d\u0430\u044f<\/h3>\n<p>\u0412\u00a0\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <a href=\"https:\/\/blog.0x08.ru\/how-to-backport-nodejs-on-windows7\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/a> \u0441\u00a0Node.js, \u0431\u0435\u043a\u043f\u043e\u0440\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Golang \u043d\u0430\u00a0Windows 7\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u0447\u0438\u0441\u0442\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\u00a0\u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0440\u0430\u0434\u0438 <s>\u0442\u0440\u0435\u0448\u0430 \u0438 \u0443\u0433\u0430\u0440\u0430<\/s> \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u0442\u0430\u043b\u0430\u043d\u0442\u043e\u0432.<\/p>\n<blockquote>\n<p>\u042f\u0437\u044b\u043a Golang \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0438 \u0434\u0430\u043b\u0435\u043a \u043e\u0442 \u043c\u0438\u0440\u0430 Windows, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/articles\/837454\/\" rel=\"noopener noreferrer nofollow\">\u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/a> \u0434\u0430\u0436\u0435 \u0442\u0430\u043c.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u043e\u043b\u044c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 Golang \u0438 \u043f\u043e\u0434 Windows, \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u0431\u0435\u043a\u043f\u043e\u0440\u0442\u0435.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041e\u0431\u044a\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Go \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439,  \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043c\u0438\u043d\u0443\u0442\u044b \u0434\u0430\u0436\u0435 \u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<blockquote>\n<p>\u042d\u0442\u043e \u043d\u0435 <a href=\"https:\/\/github.com\/dotnet\/core\" rel=\"noopener noreferrer nofollow\">.NET<\/a> \u0438 \u043d\u0435 <a href=\"https:\/\/github.com\/chromium\/chromium\" rel=\"noopener noreferrer nofollow\">Chromium<\/a> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0435 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u0443\u0442\u043a\u0430\u043c\u0438, \u0441 \u0440\u0438\u0441\u043a\u043e\u043c \u0441\u043f\u0430\u043b\u0438\u0442\u044c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<\/blockquote>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 1.5, \u0434\u043b\u044f <a href=\"https:\/\/go.dev\/doc\/install\/source\" rel=\"noopener noreferrer nofollow\">\u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/a> Go \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: <\/p>\n<pre><code> The minimum version of Go required depends on the target version of Go:     Go &lt;= 1.4: a C toolchain.     1.5 &lt;= Go &lt;= 1.19: a Go 1.4 compiler.     1.20 &lt;= Go &lt;= 1.21: a Go 1.17 compiler.     1.22 &lt;= Go &lt;= 1.23: a Go 1.20 compiler.     Going forward, Go version 1.N will require a Go 1.M compiler,      where M is N-2 rounded down to an even number.      Example: Go 1.24 and 1.25 require Go 1.22. <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430\u00a0\u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 1.24, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 1.22, \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0434\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e 1.20.<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Windows 7 \u0432\u00a0Golang \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u00a0\u0442\u0430\u043a \u0443\u0436\u00a0\u0434\u0430\u0432\u043d\u043e\u00a0\u2014 \u0441\u00a0\u0440\u0435\u043b\u0438\u0437\u043e\u043c \u0432\u0435\u0440\u0441\u0438\u0438 1.20 \u0432\u00a0\u0444\u0435\u0432\u0440\u0430\u043b\u0435 2023 \u0433\u043e\u0434\u0430:<\/p>\n<blockquote>\n<p>Go 1.20 was the last release supporting Windows 2008: <a href=\"https:\/\/go.dev\/doc\/go1.20#windows\" rel=\"noopener noreferrer nofollow\">https:\/\/go.dev\/doc\/go1.20#windows<\/a><\/p>\n<\/blockquote>\n<p>\u041d\u043e\u00a0\u0434\u0430\u0436\u0435 \u0437\u0430\u00a0\u0441\u0442\u043e\u043b\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0441\u043f\u0435\u043b\u0438 \u043d\u0430\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438), \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0432\u0448\u0438\u0445 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0446\u044b \u0441\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.20, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f Windows \u0432\u0441\u0435 \u0435\u0449\u0435 <a href=\"https:\/\/go.dev\/dl\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f<\/a>, \u043d\u043e\u00a0\u043c\u044b\u00a0\u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.4. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e, \u0442\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>\u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e\u00a0\u0441\u0431\u043e\u0440\u043a\u0430 Golang \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Microsoft <strong>\u043d\u0435\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/strong> \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 MinGW, \u043f\u0440\u0438\u0447\u0435\u043c \u0435\u0449\u0435 \u0438 \u0432\u043c\u0435\u0441\u0442\u0435\u00a0\u0441\u00a0binutils. <\/p>\n<p>\u0418 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 Windows, \u0434\u0430.<\/p>\n<blockquote>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0435\u0449\u0435 \u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0446\u0438\u0440\u043a\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0431\u0438\u043b\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/niXman\/mingw-builds-binaries\/releases\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<\/blockquote>\n<p>\u041f\u0430\u043f\u043a\u0430 <code>bin<\/code> \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 PATH:<\/p>\n<pre><code>set PATH=c:\\work\\mingw64\\bin;%PATH%<\/code><\/pre>\n<p>\u0410\u0440\u0445\u0438\u0432\u044b \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c Golang \u0431\u044b\u043b\u0438 \u0432\u0437\u044f\u0442\u044b \u0441 <a href=\"https:\/\/go.dev\/dl\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/a>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Google, \u0442\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u043b\u0438\u0437\u043d\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 1.22:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043e \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0441\u0431\u043e\u0440\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>src<\/code>:<\/p>\n<pre><code>cd src make<\/code><\/pre>\n<h3>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.4\u00a0\u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Golang, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u043e\u0439 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0421.<\/p>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0431\u0435\u0437\u00a0\u043e\u0448\u0438\u0431\u043e\u043a\u00a0\u2014 \u0432\u00a0\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>bin<\/code> \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go \u0432\u0435\u0440\u0441\u0438\u0438 1.4.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.4, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0443\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 1.19:<\/p>\n<pre><code class=\"bash\">set GOROOT_BOOTSTRAP=c:\\work\\backport-go\\1.4<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0438 \u044d\u0442\u0430 \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>bin<\/code> \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go \u0443\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 1.19:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 1.20:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e Golang, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0432\u00a0Windows 7 \u00ab\u0438\u0437\u00a0\u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u0437\u00a0\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n<blockquote>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0442\u043e\u043b\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e <a href=\"https:\/\/go.dev\/dl\/go1.20.14.windows-amd64.zip\" rel=\"noopener noreferrer nofollow\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a> \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.20, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0431\u043e\u0440\u043e\u043a.<\/p>\n<\/blockquote>\n<h3>\u041f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u0430\u0434<\/h3>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 1.20 \u0441\u043a\u0430\u0437\u043a\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0436\u0435\u0441\u0442\u044c:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430, \u0433\u043b\u0430\u0437\u0430 \u0432\u0430\u0441 \u043d\u0435\u00a0\u043f\u043e\u0434\u0432\u043e\u0434\u044f\u0442\u00a0\u2014 \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0440\u043e\u0434\u0435\u00a0\u0431\u044b \u0432\u00a0\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u043c \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"assembly\">.. docall: \/\/ Call stdcall function. CALLAX  ADDQ$(const_maxArgs*8), SP  \/\/ Return result. MOVQ0(SP), CX MOVQ8(SP), SP MOVQAX, libcall_r1(CX) \/\/ Floating point return values are returned in XMM0. Setting r2 to this \/\/ value in case this call returned a floating point value. For details, \/\/ see https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/x64-calling-convention MOVQ    X0, libcall_r2(CX)  \/\/ GetLastError(). MOVQ0x30(GS), DI MOVL0x68(DI), AX MOVQAX, libcall_err(CX)  RET ..<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0432\u044b\u0448\u0435 \u043d\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d, \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/strong>.<\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c Golang \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439.<\/p>\n<p>75 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 (\u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u043c \u043a\u043e\u0434\u0435!) \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 WinAPI \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"assembly\">ADDQ$(const_maxArgs*8), SP<\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439<\/strong>.<\/p>\n<blockquote>\n<p>\u041d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e WinAPI!<\/p>\n<\/blockquote>\n<p>\u0410 \u0432\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435 <s>\u0434\u0443\u0440\u043a\u0430 \u0438 \u0441\u0430\u043d\u0438\u0442\u0430\u0440\u044b<\/s> \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043d\u0430\u0441 \u0432\u0441\u0435\u0445 \u0437\u0430\u043c\u0435\u043d\u044f\u0442, \u0430\u0433\u0430.<\/p>\n<h3>\u041a\u0440\u043e\u0432\u0430\u0432\u044b\u0435 \u043f\u0430\u0442\u0447\u0438<\/h3>\n<p>\u0421\u0442\u043e\u0438\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 <a href=\"https:\/\/github.com\/golang\/go\/issues\/64602\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c<\/a> <a href=\"https:\/\/github.com\/golang\/go\/issues\/64413\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e<\/a> \u043f\u0440\u0438\u0440\u043e\u0434\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u00a0\u043d\u0430\u0439\u0442\u0438 \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043f\u0430\u0442\u0447\u0430 (<a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/545355\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a> \u0438\u00a0<a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/319310\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>), \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b Golang \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432\u00a0\u00abWindows 7 and older\u00bb \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a\u00a0\u00ab\u043a\u0440\u043e\u0432\u0430\u0432\u043e\u043c\u0443 \u043f\u0430\u0442\u0447\u0438\u043d\u0433\u0443\u00bb, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u043a\u0430\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0442\u0447\u0438 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/www.atlassian.com\/git\/tutorials\/cherry-pick\" rel=\"noopener noreferrer nofollow\">cherry pick<\/a> <strong>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/strong>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 Golang, \u0430\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445\u00a0\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439. <\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<h4>\u041f\u0430\u0442\u0447 \u043f\u0435\u0440\u0432\u044b\u0439<\/h4>\n<p>\u0418\u0437\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f <a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/545355\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0438\u0442\u0430<\/a>, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0441\u043d\u043e\u0432\u0430 \u00ab\u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435\u00bb:<\/p>\n<pre><code>RtlGenRandom is a semi-undocumented API, also known as SystemFunction036, which we use to generate random data on Windows. It's definition, in cryptbase.dll, is an opaque wrapper for the documented API ProcessPrng. Instead of using RtlGenRandom, switch to using ProcessPrng, since the former is simply a wrapper for the latter, there should be no practical change on the user side, other than a minor change in the DLLs we load.<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 Windows 7 <strong>\u043d\u0435\u0442<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/windows\/win32\/seccng\/processprng\" rel=\"noopener noreferrer nofollow\">ProcessPrng<\/a>. <\/p>\n<blockquote>\n<p>\u0410 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f SystemFunction036 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0435\u0441\u0442\u044c.<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/github.com\/tauri-apps\/tauri\/issues\/10008\" rel=\"noopener noreferrer nofollow\">\u041e\u0448\u0438\u0431\u043a\u0430<\/a> <a href=\"https:\/\/github.com\/ruffle-rs\/ruffle\/issues\/17337\" rel=\"noopener noreferrer nofollow\">\u0447\u0430\u0441\u0442\u0430\u044f<\/a> \u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0432\u0441\u0435, \u043a\u0442\u043e \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0435\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Windows.<\/p>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0434\u0432\u0435 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0440\u0430\u0432\u043a\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u0434\u0430, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0430\u0439\u043b <a href=\"http:\/\/src\/crypto\/rand\/rand_windows.go\" rel=\"noopener noreferrer nofollow\">rand_windows.go<\/a>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b\u00a0\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u0430\u0434, \u043d\u0443\u0436\u043d\u0430\u044f \u043d\u0430\u043c \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <strong>\u0441\u043b\u0435\u0432\u0430<\/strong> \u0438\u00a0\u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u0430\u00a0\u043d\u0435\u043d\u0443\u0436\u043d\u0430\u044f (\u043e\u043d\u0430\u00a0\u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u0430\u044f)\u00a0\u2014 <strong>\u0441\u043f\u0440\u0430\u0432\u0430<\/strong>.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">\/\/ Copyright 2010 The Go Authors. All rights reserved. \/\/ Use of this source code is governed by a BSD-style \/\/ license that can be found in the LICENSE file.  \/\/ Windows cryptographically secure pseudorandom number \/\/ generator.  package rand  import ( \"internal\/syscall\/windows\" )  func init() { Reader = &amp;rngReader{} }  type rngReader struct{}  func (r *rngReader) Read(b []byte) (n int, err error) { \/\/ RtlGenRandom only returns 1&lt;&lt;32-1 bytes at a time. We only read at \/\/ most 1&lt;&lt;31-1 bytes at a time so that  this works the same on 32-bit \/\/ and 64-bit systems. if err := batched(windows.RtlGenRandom, 1&lt;&lt;31-1)(b); err != nil { return 0, err } return len(b), nil }<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/src\/internal\/syscall\/windows\/zsyscall_windows.go\" rel=\"noopener noreferrer nofollow\">zsyscall_windows.go<\/a> \u0432\u0441\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0437\u0430\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"go\">modbcryptprimitives = syscall.NewLazyDLL(sysdll.Add(\"bcryptprimitives.dll\"))<\/code><\/pre>\n<p>\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 procProcessPrng, \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n<pre><code class=\"go\">procProcessPrng = modbcryptprimitives.NewProc(\"ProcessPrng\")<\/code><\/pre>\n<p>\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430:<\/p>\n<pre><code class=\"go\">procSystemFunction036 = modadvapi32.NewProc(\"SystemFunction036\")<\/code><\/pre>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u043a\u043e\u043d\u0435\u0446, \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043f\u0440\u0430\u0432\u043a\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 <code>syscall<\/code>:<\/p>\n<pre><code class=\"go\">func RtlGenRandom(buf []byte) (err error) { var _p0 *byte if len(buf) &gt; 0 { _p0 = &amp;buf[0] } r1, _, e1 := syscall.Syscall(procSystemFunction036.Addr(), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0) if r1 == 0 { err = errnoErr(e1) } return }<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e <a href=\"http:\/\/src\/runtime\/os_windows.go\" rel=\"noopener noreferrer nofollow\">os_windows.go<\/a>. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u0432\u0441\u0435 \u0442\u043e\u0433\u043e \u0436\u0435 <code>ProcessPrng<\/code>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"go\">_ProcessPrng stdFunction<\/code><\/pre>\n<p>\u043d\u0430\u0434\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c:<\/p>\n<pre><code class=\"go\">_RtlGenRandom stdFunction<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"go\">bcryptprimitivesdll = [...]uint16{'b', 'c', 'r', 'y', 'p', 't', 'p', 'r', 'i', 'm', 'i', 't', 'i', 'v', 'e', 's', '.', 'd', 'l', 'l', 0}<\/code><\/pre>\n<p>\u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"go\">advapi32dll = [...]uint16{'a', 'd', 'v', 'a', 'p', 'i', '3', '2', '.', 'd', 'l', 'l', 0}<\/code><\/pre>\n<p>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0430\u0432\u043a\u0430, \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>loadOptionalSyscalls<\/code>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0431\u043b\u043e\u043a\u0430, \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (\u0441\u043f\u0440\u0430\u0432\u0430) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (\u0441\u043b\u0435\u0432\u0430): <\/p>\n<pre><code class=\"go\">a32 := windowsLoadSystemLib(advapi32dll[:]) if a32 == 0 { throw(\"advapi32.dll not found\") } _RtlGenRandom = windowsFindfunc(a32, []byte(\"SystemFunction036\\000\"))<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043f\u0440\u0430\u0432\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435: <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0437\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0448\u0443\u043c\u0430 (\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445) \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getRandomData<\/code>.<\/p>\n<blockquote>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0436\u043e\u0440\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 1.22 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u0432 <code>readRandom<\/code>.<\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.24, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u0435\u0442\u043a\u0438 1.22:<\/p>\n<pre><code class=\"go\">\/\/go:nosplit func readRandom(r []byte) int { n := 0 if stdcall2(_RtlGenRandom, uintptr(unsafe.Pointer(&amp;r[0])), uintptr(len(r)))&amp;0xff != 0 { n = len(r) } return n }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u00a0\u2014 \u0441\u0431\u043e\u0440\u043a\u0430 Golang \u0432\u0435\u0440\u0441\u0438\u0438 1.22 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u043e\u00a0\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442\u00a0\u2014 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u00a0\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c.<\/p>\n<blockquote>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u0430\u0436\u0435 \u044d\u0442\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0445\u0432\u0430\u0442\u0438\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 1.24<\/p>\n<\/blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u00a0\u043d\u0435\u00a0\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e 1.22 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0430\u00a0\u043b\u0438\u0448\u044c \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u00a0\u2014 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0442\u0447 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u0430\u0442\u0447 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p><a href=\"https:\/\/go-review.googlesource.com\/c\/go\/+\/319310\" rel=\"noopener noreferrer nofollow\">\u041f\u0430\u0442\u0447<\/a> \u0441\u00a0\u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0443\u0434\u044c\u0431\u043e\u0439\u00a0\u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u00a02021 \u0433\u043e\u0434\u0443, \u043e\u043d\u00a0\u0432\u0441\u043a\u043e\u0440\u0435<\/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-452737","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/452737","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=452737"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/452737\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=452737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=452737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=452737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}