{"id":8175,"date":"2024-06-20T08:01:01","date_gmt":"2024-06-20T00:01:01","guid":{"rendered":""},"modified":"2024-06-20T08:01:01","modified_gmt":"2024-06-20T00:01:01","slug":"\u6c47\u7f16\u6307\u4ee4\u5b66\u4e60\u4e0e\u603b\u7ed3CMP\uff0cTEST\uff0cJE\uff0cJNZ\uff0cJNE\uff0cLEA\uff0cMOVE\uff0cSUB\uff0cINC,DEC,ADD,MUL,DIV,JGE\uff0cJB ,CQD","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8175.html","title":{"rendered":"\u6c47\u7f16\u6307\u4ee4\u5b66\u4e60\u4e0e\u603b\u7ed3CMP\uff0cTEST\uff0cJE\uff0cJNZ\uff0cJNE\uff0cLEA\uff0cMOVE\uff0cSUB\uff0cINC,DEC,ADD,MUL,DIV,JGE\uff0cJB ,CQD"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

\u6240\u6709\u7684\u6c47\u7f16\u90fd\u662f\u6211\u96f6\u57fa\u7840\u9006\u5411\u5fae\u4fe1\u6c47\u7f16\u7684\u6307\u4ee4 \u8fb9\u73a9\u8fb9\u5b66\uff08\u5de6\u8fb9\u6709 \u673a\u5668\u7801\uff0c\u81ea\u5df1\u53ef\u4ee5\u67e5 \u4f4d\u7f6e\uff09
\u5982\u6709\u4e0d\u5bf9\u7684\u5730\u65b9\u8bf7\u6307\u51fa<\/p>\n

\u6ce8\u660e:\u4e00\u4e9b\u6307\u4ee4\u7684\u82f1\u6587\u5355\u8bcd\uff0c\u5e76\u975e\u5b98\u65b9\uff0c\u53ea\u662f\u4e3a\u4e86\u597d\u8bb0\u597d\u7406\u89e3<\/h3>\n

\u6ce8\u610f:\u65e0\u7b26\u53f7\u6570\u7684\u6bd4\u8f83\u7528\u9ad8\u4e8e\u548c\u4f4e\u4e8e,\u6709\u7b26\u53f7\u6570\u7684\u6bd4\u8f83\u7528\u5927\u4e8e\u5c0f\u4e8e<\/p>\n

1.cmp\u3010compare\u3011\u6307\u4ee4<\/strong>
\u8fdb\u884c\u6bd4\u8f83\u4e24\u4e2a\u64cd\u4f5c\u6570\u7684\u5927\u5c0f<\/p>\n

\u4f8b:cmp oprd1,oprd2 \/\/ \u6267\u884coprd1-oprd2 \u64cd\u4f5c\uff0c\u4e0d\u8fc7\u4e0d\u4fdd\u5b58\u7ed3\u679c\uff0c\u53ea\u5f71\u54cd\u6807\u5fd7\u4f4d\u3002 <\/code><\/pre>\n

\u4e3a\u7b2c\u4e00\u4e2a\u64cd\u4f5c\u51cf\u53bb\u7b2c\u4e8c\u4e2a\u64cd\u4f5c\u6570,\u4f46\u4e0d\u5f71\u54cd\u7b2c\u4e24\u4e2a\u64cd\u4f5c\u6570\u7684\u503c,\u5b83\u5f71\u54cdflag\u7684CF\uff0cZF\uff0cOF\uff0cAF\uff0cPF.
\u5982\u679c\u51cf\u6570\u5927\u4e8e\u88ab\u51cf\u6570\uff0c\u6b64\u65f6\u6709\u501f\u4f4d\u3002\u5219\u5c06cf\u4f4d\u7f6e1\uff0c\u5426\u5219\u7f6e0.
2.test\u4e0eJE\u3010jump When Equal\u3011\u6307\u4ee4<\/strong>
test \u6307\u4ee4\u7528\u4e8e\u4e24\u4e2a\u64cd\u4f5c\u6570\u7684\u6309\u4f4dAND\u8fd0\u7b97\uff0c\u5e76\u6839\u636e\u7ed3\u679c\u8bbe\u7f6e\u6807\u5fd7\u5bc4\u5b58\u5668\uff0c\u7ed3\u679c\u672c\u8eab\u4e0d\u4f1a\u5199\u56de\u5230\u76ee\u7684\u64cd\u4f5c\u6570\u3002
\u901a\u4fd7\u70b9\u6765\u8bf4 .test\u975e\u5e38\u666e\u904d\u7684\u7528\u6cd5\u662f\u7528\u6765\u6d4b\u8bd5\u5bc4\u5b58\u5668\u662f\u5426\u4e3a\u7a7a: \u5bc4\u5b58\u5668\u4e3a\u7a7a, \u5219ZF\u96f6\u6807\u5fd7\u4e3a1,\u5219\u8df3\u8f6c<\/strong>
JE \u5f53ZF\u6807\u5fd7\u4f4d\u4e3a\u96f6,\u5c31\u8df3\u8f6c<\/strong><\/p>\n

66E9419A 85DB test ebx,ebx 66E9419C 74 64 je short WeChatWi.66E94202 \/\/\u8fd9\u4e24\u53e5\u542b\u4e49\u4e3a:ebx\u5bc4\u5b58\u5668\u4e3a\u7a7a\uff0c\u5c31\u8df3\u8f6c <\/code><\/pre>\n

3.JNZ\u3010jump no Zero\u3011\u4e0eJNE\u3010jump no Equals\u3011<\/strong>
\u90fd\u4f9d\u636eZF\u6807\u5fd7\u4f4d\uff08\u6211\u7ecf\u5e38\u53eb\u505a \u96f6\u6807\u5fd7\u4f4d\uff0c\u5224\u65ad\u662f\u4e0d\u662f0\uff09 \u4e0d\u4e3a0\/\u4e0d\u7b49\u4e8e\u65f6\u8df3\u8f6c\u6267\u884c
\u901a\u4fd7\u6765\u8bf4: \u8fd9\u4e24\u6761\u6307\u4ee4\u5b8c\u5168\u6ca1\u533a\u522b! \u5b83\u4eec\u5bf9\u5e94\u4e8e\u5b8c\u5168\u76f8\u540c\u7684\u673a\u5668\u4ee3\u7801\uff0c\u542b\u4e49\u4e3aZF\u6807\u5fd7\u4f4d\u4e0d\u7b49\u4e8e0 \u5219\u6267\u884c<\/strong><\/p>\n

66E6F4C8 66:8338 00 cmp word ptr ds:[eax],0x0 66E6F4CC 75 05 jnz short WeChatWi.66E6F4D3 \/\/\u8fd9\u4e24\u53e5\u542b\u4e49\u4e3aeax\u5bc4\u5b58\u5668\u4e0d\u7b49\u4e8e0\u5219\u8df3\u8f6c <\/code><\/pre>\n

4.LEA\u3010load(\u52a0\u8f7d) Effective(\u6709\u6548) Address(\u5730\u5740) \u4f20\u9001\u7684\u662f\u503c **
\u683c\u5f0f: LEA \u64cd\u4f5c\u6570A, \u64cd\u4f5c\u6570B
\u529f\u80fd: \u5c06\u64cd\u4f5c\u6570B\u7684\u6709\u6548\u5730\u5740\u4f20\u9001\u5230\u6307\u5b9a\u7684\u7684\u67d0\u4e2a\u5bc4\u5b58\u5668\uff0c\u64cd\u4f5c\u6570A\u5fc5\u987b\u662f\u5bc4\u5b58\u5668
LEA AX,[SI]\uff0c\u4f5c\u7528\u662f\u5c06\u5bc4\u5b58\u5668SI\u7684<\/strong>\u5185\u5bb94567H\u5f53\u505a<\/strong>\u6570\u636e**\u4f20\u9001\u7ed9AX\uff1b
\u81ea\u6211\u611f\u89c9\u6765\u8bf4:\u7528\u6765\u63d0\u5347\u5806\u6808\u6216\u8005\u6765\u83b7\u53d6\u67d0\u4e2a\u503c\u6240\u5bf9\u5e94\u7684\u5185\u5b58\u5730\u5740(\u6709\u5f02\u8bae\u8bf7\u8bc4\u8bba\u533a\u54c8)<\/strong><\/p>\n

66E6F4B0 8D45 E0 lea eax,dword ptr ss:[ebp-0x20] \/\/\u8fd9\u53e5\u7684\u610f\u601d\u65f6 \u5c06ebp\u5bc4\u5b58\u5668\u7684\u5730\u5740\u51cf\u53bb0X20 \u7684 \u5185\u5b58\u5730\u5740\u7684\u503c\uff0c\u8d4b\u503c\u7ed9eax\u5bc4\u5b58\u5668 <\/code><\/pre>\n

5.MOV\u3010move \u3011 \u4f20\u9001\u7684\u662f\u5730\u5740<\/strong>
MOV\u6307\u4ee4\u662f\u6570\u636e\u4f20\u9001\u6307\u4ee4,\u7528\u4e8e\u5c06\u4e00\u4e2a\u6570\u636e\u4ece\u6e90\u5730\u5740\u4f20\u9001\u5230\u76ee\u6807\u5730\u5740(\u79fb\u52a8\/\u8d4b\u503c)<\/p>\n

MOV AX,[SI]\uff0c\u4f5c\u7528\u662f\u5c06\u5bc4\u5b58\u5668SI\u7684\u5185\u5bb94567H\u5f53\u505a\u5730\u5740<\/strong>\u770b\u5f85\uff0c\u5c06\u5730\u5740\u4e3a4567H\u5904\u7684\u5185\u5bb9\u4f20\u9001\u7ed9AX\uff1b<\/p>\n

66E6F94F 8941 08 mov dword ptr ds:[ecx+0x8],eax \/\/\u5c06Eax\u5bc4\u5b58\u5668\u7684\u503c \u8d4b\u503c\u7ed9 ecx+0x8\u8fd9\u4e2a\u5185\u5b58\u5730\u5740 \u6307\u5411\u7684\u503c 66E6F952 8BCE mov ecx,esi\/\/\u5c06esi\u5bc4\u5b58\u5668\u768432\u4f4d\u6570\u636e\u4f20\u9001\u5230ecx\u5bc4\u5b58\u5668 <\/code><\/pre>\n

6.ADD(\u52a0)\uff0cSUB(\u51cf),MUL(\u4e58),DIV(\u9664) \u539f\u7406\u4e00\u6837<\/strong><\/p>\n

ADD ax,9 \u542b\u4e49\u4e3a ax = ax+9 sub ax,9 \u542b\u4e49\u4e3a: ax = 9-ax sub ax,bx \u542b\u4e49\u4e3a: ax = bx - ax <\/code><\/pre>\n

imul \u6709\u7b26\u53f7\u4e58\u6cd5
mul \u65e0\u7b26\u53f7\u4e58\u6cd5
\u4e3e\u4f8b<\/p>\n

mov ebx,3 \/\/\u5c063\u9001\u5165\u5230 ebx\u5bc4\u5b58\u5668 imul ebx \/\/ \u53ea\u6709\u4e00\u4e2a\u6e90\u65f6,\u9ed8\u8ba4\u662f ebx \u4e58\u4e0e eax <\/code><\/pre>\n

7.inc\u3010increase 1 \u3011,dec\u3010decrease 1\u3011<\/strong>
\u81ea\u589e1\uff0c\u81ea\u51cf1<\/p>\n

inc a \u76f8\u5f53\u4e8e add a,1 \/\/i++ \u4f18\u70b9 \u901f\u5ea6\u6bd4sub\u6307\u4ee4\u5feb\uff0c\u5360\u7528\u7a7a\u95f4\u5c0f dec a \u76f8\u5f53\u4e8e sub a,1 \u4f18\u70b9 \u901f\u5ea6\u6bd4sub\u6307\u4ee4\u5feb\uff0c\u5360\u7528\u7a7a\u95f4\u5c0f <\/code><\/pre>\n

8.jge\u3010jump when greater or equal\u3011\u5927\u4e8e\u6216\u8005\u7b49\u4e8e<\/strong>
\u4e24\u4e2a\u6807\u5fd7\u4f4dsf\u548cof \u8f6c\u79fb\u6761\u4ef6sf\u5f02\u6216of=0<\/p>\n

0040B780 cmp dword ptr [ebp-24h],1Eh 0040B784 jge main+40h (0040b790) \/\/\u8fd9\u4e24\u53e5\u7684\u542b\u4e49\u4e3a ebp-24H \u5927\u4e8e\u7b49\u4e8e1EH\u5c31\u6267\u884c\u8df3\u8f6c <\/code><\/pre>\n

9.JB(jump not above and equal )\u4f4e\u4e8e,\u5373\u4e0d\u9ad8\u4e8e\u4e14\u4e0d\u7b49\u4e8e\u5219\u8f6c\u79fb<\/p>\n

\/\/\u5047\u8bbe edx =A eax = 0, \u8df3\u8f6c\u5b9e\u73b0 00 . 3955 F0 cmp eax,edx 00 72 07 jb short \u786c\u7f16\u7801\u5bfb.00 <\/code><\/pre>\n

\u4f46\u6267\u884c\u8fd9\u6761\u8bed\u53e5\u4e4b\u524d\u5148\u7528CMP\u6765\u6bd4\u8f832\u4e2a\u65e0\u7b26\u53f7\u6570,CMP\u6bd4\u8f83\u65e0\u7b26\u53f7\u6570\u540e\u5f71\u54cd\u7684\u662fCF,\u6240\u4ee5JB\u5e94\u8be5\u662f\u901a\u8fc7CF\u6765\u5224\u65ad\u7684
(\u6ce8\u610f:\u65e0\u7b26\u53f7\u6570\u7684\u6bd4\u8f83\u5728\u8fd9\u91cc\u7528\u9ad8\u4e8e\u548c\u4f4e\u4e8e,\u6709\u7b26\u53f7\u6570\u7684\u6bd4\u8f83\u5728\u8fd9\u91cc\u7528\u5927\u4e8e\u5c0f\u4e8e)<\/strong><\/p>\n

10 CQD
\u4e8c\u8fdb\u5236\u6570\u7684 \u6700\u9ad8\u4f4d\u662f0 \u4ee3\u8868\u6b63\u6570 1\u4ee3\u8868\u8d1f\u6570
cqd \u5982\u4e0b\u65b9\u56fe\u90a3\u6837: \u5f53eax \u6700\u9ad8\u4f4d\u662f 0\u65f6, edx = 0000 0000,
\u5f53eax \u6700\u9ad8\u4f4d\u662f 0\u65f6, edx = FFFF FFFF,
CDQ \u8fd9\u4e2a\u6307\u4ee4\u628a EAX \u7684\u7b2c 31 bit \u590d\u5236\u5230 EDX \u7684\u6bcf\u4e00\u4e2a bit \u4e0a\u3002 \u5b83\u5927\u591a\u51fa\u73b0\u5728\u9664\u6cd5\u8fd0\u7b97\u4e4b\u524d\u3002\u5b83\u5b9e\u9645\u7684\u4f5c\u7528\u53ea\u662f\u628aEDX\u7684\u6240\u6709\u4f4d\u90fd\u8bbe\u6210EAX\u6700\u9ad8\u4f4d\u7684\u503c\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53EAX <, EDX \u4e3a00000000\uff1b\u5f53EAX >= \uff0c EDX \u5219\u4e3aFFFFFFFF\u3002
\u5f53eax \u662f\u6b63\u6570\u65f6:
\"\u6c47\u7f16\u6307\u4ee4\u5b66\u4e60\u4e0e\u603b\u7ed3CMP\uff0cTEST\uff0cJE\uff0cJNZ\uff0cJNE\uff0cLEA\uff0cMOVE\uff0cSUB\uff0cINC,DEC,ADD,MUL,DIV,JGE\uff0cJB
\u5f53eax \u662f\u8d1f\u6570\u65f6:
\"\u6c47\u7f16\u6307\u4ee4\u5b66\u4e60\u4e0e\u603b\u7ed3CMP\uff0cTEST\uff0cJE\uff0cJNZ\uff0cJNE\uff0cLEA\uff0cMOVE\uff0cSUB\uff0cINC,DEC,ADD,MUL,DIV,JGE\uff0cJB
\u6c47\u7f16\u6307\u4ee4\u7684\u5168\u62fc \u6709\u5f88\u591a\uff0c\u653e\u5230\u4e86doc\u4e2d\uff0c\u9644\u8fde\u63a5<\/strong>
\u94fe\u63a5: https:\/\/pan.baidu.com\/s\/17ngnluFDW_cSJOnqACE2sg \u63d0\u53d6\u7801: m2cc \u590d\u5236\u8fd9\u6bb5\u5185\u5bb9\u540e\u6253\u5f00\u767e\u5ea6\u7f51\u76d8\u624b\u673aApp\uff0c\u64cd\u4f5c\u66f4\u65b9\u4fbf\u54e6<\/p>\n","protected":false},"excerpt":{"rendered":"\u6c47\u7f16\u6307\u4ee4\u5b66\u4e60\u4e0e\u603b\u7ed3CMP\uff0cTEST\uff0cJE\uff0cJNZ\uff0cJNE\uff0cLEA\uff0cMOVE\uff0cSUB\uff0cINC,DEC,ADD,MUL,DIV,JGE\uff0cJB ,CQD\u6240\u6709\u7684\u6c47\u7f16\u90fd\u662f\u6211\u96f6\u57fa\u7840\u9006\u5411...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8175"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8175"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8175\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}