自己写的自己都忘记了,当时也只是想拿来改改的,所以单纯复制,比较简单,供参考。反正6.0根5.9大部分特效代码位置差不多
伤害函数
[EBP-4]这个变量是做计数器的
[EBP-8]是放被攻击武将的Ecx值
传进来的就是Ecx放的内存地址量了.本函数里用局部变量[EBP-C]存放004927F0 这个全局地址
这个地方有个很重要处,就是004927F0+i*4+84等于攻击伤害值 (i的值在就是[EBP-4])
[EBP-10] 和MP值相关
[EBP-14] 和HP 值相关
[EBP-18]物理攻击经验值
[EBP-1C]武器经验值
00405DE1 /$ 55 PUSH EBP
00405DE2 |. 8BEC MOV EBP,ESP
00405DE4 |. 83EC 2C SUB ESP,2C
00405DE7 |. 894D F4 MOV DWORD PTR SS:[EBP-C],ECX
00405DEA |. 6A 00 PUSH 0 ; /Arg3 = 00000000
00405DEC |. 6A 74 PUSH 74 ; |Arg2 = 00000074
00405DEE |. 8B45 F4 MOV EAX,DWORD PTR SS:[EBP-C] ; | [EBP-C]存放全局地址, 004927F0+i*4+84等于攻击伤害值 (i的值在就是[EBP-4])
00405DF1 |. 05 84000000 ADD EAX,84 ; |
00405DF6 |. 50 PUSH EAX ; |Arg1
00405DF7 |. E8 179F0700 CALL Ekd5.0047FD13 ; \Ekd5.0047FD13
00405DFC |. 83C4 0C ADD ESP,0C
00405DFF |. 6A 00 PUSH 0 ; /Arg3 = 00000000
00405E01 |. 6A 74 PUSH 74 ; |Arg2 = 00000074
00405E03 |. 8B4D F4 MOV ECX,DWORD PTR SS:[EBP-C] ; |
00405E06 |. 81C1 54020000 ADD ECX,254 ; |
00405E0C |. 51 PUSH ECX ; |Arg1
00405E0D |. E8 019F0700 CALL Ekd5.0047FD13 ; \Ekd5.0047FD13 此被调用函数和原版无区别。
00405E12 |. 83C4 0C ADD ESP,0C
00405E15 |. 33D2 XOR EDX,EDX
00405E17 |. 8955 FC MOV DWORD PTR SS:[EBP-4],EDX
00405E1A |. EB 03 JMP SHORT Ekd5.00405E1F
00405E1C |> FE45 FC /INC BYTE PTR SS:[EBP-4]
00405E1F |> 8B45 FC MOV EAX,DWORD PTR SS:[EBP-4]
00405E22 |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00405E25 |. 8A5408 10 |MOV DL,BYTE PTR DS:[EAX+ECX+10]
00405E29 |. 80FA FF |CMP DL,0FF
00405E2C |. 0F84 82020000 |JE Ekd5.004060B4 //退出
00405E32 |. 8851 01 |MOV BYTE PTR DS:[ECX+1],DL
00405E35 |. 8ACA |MOV CL,DL
00405E37 |. E8 BD030000 |CALL Ekd5.004061F9
00405E3C |. 894D E0 |MOV DWORD PTR SS:[EBP-20],ECX
00405E3F |. 8B4D E0 |MOV ECX,DWORD PTR SS:[EBP-20]
00405E42 |. E8 48070000 |CALL Ekd5.0040658F
00405E47 |. 894D F8 |MOV DWORD PTR SS:[EBP-8],ECX
00405E4A |. 33C0 |XOR EAX,EAX
00405E4C |. 3B05 042E4900 |CMP EAX,DWORD PTR DS:[492E04]
00405E52 |. 1BC9 |SBB ECX,ECX
00405E54 |. F7D9 |NEG ECX
00405E56 |. 8B45 F4 |MOV EAX,DWORD PTR SS:[EBP-C]
00405E59 |. 8A90 08060000 |MOV DL,BYTE PTR DS:[EAX+608]
00405E5F |. 84D2 |TEST DL,DL
00405E61 |. 75 03 |JNZ SHORT Ekd5.00405E66
00405E63 |. 51 |PUSH ECX
00405E64 |. EB 02 |JMP SHORT Ekd5.00405E68
00405E66 |> 6A 02 |PUSH 2
00405E68 |> 6A 01 |PUSH 1 ; |Arg2 = 00000001
00405E6A |. FF75 E0 |PUSH DWORD PTR SS:[EBP-20] ; |Arg1
00405E6D |. 8B45 F4 |MOV EAX,DWORD PTR SS:[EBP-C] ; |
00405E70 |. 8B48 0C |MOV ECX,DWORD PTR DS:[EAX+C] ; |
00405E73 |. E8 EA5D0300 |CALL Ekd5.0043BC62 ; \Ekd5.0043BC62 攻击伤害计算。
00405E78 |. 803D F45F5000>|CMP BYTE PTR DS:[505FF4],0
00405E7F |. 74 0C |JE SHORT Ekd5.00405E8D
00405E81 |. 8B55 FC |MOV EDX,DWORD PTR SS:[EBP-4]
00405E84 |. 84D2 |TEST DL,DL
00405E86 |. 74 05 |JE SHORT Ekd5.00405E8D
00405E88 |. E8 05810100 |CALL Ekd5.0041DF92
00405E8D |> 8B4D FC |MOV ECX,DWORD PTR SS:[EBP-4] [EBP-4]计数器
00405E90 |. 8B55 F4 |MOV EDX,DWORD PTR SS:[EBP-C] [EBP-C]浮动地址
00405E93 |. 8D948A 840000>|LEA EDX,DWORD PTR DS:[EDX+ECX*4+84]
00405E9A |. 8955 D8 |MOV DWORD PTR SS:[EBP-28],EDX
00405E9D |. 8902 |MOV DWORD PTR DS:[EDX],EAX
00405E9F |. 85C9 |TEST ECX,ECX
00405EA1 |. 0F85 7D000000 |JNZ Ekd5.00405F24
00405EA7 |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00405EAA |. 8A49 01 |MOV CL,BYTE PTR DS:[ECX+1]
00405EAD |. E8 47030000 |CALL Ekd5.004061F9 自定义函数:栈值转化成ecx值。
00405EB2 |. E8 CFA30C00 |CALL Ekd5.004D0286 返回武将当前体力
00405EB7 |. 85C0 |TEST EAX,EAX
00405EB9 |. 76 69 |JBE SHORT Ekd5.00405F24 不是0就就表示攻击武将被打死。
00405EBB |. 0FB605 9B0E50>|MOVZX EAX,BYTE PTR DS:[500E9B]
00405EC2 |. 85C0 |TEST EAX,EAX
00405EC4 |. 74 07 |JE SHORT Ekd5.00405ECD
00405EC6 |. B0 64 |MOV AL,64
00405EC8 |. 8945 DC |MOV DWORD PTR SS:[EBP-24],EAX
00405ECB |. EB 35 |JMP SHORT Ekd5.00405F02
00405ECD |> 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00405ED0 |. E8 86FEFFFF |CALL Ekd5.00405D5B
00405ED5 |. 8945 DC |MOV DWORD PTR SS:[EBP-24],EAX
00405ED8 |. 83F8 64 |CMP EAX,64
00405EDB |. 77 10 |JA SHORT Ekd5.00405EED
00405EDD |. 6A 00 |PUSH 0 ; /Arg2 = 00000000
00405EDF |. 50 |PUSH EAX ; |Arg1
00405EE0 |. E8 B1190300 |CALL Ekd5.00437896 ; \Ekd5.00437896
00405EE5 |. 85C0 |TEST EAX,EAX
00405EE7 |. 74 3B |JE SHORT Ekd5.00405F24
00405EE9 |. 8345 DC 64 |ADD DWORD PTR SS:[EBP-24],64
00405EED |> 8B4D F8 |MOV ECX,DWORD PTR SS:[EBP-8]
00405EF0 |. E8 DAFEFFFF |CALL Ekd5.00405DCF
00405EF5 |. 85C0 |TEST EAX,EAX
00405EF7 |. 74 09 |JE SHORT Ekd5.00405F02
00405EF9 |. 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405EFC |. 33C0 |XOR EAX,EAX
00405EFE |. 8902 |MOV DWORD PTR DS:[EDX],EAX
00405F00 |. EB 15 |JMP SHORT Ekd5.00405F17
00405F02 |> 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405F05 |. FF32 |PUSH DWORD PTR DS:[EDX]
00405F07 |. 8B45 DC |MOV EAX,DWORD PTR SS:[EBP-24]
00405F0A |. D1F8 |SAR EAX,1
00405F0C |. 50 |PUSH EAX
00405F0D |. E8 82970C00 |CALL Ekd5.004CF694
00405F12 |. 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405F15 |. 0102 |ADD DWORD PTR DS:[EDX],EAX
00405F17 |> 8B45 F4 |MOV EAX,DWORD PTR SS:[EBP-C]
00405F1A |. C780 04060000>|MOV DWORD PTR DS:[EAX+604],1
00405F24 |> 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00405F27 |. 80B9 08060000>|CMP BYTE PTR DS:[ECX+608],0
00405F2E |. 7E 1B |JLE SHORT Ekd5.00405F4B
00405F30 |. 6A 01 |PUSH 1
00405F32 |. 6A 01 |PUSH 1
00405F34 |. 6A 41 |PUSH 41 防御特殊攻击
00405F36 |. 6A 31 |PUSH 31 致命一击攻击
00405F38 |. 8B4D F8 |MOV ECX,DWORD PTR SS:[EBP-8]
00405F3B |. E8 58940C00 |CALL Ekd5.004CF398
00405F40 |. 85C0 |TEST EAX,EAX
00405F42 |. 74 07 |JE SHORT Ekd5.00405F4B
00405F44 |. 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405F47 |. 33C9 |XOR ECX,ECX
00405F49 |. 890A |MOV DWORD PTR DS:[EDX],ECX
00405F4B |> 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405F4E |. 8B02 |MOV EAX,DWORD PTR DS:[EDX]
00405F50 |. 85C0 |TEST EAX,EAX
00405F52 |. 0F84 E1000000 |JE Ekd5.00406039
00405F58 |. 8945 DC |MOV DWORD PTR SS:[EBP-24],EAX
00405F5B |. 8B4D E0 |MOV ECX,DWORD PTR SS:[EBP-20]
00405F5E |. E8 DDC80600 |CALL Ekd5.00472840
00405F63 |. 8945 D4 |MOV DWORD PTR SS:[EBP-2C],EAX
00405F66 |. 8B4D F8 |MOV ECX,DWORD PTR SS:[EBP-8]
00405F69 |. E8 A49D0C00 |CALL Ekd5.004CFD12
00405F6E |. 85C0 |TEST EAX,EAX
00405F70 |. 74 07 |JE SHORT Ekd5.00405F79
00405F72 |. 8B45 D4 |MOV EAX,DWORD PTR SS:[EBP-2C]
00405F75 |. 85C0 |TEST EAX,EAX
00405F77 |. 75 26 |JNZ SHORT Ekd5.00405F9F
00405F79 |> FF75 F4 |PUSH DWORD PTR SS:[EBP-C]
00405F7C |. FF75 FC |PUSH DWORD PTR SS:[EBP-4]
00405F7F |. 8B4D F8 |MOV ECX,DWORD PTR SS:[EBP-8]
00405F82 |. E8 0B9C0C00 |CALL Ekd5.004CFB92
00405F87 |. 84C0 |TEST AL,AL
00405F89 |. 75 48 |JNZ SHORT Ekd5.00405FD3
00405F8B |. 8B4D E0 |MOV ECX,DWORD PTR SS:[EBP-20]
00405F8E |. E8 F3A20C00 |CALL Ekd5.004D0286
00405F93 |. 3B45 DC |CMP EAX,DWORD PTR SS:[EBP-24]
00405F96 |. 73 3B |JNB SHORT Ekd5.00405FD3
00405F98 |. 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405F9B |. 8902 |MOV DWORD PTR DS:[EDX],EAX
00405F9D |. EB 34 |JMP SHORT Ekd5.00405FD3
00405F9F |> 3B45 DC |CMP EAX,DWORD PTR SS:[EBP-24]
00405FA2 |. 73 05 |JNB SHORT Ekd5.00405FA9
00405FA4 |. 8945 DC |MOV DWORD PTR SS:[EBP-24],EAX
00405FA7 |. EB 13 |JMP SHORT Ekd5.00405FBC
00405FA9 |> 8B4D E0 |MOV ECX,DWORD PTR SS:[EBP-20]
00405FAC |. E8 D5A20C00 |CALL Ekd5.004D0286
00405FB1 |. 3945 DC |CMP DWORD PTR SS:[EBP-24],EAX
00405FB4 |. 72 06 |JB SHORT Ekd5.00405FBC
00405FB6 |. 8B4D D4 |MOV ECX,DWORD PTR SS:[EBP-2C]
00405FB9 |. 894D DC |MOV DWORD PTR SS:[EBP-24],ECX
00405FBC |> 8B4D DC |MOV ECX,DWORD PTR SS:[EBP-24]
00405FBF |. 8B55 FC |MOV EDX,DWORD PTR SS:[EBP-4]
00405FC2 |. 8B45 F4 |MOV EAX,DWORD PTR SS:[EBP-C]
00405FC5 |. 898C90 540200>|MOV DWORD PTR DS:[EAX+EDX*4+254],ECX
00405FCC |. 33C9 |XOR ECX,ECX
00405FCE |. 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405FD1 |. 890A |MOV DWORD PTR DS:[EDX],ECX
00405FD3 |> 8B55 FC |MOV EDX,DWORD PTR SS:[EBP-4]
00405FD6 |. 8B45 F4 |MOV EAX,DWORD PTR SS:[EBP-C]
00405FD9 |. 8B8C90 540200>|MOV ECX,DWORD PTR DS:[EAX+EDX*4+254]
00405FE0 |. 85C9 |TEST ECX,ECX
00405FE2 |. 75 07 |JNZ SHORT Ekd5.00405FEB
00405FE4 |. 8B55 D8 |MOV EDX,DWORD PTR SS:[EBP-28]
00405FE7 |. 390A |CMP DWORD PTR DS:[EDX],ECX
00405FE9 |. 74 4E |JE SHORT Ekd5.00406039
00405FEB |> 894D DC |MOV DWORD PTR SS:[EBP-24],ECX
00405FEE |. 8B4D F8 |MOV ECX,DWORD PTR SS:[EBP-8]
00405FF1 |. E8 49A10300 |CALL Ekd5.0044013F
00405FF6 |. 85C0 |TEST EAX,EAX
00405FF8 |. 74 3F |JE SHORT Ekd5.00406039
00405FFA |. 8945 F0 |MOV DWORD PTR SS:[EBP-10],EAX
00405FFD |. 8B4D F8 |MOV ECX,DWORD PTR SS:[EBP-8]
00406000 |. E8 85120000 |CALL Ekd5.0040728A
00406005 |. 50 |PUSH EAX
00406006 |. FF75 F0 |PUSH DWORD PTR SS:[EBP-10]
00406009 |. E8 86960C00 |CALL Ekd5.004CF694
0040600E |. 3945 D4 |CMP DWORD PTR SS:[EBP-2C],EAX
00406011 |. 77 04 |JA SHORT Ekd5.00406017
00406013 |. 33C0 |XOR EAX,EAX
00406015 |. EB 02 |JMP SHORT Ekd5.00406019
00406017 |> B0 01 |MOV AL,1
00406019 |> 0145 DC |ADD DWORD PTR SS:[EBP-24],EAX
0040601C |. 8B4D DC |MOV ECX,DWORD PTR SS:[EBP-24]
0040601F |. 3B4D D4 |CMP ECX,DWORD PTR SS:[EBP-2C]
00406022 |. 90 |NOP
00406023 |. 90 |NOP
00406024 |. 90 |NOP
00406025 |. 90 |NOP
00406026 |. 90 |NOP
00406027 |. 90 |NOP
00406028 |. 73 02 |JNB SHORT Ekd5.0040602C
0040602A |. 8BC8 |MOV ECX,EAX
0040602C |> 8B55 FC |MOV EDX,DWORD PTR SS:[EBP-4]
0040602F |. 8B45 F4 |MOV EAX,DWORD PTR SS:[EBP-C]
00406032 |. 898C90 540200>|MOV DWORD PTR DS:[EAX+EDX*4+254],ECX
00406039 |> FF75 FC |PUSH DWORD PTR SS:[EBP-4]
0040603C |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
0040603F |. E8 5FD7FFFF |CALL Ekd5.004037A3
00406044 |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00406047 |. 8B91 28040000 |MOV EDX,DWORD PTR DS:[ECX+428]
0040604D |. 3BC2 |CMP EAX,EDX
0040604F |. 77 05 |JA SHORT Ekd5.00406056
00406051 |. 8955 E8 |MOV DWORD PTR SS:[EBP-18],EDX
00406054 |. EB 03 |JMP SHORT Ekd5.00406059
00406056 |> 8945 E8 |MOV DWORD PTR SS:[EBP-18],EAX
00406059 |> 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
0040605C |. 8B45 E8 |MOV EAX,DWORD PTR SS:[EBP-18]
0040605F |. 8981 28040000 |MOV DWORD PTR DS:[ECX+428],EAX
00406065 |. FF75 FC |PUSH DWORD PTR SS:[EBP-4] ; /Arg1
00406068 |. E8 1FD8FFFF |CALL Ekd5.0040388C ; \Ekd5.0040388C
0040606D |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00406070 |. 0181 2C040000 |ADD DWORD PTR DS:[ECX+42C],EAX
00406076 |. FF75 FC |PUSH DWORD PTR SS:[EBP-4] ; /Arg2
00406079 |. 51 |PUSH ECX ; |Arg1
0040607A |. E8 6F480200 |CALL Ekd5.0042A8EE ; \Ekd5.0042A8EE
0040607F |. FF75 FC |PUSH DWORD PTR SS:[EBP-4] ; /Arg1
00406082 |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C] ; |
00406085 |. E8 00DAFFFF |CALL Ekd5.00403A8A ; \Ekd5.00403A8A
0040608A |. 8B55 FC |MOV EDX,DWORD PTR SS:[EBP-4]
0040608D |. 8B4D F4 |MOV ECX,DWORD PTR SS:[EBP-C]
00406090 |. 898491 300400>|MOV DWORD PTR DS:[ECX+EDX*4+430],EAX
00406097 |. 0FB64411 10 |MOVZX EAX,BYTE PTR DS:[ECX+EDX+10]
0040609C |. 05 C58E5000 |ADD EAX,Ekd5.00508EC5
004060A1 |. 8038 FF |CMP BYTE PTR DS:[EAX],0FF
004060A4 |. 74 02 |JE SHORT Ekd5.004060A8
004060A6 |. FE00 |INC BYTE PTR DS:[EAX]
004060A8 |> 52 |PUSH EDX ; /Arg2
004060A9 |. 51 |PUSH ECX ; |Arg1
004060AA |. E8 BE480200 |CALL Ekd5.0042A96D ; \Ekd5.0042A96D
004060AF |.^ E9 68FDFFFF \JMP Ekd5.00405E1C
004060B4 |> 8B4D F4 MOV ECX,DWORD PTR SS:[EBP-C]
004060B7 |. E8 1F4A0200 CALL Ekd5.0042AADB
004060BC |. E8 28020300 CALL Ekd5.004362E9
004060C1 |. C9 LEAVE
004060C2 \. C3 RETN
人物成长(这个不知道是5.几的了)
004072FC /$ 55 push ebp
004072FD |. 8BEC mov ebp,esp
004072FF |. 83EC 0C sub esp,0xC
00407302 |. 894D F8 mov [local.2],ecx
00407305 |. C645 FC 00 mov byte ptr ss:[ebp-0x4],0x0
00407309 |. 837D 08 04 cmp [arg.1],0x4
0040730D |. 76 07 jbe XEkd5.00407316
0040730F |. 32C0 xor al,al
00407311 |. E9 88000000 jmp Ekd5.0040739E
00407316 |> 8B45 08 mov eax,[arg.1]
00407319 |. 8945 F4 mov [local.3],eax
0040731C |. 837D F4 04 cmp [local.3],0x4
00407320 |. 77 41 ja XEkd5.00407363
00407322 |. 8B4D F4 mov ecx,[local.3]
00407325 |. FF248D A47340>jmp dword ptr ds:[ecx*4+0x4073A4]
0040732C |> 8B55 F8 mov edx,[local.2]
0040732F |. 8A42 21 mov al,byte ptr ds:[edx+0x21]
00407332 |. 8845 FC mov byte ptr ss:[ebp-0x4],al
00407335 |. EB 30 jmp XEkd5.00407367
00407337 |> 8B4D F8 mov ecx,[local.2]
0040733A |. 8A51 22 mov dl,byte ptr ds:[ecx+0x22]
0040733D |. 8855 FC mov byte ptr ss:[ebp-0x4],dl
00407340 |. EB 25 jmp XEkd5.00407367
00407342 |> 8B45 F8 mov eax,[local.2]
00407345 |. 8A48 23 mov cl,byte ptr ds:[eax+0x23]
00407348 |. 884D FC mov byte ptr ss:[ebp-0x4],cl
0040734B |. EB 1A jmp XEkd5.00407367
0040734D |> 8B55 F8 mov edx,[local.2]
00407350 |. 8A42 24 mov al,byte ptr ds:[edx+0x24]
00407353 |. 8845 FC mov byte ptr ss:[ebp-0x4],al
00407356 |. EB 0F jmp XEkd5.00407367
00407358 |> 8B4D F8 mov ecx,[local.2]
0040735B |. 8A51 25 mov dl,byte ptr ds:[ecx+0x25]
0040735E |. 8855 FC mov byte ptr ss:[ebp-0x4],dl
00407361 |. EB 04 jmp XEkd5.00407367
00407363 |> 32C0 xor al,al
00407365 |. EB 37 jmp XEkd5.0040739E
00407367 |> 8B45 FC mov eax,[local.1] local.1,ebp-0x4是曹操武力41(以曹操举例)。一一判断,是否比90,70,50大,然后对号入座。
0040736A |. 25 FF000000 and eax,0xFF
0040736F |. 83F8 2D cmp eax,0x2D
00407372 |. 7C 04 jl XEkd5.00407378
00407374 |. B0 04 mov al,0x4
00407376 |. EB 26 jmp XEkd5.0040739E
00407378 |> 8B4D FC mov ecx,[local.1]
0040737B |. 81E1 FF000000 and ecx,0xFF
00407381 |. 83F9 23 cmp ecx,0x23
00407384 |. 7C 04 jl XEkd5.0040738A
00407386 |. B0 03 mov al,0x3
00407388 |. EB 14 jmp XEkd5.0040739E
0040738A |> 8B55 FC mov edx,[local.1]
0040738D |. 81E2 FF000000 and edx,0xFF
00407393 |. 83FA 19 cmp edx,0x19
00407396 |. 7C 04 jl XEkd5.0040739C
00407398 |. B0 02 mov al,0x2
0040739A |. EB 02 jmp XEkd5.0040739E
0040739C |> B0 01 mov al,0x1
0040739E |> 8BE5 mov esp,ebp
004073A0 |. 5D pop ebp
004073A1 \. C2 0400 retn 0x4
[ 本帖最后由 古月新风 于 2015-6-5 17:24 编辑 ]
|