有人可以解释为什么只使用一个结果时连续调用GetTickCount三次吗?

这不仅仅是装配的全部功能,而是多次具有GetTickCount的部分。 我认为谁不会这样做是人为的编程错误? 是某种优化技巧还是某种编译器搞砸了?

下面的输出来自OllyDbg

00412EB0  /$ 81EC F4010000  SUB ESP,1F4
00412EB6  |. 53             PUSH EBX
00412EB7  |. 55             PUSH EBP
00412EB8  |. 56             PUSH ESI
00412EB9  |. 8B35 14B24D00  MOV ESI,DWORD PTR DS:[<&KERNEL32.GetTick>;  kernel32.GetTickCount
00412EBF  |. 57             PUSH EDI
00412EC0  |. FFD6           CALL ESI                                 ; [GetTickCount
00412EC2  |. FFD6           CALL ESI                                 ; [GetTickCount
00412EC4  |. FFD6           CALL ESI                                 ; [GetTickCount
00412EC6  |. 8BC8           MOV ECX,EAX
00412EC8  |. B8 CDCCCCCC    MOV EAX,CCCCCCCD
00412ECD  |. F7E1           MUL ECX
00412ECF  |. C1EA 03        SHR EDX,3
00412ED2  |. 895424 14      MOV DWORD PTR SS:[ESP+14],EDX
00412ED6  |. FFD6           CALL ESI                                 ; [GetTickCount
00412ED8  |. FFD6           CALL ESI                                 ; [GetTickCount
00412EDA  |. FFD6           CALL ESI                                 ; [GetTickCount
00412EDC  |. 8BD0           MOV EDX,EAX
00412EDE  |. B8 CDCCCCCC    MOV EAX,CCCCCCCD
00412EE3  |. F7E2           MUL EDX
00412EE5  |. C1EA 03        SHR EDX,3
00412EE8  |. 895424 1C      MOV DWORD PTR SS:[ESP+1C],EDX
00412EEC  |. FFD6           CALL ESI                                 ; [GetTickCount
00412EEE  |. 8B0D A87C4300  MOV ECX,DWORD PTR DS:[437CA8]
00412EF4  |. 33C0           XOR EAX,EAX
00412EF6  |. 3BC8           CMP ECX,EAX
00412EF8  |. 894424 18      MOV DWORD PTR SS:[ESP+18],EAX
00412EFC  |. A3 20594D00    MOV DWORD PTR DS:[4D5920],EAX

Hex-Ray的反编译结果

  DWORD GetTickCountDivideddBy10; // [sp+14h] [bp-1F0h]@1
  unsigned int v41; // [sp+18h] [bp-1ECh]@1
  DWORD GetTickCountDividedBy10; // [sp+1Ch] [bp-1E8h]@1

  GetTickCount();
  GetTickCount();
  GetTickCountDivideddBy10 = GetTickCount() / 0xA;
  GetTickCount();
  GetTickCount();
  GetTickCountDividedBy10 = GetTickCount() / 0xA;
  GetTickCount();
  v41 = 0;
  dword_4D5920 = 0;

可执行文件: http : //www.mediafire.com/download/qnqb00q4yk4kq6v/

  ask by user3435580 translate from so

本文未有回复,本站智能推荐: