{"id":315919,"date":"2021-01-03T09:00:25","date_gmt":"2021-01-03T09:00:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315919"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315919","title":{"rendered":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 GDB"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<h2 id=\"dlya-kogo-ona-nuzhna\">\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430?<\/h2>\n<p>  <\/p>\n<p>1) \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0432\u0435\u0440\u0441\u0435\u0440\u043e\u0432, \u0437\u043d\u0430\u044e\u0449\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u043a\u0430\u043a GDB<\/p>\n<p>  <\/p>\n<p>2) \u043a\u0430\u043a \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u0442\u0435\u043c \u043a\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 IDA, Ghidra \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0449\u043d\u044b\u043c \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043d\u043e \u0432 \u0441\u0438\u043b\u0443 \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GDB, \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0437\u0430\u043b\u0435\u0437\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"osnovnye-komandy\">\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h2>\n<p>  <\/p>\n<h3 id=\"zapusk\">\u0417\u0430\u043f\u0443\u0441\u043a<\/h3>\n<p>  <\/p>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">gdb program_name<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">run | r<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a gdbserver<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">target remote host:port<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">attach PID \/ detach<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0439\u0442\u0438 \u0438\u0437 gdb<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">quit | q CTRL + D<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"staticheskiy-analiz\">\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">set disassembly-flavor intel\/att<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0441\u0435\u043a\u0446\u0438\u044f\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">info file <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">info functions | i func<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 asm-\u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">disas func_name disas address <\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 (\u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 -g3 \u0434\u043b\u044f gcc) \u0438\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0435\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">list func_name<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"dinamicheskiy-analiz\">\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h3>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">set args show args<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">info proc mappings<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">registers<\/code><\/pre>\n<p>  <\/p>\n<h5 id=\"otladka\">\u041e\u0442\u043b\u0430\u0434\u043a\u0430<\/h5>\n<p>  <\/p>\n<p>\u0428\u0430\u0433 \u0441 \u0437\u0430\u0445\u043e\u0434\u043e\u043c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">step | s<\/code><\/pre>\n<p>  <\/p>\n<p>\u0428\u0430\u0433 \u0441 \u043f\u0440\u044b\u0436\u043a\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">next | n<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">until | u number_of_list_string until | u *func_name+offset until | u *address<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e) \u0438 \u0444\u0440\u0435\u0439\u043c\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">info args info locals info frame<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">info threads thread number<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 breakpoints <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">b func_name b *func_name+offset b *address<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0447\u0435\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0443\u0434\u0430\u043b\u0438\u0442\u044c breakpoint<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">info break disable\/enable breakpoint_number delete breakpoint_number ignore breakpoint_number n  \/\/  \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u043f\u0440\u043e\u0439\u0434\u044f \u0435\u0435 n \u0440\u0430\u0437<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e breakpoint-\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">continue | c<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u0442\u0435\u043a\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">telescope telescope $rsp+64<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 x, \u0433\u0434\u0435 \u0447\u0435\u0440\u0435\u0437 &quot;\/&quot; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">x\/i - \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f x\/x - hex x\/s - \u0441\u0442\u0440\u043e\u043a\u0430 x\/a - \u0430\u0434\u0440\u0435\u0441<\/code><\/pre>\n<p>  <\/p>\n<p>\u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">x\/b - 8-bit x\/h - 16-bit x\/w - 32-bit x\/g - 64-bit<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">x\/64bx x\/i $pc<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">run $(python -c &quot;print('A'*32 + '\\xde\\xad')&quot;) run $(echo &quot;asdf\\\\xde\\xad&quot;)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0432\u0432\u043e\u0434\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">run &lt;&lt;&lt; $(python -c &quot;print('A1'*3)&quot;) run &lt;&lt;&lt; $(echo &quot;asdf\\xde\\xad&quot;)<\/code><\/pre>\n<p>  <\/p>\n<h5 id=\"gdb-server\">Gdb \u0421\u0435\u0440\u0432\u0435\u0440<\/h5>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 gdb \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">gdbserver host:port program<\/code><\/pre>\n<p>  <\/p>\n<h5 id=\"reverse-debug\">Reverse Debug<\/h5>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u043d\u0435\u043b\u043e\u0432\u043a\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u0433\u0434\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u043a\u043e\u0447\u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0443\u044e \u043d\u0430\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043f\u0443\u0442\u044c \u043d\u0430 CFG \u0438 \u0442.\u043f. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u0432 gdb \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0444\u0438\u0448\u043a\u0430 \u043a\u0430\u043a Reverse Debug, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0434\u043e \u043d\u0435\u0433\u043e. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430 \u0443\u043a\u0430\u0436\u0435\u043c gdb, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c reverse debug \u0438 \u0441\u0442\u043e\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">record<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">reverse-step reverse-next<\/code><\/pre>\n<p>  <\/p>\n<h5 id=\"sozdanie-dampa\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0430\u043c\u043f\u0430<\/h5>\n<p>  <\/p>\n<p>\u0421\u0434\u0430\u043c\u043f\u0438\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 ( \u0447\u0430\u0441\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0449\u0438\u043a\u0430\u043c\u0438 )<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">dump memory output_file start_addr end_addr<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"nastroyka-dlya-raboty\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 display<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">display\/5i $pc display\/g $rax display\/g $rbx display\/g $rcx<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"delaem-zhizn-prosche-s-gef\">\u0414\u0435\u043b\u0430\u0435\u043c \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0449\u0435 \u0441 GEF<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f gdb \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <a href=\"https:\/\/github.com\/hugsy\/gef\" rel=\"nofollow\">gef<\/a>, \u043e\u043d \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0431\u043e\u0440 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 aslr, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c\/\u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">aslr aslr on\/off<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 ASLR, Canary, PIE \u0438 \u0442.\u0434. <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">checksec<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0430\u043d\u043a\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">heap chunks<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u0440\u0435\u0439\u043a\u0438 \u0438 \u0430\u0434\u0440\u0435\u0441, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">canary<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434, \u0447\u0435\u043c info proc mappings<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">vmmap<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0444\u043b\u0430\u0433\u043e\u0432 \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">flags flags -Flag_name +Flag_name<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u043e\u0449\u044c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 \u043d\u0438\u0445 \u0442\u043e\u0447\u0435\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c)<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">format-string-helper<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0438 \u0435\u0433\u043e \u043f\u043e\u0438\u0441\u043a <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">pattern create 128 pattern search 0x61616167 pattern search $rbp<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0438\u0441\u043a \u0441\u0442\u0440\u043e\u043a \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">search-pattern pattern<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0430\u0442\u0447\u0438\u043d\u0433<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">patch byte\/word\/dword\/qword address value<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0447\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 python \u043a\u043e\u0434. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c 8\/16\/32\/64, l \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">print-format -b 64 -l 1  $rsp<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">shellcode search pattern shellcode get shellcode_number<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0441\u043e\u0440\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">xor display address\/register size xor_key xor patch address\/register size xor_key<\/code><\/pre>\n<\/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=\"https:\/\/habr.com\/ru\/post\/535960\/\"> https:\/\/habr.com\/ru\/post\/535960\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<h2 id=\"dlya-kogo-ona-nuzhna\">\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430?<\/h2>\n<p>  <\/p>\n<p>1) \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0432\u0435\u0440\u0441\u0435\u0440\u043e\u0432, \u0437\u043d\u0430\u044e\u0449\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u043a\u0430\u043a GDB<\/p>\n<p>  <\/p>\n<p>2) \u043a\u0430\u043a \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u0442\u0435\u043c \u043a\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 IDA, Ghidra \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0449\u043d\u044b\u043c \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043d\u043e \u0432 \u0441\u0438\u043b\u0443 \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GDB, \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0437\u0430\u043b\u0435\u0437\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c<\/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-315919","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315919","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=315919"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315919\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}