Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[ASM] How to multiply ecx only?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
CodschildGaming
How do I cheat?
Reputation: 0

Joined: 11 Apr 2018
Posts: 3

PostPosted: Mon Sep 20, 2021 3:09 am    Post subject: [ASM] How to multiply ecx only? Reply with quote

I am trying to only edit the ecx value to be ecx*1.5 or (ecx*15)/10. I have tried a method from the forums already but it broke the rest of the function in game.

The function in game adds xp (respect) to the player, ecx is the xp getting added. I believe esi is the max respect the player can have at the time. Using the other method on the forums goes past the max respect limit, while this seems to be okay I'd rather avoid it as the respect caps out when you have enough to finish every main mission in game.

Changing the ecx value alone makes sure the the respect doesn't go past the limit in game.

Code:
cmp ecx,esi
mov [esp+10],eax
jmp return




Assembly Stack:
Code:
{
// ORIGINAL CODE - INJECTION POINT: 009DBAFB

009DBADA: DF E0              - fnstsw ax
009DBADC: DD D9              - fstp st(1)
009DBADE: F6 C4 01           - test ah,01
009DBAE1: 75 08              - jne 009DBAEB
009DBAE3: DC 05 70 BF E5 00  - fadd qword ptr [00E5BF70]
009DBAE9: EB 06              - jmp 009DBAF1
009DBAEB: DC 25 70 BF E5 00  - fsub qword ptr [00E5BF70]
009DBAF1: E8 4A 46 3C 00     - call 00DA0140
009DBAF6: 03 C3              - add eax,ebx
009DBAF8: 8D 0C 28           - lea ecx,[eax+ebp]
// ---------- INJECTING HERE ----------
009DBAFB: 3B CE              - cmp ecx,esi
// ---------- DONE INJECTING  ----------
009DBAFD: 89 44 24 10        - mov [esp+10],eax
009DBB01: 7C 08              - jl 009DBB0B
009DBB03: 2B F5              - sub esi,ebp
009DBB05: 8B C6              - mov eax,esi
009DBB07: 89 44 24 10        - mov [esp+10],eax
009DBB0B: 8B 8F FC 11 00 00  - mov ecx,[edi+000011FC]
009DBB11: 33 D2              - xor edx,edx
009DBB13: 03 C8              - add ecx,eax
009DBB15: 85 C9              - test ecx,ecx
009DBB17: 0F 9E C2           - setle dl
}



What I tried:
Code:
  push edx
  push ecx
  mov ecx,[multi] //multi is a int value, changeable in cheat table, added via parent script
  mul ecx
  mov ecx,#10
  xor edx,edx
  div ecx
  pop ecx
  pop edx
  cmp ecx,esi
  mov [esp+10],eax
  jmp return


I don't know much about assembly just kinda jumped in 2 days ago to work on saints row 2 due to a max respect cheat never being made for it, now I am wanting to mess around with it a little to use it in other games.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Mon Sep 20, 2021 3:42 am    Post subject: Reply with quote

easy way:
multiply by 15
and then divide by 10

(i'm on my phone so don't want to write a full script right now)

but the easiest way:
Code:

{$ccode value=ecx}
value=value*1.5f;
{$asm}

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites