{"id":271778,"date":"2016-01-08T16:36:03","date_gmt":"2016-01-08T13:36:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271778"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271778","title":{"rendered":"\u041e\u0431\u0435\u0437\u0432\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u043c \u0431\u043e\u043c\u0431\u0443 \u0441 Radare2"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0f6\/894\/09e\/0f689409e9a246c1b214c3a2fd9402f2.png\"\/><br \/>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, %username%! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0440\u0435\u0432\u0435\u0440\u0441\u0435\u0440\u0430 \u2014 radare2. \u0412 \u0432\u0438\u0434\u0435 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043e\u043f\u0430\u0432\u0448\u0443\u044e \u0431\u043e\u043c\u0431\u0443, \u043e\u043d\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441 <a href=\"http:\/\/csapp.cs.cmu.edu\/3e\/bomb.tar\">\u0441\u0430\u0439\u0442\u0430<\/a> \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \u041a\u0430\u0440\u043d\u0435\u0433\u0438 \u041c\u0435\u043b\u043b\u043e\u043d.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0425\u044d\u0448\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\u0422.\u043a. \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0445\u044d\u0448\u0441\u0443\u043c\u043c\u044b:<br \/>  md5sum: 1f38d04188a1d08f95d8c302f5361e9f<br \/>  sha1sum: 31022a4baa524f6275209f7424c616226bc9814b<br \/>  sha256sum: 8849e033691d51426c0c91a76eeb0c346eddd37e8fdf21cd93acd16669f1b461  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041e \u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0435\u0447\u044c?<\/h3>\n<p>  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Radare2\">Radare2<\/a>(aka r2) \u2014 <a href=\"https:\/\/github.com\/radare\/radare2\">\u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u044b\u0439<\/a> \u043a\u0440\u043e\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0434\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432(\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u043a \u0441\u043b\u043e\u0432\u0443, hex-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440). \u0413\u043b\u0430\u0432\u043d\u044b\u043c \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u043c \u043e\u043d\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f IDA \u0418\u043b\u044c\u0444\u0430\u043a\u0430, \u043d\u043e, \u0443\u0432\u044b, \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430 \u043e\u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u043e\u0432\u0430\u0442\u0430, \u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441 x86-64 \u043d\u0435 \u0434\u0440\u0443\u0436\u0438\u0442. \u0410 \u0435\u0449\u0435 \u0440\u0430\u0434\u0430\u0440 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a <a href=\"http:\/\/rada.re\/r\/cmp.html\">\u043a\u0440\u0443\u0447\u0435<\/a>.<br \/>  \u0411\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u0431\u043e\u043c\u0431\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u043e\u043c\u0431\u0430 \u2014 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441 \u044d\u0442\u0438\u043c \u044e\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430. \u042d\u0442\u043e \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u0438\u043b\u0438 \u0444\u0430\u0437\u044b, \u0443 \u043d\u0430\u0441 \u0438\u0445 \u0446\u0435\u043b\u044b\u0445 6.<\/p>\n<h3>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a<\/h3>\n<p>  Radare2, \u043a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e, \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440. \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0443\u043b\u0437 \u0432\u0440\u043e\u0434\u0435 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u0430, hex-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043f\u043e\u0438\u0441\u043a\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Return-oriented_programming\">ROP<\/a>-\u0433\u0430\u0434\u0436\u0435\u0442\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u0414\u043b\u044f \u043d\u0435\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443 \u043d\u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u044b\u0440\u043e\u0432\u0430\u0442\u044b\u0445 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u044d\u0442\u043e WebUI(<code>$ r2 -c &quot;=H&quot; file<\/code>) \u0438 <a href=\"http:\/\/www.bokken.re\/\">Bokken<\/a>.<br \/>  \u041c\u0430\u043d\u0443\u0430\u043b \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u0432 man, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0435 &quot;?&quot;. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00abpd?\u00bb \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 pd.<\/p>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0441\u044b\u043b\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435:  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.radare.org\/r\/\">\u041e\u0444\u0444. \u0441\u0430\u0439\u0442<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/radare\/radare2book\">\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u043a\u043d\u0438\u0436\u043a\u0430<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/radare\/radare2\">\u0413\u0438\u0442\u0445\u0430\u0431<\/a><\/li>\n<li><a href=\"http:\/\/radare.today\/\">\u0411\u043b\u043e\u0433<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pwntester\/cheatsheets\/blob\/master\/radare2.md\">Cheatsheet<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/radare\/radare2\/wiki\/Migration-from-ida-or-gdb\">Migration guide \u0434\u043b\u044f \u0437\u0430\u043a\u043e\u0440\u0435\u043d\u0435\u043b\u044b\u0445 \u0438\u0434\u0435\u0440\u043e\u0432<\/a><\/li>\n<li><a href=\"http:\/\/irc:\/\/irc.freenode.net\/#radare\">IRC-\u043a\u0430\u043d\u0430\u043b \u043d\u0430 Freenode<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3>Here we go!<\/h3>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u043c \u043b\u044e\u0431\u0435\u0437\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u2014 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0432\u043e\u0434\u0430, \u0432\u044b\u0437\u043e\u0432 \u0444\u0430\u0437, \u0438 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0445\u044d\u0434\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u043e\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/***************************************************************************  * Dr. Evil's Insidious Bomb, Version 1.1  * Copyright 2011, Dr. Evil Incorporated. All rights reserved.  *  * LICENSE:  *  * Dr. Evil Incorporated (the PERPETRATOR) hereby grants you (the  * VICTIM) explicit permission to use this bomb (the BOMB).  This is a  * time limited license, which expires on the death of the VICTIM.  * The PERPETRATOR takes no responsibility for damage, frustration,  * insanity, bug-eyes, carpal-tunnel syndrome, loss of sleep, or other  * harm to the VICTIM.  Unless the PERPETRATOR wants to take credit,  * that is.  The VICTIM may not distribute this bomb source code to  * any enemies of the PERPETRATOR.  No VICTIM may debug,  * reverse-engineer, run &quot;strings&quot; on, decompile, decrypt, or use any  * other technique to gain knowledge of and defuse the BOMB.  BOMB  * proof clothing may not be worn when handling this program.  The  * PERPETRATOR will not apologize for the PERPETRATOR's poor sense of  * humor.  This license is null and void where the BOMB is prohibited  * by law.  ***************************************************************************\/  #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &quot;support.h&quot; #include &quot;phases.h&quot;  \/*   * Note to self: Remember to erase this file so my victims will have no  * idea what is going on, and so they will all blow up in a  * spectaculary fiendish explosion. -- Dr. Evil   *\/  FILE *infile;  int main(int argc, char *argv[]) {     char *input;      \/* Note to self: remember to port this bomb to Windows and put a       * fantastic GUI on it. *\/      \/* When run with no arguments, the bomb reads its input lines       * from standard input. *\/     if (argc == 1) {       infile = stdin;     }       \/* When run with one argument &lt;file&gt;, the bomb reads from &lt;file&gt;       * until EOF, and then switches to standard input. Thus, as you       * defuse each phase, you can add its defusing string to &lt;file&gt; and      * avoid having to retype it. *\/     else if (argc == 2) {     if (!(infile = fopen(argv[1], &quot;r&quot;))) {         printf(&quot;%s: Error: Couldn't open %s\\n&quot;, argv[0], argv[1]);         exit(8);     }     }      \/* You can't call the bomb with more than 1 command line argument. *\/     else {     printf(&quot;Usage: %s [&lt;input_file&gt;]\\n&quot;, argv[0]);     exit(8);     }      \/* Do all sorts of secret stuff that makes the bomb harder to defuse. *\/     initialize_bomb();      printf(&quot;Welcome to my fiendish little bomb. You have 6 phases with\\n&quot;);     printf(&quot;which to blow yourself up. Have a nice day!\\n&quot;);      \/* Hmm...  Six phases must be more secure than one phase! *\/     input = read_line();             \/* Get input                   *\/     phase_1(input);                  \/* Run the phase               *\/     phase_defused();                 \/* Drat!  They figured it out!                       * Let me know how they did it. *\/     printf(&quot;Phase 1 defused. How about the next one?\\n&quot;);      \/* The second phase is harder.  No one will ever figure out      * how to defuse this... *\/     input = read_line();     phase_2(input);     phase_defused();     printf(&quot;That's number 2.  Keep going!\\n&quot;);      \/* I guess this is too easy so far.  Some more complex code will      * confuse people. *\/     input = read_line();     phase_3(input);     phase_defused();     printf(&quot;Halfway there!\\n&quot;);      \/* Oh yeah?  Well, how good is your math?  Try on this saucy problem! *\/     input = read_line();     phase_4(input);     phase_defused();     printf(&quot;So you got that one.  Try this one.\\n&quot;);          \/* Round and 'round in memory we go, where we stop, the bomb blows! *\/     input = read_line();     phase_5(input);     phase_defused();     printf(&quot;Good work!  On to the next...\\n&quot;);      \/* This phase will never be used, since no one will get past the      * earlier ones.  But just in case, make this one extra hard. *\/     input = read_line();     phase_6(input);     phase_defused();      \/* Wow, they got it!  But isn't something... missing?  Perhaps      * something they overlooked?  Mua ha ha ha ha! *\/          return 0; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 r2 \u043e\u043d \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442 \u043d\u0430\u0441 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0444\u0440\u0430\u0437\u043e\u0439. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Entry_point\">entry-point<\/a> \u0438 \u0436\u0434\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0424\u043b\u0430\u0436\u043e\u043a <b>-\u0410<\/b> \u043f\u0440\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442.<br \/>  \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 <b>a<\/b>), \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 <b>afl<\/b> \u2014 \u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u0438\u0437 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439. <b>~<\/b> \u2014 \u0430\u043d\u0430\u043b\u043e\u0433 grep-a(\u0444\u0438\u043b\u044c\u0442\u0440\u0430). \u041f\u043e\u0438\u0449\u0435\u043c \u0443 \u043d\u0435\u0433\u043e \u043d\u0430\u0448\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"bash\">$ r2 -A bomb  -- In soviet Afghanistan, you debug radare2! [0x00400c90]&gt; afl~phase 0x00400ee0  28  3  sym.phase_1 0x004015c4  149  8  sym.phase_defused 0x00400efc  71  8  sym.phase_2 0x00400f43  139  8  sym.phase_3 0x0040100c  86  7  sym.phase_4 0x00401062  146  9  sym.phase_5 0x004010f4  272  26  sym.phase_6 0x00401242  81  5  sym.secret_phase <\/code><\/pre>\n<p>  <\/p>\n<h3>Level 1<\/h3>\n<p>  \u0427\u0443\u0434\u0435\u0441\u043d\u043e, \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0435\u0449\u0435 \u0438 \u043d\u0430\u0448\u043b\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0444\u0430\u0437\u0443. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u0441\u043c\u0435\u0441\u0442\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u043a\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"bash\">[0x00400c90]&gt; s 0x00400ee0 # \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 's' - \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e [0x00400ee0]&gt; pd 8 # \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c 8 \u043e\u043f\u043a\u043e\u0434\u043e\u0432 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f <\/code><\/pre>\n<p>  \u0422.\u043a. \u0432\u044b\u0432\u043e\u0434 r2 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u0435\u043d, \u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u0431\u0443\u0434\u0443 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438 \u043f\u043e\u0441\u0442\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a2d\/592\/716\/a2d5927162ce4826af22215b6a0b75ad.png\"\/><br \/>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0430\u0434\u0430\u0440 \u0441\u043d\u0430\u0431\u0434\u0438\u043b \u043d\u0430\u0441 XREF-\u0430\u043c\u0438(\u0442\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435) \u0441 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u043a\u0430\u043c\u0438 \u043f\u0440\u044b\u0436\u043a\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0432 \u0432\u0438\u0434\u0435 ascii-\u0441\u0442\u0440\u0435\u043b\u043e\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0432 \u0431\u043b\u043e\u043a\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434 \u0441 objdump<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>0000000000400ee0 &lt;phase_1&gt;:   400ee0:   48 83 ec 08             sub    rsp,0x8   400ee4:   be 00 24 40 00          mov    esi,0x402400   400ee9:   e8 4a 04 00 00          call   401338 &lt;strings_not_equal&gt;   400eee:   85 c0                   test   eax,eax   400ef0:   74 05                   je     400ef7 &lt;phase_1+0x17&gt;   400ef2:   e8 43 05 00 00          call   40143a &lt;explode_bomb&gt;   400ef7:   48 83 c4 08             add    rsp,0x8   400efb:   c3                      ret                    retq <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u0436\u0435 \u043d\u0435 \u0432\u043d\u0438\u043a\u0430\u044f, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u0430 \u2014 \u00abBorder relations with Canada have never been better.\u00bb. \u0418 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043f\u0440\u0438 \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u043d\u0438\u0438 \u0435\u0435 \u0431\u043e\u043c\u0431\u0435, \u043e\u043d\u0430, \u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0430\u0441 \u043d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u0444\u0430\u0437\u0443.  <\/p>\n<pre><code class=\"bash\">$ .\/bomb Welcome to my fiendish little bomb. You have 6 phases with which to blow yourself up. Have a nice day! Border relations with Canada have never been better. Phase 1 defused. How about the next one? <\/code><\/pre>\n<p>  <\/p>\n<h3>Level 2<\/h3>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u043a. \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0437\u044b \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">[0x00400ee0]&gt; pdf @ 0x00400efc <\/code><\/pre>\n<p>  \u043b\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d:  <\/p>\n<pre><code class=\"bash\">[0x00400ee0]&gt; pdf @ sym.phase_2 <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f6d\/c00\/ac3\/f6dc00ac3f454a23b71ce243777cf3b3.png\"\/><br \/>  \u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0443 \u043d\u0430\u0441 \u2014 \u043d\u0435 \u0432\u0437\u043e\u0440\u0432\u0430\u0442\u044c \u0431\u043e\u043c\u0431\u0443, \u0442.\u0435. \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <b>call sym.explode_bomb<\/b>, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u0430 \u043f\u0440\u044b\u0436\u043a\u0430 je.<br \/>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0443 \u043d\u0430\u0441 \u043d\u0430 \u043f\u0443\u0442\u0438 \u2014 \u0432\u044b\u0437\u043e\u0432 <b>call sym.read_six_numbers<\/b>. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430 \u0432\u0435\u0440\u0445\u0443 \u0441\u0442\u0435\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/244\/a0a\/79f\/244a0a79f19141af8bb2215df44a0531.png\"\/><br \/>  \u0420\u0430\u043d\u044c\u0448\u0435 r2 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u043e\u043f\u043a\u043e\u0434\u0435 <b>ret<\/b>, \u0447\u0442\u043e \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0432\u044b\u0432\u043e\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 exit()). \u0412 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0434\u0430\u0440 \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e.  <\/p>\n<pre><code class=\"bash\">[0x00400ee0]&gt; s 0x0040149e # \u0434\u0432\u0438\u0433\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u043f\u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0446\u0430 [0x0040149e]&gt; af+ sym.read_six_numbers `?vi $$-sym.read_six_numbers` rsn # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 rsn, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0441 \u043c\u0435\u0442\u043a\u0438 sym.read_six_numbers \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f. <\/code><\/pre>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a<b>&#171;<\/b>.<br \/>  \u0412 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e, \u043e\u043d\u0430 \u0438\u0437 \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u0442 6 \u0447\u0438\u0441\u0435\u043b \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0417\u0430\u0442\u0435\u043c \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0441\u0435\u043b \u0431\u043e\u043b\u044c\u0448\u0435 5.<br \/>  \u0412 \u0421\u0438 \u0431\u044b \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">void read_six_numbers(char *str, long long *p) {     if (sscanf(str, &quot;%d %d %d %d %d %d&quot;, p, p+1, p+2, p+3, p+4, p+5) &lt;= 5)         explode_bomb(); } <\/code><\/pre>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b>phase_2<\/b>. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0441\u0442\u0435\u043a\u0430(<b>mov rsi, rsp<\/b>). \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u2014 1.<br \/>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c IDA \u0441\u043a\u043e\u0440\u0435\u0439 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0436\u0430\u043b \u0431\u044b \u043f\u0440\u043e\u0431\u0435\u043b \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0433\u0440\u0430\u0444 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432. \u0412\u044b \u043d\u0435 \u043f\u043e\u0432\u0435\u0440\u0438\u0442\u0435, \u043d\u043e \u0442\u0443\u0442 \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c. \u041f\u043e\u0434\u043e\u0431\u043d\u043e vim \u0442\u0443\u0442 \u0435\u0441\u0442\u044c visual-mode (\u043a\u043e\u043c\u0430\u043d\u0434\u0430 <b>V<\/b>) \u0438 \u0432 \u043d\u0435\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0433\u0440\u0430\u0444 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432, \u0442\u043e\u0436\u0435 \u043f\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 <b>V<\/b>(\u043b\u0438\u0431\u043e \u0441\u0440\u0430\u0437\u0443 <b>VV<\/b>). \u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0430 \u2014 <b>q<\/b>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430 \u0432\u044b\u0432\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0438\u043b\u044b\u0439 ASCII \u0433\u0440\u0430\u0444<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/02c\/8c4\/b0b\/02c8c4b0beaf45e8b9fa607f98fff4a5.png\"\/>  <\/div>\n<\/div>\n<p>  \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e, \u0441 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439(\u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u043e\u0448\u043b\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438). \u041f\u043e\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u044d\u0442\u043e \u0447\u0443\u0434\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438, \u043b\u0438\u0431\u043e vim-like <b>&#8216;hjkl&#8217;<\/b>. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0430\u043c \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438\u0445 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0445\u043e\u0442\u043a\u0435\u044f\u043c\u0438 <b>Shift+&#8217;hjkl&#8217;<\/b>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a(\u0441\u0438\u043d\u0438\u0439), \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e <b>Tab<\/b>\/<b>Shift-Tab<\/b>.<br \/>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u0432 <b>rbx<\/b> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 \u0432 <b>rbp<\/b> \u2014 \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0447\u0438\u0441\u0435\u043b. \u0418 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043f\u0430\u0440\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430.  <\/p>\n<pre><code>mov eax, dword [rbx - 4] ; \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 eax add eax, eax             ; \u0423\u0434\u0432\u043e\u0438\u0442\u044c \u0435\u0433\u043e cmp dword [rbx], eax     ; \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c je 0x400f25              ; \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0446\u0438\u043a\u043b, \u0435\u0441\u043b\u0438 \u0440\u0430\u0432\u043d\u044b call sym.explode_bomb    ; \u0412\u0437\u043e\u0440\u0432\u0430\u0442\u044c \u0431\u043e\u043c\u0431\u0443, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0432\u043d\u044b add rbx, 4               ; \u0421\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e cmp rbx, rbp             ; \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043b\u0438 \u043c\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 jne 0x400f17             ; \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u043e jmp 0x400f3c             ; \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0446\u0438\u043a\u043b <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0434\u0432\u043e\u0439\u043a\u0438 \u043e\u0442 1 \u0434\u043e 32. \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u043e \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e.  <\/p>\n<pre><code class=\"bash\">$ .\/bomb ... Phase 1 defused. How about the next one? 1 2 4 8 16 32 That's number 2.  Keep going! <\/code><\/pre>\n<p>  <\/p>\n<h3>Level 3<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b13\/5d9\/a4b\/b135d9a4b7394707a5d1074428a249e1.png\"\/><br \/>  \u041d\u0430\u0432\u0435\u0440\u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0434\u0430\u043b\u0435\u043a\u0438\u0439 \u043e\u0442 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430, \u0432 \u044d\u043f\u0438\u043b\u0435\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043f\u0430\u0434\u043a\u0430\u0445 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043f\u043e \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u0443 \u043d\u0430 \u043a\u0440\u0430\u044e \u043e\u043a\u043d\u0430. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0431\u043e\u044f\u0442\u044c\u0441\u044f \u0442\u0443\u0442 \u043d\u0435\u0447\u0435\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 switch-case \u0431\u043b\u043e\u043a.<br \/>  \u0427\u0438\u0441\u043b\u0430 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u0441\u043b\u0443\u0447\u0430\u044e, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430. \u0425\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043e\u043d\u0438 \u0432 <b>[rsp+8]<\/b> \u0438 <b>[rsp+0xc]<\/b> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<br \/>  \u0417\u0430\u0442\u0435\u043c \u0438\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0447\u0442\u043e \u043e\u0431\u0430 \u0447\u0438\u0441\u043b\u0430 \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 7. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 switch \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <b>0x402470<\/b> \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c (\u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e)*8.<br \/>  \u041d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043c \u043b\u0435\u0436\u0430\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 case-\u043c\u0435\u0442\u043e\u043a. \u0414\u0430\u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u043c, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0435\u0436\u0438\u0442. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u0440\u0443\u043f\u043f \u043a\u043e\u043c\u043c\u0430\u043d\u0434 <b>px<\/b>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 8-\u0431\u0430\u0439\u0442\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430(<b>Q<\/b>uad-word).  <\/p>\n<pre><code class=\"bash\">[0x0040149e]&gt; pxQ 72 @ 0x402470 0x00402470 0x0000000000400f7c sym.phase_3+57 0x00402478 0x0000000000400fb9 sym.phase_3+118 0x00402480 0x0000000000400f83 sym.phase_3+64 0x00402488 0x0000000000400f8a sym.phase_3+71 0x00402490 0x0000000000400f91 sym.phase_3+78 0x00402498 0x0000000000400f98 sym.phase_3+85 0x004024a0 0x0000000000400f9f sym.phase_3+92 0x004024a8 0x0000000000400fa6 sym.phase_3+99 <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u0445\u043e\u0442\u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u0430\u043b\u044c\u0448\u0435 \u0438\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441 \u0442\u0435\u043c \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <b>eax<\/b> \u043f\u0440\u0438 \u0441\u0432\u0438\u0442\u0447\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0432\u043e\u0434 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 hex-\u0430. \u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>rax2<\/b>(\u0430\u043d\u0430\u043b\u043e\u0433 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430) \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u0448\u0435\u043b\u043b\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440(\u0445\u043e\u0442\u043a\u0435\u0439 \u2014 <b>?<\/b>), \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0410, \u0434\u0430\u0431\u044b \u043d\u0435 \u0436\u043c\u0430\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e enter \u043c\u043e\u0436\u043d\u043e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u044f\u043c \u043a\u0430\u043a \u0432 \u0431\u0430\u0448\u0435.  <\/p>\n<pre><code class=\"bash\">[0x0040149e]&gt; !rax2 0xcf 207 [0x0040149e]&gt; ?vi 0x2c3; ?vi 0x100; ?vi 0x185; ?vi 0xce; ?vi 0x2aa; ?vi 0x147; ?vi 0x137 707 256 389 206 682 327 311 <\/code><\/pre>\n<p>  \u0418\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442:  <\/p>\n<ul>\n<li>0 207<\/li>\n<li>1 311<\/li>\n<li>2 707<\/li>\n<li>3 256<\/li>\n<li>4 389<\/li>\n<li>5 206<\/li>\n<li>6 682<\/li>\n<li>7 327<\/li>\n<\/ul>\n<p>  \u0418 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:  <\/p>\n<pre><code class=\"bash\">$ .\/bomb ... That's number 2.  Keep going! 4 389 Halfway there! <\/code><\/pre>\n<p>  <\/p>\n<h3>Level 4<\/h3>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">sym.phase_4<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7c0\/f3c\/449\/7c0f3c44994e42d699230fb9c24e1143.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">sym.func4<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/aa9\/404\/86f\/aa940486fda041729bfa2728c4d52780.png\"\/>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044f\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f. \u041f\u043e\u043c\u0438\u043c\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 ASCII-\u0433\u0440\u0430\u0444\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u044b \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f dot \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0442\u044c \u0432 png.  <\/p>\n<pre><code class=\"bash\">[0x0040149e]&gt; ag sym.func4 &gt; func4.dot [0x0040149e]&gt; dot -Tpng -o func4.png func4.dot <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7e8\/547\/095\/7e85470951c1422080a2668a4f6f5415.png\"\/><br \/>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u0421\u0438, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c <i>\u043f\u043e\u0447\u0442\u0438<\/i> \u043d\u0435 \u0442\u0430\u043a \u0441\u0442\u0440\u0430\u0448\u043d\u043e.  <\/p>\n<pre><code class=\"cpp\">void phase_4(char *str) {     int x, y;     if (sscanf(str, &quot;%d %d&quot;, &x, &y) != 2 ||              x &gt; 14 ||              func4(x, 0, 14) ||              y != 0)         explode_bomb(); }  int func4(int x, int y, int z) {     unsigned diff = (z - y)\/2;     int p = y + diff;      if (p &gt; x) {         func4(x, y, p-1);         return diff * 2;     } else if (p &lt; x) {         func4(x, p + 1, z);         return diff * 2 + 1;     }      return 0; }  <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f func4 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u0442 0, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u043d\u0435 \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u044c else-if. \u0412\u0432\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <b>x<\/b>, \u0430 <b>p=7<\/b> \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u0445\u043e\u0434\u0435. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438 <b>x=7<\/b> \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 0, \u0431\u0435\u0437 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u0412\u0442\u043e\u0440\u0430\u044f \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0430 \u043d\u0443\u043b\u0435\u043c. \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c.  <\/p>\n<pre><code class=\"bash\">$ .\/bomb in.tmp  ... Halfway there! 7 0 So you got that one.  Try this one. <\/code><\/pre>\n<p>  <\/p>\n<h3>Level 5<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d4c\/46b\/e90\/d4c46be90750481eafcba9ff0ffeb3e9.png\"\/><br \/>  \u0421 \u044d\u0442\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0442\u0443\u0442 \u043d\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0435\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<br \/>  \u0412 <b>0x00401073<\/b> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Stack_buffer_overflow#Stack_canaries\">\u043a\u0430\u043d\u0430\u0440\u0435\u0439\u043a\u0430<\/a> \u043d\u0430 \u0441\u0442\u0435\u043a. \u041f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <b>i<\/b>. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 <b>i~canary<\/b> \u0432\u0435\u0440\u043d\u0435\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <b>true<\/b>.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 string_length \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 6 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0441\u043f\u0430\u0433\u0435\u0442\u0442\u0438-\u043a\u043e\u0434. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u0430 \u0441 \u044d\u0442\u0438\u043c \u0434\u043e\u043b\u0433\u043e \u0438 \u0441\u043b\u043e\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0433\u0440\u0435\u0445 \u0438\u043c \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u0444\u043b\u0430\u0433\u043e\u043c \u0434\u0435\u0431\u0430\u0433\u0430 \u043b\u0438\u0431\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435:  <\/p>\n<pre><code class=\"bash\">$ r2 -Ad bomb <\/code><\/pre>\n<p>  \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043e\u0442\u043a\u0440\u044b\u0432 \u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"bash\">[0x0040149e]&gt; ood <\/code><\/pre>\n<p>  \u0410\u0434\u0440\u0435\u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438\u044d\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u043a\u043e\u0434 \u0432 entry-point, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0435\u043d \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u043c breakpoints \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e \u043d\u0438\u0445.  <\/p>\n<pre><code class=\"bash\">[0x7f2960b99d80]&gt; db sym.phase_5 # \u043b\u0438\u0431\u043e s sym.phase_5; db $$ [0x7f2960b99d80]&gt; dc             # \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e 1 \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u0430 <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0435\u0441\u0442\u044c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430: \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 <b>d<\/b>\/<b>db<\/b>, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0432 Visual-mode. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c.<br \/>  \u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c Visual-mode, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0431\u0435\u0440\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 debug-layout \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0445\u043e\u0442\u043a\u0435\u044f\u043c\u0438 <b>p<\/b>\/<b>P<\/b>.<br \/>  \u041f\u0435\u0440\u0435\u043c\u0435\u0448\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>n<\/b>\/<b>N<\/b> \u2014 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f\/\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f; <b>j<\/b>\/<b>k<\/b> \u2014 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u043f\u043a\u043e\u0434.<br \/>  \u0418 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435: <b>b<\/b>\/<b>F2<\/b> \u2014 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442, <b>s<\/b>\/<b>F7<\/b> \u2014 \u0448\u0430\u0433 \u0432 1 \u043e\u043f\u043a\u043e\u0434, <b>S<\/b>\/<b>F8<\/b> \u2014 \u0448\u0430\u0433 \u0432 1 \u043e\u043f\u043a\u043e\u0434 \u043d\u0435 \u0437\u0430\u0445\u043e\u0434\u044f \u0432 call, <b>F9<\/b> \u2014 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0434\u043e \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c71\/628\/348\/c7162834889e4ef8b1b932ffb8e02791.gif\"\/>  <\/div>\n<\/div>\n<p>  \u0418\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0432 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a, \u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<br \/>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e 16 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 <code>char *s = &quot;maduiersnfotvbyl&quot;<\/code> \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u00abflyers\u00bb.<br \/>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 str \u0434\u0430\u044e\u0442 \u0438\u0441\u043a\u043e\u043c\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<br \/>  \u0421\u0442\u0440\u043e\u043a\u0443 flyers \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: {s[0x9], s[0xe], s[0xf], s[0x5], s[0x6], s[0x7]}. \u0414\u0443\u043c\u0430\u044e ASCII \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0435 \u043a\u0430\u0436\u0434\u044b\u0439, \u043f\u043e\u0441\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0443\u0442\u0438\u043b\u0438\u0442\u0435 rax2 \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e. \u0421 \u043a\u043b\u044e\u0447\u0435\u043c <b>-s<\/b> \u043e\u043d \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0442 \u0438\u0437 hex \u0432 string. \u0422.\u043a. \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e 16, \u0442\u043e \u0434\u043b\u044f \u044d\u0441\u0442\u0435\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"bash\">$ rax2 -s 49 4e 4f 45 46 47 IONEFG <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">$ .\/bomb ... So you got that one.  Try this one. IONEFG Good work!  On to the next... <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u0441\u0442\u0440\u043e\u043a\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\u042f \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u043b \u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0442\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043a\u0442\u043e-\u0442\u043e \u043e\u0442\u044b\u0449\u0435\u0442 \u0431\u0443\u0434\u0443 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \ud83d\ude42  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>The Last One<\/h3>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u044b\u0448\u043b\u0430 \u0432\u0435\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u0430 \u0432\u0441\u0435 \u0444\u0430\u0437\u044b \u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 6 \u0444\u0430\u0437\u0443 \u044f \u043e\u043f\u0443\u0449\u0443, \u0438\u0431\u043e \u0442\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u043f\u043e\u0442\u043b\u0438\u0432\u043e\u0433\u043e \u0432\u043d\u0438\u043a\u0430\u043d\u0438\u044f \u0431\u0435\u0437 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043b\u044e\u0431\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<br \/>  \u0412 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0444\u0430\u0437\u0443 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u0441\u0435\u043c\u0443 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u043f\u0430\u0442\u0447\u0438\u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a. \u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e, \u0432\u044b\u0434\u0430\u0432 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0444\u043b\u0430\u0436\u043a\u043e\u043c <b>-w<\/b>, \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>oo+<\/b> \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u044f \u0438\u0437 r2.  <\/p>\n<pre><code class=\"bash\">$ r2 -Aw bomb  -- Did you ever ordered a pizza using radare2? [0x00400c90]&gt; s 0x00400ec6 # call sym.phase_6 [0x00400ec6]&gt; wa call sym.secret_phase # \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0443\u0436\u043d\u044b\u0445 \u043e\u043f\u043a\u043e\u0434\u043e\u0432 [0x00400ec6]&gt; pdf @ sym.secret_phase; pdf @ sym.fun7 <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">secret_phase<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ef3\/0bb\/17a\/ef30bb17a8384842ae0cc1040a222a7e.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">fun7<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f25\/e99\/164\/f25e9916405a41e9b15f82481d73588a.png\"\/>  <\/div>\n<\/div>\n<p>  \u041e\u043f\u044f\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0435\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438, \u0438\u0431\u043e \u0431\u0435\u0437 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. ASCII-\u0433\u0440\u0430\u0444 \u0441\u043d\u043e\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c35\/2cc\/c8d\/c352ccc8d0254c8b9b06e7fb4d2eb565.png\"\/><br \/>  \u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u0435\u0442 <abbr title=\"\u042f \u0442\u0443\u0442, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u043b\">\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e<\/abbr> \u0442\u0430\u043a\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 \u0421\u0438:  <\/p>\n<pre><code class=\"cpp\">void secret_phase() {     long num = strtol(read_line()) - 1;      if (num &gt; 0x3e8 ||              fun7((long*)(0x6030f0), num) != 2)         explode_bomb();      puts(&quot;Wow! You've defused the secret stage!&quot;);     phase_defused(); }  int fun7(long *array, int num) {     if (array == 0)         return -1;      if (*array &lt;= num) {         if (*array == num)             return 0;                        \/\/ 1         else {             return 2 * fun7(array + 1, num); \/\/ 2         }     } else {         return 2 * fun7(array + 2, num) + 1; \/\/ 3     } } <\/code><\/pre>\n<p>  \u0418\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 <b>fun7<\/b> \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0432\u043e\u0439\u043a\u0443, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c ret \u043d\u0430 <b>2<\/b> \u0441\u0442\u0440\u043e\u043a\u0435, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 <b>3<\/b> \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0430 <b>1<\/b>. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0430 \u0437\u0430\u0433\u0430\u0434\u043a\u0430 \u2014 \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <b>0x6030f0<\/b>.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">480 \u0431\u0430\u0439\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">[0x00401204]&gt; px 480 @ 0x6030f0 - offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF 0x006030f0  2400 0000 0000 0000 1031 6000 0000 0000  $........1`..... 0x00603100  3031 6000 0000 0000 0000 0000 0000 0000  01`............. 0x00603110  0800 0000 0000 0000 9031 6000 0000 0000  .........1`..... 0x00603120  5031 6000 0000 0000 0000 0000 0000 0000  P1`............. 0x00603130  3200 0000 0000 0000 7031 6000 0000 0000  2.......p1`..... 0x00603140  b031 6000 0000 0000 0000 0000 0000 0000  .1`............. 0x00603150  1600 0000 0000 0000 7032 6000 0000 0000  ........p2`..... 0x00603160  3032 6000 0000 0000 0000 0000 0000 0000  02`............. 0x00603170  2d00 0000 0000 0000 d031 6000 0000 0000  -........1`..... 0x00603180  9032 6000 0000 0000 0000 0000 0000 0000  .2`............. 0x00603190  0600 0000 0000 0000 f031 6000 0000 0000  .........1`..... 0x006031a0  5032 6000 0000 0000 0000 0000 0000 0000  P2`............. 0x006031b0  6b00 0000 0000 0000 1032 6000 0000 0000  k........2`..... 0x006031c0  b032 6000 0000 0000 0000 0000 0000 0000  .2`............. 0x006031d0  2800 0000 0000 0000 0000 0000 0000 0000  (............... 0x006031e0  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x006031f0  0100 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603200  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603210  6300 0000 0000 0000 0000 0000 0000 0000  c............... 0x00603220  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603230  2300 0000 0000 0000 0000 0000 0000 0000  #............... 0x00603240  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603250  0700 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603260  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603270  1400 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603280  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x00603290  2f00 0000 0000 0000 0000 0000 0000 0000  \/............... 0x006032a0  0000 0000 0000 0000 0000 0000 0000 0000  ................ 0x006032b0  e903 0000 0000 0000 0000 0000 0000 0000  ................ 0x006032c0  0000 0000 0000 0000 0000 0000 0000 0000  ................ <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0443\u0442 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f 8-\u0431\u0430\u0439\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u043e 4. \u041f\u0435\u0440\u0432\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 \u043d\u0430\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c; \u0432\u0442\u043e\u0440\u043e\u0435 \u0438 \u0442\u0440\u0435\u0442\u044c\u0435 \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f; \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0435 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0434\u0434\u0438\u043d\u0433, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u043a\u043e\u043c\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e.  <\/p>\n<ul>\n<li><abbr title=\"0x006030f0\">2 ret<\/abbr>: num &lt; 0x24<\/li>\n<li><abbr title=\"0x00603110\">3 ret<\/abbr>: num &gt; 0x08<\/li>\n<li><abbr title=\"0x00603150\">1 ret<\/abbr>: num == 0x16<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"bash\">$ .\/bombSec in.tmp  ... Good work!  On to the next... 22 Wow! You've defused the secret stage! Congratulations! You've defused the bomb! <\/code><\/pre>\n<p>  \u0415\u0445\u0443, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e! <s>\u0427\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u0435\u0442 \u0436\u0438\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e<\/s>. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u044b\u0448\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u0430, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0444\u0438\u0447 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043d\u0435 \u0431\u044b\u043b\u0438 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0435\u0449\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044c. \u0422\u0430\u043a\u0436\u0435, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274617\/\"> http:\/\/habrahabr.ru\/post\/274617\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0f6\/894\/09e\/0f689409e9a246c1b214c3a2fd9402f2.png\"\/><br \/>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, %username%! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0440\u0435\u0432\u0435\u0440\u0441\u0435\u0440\u0430 \u2014 radare2. \u0412 \u0432\u0438\u0434\u0435 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043e\u043f\u0430\u0432\u0448\u0443\u044e \u0431\u043e\u043c\u0431\u0443, \u043e\u043d\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441 <a href=\"http:\/\/csapp.cs.cmu.edu\/3e\/bomb.tar\">\u0441\u0430\u0439\u0442\u0430<\/a> \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \u041a\u0430\u0440\u043d\u0435\u0433\u0438 \u041c\u0435\u043b\u043b\u043e\u043d.  <\/p>\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-271778","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271778","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=271778"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271778\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}