{"id":322709,"date":"2021-02-05T21:47:00","date_gmt":"2021-02-05T13:47:00","guid":{"rendered":"http:\/\/4563.org\/?p=322709"},"modified":"2021-02-05T21:47:00","modified_gmt":"2021-02-05T13:47:00","slug":"x64-%e6%b1%87%e7%bc%96%e9%87%8c%e9%9d%a2-popq-rsp-%e7%9a%84%e7%bb%93%e6%9e%9c%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%85%88%e6%8a%8a%e6%a0%88%e9%a1%b6%e7%9a%84-8byte-%e5%85%83%e7%b4%a0%e6%94%be","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=322709","title":{"rendered":"x64 \u6c47\u7f16\u91cc\u9762 popq %rsp \u7684\u7ed3\u679c\u662f\u4ec0\u4e48\uff1f\u5148\u628a\u6808\u9876\u7684 8byte \u5143\u7d20\u653e\u5230%rsp\uff0c\u7136\u540e%rsp \u91cc\u9762\u7684\u503c\u518d+8\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  x64 \u6c47\u7f16\u91cc\u9762 popq %rsp \u7684\u7ed3\u679c\u662f\u4ec0\u4e48\uff1f\u5148\u628a\u6808\u9876\u7684 8byte \u5143\u7d20\u653e\u5230%rsp\uff0c\u7136\u540e%rsp \u91cc\u9762\u7684\u503c\u518d+8\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : movq <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u7f51\u4e0a\u627e\u4e86\u5f88\u591a\u6ca1\u770b\u5230\u6bd4\u8f83\u6709\u7528\u7684\u4fe1\u606f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>17<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5008443\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : konar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u662f\u629b\u5f03\u6808\u9876\u5143\u7d20\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008444\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rdZZZ <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 gcc \u7f16\u8bd1\u7684\u4e48\uff1f\u5bf9%rsp \u8fdb\u884c+\/-8 \u7684\u64cd\u4f5c\uff0c\u5c31\u662f\u51fa\u6808\u5165\u6808\u7684\u64cd\u4f5c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008445\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : konar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6808\u9876\u5143\u7d20\u51fa\u6808\u540e\u53c8\u653e\u5165\u6808\u9876\uff0c\u7136\u540e\u6808\u9876\u6307\u9488\u4e0b\u79fb\uff0c\u90a3\u5c31\u662f\u629b\u5f03\u6808\u9876\u5143\u7d20\u7684\u610f\u601d\u5427<br \/>\u4e0d\u8fc7\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5 subq\/addq \u5462                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008446\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nifury <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ea\u653e\u6570\u636e\u5230 rsp\uff0c\u4e0d+8<br \/>\u4e3a\u4ec0\u4e48\u4e0d debug \u770b\u4e00\u773c\u5462                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008447\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : konar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/stackoverflow.com\/questions\/14968824\/what-is-an-assembly-level-representation-of-pushl-popl-esp                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008448\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : konar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5173\u4e8e push\/pop %esp \u7684\uff0cpushq\/popq %rsp \u5e94\u8be5\u7c7b\u4f3c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008449\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : movq <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nifury \u56e0\u4e3a\u6211\u4e0d\u4f1a\u5199\u6c47\u7f16\uff0c\u53ea\u4f1a\u770b\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008450\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : airqj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u4e13\u653b\u6c47\u7f16\u5417? <br \/>ID \u90fd\u662f\u4e3a\u6c47\u7f16\u800c\u751f\u554a \ud83d\ude42                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008451\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : movq <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @airqj \u60f3\u4e0d\u51fa\u5565\u540d\uff0c\u6ce8\u518c\u7684\u65f6\u5019\u6b63\u5728\u770b\u6c47\u7f16\uff0c\u5c31\u6574\u4e86\u4e2a\u8fd9\u4e2a\uff0c\u770b\u8d77\u6765\u6bd4\u8f83 geek                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008452\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u822c\u4e0d\u4f1a\u5bf9 rsp \u8fdb\u884c pop\/push \u64cd\u4f5c \u81f3\u5c11\u6211\u770b\u4e86\u8fd9\u4e48\u591a gcc \u7684\u53cd\u6c47\u7f16 \u6ca1\u6709\u9047\u5230\u8fc7.. fastcall \u7684\u7ea6\u5b9a\u662f \u88ab\u8c03\u7528\u65b9\u4fdd\u62a4\u597d \u8c03\u7528\u65b9\u7684 rbp \u6307\u9488\u5c31\u884c\u4e86\uff0crsp \u4e00\u822c\u90fd\u662f\u7528\u5b8c\u4e4b\u540e \u5728\u5f53\u524d\u5e27\u8fd4\u56de\u4e4b\u524d\u6062\u590d\u72b6\u6001\u5c31\u884c\u4e86 \u4e00\u822c\u90fd\u662f\u5f53\u524d\u5e27\u4e00\u5f00\u59cb sub rsp, 0x8 \u7136\u540e\u5f53\u524d\u5e27\u8fd4\u56de\u524d add rsp, 0x8\uff0c\u8fd9 8 \u4e2a\u5b57\u8282\u6808\u7a7a\u95f4\u5c31\u662f\u5f53\u524d\u51fd\u6570\u5e27\u5b58\u653e\u53d8\u91cf\u7684\u4f4d\u7f6e..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008453\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 6e25h <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             csapp \u6211\u8bb0\u5f97\u6709\u89e3\u91ca\u8fc7\u8fd9\u4e2a\u4e1c\u897f\uff0c\u8bb0\u5f97\u597d\u50cf\u5c31\u662f 4 \u6240\u8bf4\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008454\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Crimilals <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/www.felixcloutier.com\/x86\/pop \u770b\u4f2a\u4ee3\u7801                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008455\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Crimilals <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Crimilals If the ESP register is used as a base register for addressing a destination operand in memory, the POP instruction computes the effective address of the operand after it increments the ESP register. For the case of a 16-bit stack where ESP wraps to 0H as a result of the POP instruction, the resulting location of the memory write is processor-family-specific.<\/p>\n<p>The POP ESP instruction increments the stack pointer (ESP) before data at the old top of stack is written into the destination.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008456\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : irytu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nifury @6e25h \u662f\u7684 \u662f\u5728\u5904\u7406\u5668\u4f53\u7cfb\u7ed3\u6784\u8bb2\u5230\u7684\uff0c\u8bb2\u6d41\u6c34\u7ebf\u7684\u65f6\u5019\u8fd9\u4e2a\u662f\u4e2a\u7279\u4f8b\u62ff\u51fa\u6765\u8bf4\u7684\uff0c\u5c31\u662f\u91cd\u7f6e\u6808\u6307\u9488                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008457\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : movq <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @6e25h \u6211\u4e5f\u8bb0\u5f97\u8bb2\u8fc7\uff0c\u4f46\u662f\u4e66\u592a\u539a\u4e86\u4e0d\u8bb0\u5f97\u5728\u54ea\u91cc\u4e86\uff0c\u5c31\u62ff\u51fa\u6765\u95ee\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008458\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : laumm1314 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pop \u548c push \u547d\u4ee4\u76f8\u53cd<br \/>push \u628a\u6570\u636e\u538b\u5165\u6808\u9876\uff0c\u7136\u540e sp \u51cf\u53bb\u673a\u5668\u5b57\u8282\u957f\u5ea6<br \/>pop \u628a sp \u52a0\u4e0a\u673a\u5668\u5b57\u8282\uff0c\u7136\u540e\u6570\u636e\u5f39\u51fa\u5230\u76ee\u7684\u6570<br \/>\u5728 amd64 \u673a\u5668\u4e0a\uff0csp \u5bf9\u5e94 rsp<br \/>popq \u4e2d\u7684 q \u6807\u8bc6\u6570\u636e\u5bbd\u5ea6\u662f 8 \u4e2a\u5b57\u8282\uff0c\u65e2\u662f 64 \u4f4d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5008459\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : laumm1314 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6808\u662f\u5411\u4f4e\u65b9\u5411\u62d3\u5c55\u7684\uff0c\u6240\u4ee5 rsp \u503c\u53d8\u5927\u5bf9\u5e94\u6808\u6536\u7f29\uff0crsp \u503c\u53d8\u5c0f\uff0c\u6808\u6269\u5927                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>x64 \u6c47\u7f16\u91cc\u9762 popq %rs&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/322709"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=322709"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/322709\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322709"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}