-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


, 12 2017 . 20:20 +



. , , . , . , , . , , , . .



ArtMoney, IDA, Hiew.

, . 1.07.

IDA, game.exe, .
, .
, .
, .






, . 54.
ArtMoney. . 4 .
- .
, .


, , . .
. ().

IDA. 'Pause process', .
, - , .

.
.text:00548315 loc_548315:
.text:00548315                 fld     dword ptr [edi+14h]
.text:00548318                 fld     dword ptr [edi+18h]
.text:0054831B                 fmul    ds:dbl_73F088
.text:00548321                 fsubp   st(1), st
.text:00548323                 fst     dword ptr [edi+14h]
.text:00548326 >               fcomp   ds:flt_73B858
.text:0054832C                 fnstsw  ax
.text:0054832E                 test    ah, 1
.text:00548331                 jz      short loc_548388


fst dword ptr [edi+14h]. Operand type Floating point [edi+18h].


, :
[edi+14h]
[edi+18h]

, dbl_73F088, . .
.rdata:0073F088 dbl_73F088      dq 6.666666666666666e-3
; 6.666666666666666e-3 = 0.006666666666666666 = 1/150

150 , , , . 9-10 , 15 16.66 .
, .



:
4E 1B E8 B4 81 4E 7B 3F


game.exe Hiew ".73F088".


, .

, . 3 .
(1/150)/3 = 1/450 = 0.0022222222222222222

float/double hex- -, .

0.0066666666666666667 - 0x3F7B4E81B4E81B4F
0.006666666666666666  - 0x3F7B4E81B4E81B4E
0.0022222222222222222 - 0x3F623456789ABCDF
0.002222222222222222  - 0x3F623456789ABCDE


0x3F623456789ABCDF
DF BC 9A 78 56 34 62 3F

, , . , .





. . . , , .

, . . 116.


. 4 .

, , int. float, , .

- . , , , . . . , 5 , 2 , 2, 2.5 .



6 , .


. Pause process.

. rep movsd.
.text:00522D00                 fld     dword ptr [ebx+700h]
.text:00522D06                 fadd    dword ptr [ebx+4]
.text:00522D09                 fsub    dword ptr [ebx+8]
.text:00522D0C                 fstp    [ebp+var_10]
.text:00522D0F                 fld     [ebp+var_10]
.text:00522D12                 fistp   [ebp+var_C]
.text:00522D15                 mov     edx, [ebp+var_C]
.text:00522D18                 mov     [edi+8], edx
.text:00522D1B >               mov     eax, [ebx+10h]
.text:00522D1E                 mov     [ebp+var_10], eax


. , , . ebx . [ebx+700h] 0.

.


387 271 = 116
, , .

[ebx+4].

.



, .

.text:005239D7                 fld     ds:dbl_73E128
.text:005239DD                 fld     dword ptr [esi+20h]
.text:005239E0                 fsub    ds:flt_73E124
.text:005239E6                 call    __CIpow
.text:005239EB                 fmul    [ebp+arg_4]
.text:005239EE                 fadd    dword ptr [esi+700h]
.text:005239F4                 fcom    ds:flt_73B858
.text:005239FA                 fst     dword ptr [esi+700h]
.text:00523A00                 fnstsw  ax
.text:00523A02                 test    ah, 41h
.text:00523A05                 jnz     short loc_523A19
.text:00523A07                 fadd    dword ptr [esi+4]
.text:00523A0A                 mov     dword ptr [esi+700h], 0
.text:00523A14                 fstp    dword ptr [esi+4]
.text:00523A17 >               jmp     short loc_523A1B


[esi+4] . [ebp+arg_4] 2.0. 4.0, .

Ctrl+F7. , .

, .
.text:00591521 loc_591521:
.text:00591521                 fild    [ebp+var_18]
.text:00591524                 xor     esi, esi
.text:00591526                 cmp     eax, edi
.text:00591528                 mov     [ebp+var_14], esi
.text:0059152B                 fdivr   [ebp+arg_4]
.text:0059152E                 fstp    [ebp+arg_4]
.text:00591531                 jle     short loc_5915A5
.text:00591533                 jmp     short loc_591537


:
.text:00591324                 fdiv    [ebp+var_18]

, . .

00591521 .
fdivr st(0) st(0): st(0) = arg / st(0). st(0) [ebp+var_18], 2 . [ebp+arg_4] 4.0 . .

Hiew . - fdivr nop 3 (9 ).
// 
.00591521: DB45E8                         fild        d,[ebp][-018]
.00591524: 33F6                           xor         esi,esi
.00591526: 3BC7                           cmp         eax,edi
.00591528: 8975EC                         mov         [ebp][-014],esi
.0059152B: D87D0C                         fdivr       d,[ebp][00C]
.0059152E: D95D0C                         fstp        d,[ebp][00C]
.00591531: 7E72                           jle        .0005915A5
.00591533: EB02                           jmps       .000591537

// 
.00591521: 909090                         nop
.00591524: 33F6                           xor         esi,esi
.00591526: 3BC7                           cmp         eax,edi
.00591528: 8975EC                         mov         [ebp][-014],esi
.0059152B: 909090                         nop
.0059152E: 909090                         nop
.00591531: 7E72                           jle        .0005915A5
.00591533: EB02                           jmps       .000591537


, , , . , .

!
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/335498/

:  

: [1] []
 

:
: 

: ( )

:

  URL