Test DIM I as Long, a as longprivate sub touch1_click () for i = 1 to 10 a = a 2Next Iend Sub
Using SC to find the entry point of Command1, OD is debugged, discovering the anti-assessment of the loop portion is the following sample 004019CD> 8bd1 MOV EDX, ECX004019CF. 8BC7 MOV EAX, EDI004019D1. 83C2 02 Add EDX, 2004019D4. 70 3A Jo Short TNEXT.00401A10004019D6 . 83C0 01 ADD EAX, 1004019D9. 8BCA MOV ECX, EDX004019DB. 70 33 JO SHORT TNEXT.00401A10004019DD. 83F8 0A CMP EAX, 0A004019E0. 8BF8 MOV EDI, EAX004019E2. ^ 7E E9 JLE SHORT TNEXT.004019CD modify the above code Dim I as variant, a as longprivate submmand1_click () for i = 1 to 10 a = a 2Next Iend Sub We convert the type of cyclic counter i to variants, that is, without Option Explicit, mandatory variable declaration, no declaration The default type of variable, the same method looks at the reverse copy code, and the discovery changes are relatively large.
00401A78 FF15 18104000 CALL DWORD PTR DS:... [<& MSVBVM60 .__ vbaVarFo>; MSVBVM60 .__ vbaVarForInit00401A7E> 3BC3 CMP EAX, EBX00401A80 74 1C JE SHORT TNEXTWIT.00401A9E00401A82 8B4E 44 MOV ECX, DWORD PTR DS: [ESI 44] 00401A85. 8D55 9C LEA EDX, DWORD PTR SS: [EBP-64] 00401A88. 8D45 AC LEA EAX, DWORD PTR SS: [EBP-54] 00401A8B. 83C1 02 Add ECX, 200401A8E. 52 Push EDX00401A8F. 50 Push Eax00401a90. 70 47 JO ... SHORT TNEXTWIT.00401AD900401A92 57 PUSH EDI00401A93 894E 44 MOV DWORD PTR DS: [ESI 44], ECX00401A96 FF15 78104000 CALL DWORD PTR DS: [<& MSVBVM60 .__ vbaVarFo>; MSVBVM60 .__ vbaVarForNext00401A9C ^ EB E0 JMP SHORT TNEXTWIT.00401A7E00401A9E. > 895D FC MOV DWORD PTR SS: [EBP-4], EBX