 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
martinezz123 Newbie cheater
Reputation: 0
Joined: 17 Jun 2018 Posts: 12
|
Posted: Thu Aug 23, 2018 7:38 am Post subject: How to divide a variable by 10 in assembly? |
|
|
Hi.
I'm new in assembly.
I understand general structure and basic functions: mov, test, sub...
While trying to cheat Absolver health loss I've come to an Idea to divide the amount of health that's being substracted while being hit, by a value (let's say by 10).
I've found an exact code which executes while being hit. It's like this:
Code: | subss xmm0,xmm6
movss [rbx+000000F4],xmm0
|
I'm trying to exchange this code by mine own. I've used code injection template and it looks like this:
Code: | alloc(newmem,2048,"Absolver-Win64-Shipping.exe"+25EBCA)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
subss xmm0,xmm6
movss [rbx+000000F4],xmm0
exit:
jmp returnhere
"Absolver-Win64-Shipping.exe"+25EBCA:
jmp newmem
[ENABLE]
subss xmm0,xmm6/10
movss [rbx+000000F4],xmm0
returnhere:
[DISABLE]
subss xmm0,xmm6
movss [rbx+000000F4],xmm0
|
The cheat engine says it's wrong.
Ok, I know.
I did it this way because I've seen other arithmetic operations in the code like for example:
Code: | mov [rbp+rcx*2+08],ax
|
So. The question is. How to divide the amount of health loss by a number (for ex. 10)?
|
|
Back to top |
|
 |
FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 23, 2018 8:47 am Post subject: |
|
|
https://www.google.com/search?q=divide+number+by+10+x86+assembly
https://www.tutorialspoint.com/assembly_programming/assembly_arithmetic_instructions.htm
https://www.youtube.com/results?search_query=x86+asm+divide
https://www.youtube.com/watch?v=iuN7Tf0Q1Uw
edit: well, looking at the code it looks like you have to deal with floats, and surprisingly much like with integer, mov, sub, mul and div, the SSE float equivalents are movss, subss, mulss, and divss. And just like movss and subss, divss can take either two xmm registers or a register and a memory address with another float. so divss xmm0, [some address with float 10]
_________________
|
|
Back to top |
|
 |
martinezz123 Newbie cheater
Reputation: 0
Joined: 17 Jun 2018 Posts: 12
|
Posted: Thu Aug 23, 2018 10:30 am Post subject: |
|
|
SO I have to div by an adress which contains 10.
But how to set this adress to be 10?
Would you mind fixing my code??
|
|
Back to top |
|
 |
FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 23, 2018 10:39 am Post subject: |
|
|
Code: | [ENABLE]
alloc(newmem,2048,"Absolver-Win64-Shipping.exe"+25EBCA)
label(returnhere)
label(originalcode)
label(exit)
label(somedata)
newmem:
// assuming xmm0 is current health and xmm6 is amount of damage
divss xmm6, [somedata] // divide damage by 10
originalcode:
subss xmm0,xmm6
movss [rbx+000000F4],xmm0
exit:
jmp returnhere
somedata:
dd (float)10
// still in newmem so can add arbitrary data which won't be executed as code since
// code flow would always lead to the jmp returnhere, and thus back to the main code
"Absolver-Win64-Shipping.exe"+25EBCA:
jmp newmem
// nop rest of movss bytes not overwritten by jmp newmem
db 90 90 90 90 90 90 90
returnhere:
[DISABLE]
"Absolver-Win64-Shipping.exe"+25EBCA:
subss xmm0,xmm6
movss [rbx+000000F4],xmm0
dealloc(newmem) |
_________________
Last edited by FreeER on Thu Aug 23, 2018 1:24 pm; edited 1 time in total |
|
Back to top |
|
 |
martinezz123 Newbie cheater
Reputation: 0
Joined: 17 Jun 2018 Posts: 12
|
Posted: Thu Aug 23, 2018 12:56 pm Post subject: |
|
|
thank you!
---edit---
Shit. It divides the aomount of damage for everyoune: me and the opponents.
The same was when I fixed the amount of health - it fixed it for all the characters in the game.
How to split it?
|
|
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
|
|