 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
fishcorpse How do I cheat?
Reputation: 0
Joined: 06 May 2015 Posts: 4
|
Posted: Wed May 06, 2015 7:42 pm Post subject: incrementing an integer with non-integer value |
|
|
Hi, newbie here.
there is a value that is incrementing with 1 in every loop.
that opcode:
inc [ebx+00000020]
i can easily change it to this
add [ebx+00000020],02 //doubles the speed of process
adding 1 in each loop is default and slow but adding 2 is way too much.
Since i cant add 1.5 to an integer, i thought another solution but i couldnt write it. because dont know how to write it in assembly
MyCode:
inc [ebx+00000020]
inc [X] //My Defined Register
if X is even
jump to [it_is_even] //if last bit is 1, do another inc. if it is 0, jump to end.
inc [ebx+00000020]
it_is_even:
This pseudo code will add 3 in every 2 loops. So it will be like adding 1.5
1) How to write this in asm?
2) what can i do if want to increment with 1.1?[/b]
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed May 06, 2015 8:07 pm Post subject: |
|
|
| Code: | alloc(x,4)
inc [ebx+00000020]
inc [x]
cmp [x],#1 // compare your value to 1 (starts at 0)
jg return // if it is greater than 1, jump to the return block
inc [ebx+00000020] // otherwise, increment your variable again
mov [x],0 // reset x to 0 so this logic is skipped next go around |
Simply increase the compare if you want to increment every third, fourth, fifth, etc. occurrence.
1.1 would increment every 10th? so set the compare to:
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|